UAReferenceType.ts 1.0 KB

12345678910111213141516171819202122232425262728293031
  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 UAReferenceType extends UABaseNode{
  6. public isAbstract: boolean;
  7. constructor(options: UAReferenceTypeOptions) {
  8. super(options)
  9. Object.assign(this, options);
  10. this.nodeClass="UAReferenceType";
  11. this.isAbstract=options.isAbstract||false;
  12. }
  13. static fromXML(xmlRefType: any, addressSpace: IAddressSpace): UAReferenceType{
  14. const bn=super.fromXML(xmlRefType, addressSpace)
  15. return new UAReferenceType(bn as UABaseNodeOptions);
  16. }
  17. toXML(lnst:NamespaceTable, gnst:NamespaceTable): XMLElem {
  18. const elem=super.toXML(lnst, gnst);
  19. elem.name=this.nodeClass;
  20. elem.attr('IsAbstract', this.isAbstract);
  21. return elem;
  22. }
  23. }
  24. export interface UAReferenceTypeOptions extends UABaseNodeOptions{
  25. isAbstract?: boolean
  26. }