Esempio n. 1
0
 private static void Update(IDataTypeFactory nodeDesign, UADataType nodeSet, IUAModelContext modelContext, Action <TraceMessage> traceEvent)
 {
     nodeSet.Definition.GetParameters(nodeDesign.NewDefinition(), modelContext, traceEvent);
     nodeDesign.DataTypePurpose = nodeSet.Purpose.ConvertToDataTypePurpose();
     if (nodeSet.Purpose != XML.DataTypePurpose.Normal)
     {
         traceEvent(TraceMessage.DiagnosticTraceMessage($"DataTypePurpose value {nodeSet.Purpose } is not supported by the tool"));
     }
 }
Esempio n. 2
0
 internal override void RecalculateNodeIds(IUAModelContext modelContext)
 {
     base.RecalculateNodeIds(modelContext);
     if (this.Definition is null)
     {
         return;
     }
     this.Definition.RecalculateNodeIds(modelContext.ImportNodeId);
 }
Esempio n. 3
0
 internal virtual void RecalculateNodeIds(IUAModelContext modelContext)
 {
     BrowseName  = modelContext.ImportQualifiedName(BrowseName);
     this.NodeId = modelContext.ImportNodeId(this.NodeId);
     if (!(this.References is null))
     {
         foreach (Reference _reference in this.References)
         {
             _reference.RecalculateNodeIds(modelContext.ImportNodeId);
         }
     }
     ImportNodeId(this.RolePermissions, modelContext.ImportNodeId);
 }
Esempio n. 4
0
 internal void RecalculateNodeIds(IUAModelContext modelContext)
 {
     if (this.Aliases != null)
     {
         foreach (NodeIdAlias _alias in this.Aliases)
         {
             _alias.RecalculateNodeIds(modelContext.ImportNodeId);
         }
     }
     if (this.Items != null)
     {
         foreach (UANode item in Items)
         {
             item.RecalculateNodeIds(modelContext);
         }
     }
 }
Esempio n. 5
0
        internal static UAReferenceContext NewReferenceStub
            (Reference reference, IAddressSpaceBuildContext addressSpaceContext, IUAModelContext modelContext, IUANodeContext parentNode, Action <TraceMessage> traceEvent)
        {
            IUANodeContext     targetNode = modelContext.GetOrCreateNodeContext(reference.Value, true);
            UAReferenceContext _stb       = new UAReferenceContext()
            {
                m_Context  = addressSpaceContext,
                ParentNode = parentNode,
                SourceNode = reference.IsForward ? parentNode : targetNode,
                ModelNode  = reference,
                TargetNode = reference.IsForward ? targetNode : parentNode,
                TypeNode   = modelContext.GetOrCreateNodeContext(reference.ReferenceType, true),
            };

            if (_stb.TypeNode != null && _stb.TypeNode.NodeIdContext.NamespaceIndex == 0)
            {
                _stb.ReferenceKind = _stb.GetReferenceKind(_stb.TypeNode);
            }
            return(_stb);
        }
Esempio n. 6
0
 internal void RecalculateNodeIds(IUAModelContext importNodeId)
 {
     if (this.Aliases != null)
     {
         foreach (NodeIdAlias _alias in this.Aliases)
         {
             _alias.RecalculateNodeIds(importNodeId.ImportNodeId);
         }
     }
     if (this.NodesToAdd != null)
     {
         foreach (UANode _node in this.NodesToAdd)
         {
             _node.RecalculateNodeIds(importNodeId);
         }
     }
     if (this.NodesToDelete != null)
     {
         foreach (NodeToDelete _node in this.NodesToDelete)
         {
             _node.RecalculateNodeIds(importNodeId.ImportNodeId);
         }
     }
     if (this.ReferencesToAdd != null)
     {
         foreach (ReferenceChange _reference in this.ReferencesToAdd)
         {
             _reference.RecalculateNodeIds(importNodeId.ImportNodeId);
         }
     }
     if (this.ReferencesToDelete != null)
     {
         foreach (var _reference in this.ReferencesToDelete)
         {
             _reference.RecalculateNodeIds(importNodeId.ImportNodeId);
         }
     }
 }
