22namespace AdminShell
33{
44 using AAS2Nodeset ;
5+ using I4AAS . Submodels ;
56 using Opc . Ua ;
67 using Opc . Ua . Export ;
78 using Opc . Ua . Server ;
89 using System ;
910 using System . Collections . Generic ;
1011 using System . IO ;
11- using System . Linq ;
12-
12+ using System . Linq ;
13+ using System . Reflection ;
14+
1315 public class I4AASNodeManager : CustomNodeManager2
1416 {
1517 const int c_administrationNodeId = 1001 ;
@@ -32,6 +34,8 @@ public class I4AASNodeManager : CustomNodeManager2
3234 public I4AASNodeManager ( IServerInternal server , ApplicationConfiguration configuration )
3335 : base ( server , configuration )
3436 {
37+ SystemContext . NodeIdFactory = this ;
38+
3539 List < string > namespaceUris =
3640 [
3741 "http://opcfoundation.org/UA/i4aas/"
@@ -42,6 +46,8 @@ public I4AASNodeManager(IServerInternal server, ApplicationConfiguration configu
4246 _namespaceIndex = Server . NamespaceUris . GetIndexOrAppend ( namespaceUris [ 0 ] ) ;
4347
4448 _lastUsedId = 0 ;
49+
50+ Server . MessageContext . Factory . AddEncodeableTypes ( typeof ( SubmodelDataType ) . GetTypeInfo ( ) . Assembly ) ;
4551 }
4652
4753 public override NodeId New ( ISystemContext context , NodeState node )
@@ -71,9 +77,9 @@ public override void CreateAddressSpace(IDictionary<NodeId, IList<IReference>> e
7177 lock ( Lock )
7278 {
7379 IList < IReference > ? objectsFolderReferences = null ;
74- if ( ! externalReferences . TryGetValue ( ObjectIds . ObjectsFolder , out objectsFolderReferences ) )
80+ if ( ! externalReferences . TryGetValue ( Opc . Ua . ObjectIds . ObjectsFolder , out objectsFolderReferences ) )
7581 {
76- externalReferences [ ObjectIds . ObjectsFolder ] = objectsFolderReferences = new List < IReference > ( ) ;
82+ externalReferences [ Opc . Ua . ObjectIds . ObjectsFolder ] = objectsFolderReferences = new List < IReference > ( ) ;
7783 }
7884
7985 AddNodesFromNodesetXml ( "./I4AAS.NodeSet2.xml" ) ;
@@ -358,7 +364,7 @@ public FolderState CreateFolder(NodeState? parent, string browseDisplayName)
358364 BrowseName = browseDisplayName ,
359365 DisplayName = browseDisplayName ,
360366 NodeId = new NodeId ( browseDisplayName , _namespaceIndex ) ,
361- TypeDefinitionId = ObjectTypeIds . FolderType
367+ TypeDefinitionId = Opc . Ua . ObjectTypeIds . FolderType
362368 } ;
363369
364370 AddPredefinedNode ( SystemContext , x ) ;
0 commit comments