Quellcode durchsuchen

added ServerConfig.ts for server configuration in json format

dstrutzenberger vor 11 Monaten
Ursprung
Commit
b7aac3c523
3 geänderte Dateien mit 23 neuen und 1 gelöschten Zeilen
  1. 3 1
      src/ua/AddressSpace.ts
  2. 10 0
      src/ua/UAObject.ts
  3. 10 0
      src/ua/UAVariable.ts

+ 3 - 1
src/ua/AddressSpace.ts

@@ -5,6 +5,7 @@ import YAML from 'yaml'
 import JSZip from "jszip";
 import { ReferenceTypeIds } from "./opcua_node_ids";
 import type { NodeId } from "./NodeId";
+import {sconfig} from "@/util/ServerConfig"
 
 export class AddressSpace{
 
@@ -73,7 +74,8 @@ export class AddressSpace{
             fileNames.push(ns.fileName);
             zip.file(ns.fileName, ns.toXML(ns.nameSpaceTable, this.nst).toString());
         }
-        zip.file("project.json", JSON.stringify(fileNames));
+        sconfig.nodesets = fileNames;
+        zip.file("project.json", JSON.stringify(sconfig));
         const mapString=YAML.stringify(this.mapping.values());
         zip.file("mapping.yaml", mapString)
         return zip.generateAsync({type:'blob'});

+ 10 - 0
src/ua/UAObject.ts

@@ -29,6 +29,16 @@ export class UAObject extends UABaseNode {
         }
         return elem;
     }
+
+    getModellingRule(){
+        let res:any = "";
+        this.references.forEach((ref)=>{
+            if(ref.referenceType == "HasModellingRule"){
+                res = ref.toNode.displayName;
+            }
+        })
+        return res;
+    }
 }
 
 export interface UAObjectNodeOptions extends UABaseNodeOptions{

+ 10 - 0
src/ua/UAVariable.ts

@@ -29,6 +29,16 @@ export class UAVariable extends UABaseNode {
         }
         return elem;
     }
+
+    getModellingRule(){
+        let res:any = "";
+        this.references.forEach((ref)=>{
+            if(ref.referenceType == "HasModellingRule"){
+                res = ref.toNode.displayName;
+            }
+        })
+        return res;
+    }
 }
 
 export interface UAVariableNodeOptions extends UABaseNodeOptions{