|
@@ -3,17 +3,20 @@ import type { NamespaceTable } from "./NameSpaceTable";
|
|
|
import { UABaseNode, type UABaseNodeOptions } from "./UABaseNode";
|
|
|
|
|
|
export class UAReferenceType extends UABaseNode{
|
|
|
+ public isAbstract: boolean;
|
|
|
|
|
|
constructor(options: UAReferenceTypeOptions) {
|
|
|
super(options)
|
|
|
+ this.isAbstract=options.isAbstract||false;
|
|
|
}
|
|
|
|
|
|
- static fromXML(uaMethod: any): UAReferenceType{
|
|
|
- const bn=super.fromXML(uaMethod)
|
|
|
+ static fromXML(xmlRefType: any): UAReferenceType{
|
|
|
+ const bn=super.fromXML(xmlRefType)
|
|
|
return new UAReferenceType({nodeId: bn.nodeId,
|
|
|
browseName: bn.browseName,
|
|
|
displayName: bn.displayName,
|
|
|
- references: bn.references});
|
|
|
+ references: bn.references,
|
|
|
+ isAbstract: xmlRefType['@_IsAbstract']==='true'});
|
|
|
}
|
|
|
|
|
|
toXML(lnst:NamespaceTable, gnst:NamespaceTable): XMLElem {
|
|
@@ -21,6 +24,7 @@ export class UAReferenceType extends UABaseNode{
|
|
|
const elem =new XMLElem('UAReferenceType');
|
|
|
elem.attr('NodeId', nid.toString())
|
|
|
.attr('BrowseName', this.browseName)
|
|
|
+ .attr('IsAbstract', this.isAbstract)
|
|
|
.elem('DisplayName', this.displayName);
|
|
|
const refs=elem.add(new XMLElem('References'))
|
|
|
for(const ref of this.references) {
|
|
@@ -32,5 +36,5 @@ export class UAReferenceType extends UABaseNode{
|
|
|
}
|
|
|
|
|
|
export interface UAReferenceTypeOptions extends UABaseNodeOptions{
|
|
|
-
|
|
|
+ isAbstract?: boolean
|
|
|
}
|