From e3eea26562958c99ec17cb5aa89efee51c44182f Mon Sep 17 00:00:00 2001 From: Archie Miller <62433534+Archie-Miller@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:28:35 -0700 Subject: [PATCH 01/11] Potential Solution - requires feedback --- NodeSetToAML.cs | 276 +++++++++++++++++++++++++++++++++++++++++++++--- Program.cs | 1 - UANodeSet.cs | 146 ++++++++++++++++++------- UANodeSet.xsd | 42 ++++---- generate.bat | 1 + 5 files changed, 386 insertions(+), 80 deletions(-) create mode 100644 generate.bat diff --git a/NodeSetToAML.cs b/NodeSetToAML.cs index fb3fd2b..fe5cdb1 100644 --- a/NodeSetToAML.cs +++ b/NodeSetToAML.cs @@ -35,10 +35,12 @@ using Aml.Engine.AmlObjects; using Aml.Engine.CAEX; using Aml.Engine.CAEX.Extensions; +using UADataType = MarkdownProcessor.NodeSet.UADataType; +using UAInstance = MarkdownProcessor.NodeSet.UAInstance; using UANode = MarkdownProcessor.NodeSet.UANode; +using UAObject = MarkdownProcessor.NodeSet.UAObject; using UAType = MarkdownProcessor.NodeSet.UAType; using UAVariable = MarkdownProcessor.NodeSet.UAVariable; -using UAInstance = MarkdownProcessor.NodeSet.UAInstance; using DataTypeField = MarkdownProcessor.NodeSet.DataTypeField; using Aml.Engine.Adapter; using System.Xml.Linq; @@ -48,9 +50,7 @@ using NodeSetToAmlUtils; using System.Collections; using System.Reflection; -using MarkdownProcessor.NodeSet; using System.Xml; -using Microsoft.AspNetCore.Identity; namespace MarkdownProcessor { @@ -221,20 +221,29 @@ public void CreateAML(string modelPath, string modelName = null) AddLibraryHeaderInfo(scl_temp as CAEXBasicObject, modelInfo); SortedDictionary SortedDataTypes = new SortedDictionary(); + SortedDictionary SortedReferenceTypes = new SortedDictionary(); SortedDictionary SortedObjectTypes = new SortedDictionary(); // also contains VariableTypes - - foreach (var node in modelInfo.Types) + Dictionary fieldDefinitions = new Dictionary(); + foreach (KeyValuePair node in modelInfo.Types) { switch (node.Value.NodeClass) { case NodeClass.DataType: - var toAdd = ProcessDataType(node.Value); - if (toAdd != null) + if( node.Key.Equals( "RedundantServerDataType", StringComparison.OrdinalIgnoreCase ) ) + { + bool interesting = true; + } + + AttributeFamilyType toAdd = ProcessDataType( node.Value ); + if( toAdd != null ) { - if (!SortedDataTypes.ContainsKey(node.Value.DecodedBrowseName.Name)) - SortedDataTypes.Add(node.Value.DecodedBrowseName.Name, toAdd); + if( !SortedDataTypes.ContainsKey( node.Value.DecodedBrowseName.Name ) ) + { + SortedDataTypes.Add( node.Value.DecodedBrowseName.Name, toAdd ); + fieldDefinitions.Add( node.Value.DecodedBrowseName.Name, node.Value ); + } } break; case NodeClass.ReferenceType: @@ -248,14 +257,15 @@ public void CreateAML(string modelPath, string modelName = null) } } - foreach( var dicEntry in SortedDataTypes) + foreach( KeyValuePair dicEntry in SortedDataTypes) { if (atl == null) { atl = m_cAEXDocument.CAEXFile.AttributeTypeLib.Append(ATLPrefix + modelInfo.NamespaceUri); AddLibraryHeaderInfo(atl as CAEXBasicObject, modelInfo); } - atl.AttributeType.Insert(dicEntry.Value, false); // insert into the AML document in alpha order + + atl.AttributeType.Insert( dicEntry.Value, false); // insert into the AML document in alpha order } foreach( var dicEntry in SortedDataTypes) // cteate the ListOf versions @@ -263,6 +273,25 @@ public void CreateAML(string modelPath, string modelName = null) atl.AttributeType.Insert(CreateListOf(dicEntry.Value), false); // insert into the AML document in alpha order } + if( atl != null ) + { + foreach( AttributeFamilyType attribute in atl.AttributeType ) + { + if( fieldDefinitions.ContainsKey( attribute.Name ) ) + { + AddStructureFieldDefinition( attribute, fieldDefinitions[ attribute.Name ] ); + } + else + { + if( !attribute.Name.StartsWith( "ListOf" ) ) + { + bool unexpected = true; + } + } + } + } + + foreach( var refType in SortedReferenceTypes) { ProcessReferenceType(ref icl_temp, refType.Value); @@ -332,6 +361,10 @@ public void CreateAML(string modelPath, string modelName = null) Utils.LogInfo( "Creating Instances Complete" ); + RemoveTypeOnly(); + + Utils.LogInfo( "Remove Type Only information Complete" ); + // write out the AML file // var OutFilename = modelName + ".aml"; // m_cAEXDocument.SaveToFile(OutFilename, true); @@ -505,7 +538,58 @@ private void AddMetaModelLibraries(CAEXDocument doc) atl_meta.AttributeType.Insert(AliasAttr, false); - + //Add StructureFieldDefinition + AttributeFamilyType structureFieldDefinition = new AttributeFamilyType( + new System.Xml.Linq.XElement( defaultNS + "AttributeType" ) ); + structureFieldDefinition.Name = "StructureFieldDefinition"; + + AttributeType nameAttribute = new AttributeType( + new System.Xml.Linq.XElement( defaultNS + "Attribute" ) ); + nameAttribute.Name = "Name"; + nameAttribute.AttributeDataType = "xs:string"; + structureFieldDefinition.Insert( nameAttribute, false ); + + //AttributeType descriptionAttribute = new AttributeType( + // new System.Xml.Linq.XElement( defaultNS + "Attribute" ) ); + //descriptionAttribute.Name = "Description"; + //descriptionAttribute.AttributeDataType = "xs:string"; + //structureFieldDefinition.Insert( descriptionAttribute, false ); + + AttributeType valueRankAttribute = new AttributeType( + new System.Xml.Linq.XElement( defaultNS + "Attribute" ) ); + valueRankAttribute.Name = "ValueRank"; + valueRankAttribute.AttributeDataType = "xs:int"; + valueRankAttribute.RefAttributeType = "[ATL_http://opcfoundation.org/UA/]/[Int32]"; + structureFieldDefinition.Insert( valueRankAttribute, false ); + + AttributeType isOptionalAttribute = new AttributeType( + new System.Xml.Linq.XElement( defaultNS + "Attribute" ) ); + isOptionalAttribute.Name = "IsOptional"; + isOptionalAttribute.AttributeDataType = "xs:boolean"; + structureFieldDefinition.Insert( isOptionalAttribute, false ); + + AttributeType arrayDimensionsAttribute = new AttributeType( + new System.Xml.Linq.XElement( defaultNS + "Attribute" ) ); + arrayDimensionsAttribute.Name = "ArrayDimensions"; + arrayDimensionsAttribute.AttributeDataType = "xs:int"; + arrayDimensionsAttribute.RefAttributeType = "[ATL_http://opcfoundation.org/UA/]/[ListOfInt32]"; + structureFieldDefinition.Insert( arrayDimensionsAttribute, false ); + + AttributeType allowSubtypesAttribute = new AttributeType( + new System.Xml.Linq.XElement( defaultNS + "Attribute" ) ); + allowSubtypesAttribute.Name = "AllowSubtypes"; + allowSubtypesAttribute.AttributeDataType = "xs:boolean"; + structureFieldDefinition.Insert( allowSubtypesAttribute, false ); + + AttributeType maxStringLengthAttribute = new AttributeType( + new System.Xml.Linq.XElement( defaultNS + "Attribute" ) ); + maxStringLengthAttribute.Name = "MaxStringLength"; + maxStringLengthAttribute.AttributeDataType = "xs:int"; + maxStringLengthAttribute.RefAttributeType = "[ATL_http://opcfoundation.org/UA/]/[UInt32]"; + structureFieldDefinition.Insert( maxStringLengthAttribute, false ); + + atl_meta.AttributeType.Insert( structureFieldDefinition, false ); + // add UABaseRole to the RCL var rcl_meta = m_cAEXDocument.CAEXFile.RoleClassLib.Append(RCLPrefix + MetaModelName); @@ -1030,7 +1114,7 @@ private Dictionary CreateFieldReferenceTypes( AttributeTy if( typeUaNode != null ) { - UADataType typeDataType = typeUaNode as UADataType; + NodeSet.UADataType typeDataType = typeUaNode as NodeSet.UADataType; if( typeDataType != null && typeDataType.Definition != null && typeDataType.Definition.Field != null ) { Dictionary fields = new Dictionary(); @@ -2389,21 +2473,26 @@ SystemUnitFamilyType FindOrAddSUC(ref SystemUnitClassLibType scl, ref RoleClassL } private void SetArrayDimensions( SystemUnitClassType element, string arrayDimensions ) + { + SetArrayDimensions( element.Attribute, arrayDimensions ); + } + + private void SetArrayDimensions( AttributeSequence attributes, string arrayDimensions ) { string[] parts = arrayDimensions.Split( ',' ); List arrayValues = new List(); foreach( string part in parts ) { UInt32 value; - if ( UInt32.TryParse( part, out value ) ) + if( UInt32.TryParse( part, out value ) ) { arrayValues.Add( value ); } } - AddModifyAttribute( element.Attribute, - "ArrayDimensions", - Opc.Ua.DataTypeIds.UInt32, + AddModifyAttribute( attributes, + "ArrayDimensions", + Opc.Ua.DataTypeIds.UInt32, new Variant( arrayValues.ToArray() ), bListOf: true ); } @@ -2713,6 +2802,7 @@ private void RecurseStructures(ref AttributeTypeType att, NodeId nodeId) } if (m_modelManager.IsTypeOf(nodeId, structureNode.DecodedNodeId)) { + bool debugMessage = false; att.AttributeDataType = ""; var MyNode = FindNode(nodeId) as NodeSet.UADataType; if (MyNode.Definition != null && MyNode.Definition.Field != null) @@ -2781,6 +2871,67 @@ private void RecurseStructures(ref AttributeTypeType att, NodeId nodeId) } } + private void AddStructureFieldDefinition( AttributeFamilyType attribute, UANode uaNode) + { + if( m_modelManager.IsTypeOf( uaNode.DecodedNodeId, structureNode.DecodedNodeId ) ) + { + attribute.AttributeDataType = ""; + NodeSet.UADataType uaDataType = uaNode as NodeSet.UADataType; + + if( uaDataType != null && + uaDataType.Definition != null && + uaDataType.Definition.Field != null ) + { + if( !uaDataType.Definition.IsOptionSet || + !m_modelManager.IsTypeOf( uaNode.DecodedNodeId, OptionSetStructureNodeId ) ) + { + string path = BuildLibraryReference( ATLPrefix, MetaModelName, "StructureFieldDefinition" ); + + for( int index = 0; index < uaDataType.Definition.Field.Length; index++ ) + { + DataTypeField field = uaDataType.Definition.Field[ index ]; + AttributeTypeType fieldDefinitionAttribute = attribute.Attribute[ field.Name ] ; + if( fieldDefinitionAttribute != null ) + { + AttributeType structureFieldAttribute = + fieldDefinitionAttribute.Attribute[ "StructureFieldDefinition" ]; + + if( structureFieldAttribute == null ) + { + AttributeFamilyType structureFieldDefinition = m_cAEXDocument.FindByPath( path ) as AttributeFamilyType; + + structureFieldAttribute = new AttributeType( + new System.Xml.Linq.XElement( defaultNS + "Attribute" ) ); + + structureFieldAttribute.RecreateAttributeInstance( structureFieldDefinition as AttributeFamilyType ); + structureFieldAttribute.Name = "StructureFieldDefinition"; + structureFieldAttribute.AdditionalInformation.Append( "OpcUa:TypeOnly" ); + + + // NowFill the data + AddModifyAttribute( structureFieldAttribute.Attribute, + "Name", "String", new Variant( field.Name ) ); + AddModifyAttribute( structureFieldAttribute.Attribute, + "ValueRank", "Int32", new Variant( field.ValueRank ) ); + AddModifyAttribute( structureFieldAttribute.Attribute, + "IsOptional", "Boolean", new Variant( field.IsOptional) ); + + SetArrayDimensions( structureFieldAttribute.Attribute, field.ArrayDimensions ); + + AddModifyAttribute( structureFieldAttribute.Attribute, + "AllowSubtypes", "Boolean", new Variant( field.AllowSubTypes ) ); + AddModifyAttribute( structureFieldAttribute.Attribute, + "MaxStringLength", "UInt32", new Variant( field.MaxStringLength ) ); + + fieldDefinitionAttribute.Attribute.Insert( structureFieldAttribute ); + } + } + } + } + } + } + } + private AttributeFamilyType ProcessDataType(NodeSet.UANode node) { var typeNode = node as MarkdownProcessor.NodeSet.UADataType; @@ -3295,6 +3446,97 @@ public NodeId ComplexGetBuiltInTypeEx( NodeId sourceId ) return null; } + #endregion + + #region Type Only + + private void RemoveTypeOnly() + { + RemoveTypeOnlySystemUnitClasses(); + RemoveTypeOnlyInstances(); + } + + private void RemoveTypeOnlyInstances( ) + { + Utils.LogInfo("Remove TypeOnly Attributes - Instances" ); + + foreach( InstanceHierarchyType instanceHierarchy in m_cAEXDocument.CAEXFile.InstanceHierarchy ) + { + Console.WriteLine( "InstanceHierarchy " + instanceHierarchy.Name ); + + foreach( InternalElementType internalElement in instanceHierarchy.InternalElement ) + { + RemoveTypeOnlySystemUnitClassTypes( internalElement ); + } + } + } + + private void RemoveTypeOnlySystemUnitClasses( ) + { + Utils.LogInfo( "Remove TypeOnly Attributes - SystemUnitClasses" ); + + foreach( SystemUnitClassLibType libType in m_cAEXDocument.CAEXFile.SystemUnitClassLib ) + { + Console.WriteLine( "SystemUnitClass LibType " + libType.Name ); + + foreach( SystemUnitFamilyType familyType in libType.SystemUnitClass ) + { + RemoveTypeOnlySystemUnitClassTypes( familyType ); + } + } + } + + private void RemoveTypeOnlySystemUnitClassTypes( SystemUnitClassType entity ) + { + Console.WriteLine( "\tSystemUnitClassType " + entity.Name ); + + foreach( InternalElementType internalElement in entity.InternalElement ) + { + RemoveTypeOnlySystemUnitClassTypes( internalElement ); + } + + RemoveTypeOnlyAttributes(entity.Attribute, entity.Name ); + } + + private void RemoveTypeOnlyAttributes( AttributeSequence attributes, string path ) + { + List attributesToRemove = new List(); + + foreach( AttributeType attribute in attributes ) + { + if ( attribute.AdditionalInformation != null && + attribute.AdditionalInformation.Count > 0 ) + { + foreach( object additionalInformation in attribute.AdditionalInformation ) + { + if ( additionalInformation.GetType().Name == "String" ) + { + string isTypeOnly = additionalInformation as string; + if ( !string.IsNullOrEmpty( isTypeOnly ) && + isTypeOnly == "OpcUa:TypeOnly" ) + { + attributesToRemove.Add( attribute ); + break; + } + } + } + } + } + + foreach( AttributeType attribute in attributesToRemove ) + { + Utils.LogInfo( "{0} Removing TypeOnly Attribute {1}", path, attribute.Name ); + attributes.RemoveElement( attribute ); + } + + foreach( AttributeType attribute in attributes ) + { + string subPath = path + " " + attribute.Name; + RemoveTypeOnlyAttributes( attribute.Attribute, subPath ); + } + } + + #endregion } } \ No newline at end of file diff --git a/Program.cs b/Program.cs index d02987b..8c0d206 100644 --- a/Program.cs +++ b/Program.cs @@ -36,7 +36,6 @@ using System.IO; using System.Collections.Generic; using MarkdownProcessor; -using Microsoft.Extensions.Configuration; using Opc.Ua; namespace Opc2Aml diff --git a/UANodeSet.cs b/UANodeSet.cs index 1e75551..065c96d 100644 --- a/UANodeSet.cs +++ b/UANodeSet.cs @@ -1,4 +1,3 @@ -#pragma warning disable 1591 //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -10,14 +9,14 @@ //------------------------------------------------------------------------------ // -// This source code was auto-generated by xsd, Version=4.6.1055.0. +// This source code was auto-generated by xsd, Version=4.8.3928.0. // namespace MarkdownProcessor.NodeSet { using System.Xml.Serialization; /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -138,7 +137,7 @@ public bool LastModifiedSpecified { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -151,16 +150,20 @@ public partial class ModelTableEntry { private string modelUriField; + private string xmlSchemaUriField; + private string versionField; private System.DateTime publicationDateField; private bool publicationDateFieldSpecified; - private byte accessRestrictionsField; + private string modelVersionField; + + private ushort accessRestrictionsField; public ModelTableEntry() { - this.accessRestrictionsField = ((byte)(0)); + this.accessRestrictionsField = ((ushort)(0)); } /// @@ -196,6 +199,17 @@ public string ModelUri { } } + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string XmlSchemaUri { + get { + return this.xmlSchemaUriField; + } + set { + this.xmlSchemaUriField = value; + } + } + /// [System.Xml.Serialization.XmlAttributeAttribute()] public string Version { @@ -231,8 +245,19 @@ public bool PublicationDateSpecified { /// [System.Xml.Serialization.XmlAttributeAttribute()] - [System.ComponentModel.DefaultValueAttribute(typeof(byte), "0")] - public byte AccessRestrictions { + public string ModelVersion { + get { + return this.modelVersionField; + } + set { + this.modelVersionField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + [System.ComponentModel.DefaultValueAttribute(typeof(ushort), "0")] + public ushort AccessRestrictions { get { return this.accessRestrictionsField; } @@ -243,7 +268,7 @@ public byte AccessRestrictions { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -283,7 +308,7 @@ public string Value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -323,7 +348,7 @@ public string Value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -363,7 +388,7 @@ public string Value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -429,7 +454,7 @@ public string Value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -456,6 +481,8 @@ public partial class DataTypeField { private bool isOptionalField; + private bool allowSubTypesField; + public DataTypeField() { this.dataTypeField = "i=24"; this.valueRankField = -1; @@ -463,6 +490,7 @@ public DataTypeField() { this.maxStringLengthField = ((uint)(0)); this.valueField = -1; this.isOptionalField = false; + this.allowSubTypesField = false; } /// @@ -580,10 +608,22 @@ public bool IsOptional { this.isOptionalField = value; } } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + [System.ComponentModel.DefaultValueAttribute(false)] + public bool AllowSubTypes { + get { + return this.allowSubTypesField; + } + set { + this.allowSubTypesField = value; + } + } } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -623,7 +663,7 @@ public string Value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -643,7 +683,6 @@ public partial class DataTypeDefinition { private string baseTypeField; public DataTypeDefinition() { - this.symbolicNameField = ""; this.isUnionField = false; this.isOptionSetField = false; this.baseTypeField = ""; @@ -673,7 +712,6 @@ public string Name { /// [System.Xml.Serialization.XmlAttributeAttribute()] - [System.ComponentModel.DefaultValueAttribute("")] public string SymbolicName { get { return this.symbolicNameField; @@ -721,7 +759,7 @@ public string BaseType { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -755,7 +793,7 @@ public LocalizedText[] Description { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -790,7 +828,7 @@ public string Name { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -813,7 +851,7 @@ public object[] Items { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -876,7 +914,7 @@ public string Value { [System.Xml.Serialization.XmlIncludeAttribute(typeof(UAMethod))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(UAVariable))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(UAObject))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -905,7 +943,11 @@ public partial class UANode { private uint userWriteMaskField; - private byte accessRestrictionsField; + private ushort accessRestrictionsField; + + private bool accessRestrictionsFieldSpecified; + + private bool hasNoPermissionsField; private string symbolicNameField; @@ -914,7 +956,7 @@ public partial class UANode { public UANode() { this.writeMaskField = ((uint)(0)); this.userWriteMaskField = ((uint)(0)); - this.accessRestrictionsField = ((byte)(0)); + this.hasNoPermissionsField = false; this.releaseStatusField = ReleaseStatus.Released; } @@ -1042,8 +1084,7 @@ public uint UserWriteMask { /// [System.Xml.Serialization.XmlAttributeAttribute()] - [System.ComponentModel.DefaultValueAttribute(typeof(byte), "0")] - public byte AccessRestrictions { + public ushort AccessRestrictions { get { return this.accessRestrictionsField; } @@ -1052,6 +1093,29 @@ public byte AccessRestrictions { } } + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool AccessRestrictionsSpecified { + get { + return this.accessRestrictionsFieldSpecified; + } + set { + this.accessRestrictionsFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + [System.ComponentModel.DefaultValueAttribute(false)] + public bool HasNoPermissions { + get { + return this.hasNoPermissionsField; + } + set { + this.hasNoPermissionsField = value; + } + } + /// [System.Xml.Serialization.XmlAttributeAttribute()] public string SymbolicName { @@ -1077,7 +1141,7 @@ public ReleaseStatus ReleaseStatus { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://opcfoundation.org/UA/2011/03/UANodeSet.xsd")] public enum ReleaseStatus { @@ -1097,7 +1161,7 @@ public enum ReleaseStatus { [System.Xml.Serialization.XmlIncludeAttribute(typeof(UADataType))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(UAVariableType))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(UAObjectType))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1124,7 +1188,7 @@ public bool IsAbstract { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1164,7 +1228,7 @@ public bool Symmetric { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1203,7 +1267,7 @@ public DataTypePurpose Purpose { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://opcfoundation.org/UA/2011/03/UANodeSet.xsd")] public enum DataTypePurpose { @@ -1219,7 +1283,7 @@ public enum DataTypePurpose { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1288,7 +1352,7 @@ public string ArrayDimensions { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1301,7 +1365,7 @@ public partial class UAObjectType : UAType { [System.Xml.Serialization.XmlIncludeAttribute(typeof(UAMethod))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(UAVariable))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(UAObject))] - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1323,7 +1387,7 @@ public string ParentNodeId { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1365,7 +1429,7 @@ public byte EventNotifier { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1433,7 +1497,7 @@ public string MethodDeclarationId { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1575,7 +1639,7 @@ public bool Historizing { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1602,7 +1666,7 @@ public byte EventNotifier { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1637,7 +1701,7 @@ public string Value { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -1815,7 +1879,7 @@ public bool AcceptAllOrNothing { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] diff --git a/UANodeSet.xsd b/UANodeSet.xsd index fc9e924..209bfa5 100644 --- a/UANodeSet.xsd +++ b/UANodeSet.xsd @@ -1,6 +1,6 @@