import { XMLElem } from "@/util/XmlElem"; import { UABaseNode, type UABaseNodeOptions } from "./UABaseNode"; export class UAVariable extends UABaseNode { constructor(options: UAVariableNodeOptions) { super(options); } static fromXML(uaObject: any): UAVariable{ const bn=super.fromXML(uaObject) return new UAVariable({nodeId: bn.nodeId, nodeClass: "Variable", browseName: bn.browseName, displayName: bn.displayName, references: bn.references}); } toXML(): XMLElem { const elem =new XMLElem('UAVariable'); elem.attr('NodeID', this.nodeId.toString()) .attr('BrowseName', this.browseName) .attr('DisplayName', this.displayName); const refs=elem.add(new XMLElem('References')) for(const ref of this.references) { refs.add(ref.toXML()); } return elem; } } export interface UAVariableNodeOptions extends UABaseNodeOptions{ }