Constructor.
Name of the new node as string.
Display name of the new node as multi-language string.
The data point (element) which is linked to the node as string. If no data point shall be linked an empty string can be defined.
Optionalchildren: WinccoaCnsTreeNode[]Optional children which define subtree of the current tree node.
Optionaltype: numberOptional node type (see WinccoaCnsNodeType). If omitted, the type is derived from dp (WinccoaCnsNodeType.Empty when no data point is linked, WinccoaCnsNodeType.Datapoint otherwise). A custom numerical node type can be assigned as well.
import { WinccoaManager, WinccoaCnsTreeNode } from 'winccoa-manager';
const winccoa = new WinccoaManager();
async function test() {
const tree = new WinccoaCnsTreeNode('CarTree', {'en': 'Car', 'de': 'Auto'}, '', [
new WinccoaCnsTreeNode('B', 'B', '', [
new WinccoaCnsTreeNode('dp', 'ExampleDP_Rpt1', 'System1:ExampleDP_Rpt1.')
]),
new WinccoaCnsTreeNode('C')
]);
try {
await winccoa.cnsAddTree('System1.View1', tree);
} catch(exc) {
console.error(exc);
}
}
OptionalchildrenOptional children which define subtree of the current tree node.
Display name of the new node as multi-language string.
The data point (element) which is linked to the node as string. If no data point shall be linked an empty string can be defined.
Name of the new node as string.
OptionaltypeOptional node type (see WinccoaCnsNodeType). If omitted, the type is derived from dp (WinccoaCnsNodeType.Empty when no data point is linked, WinccoaCnsNodeType.Datapoint otherwise). A custom numerical node type can be assigned as well.
CNS Tree Node for a CNS tree.