Esempio n. 7
0
 internal static void GetParameters(this XML.DataTypeDefinition dataTypeDefinition, IDataTypeDefinitionFactory dataTypeDefinitionFactory, IUAModelContext modelContext, Action <TraceMessage> traceEvent)
 {
     //xsd comment  < !--BaseType is obsolete and no longer used.Left in for backwards compatibility. -->
     //definition.BaseType = modelContext.ExportBrowseName(dataTypeDefinition.BaseType, DataTypes.BaseDataType);
     dataTypeDefinitionFactory.IsOptionSet  = dataTypeDefinition.IsOptionSet;
     dataTypeDefinitionFactory.IsUnion      = dataTypeDefinition.IsUnion;
     dataTypeDefinitionFactory.Name         = null; //TODO UADataType.Definition.Name wrong value #341 modelContext.ExportBrowseName( dataTypeDefinition.Name, DataTypes.BaseDataType);
     dataTypeDefinitionFactory.SymbolicName = dataTypeDefinition.SymbolicName;
     if (dataTypeDefinition == null || dataTypeDefinition.Field == null || dataTypeDefinition.Field.Length == 0)
     {
         return;
     }
     foreach (XML.DataTypeField _item in dataTypeDefinition.Field)
     {
         IDataTypeFieldFactory _nP = dataTypeDefinitionFactory.NewField();
         _nP.Name         = _item.Name;
         _nP.SymbolicName = _item.SymbolicName;
         _item.DisplayName.ExportLocalizedTextArray(_nP.AddDisplayName);
         _nP.DataType        = modelContext.ExportBrowseName(_item.DataType, DataTypes.BaseDataType);
         _nP.ValueRank       = _item.ValueRank.GetValueRank(traceEvent);
         _nP.ArrayDimensions = _item.ArrayDimensions;
         _nP.MaxStringLength = _item.MaxStringLength;
         _item.Description.ExportLocalizedTextArray(_nP.AddDescription);
         _nP.Value      = _item.Value;
         _nP.IsOptional = _item.IsOptional;
     }
 }
 public IUANodeContext GetOrCreateNodeContext(NodeId id, IUAModelContext uAModelContext)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
 /// <summary>
 /// Recalculates the node identifiers.
 /// </summary>
 /// <param name="modelContext">The model context.</param>
 internal override void RecalculateNodeIds(IUAModelContext modelContext)
 {
     base.RecalculateNodeIds(modelContext);
     this.DataType = modelContext.ImportNodeId(DataType);
 }
Esempio n. 10
0
 internal override void RecalculateNodeIds(IUAModelContext modelContext)
 {
     base.RecalculateNodeIds(modelContext);
     this.ParentNodeId = modelContext.ImportNodeId(this.ParentNodeId);
 }
Esempio n. 11
0
 internal override void RecalculateNodeIds(IUAModelContext modelContext)
 {
     base.RecalculateNodeIds(modelContext);
     MethodDeclarationId = modelContext.ImportNodeId(this.MethodDeclarationId);
 }
Esempio n. 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UANodeContext" /> class.
 /// </summary>
 /// <param name="addressSpaceContext">The address space context.</param>
 /// <param name="modelContext">The model context.</param>
 /// <param name="nodeId">An object of <see cref="NodeId"/> that stores an identifier for a node in a server's address space.</param>
 internal UANodeContext(IAddressSpaceBuildContext addressSpaceContext, IUAModelContext modelContext, NodeId nodeId)
 {
     this.m_AddressSpaceContext = addressSpaceContext;
     this.NodeIdContext         = nodeId;
     this.UAModelContext        = modelContext;
 }