Exemplo n.º 1
0
        private static string CreateDictionaryEntry(AdminShellV20.ConceptDescription concept)
        {
            UAObject entry = new UAObject();

            entry.NodeId = "ns=1;i=" + masterID.ToString();

            entry.BrowseName = "1:" + concept.ToCaptionInfo().Item2;


            masterID++;
            List <Reference> refs = new List <Reference>();

            refs.Add(CreateHasTypeDefinition("DictionaryEntryType"));

            if (concept.identification.idType == "IRI")
            {
                refs.Add(CreateReference("HasComponent", CreateUriConceptDescription(concept)));
            }
            else
            {
                refs.Add(CreateReference("HasComponent", CreateIrdConceptDescription(concept)));
            }

            entry.References = refs.ToArray();
            root.Add((UANode)entry);
            return(entry.NodeId);
        }
Exemplo n.º 2
0
        private static string CreateDataSpecification(AdminShellV20.ConceptDescription concept)
        {
            UAObject ident = new UAObject();

            ident.NodeId     = "ns=1;i=" + masterID.ToString();
            ident.BrowseName = "1:DataSpecification";
            masterID++;
            List <Reference> refs = new List <Reference>();

            refs.Add(CreateHasTypeDefinition("1:AASDataSpecificationType"));

            refs.Add(CreateReference("HasComponent", CreateDataSpecificationIEC61360(concept)));

            ident.References = refs.ToArray();
            root.Add((UANode)ident);
            return(ident.NodeId);
        }
Exemplo n.º 3
0
        private static string CreateDataSpecificationIEC61360(AdminShellV20.ConceptDescription concept)
        {
            UAObject ident = new UAObject();

            ident.NodeId     = "ns=1;i=" + masterID.ToString();
            ident.BrowseName = "1:DataSpecificationIEC61360";
            masterID++;
            List <Reference> refs = new List <Reference>();

            refs.Add(CreateHasTypeDefinition("1:AASDataSpecificationIEC61360Type"));

            refs.Add(
                CreateReference(
                    "HasProperty",
                    CreateProperty(
                        "DataSpecificationIEC61360", "PropertyType", "DefaultInstanceBrowseName", "String")));
            refs.Add(
                CreateReference(
                    "HasProperty",
                    CreateProperty("DataSpecificationIEC61360", "PropertyType", "IdShort", "String")));
            refs.Add(
                CreateReference(
                    "HasProperty",
                    CreateProperty(concept.category, "PropertyType", "Category", "String")));

            refs.Add(
                CreateReference(
                    "HasProperty",
                    CreateProperty(
                        concept.GetIEC61360()?.GetHashCode().ToString(), "BaseVariableType", "Code", "String")));
            refs.Add(
                CreateReference(
                    "HasProperty",
                    CreateProperty(concept.GetIEC61360()?.dataType, "BaseVariableType", "DataType", "String")));

            refs.Add(
                CreateReference(
                    "HasComponent",
                    CreateLangStrContainer(concept.GetIEC61360()?.definition, "Definition")));
            refs.Add(
                CreateReference(
                    "HasComponent",
                    CreateLangStrContainer(concept.GetIEC61360()?.preferredName, "PreferredName")));

            refs.Add(
                CreateReference(
                    "HasProperty",
                    CreateProperty(
                        concept.GetIEC61360()?.shortName.ToString(), "BaseVariableType", "ShortName", "String")));
            refs.Add(
                CreateReference(
                    "HasProperty",
                    CreateProperty(concept.GetIEC61360()?.symbol, "BaseVariableType", "Symbol", "String")));
            refs.Add(
                CreateReference(
                    "HasProperty",
                    CreateProperty(concept.GetIEC61360()?.unit, "BaseVariableType", "Unit", "String")));
            refs.Add(
                CreateReference(
                    "HasProperty",
                    CreateProperty(concept.GetIEC61360()?.valueFormat, "BaseVariableType", "ValueFormat", "String")));

            ident.References = refs.ToArray();
            root.Add((UANode)ident);
            return(ident.NodeId);
        }