123456789101112131415161718192021222324252627282930313233343536373839 |
- import { XMLElem } from "@/util/XmlElem";
- import { UABaseNode, type UABaseNodeOptions } from "./UABaseNode";
- import type { NamespaceTable } from "./NameSpaceTable";
- import type { IAddressSpace } from "./IAddressSpace";
- export class UAMethod extends UABaseNode {
- public methodDeclarationId: string|undefined;
- public userExecutable!: Boolean;
- public executable!: Boolean;
- constructor(options: UAMethodNodeOptions) {
- super(options);
- Object.assign(this, options);
- this.nodeClass="UAMethod";
- }
- static fromXML(uaMethod: any, addressSpace: IAddressSpace): UAMethod{
- const bn=super.fromXML(uaMethod, addressSpace) as UAMethodNodeOptions;
- bn.methodDeclarationId=uaMethod['@_MethodDeclarationId'];
- bn.userExecutable=Boolean(uaMethod['@_UserExecutable']||true);
- bn.executable=Boolean(uaMethod['@_Executable']||true);
- return new UAMethod(bn as UABaseNodeOptions);
- }
- toXML(lnst:NamespaceTable, gnst:NamespaceTable): XMLElem {
- const elem =super.toXML(lnst, gnst);
- elem.name=this.nodeClass;
- elem.attr("MethodDeclarationId", this.methodDeclarationId);
- elem.attr("UserExecutable", this.userExecutable.toString());
- elem.attr("Executable", this.executable.toString());
- return elem;
- }
- }
- export interface UAMethodNodeOptions extends UABaseNodeOptions{
- methodDeclarationId?: string;
- userExecutable?: Boolean;
- executable?: Boolean;
- }
|