UAVariableType.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. import { XMLElem } from "@/util/XmlElem";
  2. import type { NamespaceTable } from "./NameSpaceTable";
  3. import { UABaseNode, type UABaseNodeOptions } from "./UABaseNode";
  4. import type { IAddressSpace } from "./IAddressSpace";
  5. export class UAVariableType extends UABaseNode{
  6. public isAbstract: boolean=false;
  7. constructor(options: UAVariableTypeOptions) {
  8. super(options)
  9. Object.assign(this, options);
  10. this.nodeClass="VariableType";
  11. }
  12. static fromXML(xmlObjType: any, addressSpace: IAddressSpace): UAVariableType{
  13. const bn=super.fromXML(xmlObjType, addressSpace)
  14. const uavt= new UAVariableType(bn as UABaseNodeOptions);
  15. uavt.isAbstract= xmlObjType['@_IsAbstract']==='true';
  16. return uavt;
  17. }
  18. toXML(lnst:NamespaceTable, gnst:NamespaceTable): XMLElem {
  19. const elem =super.toXML(lnst, gnst);
  20. elem.attr('IsAbstract', this.isAbstract);
  21. return elem;
  22. }
  23. }
  24. export interface UAVariableTypeOptions extends UABaseNodeOptions{
  25. isAbstract?: boolean
  26. }