Ejemplo n.º 1
0
        /// <summary>
        /// Returns the given port as property
        /// </summary>
        /// <param name="port"></param>
        /// <param name="direction"></param>
        /// <returns></returns>
        private AdminShellNS.AdminShell.Property GetPortAsProperty(IOput port, string direction)
        {
            AdminShellNS.AdminShell.Property port_prop = new AdminShellNS.AdminShell.Property();
            port_prop.idShort = port.IdShort;
            port_prop.AddQualifier("direction", direction);
            port_prop.AddQualifier("Domain", port.Domain);
            port_prop.valueType  = port.Datatype;
            port_prop.semanticId = port.SemanticId;

            return(port_prop);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the given Relationshipelement as RelationshipElement of Adminshell
        /// </summary>
        /// <param name="input"></param>
        /// <param name="output"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public AdminShellNS.AdminShell.RelationshipElement GetPortsAsRelation(IOput input, IOput output, int type = 0)
        {
            AdminShellNS.AdminShell.Submodel submodel = new AdminShellNS.AdminShell.Submodel();

            submodel.identification.id     = "urn:itsowl.tedz.com:sm:instance:9053_7072_4002_2783";
            submodel.identification.idType = "IRI";


            // Finden der zugehörigen properties der in und out
            AdminShellNS.AdminShell.Entity entity = new AdminShellNS.AdminShell.Entity();
            entity.idShort = input.Owner;
            entity.parent  = submodel;

            AdminShellNS.AdminShell.Property property = new AdminShellNS.AdminShell.Property();
            property.idShort = input.IdShort;
            property.parent  = entity;


            AdminShellNS.AdminShell.Entity outentity = new AdminShellNS.AdminShell.Entity();
            outentity.idShort = output.Owner;
            outentity.parent  = submodel;

            AdminShellNS.AdminShell.Property outproperty = new AdminShellNS.AdminShell.Property();
            outproperty.idShort = output.IdShort;
            outproperty.parent  = outentity;


            // setzen als first bzw second

            AdminShellNS.AdminShell.RelationshipElement relationshipElement =
                new AdminShellNS.AdminShell.RelationshipElement();

            relationshipElement.first      = outproperty.GetReference();
            relationshipElement.second     = property.GetReference();
            relationshipElement.semanticId = SetSemanticIdRelEle(input, output, type);
            relationshipElement.idShort    = $"{relCount++}";


            return(relationshipElement);
        }