UADataType.ts 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. import { XMLElem, type IToXML } from "@/util/XmlElem";
  2. import { type UABaseNodeOptions } from "./UABaseNode";
  3. import type { NamespaceTable } from "./NameSpaceTable";
  4. import type { IAddressSpace } from "./IAddressSpace";
  5. import { UAType } from "./UAType";
  6. export class UADataType extends UAType implements IToXML {
  7. //TODO definition
  8. constructor(options: UATypeOptions) {
  9. super(options);
  10. Object.assign(this, options);
  11. this.nodeClass="UADataType";
  12. }
  13. toXML(lnst:NamespaceTable, gnst:NamespaceTable): XMLElem {
  14. const elem=super.toXML(lnst, gnst);
  15. elem.name=this.nodeClass;
  16. elem.attr("Purpose", this.purpose);
  17. elem.attr('IsAbstract', this.isAbstract);
  18. return elem;
  19. }
  20. static fromXML(uaObject: any, addressSpace: IAddressSpace): UADataType{
  21. const bn=super.fromXML(uaObject, addressSpace) as UATypeOptions
  22. return new UADataType(bn as UATypeOptions);
  23. }
  24. }
  25. export interface UATypeOptions extends UABaseNodeOptions{
  26. }