|
@@ -4,6 +4,10 @@ import type { NamespaceTable } from "./NameSpaceTable";
|
|
import type { IAddressSpace } from "./IAddressSpace";
|
|
import type { IAddressSpace } from "./IAddressSpace";
|
|
|
|
|
|
export class UAMethod extends UABaseNode {
|
|
export class UAMethod extends UABaseNode {
|
|
|
|
+ public methodDeclarationId: string|undefined;
|
|
|
|
+ public userExecutable!: Boolean;
|
|
|
|
+ public executable!: Boolean;
|
|
|
|
+
|
|
constructor(options: UAMethodNodeOptions) {
|
|
constructor(options: UAMethodNodeOptions) {
|
|
super(options);
|
|
super(options);
|
|
Object.assign(this, options);
|
|
Object.assign(this, options);
|
|
@@ -11,12 +15,18 @@ export class UAMethod extends UABaseNode {
|
|
}
|
|
}
|
|
|
|
|
|
static fromXML(uaMethod: any, addressSpace: IAddressSpace): UAMethod{
|
|
static fromXML(uaMethod: any, addressSpace: IAddressSpace): UAMethod{
|
|
- const bn=super.fromXML(uaMethod, addressSpace)
|
|
|
|
|
|
+ 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);
|
|
return new UAMethod(bn as UABaseNodeOptions);
|
|
}
|
|
}
|
|
|
|
|
|
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.attr("MethodDeclarationId", this.methodDeclarationId);
|
|
|
|
+ elem.attr("UserExecutable", this.userExecutable.toString());
|
|
|
|
+ elem.attr("Executable", this.executable.toString());
|
|
return elem;
|
|
return elem;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -32,5 +42,7 @@ export class UAMethod extends UABaseNode {
|
|
}
|
|
}
|
|
|
|
|
|
export interface UAMethodNodeOptions extends UABaseNodeOptions{
|
|
export interface UAMethodNodeOptions extends UABaseNodeOptions{
|
|
-
|
|
|
|
|
|
+ methodDeclarationId?: string;
|
|
|
|
+ userExecutable?: Boolean;
|
|
|
|
+ executable?: Boolean;
|
|
}
|
|
}
|