UAReferenceType.ts 963 B

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