|
@@ -3,29 +3,32 @@ import { type UABaseNodeOptions } from "./UABaseNode";
|
|
import type { NamespaceTable } from "./NameSpaceTable";
|
|
import type { NamespaceTable } from "./NameSpaceTable";
|
|
import type { IAddressSpace } from "./IAddressSpace";
|
|
import type { IAddressSpace } from "./IAddressSpace";
|
|
import { UAType } from "./UAType";
|
|
import { UAType } from "./UAType";
|
|
|
|
+import { Definition } from "./Definition";
|
|
export class UADataType extends UAType implements IToXML {
|
|
export class UADataType extends UAType implements IToXML {
|
|
-//TODO definition
|
|
|
|
|
|
+ public definition?:Definition;
|
|
|
|
|
|
constructor(options: UATypeOptions) {
|
|
constructor(options: UATypeOptions) {
|
|
super(options);
|
|
super(options);
|
|
Object.assign(this, options);
|
|
Object.assign(this, options);
|
|
this.nodeClass="UADataType";
|
|
this.nodeClass="UADataType";
|
|
|
|
+ this.definition=options.definition;
|
|
}
|
|
}
|
|
toXML(lnst:NamespaceTable, gnst:NamespaceTable): XMLElem {
|
|
toXML(lnst:NamespaceTable, gnst:NamespaceTable): XMLElem {
|
|
const elem=super.toXML(lnst, gnst);
|
|
const elem=super.toXML(lnst, gnst);
|
|
elem.name=this.nodeClass;
|
|
elem.name=this.nodeClass;
|
|
elem.attr("Purpose", this.purpose);
|
|
elem.attr("Purpose", this.purpose);
|
|
elem.attr('IsAbstract', this.isAbstract);
|
|
elem.attr('IsAbstract', this.isAbstract);
|
|
-
|
|
|
|
|
|
+ elem.elem("Definition", this.definition?.toXML(lnst,gnst));
|
|
return elem;
|
|
return elem;
|
|
}
|
|
}
|
|
- static fromXML(uaObject: any, addressSpace: IAddressSpace): UADataType{
|
|
|
|
- const bn=super.fromXML(uaObject, addressSpace) as UATypeOptions
|
|
|
|
-
|
|
|
|
|
|
+ static fromXML(xmlObject: any, addressSpace: IAddressSpace): UADataType{
|
|
|
|
+ const bn=super.fromXML(xmlObject, addressSpace) as UADataType;
|
|
|
|
+ if(xmlObject['Definition'])
|
|
|
|
+ bn.definition = Definition.fromXML(xmlObject['Definition'], addressSpace);
|
|
return new UADataType(bn as UATypeOptions);
|
|
return new UADataType(bn as UATypeOptions);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export interface UATypeOptions extends UABaseNodeOptions{
|
|
export interface UATypeOptions extends UABaseNodeOptions{
|
|
-
|
|
|
|
|
|
+ definition?:Definition;
|
|
}
|
|
}
|