소스 검색

added UAMethod.ts

DS 7 달 전
부모
커밋
3e81cfca47
1개의 변경된 파일35개의 추가작업 그리고 0개의 파일을 삭제
  1. 35 0
      src/ua/UAMethod.ts

+ 35 - 0
src/ua/UAMethod.ts

@@ -0,0 +1,35 @@
+import { XMLElem } from "@/util/XmlElem";
+import { UABaseNode, type UABaseNodeOptions } from "./UABaseNode";
+
+export class UAMethod extends UABaseNode {
+    constructor(options: UAMethodNodeOptions) {
+                    super(options);
+    }
+
+    static  fromXML(uaMethod: any): UAMethod{
+        const bn=super.fromXML(uaMethod)
+        return new UAMethod({nodeId: bn.nodeId, 
+                            browseName: bn.browseName, 
+                            nodeClass: "Method",
+                            namespace: bn.namespace,
+                            displayName: bn.displayName,
+                            references: bn.references});
+    }
+
+
+    toXML(): XMLElem {
+        const elem =new XMLElem('UAMethod');
+        elem.attr('NodeID', this.nodeId.toString())
+            .attr('BrowseName', this.browseName)
+            .attr('DisplayName', this.displayName);
+        const refs=elem.add(new XMLElem('References'))
+        for(const ref of this.references) {
+            refs.add(ref.toXML());
+        }
+        return elem;
+    }
+}
+
+export interface UAMethodNodeOptions extends UABaseNodeOptions{
+   
+}