UAObjectType.ts 952 B

123456789101112131415161718192021222324252627282930
  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 UAObjectType extends UABaseNode{
  6. public isAbstract: boolean;
  7. constructor(options: UAObjectTypeOptions) {
  8. super(options)
  9. Object.assign(this, options);
  10. this.isAbstract=options.isAbstract||false;
  11. }
  12. static fromXML(xmlObjType: any, addressSpace: IAddressSpace): UAObjectType{
  13. const bn=super.fromXML(xmlObjType, addressSpace)
  14. return new UAObjectType(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 UAObjectTypeOptions extends UABaseNodeOptions{
  23. isAbstract?: boolean
  24. }