UAMethod.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { XMLElem } from "@/util/XmlElem";
  2. import { UABaseNode, type UABaseNodeOptions } from "./UABaseNode";
  3. import type { NamespaceTable } from "./NameSpaceTable";
  4. import type { IAddressSpace } from "./IAddressSpace";
  5. export class UAMethod extends UABaseNode {
  6. constructor(options: UAMethodNodeOptions) {
  7. super(options);
  8. Object.assign(this, options);
  9. this.nodeClass="Method";
  10. }
  11. static fromXML(uaMethod: any, addressSpace: IAddressSpace): UAMethod{
  12. const bn=super.fromXML(uaMethod, addressSpace)
  13. return new UAMethod(bn as UABaseNodeOptions);
  14. }
  15. toXML(lnst:NamespaceTable, gnst:NamespaceTable): XMLElem {
  16. const elem =super.toXML(lnst, gnst);
  17. return elem;
  18. }
  19. getModellingRule(){
  20. let res:any = "";
  21. this.references.forEach((ref)=>{
  22. if(ref.referenceType == "HasModellingRule"){
  23. res = ref.toNode.browseName;
  24. }
  25. })
  26. return res;
  27. }
  28. }
  29. export interface UAMethodNodeOptions extends UABaseNodeOptions{
  30. }