node-opcua-address-space 2.105.1 → 2.107.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/source/address_space_ts.js +1 -1
- package/dist/source/address_space_ts.js.map +1 -1
- package/dist/source/loader/register_node_promoter.d.ts +1 -1
- package/dist/source/loader/register_node_promoter.js +2 -2
- package/dist/source/loader/register_node_promoter.js.map +1 -1
- package/dist/source/pseudo_session.d.ts +1 -1
- package/dist/source/pseudo_session.js.map +1 -1
- package/dist/source/session_context.js +3 -3
- package/dist/source/session_context.js.map +1 -1
- package/dist/src/_instantiate_helpers.d.ts +2 -0
- package/dist/src/_instantiate_helpers.js +80 -0
- package/dist/src/_instantiate_helpers.js.map +1 -0
- package/dist/src/_mandatory_child_or_requested_optional_filter.d.ts +9 -0
- package/dist/src/_mandatory_child_or_requested_optional_filter.js +80 -0
- package/dist/src/_mandatory_child_or_requested_optional_filter.js.map +1 -0
- package/dist/src/address_space.d.ts +0 -10
- package/dist/src/address_space.js +1 -11
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +1 -1
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +4 -1
- package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +1 -1
- package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +2 -2
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +3 -2
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/base_node_impl.d.ts +1 -1
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/base_node_private.d.ts +1 -1
- package/dist/src/base_node_private.js +82 -82
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +1 -1
- package/dist/src/namespace_impl.js +7 -7
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.js +13 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/src/state_machine/finite_state_machine.d.ts +1 -1
- package/dist/src/state_machine/finite_state_machine.js +204 -19
- package/dist/src/state_machine/finite_state_machine.js.map +1 -1
- package/dist/src/ua_method_impl.js +4 -1
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/src/ua_object_impl.js +2 -3
- package/dist/src/ua_object_impl.js.map +1 -1
- package/dist/src/ua_object_type_impl.js +2 -1
- package/dist/src/ua_object_type_impl.js.map +1 -1
- package/dist/src/ua_variable_impl.d.ts +1 -1
- package/dist/src/ua_variable_impl.js +6 -4
- package/dist/src/ua_variable_impl.js.map +1 -1
- package/dist/src/ua_variable_type_impl.d.ts +5 -3
- package/dist/src/ua_variable_type_impl.js +8 -132
- package/dist/src/ua_variable_type_impl.js.map +1 -1
- package/dist/tsconfig_common.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/source/loader/register_node_promoter.ts +3 -6
- package/source/pseudo_session.ts +2 -2
- package/src/_instantiate_helpers.ts +141 -0
- package/src/_mandatory_child_or_requested_optional_filter.ts +98 -0
- package/src/address_space.ts +25 -25
- package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +3 -0
- package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +1 -1
- package/src/alarms_and_conditions/ua_condition_impl.ts +7 -5
- package/src/base_node_impl.ts +2 -1
- package/src/base_node_private.ts +100 -117
- package/src/namespace_impl.ts +11 -7
- package/src/nodeset_tools/nodeset_to_xml.ts +22 -1
- package/src/state_machine/finite_state_machine.ts +250 -37
- package/src/ua_method_impl.ts +4 -1
- package/src/ua_object_impl.ts +2 -3
- package/src/ua_object_type_impl.ts +1 -1
- package/src/ua_variable_impl.ts +7 -7
- package/src/ua_variable_type_impl.ts +4 -202
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.d.ts +0 -1
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js +0 -35
- package/dist/src/data_access/check_variant_compatibility_ua_analog_item.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-address-space",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.107.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module address-space",
|
|
5
5
|
"main": "./dist/src/index_current.js",
|
|
6
6
|
"types": "./dist/source/index.d.ts",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"chalk": "4.1.2",
|
|
23
23
|
"dequeue": "^1.0.5",
|
|
24
24
|
"lodash": "4.17.21",
|
|
25
|
-
"node-opcua-address-space-base": "2.
|
|
25
|
+
"node-opcua-address-space-base": "2.107.0",
|
|
26
26
|
"node-opcua-assert": "2.105.0",
|
|
27
27
|
"node-opcua-basic-types": "2.105.0",
|
|
28
28
|
"node-opcua-binary-stream": "2.105.0",
|
|
29
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
29
|
+
"node-opcua-client-dynamic-extension-object": "2.107.0",
|
|
30
30
|
"node-opcua-constants": "2.98.1",
|
|
31
31
|
"node-opcua-crypto": "3.0.6",
|
|
32
|
-
"node-opcua-data-access": "2.
|
|
32
|
+
"node-opcua-data-access": "2.107.0",
|
|
33
33
|
"node-opcua-data-model": "2.105.0",
|
|
34
34
|
"node-opcua-data-value": "2.105.0",
|
|
35
35
|
"node-opcua-date-time": "2.105.0",
|
|
@@ -38,20 +38,20 @@
|
|
|
38
38
|
"node-opcua-extension-object": "2.105.0",
|
|
39
39
|
"node-opcua-factory": "2.105.0",
|
|
40
40
|
"node-opcua-nodeid": "2.105.0",
|
|
41
|
-
"node-opcua-nodeset-ua": "2.
|
|
41
|
+
"node-opcua-nodeset-ua": "2.107.0",
|
|
42
42
|
"node-opcua-numeric-range": "2.105.0",
|
|
43
43
|
"node-opcua-object-registry": "2.105.0",
|
|
44
|
-
"node-opcua-pseudo-session": "2.
|
|
45
|
-
"node-opcua-service-browse": "2.
|
|
46
|
-
"node-opcua-service-call": "2.
|
|
47
|
-
"node-opcua-service-history": "2.
|
|
48
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
49
|
-
"node-opcua-service-write": "2.
|
|
44
|
+
"node-opcua-pseudo-session": "2.107.0",
|
|
45
|
+
"node-opcua-service-browse": "2.107.0",
|
|
46
|
+
"node-opcua-service-call": "2.107.0",
|
|
47
|
+
"node-opcua-service-history": "2.107.0",
|
|
48
|
+
"node-opcua-service-translate-browse-path": "2.107.0",
|
|
49
|
+
"node-opcua-service-write": "2.107.0",
|
|
50
50
|
"node-opcua-status-code": "2.105.0",
|
|
51
|
-
"node-opcua-types": "2.
|
|
51
|
+
"node-opcua-types": "2.107.0",
|
|
52
52
|
"node-opcua-utils": "2.105.0",
|
|
53
53
|
"node-opcua-variant": "2.105.0",
|
|
54
|
-
"node-opcua-xml2json": "2.
|
|
54
|
+
"node-opcua-xml2json": "2.107.0",
|
|
55
55
|
"semver": "^7.5.1",
|
|
56
56
|
"set-prototype-of": "^1.0.0",
|
|
57
57
|
"thenify": "^3.3.1",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"mocha": "^10.2.0",
|
|
62
62
|
"node-opcua-benchmarker": "2.105.0",
|
|
63
63
|
"node-opcua-leak-detector": "2.105.0",
|
|
64
|
-
"node-opcua-nodesets": "2.
|
|
64
|
+
"node-opcua-nodesets": "2.107.0",
|
|
65
65
|
"node-opcua-packet-analyzer": "2.105.0",
|
|
66
|
-
"node-opcua-service-filter": "2.
|
|
67
|
-
"node-opcua-test-fixtures": "2.
|
|
66
|
+
"node-opcua-service-filter": "2.107.0",
|
|
67
|
+
"node-opcua-test-fixtures": "2.107.0",
|
|
68
68
|
"should": "^13.2.3",
|
|
69
69
|
"sinon": "^15.1.0",
|
|
70
70
|
"source-map-support": "^0.5.21"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"internet of things"
|
|
85
85
|
],
|
|
86
86
|
"homepage": "http://node-opcua.github.io/",
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "df5c9168eea0d1a521603d181fa66ace7649e79e",
|
|
88
88
|
"files": [
|
|
89
89
|
"dist",
|
|
90
90
|
"distHelpers",
|
|
@@ -3,10 +3,7 @@ import { UAObject, UAVariable } from "node-opcua-address-space-base";
|
|
|
3
3
|
|
|
4
4
|
import { g_promotableObject, Promoter } from "./namespace_post_step";
|
|
5
5
|
|
|
6
|
-
export function registerNodePromoter(
|
|
7
|
-
|
|
8
|
-
promoter
|
|
9
|
-
applyOnTypes = false
|
|
10
|
-
): void {
|
|
11
|
-
g_promotableObject[resolveNodeId(standardNodeId).toString()] = { promoter, onInstanceOnly: applyOnTypes };
|
|
6
|
+
export function registerNodePromoter(standardNodeId: number, promoter: Promoter, onInstanceOnly = false): void {
|
|
7
|
+
|
|
8
|
+
g_promotableObject[resolveNodeId(standardNodeId).toString()] = { promoter, onInstanceOnly };
|
|
12
9
|
}
|
package/source/pseudo_session.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface InnerBrowseEngine {
|
|
|
49
49
|
maxBrowseContinuationPoints: number;
|
|
50
50
|
continuationPointManager: ContinuationPointManager;
|
|
51
51
|
context: ISessionContext;
|
|
52
|
-
browseAll: (nodesToBrowse: BrowseDescriptionOptions[],
|
|
52
|
+
browseAll: (nodesToBrowse: BrowseDescriptionOptions[], callback: ResponseCallback<BrowseResult[]>) => void;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export function innerBrowse(
|
|
@@ -172,7 +172,7 @@ export class PseudoSession implements IBasicSession {
|
|
|
172
172
|
const r = this[$addressSpace].browseSingleNode(nodeId, _browseDescription, this[$context]);
|
|
173
173
|
results.push(r);
|
|
174
174
|
}
|
|
175
|
-
callack(null, results);
|
|
175
|
+
callack!(null, results);
|
|
176
176
|
};
|
|
177
177
|
|
|
178
178
|
setImmediate(() => {
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space
|
|
3
|
+
*/
|
|
4
|
+
// tslint:disable:max-classes-per-file
|
|
5
|
+
// tslint:disable:no-console
|
|
6
|
+
import chalk from "chalk";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
UAMethod,
|
|
10
|
+
UAObject,
|
|
11
|
+
UAObjectType,
|
|
12
|
+
UAVariable,
|
|
13
|
+
UAVariableType,
|
|
14
|
+
reconstructFunctionalGroupType,
|
|
15
|
+
reconstructNonHierarchicalReferences,
|
|
16
|
+
CloneHelper
|
|
17
|
+
} from "node-opcua-address-space-base";
|
|
18
|
+
|
|
19
|
+
import { checkDebugFlag, make_debugLog, make_warningLog, make_errorLog } from "node-opcua-debug";
|
|
20
|
+
import { sameNodeId } from "node-opcua-nodeid";
|
|
21
|
+
|
|
22
|
+
import { makeOptionalsMap, OptionalMap } from "../source/helpers/make_optionals_map";
|
|
23
|
+
|
|
24
|
+
import { _clone_hierarchical_references } from "./base_node_private";
|
|
25
|
+
import { MandatoryChildOrRequestedOptionalFilter } from "./_mandatory_child_or_requested_optional_filter";
|
|
26
|
+
|
|
27
|
+
const debugLog = make_debugLog(__filename);
|
|
28
|
+
const doDebug = checkDebugFlag(__filename);
|
|
29
|
+
const warningLog = make_warningLog(__filename);
|
|
30
|
+
const errorLog = make_errorLog(__filename);
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line prefer-const
|
|
33
|
+
let doTrace = checkDebugFlag("INSTANTIATE");
|
|
34
|
+
const traceLog = errorLog;
|
|
35
|
+
|
|
36
|
+
// install properties and components on a instantiated Object
|
|
37
|
+
//
|
|
38
|
+
// based on their ModelingRule
|
|
39
|
+
// => Mandatory => Installed
|
|
40
|
+
// => Optional => Not Installed , unless it appear in optionals array
|
|
41
|
+
// => OptionalPlaceHolder => Not Installed
|
|
42
|
+
// => null (no modelling rule ) => Not Installed
|
|
43
|
+
//
|
|
44
|
+
|
|
45
|
+
function _initialize_properties_and_components<B extends UAObject | UAVariable | UAMethod, T extends UAObjectType | UAVariableType>(
|
|
46
|
+
instance: B,
|
|
47
|
+
topMostType: T,
|
|
48
|
+
typeDefinitionNode: T,
|
|
49
|
+
copyAlsoModellingRules: boolean,
|
|
50
|
+
optionalsMap: OptionalMap,
|
|
51
|
+
extraInfo: CloneHelper,
|
|
52
|
+
browseNameMap: Set<string>
|
|
53
|
+
) {
|
|
54
|
+
if (doTrace) {
|
|
55
|
+
warningLog("instance browseName =", instance.browseName.toString());
|
|
56
|
+
warningLog("typeNode =", typeDefinitionNode.browseName.toString());
|
|
57
|
+
warningLog("optionalsMap =", Object.keys(optionalsMap).join(" "));
|
|
58
|
+
|
|
59
|
+
const c = typeDefinitionNode.findReferencesEx("Aggregates");
|
|
60
|
+
warningLog("typeDefinition aggregates =", c.map((x) => x.node!.browseName.toString()).join(" "));
|
|
61
|
+
}
|
|
62
|
+
optionalsMap = optionalsMap || {};
|
|
63
|
+
|
|
64
|
+
if (sameNodeId(topMostType.nodeId, typeDefinitionNode.nodeId)) {
|
|
65
|
+
return; // nothing to do
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const filter = new MandatoryChildOrRequestedOptionalFilter(instance, optionalsMap);
|
|
69
|
+
|
|
70
|
+
doTrace &&
|
|
71
|
+
traceLog(
|
|
72
|
+
chalk.cyan(extraInfo.pad(), "cloning relevant member of typeDefinition class"),
|
|
73
|
+
typeDefinitionNode.browseName.toString()
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
_clone_hierarchical_references(typeDefinitionNode, instance, copyAlsoModellingRules, filter, extraInfo, browseNameMap);
|
|
77
|
+
|
|
78
|
+
// now apply recursion on baseTypeDefinition to get properties and components from base class
|
|
79
|
+
|
|
80
|
+
const baseTypeDefinitionNodeId = typeDefinitionNode.subtypeOf;
|
|
81
|
+
const baseTypeDefinition = typeDefinitionNode.subtypeOfObj!;
|
|
82
|
+
|
|
83
|
+
doTrace &&
|
|
84
|
+
traceLog(
|
|
85
|
+
chalk.cyan(
|
|
86
|
+
extraInfo.pad(),
|
|
87
|
+
"now apply recursion on baseTypeDefinition to get properties and components from base class"
|
|
88
|
+
),
|
|
89
|
+
baseTypeDefinition.browseName.toString()
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// istanbul ignore next
|
|
93
|
+
if (!baseTypeDefinition) {
|
|
94
|
+
throw new Error(chalk.red("Cannot find object with nodeId ") + baseTypeDefinitionNodeId);
|
|
95
|
+
}
|
|
96
|
+
extraInfo.level++;
|
|
97
|
+
_initialize_properties_and_components(
|
|
98
|
+
instance,
|
|
99
|
+
topMostType,
|
|
100
|
+
baseTypeDefinition,
|
|
101
|
+
copyAlsoModellingRules,
|
|
102
|
+
optionalsMap,
|
|
103
|
+
extraInfo,
|
|
104
|
+
browseNameMap
|
|
105
|
+
);
|
|
106
|
+
extraInfo.level--;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function initialize_properties_and_components<
|
|
110
|
+
B extends UAObject | UAVariable | UAMethod,
|
|
111
|
+
T extends UAVariableType | UAObjectType
|
|
112
|
+
>(instance: B, topMostType: T, nodeType: T, copyAlsoModellingRules: boolean, optionals?: string[]): void {
|
|
113
|
+
const extraInfo = new CloneHelper();
|
|
114
|
+
|
|
115
|
+
extraInfo.pushContext({
|
|
116
|
+
clonedParent: instance,
|
|
117
|
+
originalParent: nodeType
|
|
118
|
+
});
|
|
119
|
+
extraInfo.registerClonedObject({
|
|
120
|
+
clonedNode: instance,
|
|
121
|
+
originalNode: nodeType
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const optionalsMap = makeOptionalsMap(optionals);
|
|
125
|
+
|
|
126
|
+
const browseNameMap = new Set<string>();
|
|
127
|
+
|
|
128
|
+
_initialize_properties_and_components(
|
|
129
|
+
instance,
|
|
130
|
+
topMostType,
|
|
131
|
+
nodeType,
|
|
132
|
+
copyAlsoModellingRules,
|
|
133
|
+
optionalsMap,
|
|
134
|
+
extraInfo,
|
|
135
|
+
browseNameMap
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
reconstructFunctionalGroupType(extraInfo);
|
|
139
|
+
|
|
140
|
+
reconstructNonHierarchicalReferences(extraInfo);
|
|
141
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { assert } from "node-opcua-assert";
|
|
2
|
+
import { BaseNode, UAMethod, UAObject, UAReference, UAVariable, CloneFilter, fullPath2 } from "node-opcua-address-space-base";
|
|
3
|
+
|
|
4
|
+
import { checkDebugFlag, make_debugLog, make_warningLog, make_errorLog } from "node-opcua-debug";
|
|
5
|
+
|
|
6
|
+
import { _clone_hierarchical_references } from "./base_node_private";
|
|
7
|
+
|
|
8
|
+
// const debugLog = make_debugLog(__filename);
|
|
9
|
+
const doDebug = checkDebugFlag(__filename);
|
|
10
|
+
const warningLog = make_warningLog(__filename);
|
|
11
|
+
const errorLog = make_errorLog(__filename);
|
|
12
|
+
const doTrace = checkDebugFlag("INSTANTIATE");
|
|
13
|
+
const traceLog = errorLog;
|
|
14
|
+
|
|
15
|
+
export class MandatoryChildOrRequestedOptionalFilter implements CloneFilter {
|
|
16
|
+
private readonly instance: BaseNode;
|
|
17
|
+
private readonly optionalsMap: any;
|
|
18
|
+
private readonly references: UAReference[];
|
|
19
|
+
|
|
20
|
+
constructor(instance: BaseNode, optionalsMap: any) {
|
|
21
|
+
// should we clone the node to be a component or propertyOf of a instance
|
|
22
|
+
assert(optionalsMap !== null && typeof optionalsMap === "object");
|
|
23
|
+
assert(null !== instance);
|
|
24
|
+
this.optionalsMap = optionalsMap;
|
|
25
|
+
this.instance = instance;
|
|
26
|
+
this.references = instance.allReferences();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public shouldKeep(node: BaseNode): boolean {
|
|
30
|
+
const addressSpace = node.addressSpace;
|
|
31
|
+
|
|
32
|
+
const alreadyIn = this.references.filter((r: UAReference) => {
|
|
33
|
+
const n = addressSpace.findNode(r.nodeId)!;
|
|
34
|
+
// istanbul ignore next
|
|
35
|
+
if (!n) {
|
|
36
|
+
warningLog(" cannot find node ", r.nodeId.toString());
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return n.browseName!.name!.toString() === node.browseName!.name!.toString();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (alreadyIn.length > 0) {
|
|
43
|
+
assert(alreadyIn.length === 1, "Duplication found ?");
|
|
44
|
+
// a child with the same browse name has already been install
|
|
45
|
+
// probably from a SuperClass, we should ignore this.
|
|
46
|
+
return false; // ignore
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const modellingRule = node.modellingRule;
|
|
50
|
+
|
|
51
|
+
switch (modellingRule) {
|
|
52
|
+
case null:
|
|
53
|
+
case undefined:
|
|
54
|
+
// istanbul ignore next
|
|
55
|
+
doTrace &&
|
|
56
|
+
traceLog(
|
|
57
|
+
"node ",
|
|
58
|
+
fullPath2(node),
|
|
59
|
+
" has no modellingRule ",
|
|
60
|
+
node ? fullPath2(node) : ""
|
|
61
|
+
);
|
|
62
|
+
/**
|
|
63
|
+
* in some badly generated NodeSet2.xml file, the modellingRule is not specified
|
|
64
|
+
*
|
|
65
|
+
* but in some other NodeSet2.xml, this means that the data are only attached to the Type node and shall not be
|
|
66
|
+
* instantiate in the corresponding instance (example is the state variable of a finite state machine that are only
|
|
67
|
+
* defined in the Type node)
|
|
68
|
+
*
|
|
69
|
+
* we should not consider it as an error, and treat it as not present
|
|
70
|
+
*/
|
|
71
|
+
return false;
|
|
72
|
+
|
|
73
|
+
case "Mandatory":
|
|
74
|
+
return true; // keep;
|
|
75
|
+
case "Optional":
|
|
76
|
+
// only if in requested optionals
|
|
77
|
+
return node.browseName!.name! in this.optionalsMap;
|
|
78
|
+
case "OptionalPlaceholder":
|
|
79
|
+
return false; // ignored
|
|
80
|
+
default:
|
|
81
|
+
return false; // ignored
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public filterFor(childInstance: UAVariable | UAObject | UAMethod): CloneFilter {
|
|
86
|
+
const browseName: string = childInstance.browseName.name!;
|
|
87
|
+
|
|
88
|
+
let map = {};
|
|
89
|
+
|
|
90
|
+
if (browseName in this.optionalsMap) {
|
|
91
|
+
map = this.optionalsMap[browseName];
|
|
92
|
+
}
|
|
93
|
+
// istanbul ignore next
|
|
94
|
+
doTrace && traceLog("filterFor ", browseName, map);
|
|
95
|
+
const newFilter = new MandatoryChildOrRequestedOptionalFilter(childInstance, map);
|
|
96
|
+
return newFilter;
|
|
97
|
+
}
|
|
98
|
+
}
|
package/src/address_space.ts
CHANGED
|
@@ -10,7 +10,17 @@ import { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object
|
|
|
10
10
|
import { DataTypeIds, VariableTypeIds } from "node-opcua-constants";
|
|
11
11
|
import { BrowseDirection, NodeClass, QualifiedName } from "node-opcua-data-model";
|
|
12
12
|
import { ExtensionObject } from "node-opcua-extension-object";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
coerceExpandedNodeId,
|
|
15
|
+
coerceNodeId,
|
|
16
|
+
INodeId,
|
|
17
|
+
makeNodeId,
|
|
18
|
+
NodeId,
|
|
19
|
+
NodeIdLike,
|
|
20
|
+
NodeIdType,
|
|
21
|
+
resolveNodeId,
|
|
22
|
+
sameNodeId
|
|
23
|
+
} from "node-opcua-nodeid";
|
|
14
24
|
import { ObjectRegistry } from "node-opcua-object-registry";
|
|
15
25
|
import { BrowseResult } from "node-opcua-service-browse";
|
|
16
26
|
import { StatusCodes } from "node-opcua-status-code";
|
|
@@ -474,9 +484,9 @@ export class AddressSpace implements AddressSpacePrivate {
|
|
|
474
484
|
if (!(dataTypeNode instanceof UADataTypeImpl)) {
|
|
475
485
|
throw new Error(
|
|
476
486
|
"we are expecting an UADataType here : " +
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
487
|
+
_orig_dataTypeNode.toString() +
|
|
488
|
+
" should not refer to a " +
|
|
489
|
+
(dataTypeNode as BaseNode).browseName.name
|
|
480
490
|
);
|
|
481
491
|
}
|
|
482
492
|
|
|
@@ -768,18 +778,18 @@ export class AddressSpace implements AddressSpacePrivate {
|
|
|
768
778
|
// tslint:disable:no-console
|
|
769
779
|
console.log(
|
|
770
780
|
chalk.red("ERROR : AddressSpace#constructEventData(eventType,options) " + "cannot find property ") +
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
781
|
+
self.browseName.toString() +
|
|
782
|
+
" => " +
|
|
783
|
+
chalk.cyan(lowerName)
|
|
774
784
|
);
|
|
775
785
|
} else {
|
|
776
786
|
console.log(
|
|
777
787
|
chalk.yellow(
|
|
778
788
|
"Warning : AddressSpace#constructEventData(eventType,options)" + " cannot find property "
|
|
779
789
|
) +
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
790
|
+
self.browseName.toString() +
|
|
791
|
+
" => " +
|
|
792
|
+
chalk.cyan(lowerName)
|
|
783
793
|
);
|
|
784
794
|
}
|
|
785
795
|
}
|
|
@@ -796,11 +806,11 @@ export class AddressSpace implements AddressSpacePrivate {
|
|
|
796
806
|
if (!alreadyVisited(k)) {
|
|
797
807
|
throw new Error(
|
|
798
808
|
" cannot find property '" +
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
809
|
+
k +
|
|
810
|
+
"' in [ " +
|
|
811
|
+
Object.keys(visitedProperties).join(", ") +
|
|
812
|
+
"] when filling " +
|
|
813
|
+
eventTypeNode.browseName.toString()
|
|
804
814
|
);
|
|
805
815
|
}
|
|
806
816
|
});
|
|
@@ -1090,16 +1100,6 @@ export class AddressSpace implements AddressSpacePrivate {
|
|
|
1090
1100
|
}
|
|
1091
1101
|
}
|
|
1092
1102
|
|
|
1093
|
-
/**
|
|
1094
|
-
*
|
|
1095
|
-
* @method browseSingleNode
|
|
1096
|
-
* @param nodeId {NodeId|String} : the nodeid of the element to browse
|
|
1097
|
-
* @param browseDescription
|
|
1098
|
-
* @param browseDescription.browseDirection {BrowseDirection} :
|
|
1099
|
-
* @param browseDescription.referenceTypeId {String|NodeId}
|
|
1100
|
-
* @param [session]
|
|
1101
|
-
* @return {BrowseResult}
|
|
1102
|
-
*/
|
|
1103
1103
|
public browseSingleNode(nodeId: NodeIdLike, browseDescription: BrowseDescription, context?: ISessionContext): BrowseResult {
|
|
1104
1104
|
const browseResult: BrowseResultOptions = {
|
|
1105
1105
|
continuationPoint: undefined,
|
|
@@ -201,6 +201,9 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
|
|
|
201
201
|
|
|
202
202
|
public deactivateAlarm(retain?: boolean): void {
|
|
203
203
|
const branch = this.currentBranch();
|
|
204
|
+
if (!branch) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
204
207
|
branch.setRetain(retain === undefined ? true : retain);
|
|
205
208
|
branch.setActiveState(false);
|
|
206
209
|
}
|
|
@@ -193,7 +193,7 @@ class UACertificateExpirationAlarmImpl extends UASystemOffNormalAlarmImpl implem
|
|
|
193
193
|
this.expirationLimit.accessLevel = makeAccessLevelExFlag("CurrentRead | CurrentWrite");
|
|
194
194
|
this.expirationLimit.userAccessLevel = makeAccessLevelExFlag("CurrentRead | CurrentWrite");
|
|
195
195
|
this.expirationLimit.on("value_changed", (dataValue) => {
|
|
196
|
-
// make sure we re-evaluate the
|
|
196
|
+
// make sure we re-evaluate the certificate
|
|
197
197
|
const certificate = this.getCertificate();
|
|
198
198
|
this.setCertificate(certificate);
|
|
199
199
|
});
|
|
@@ -32,7 +32,8 @@ import {
|
|
|
32
32
|
BaseNode,
|
|
33
33
|
UAObject,
|
|
34
34
|
InstantiateObjectOptions,
|
|
35
|
-
UAProperty
|
|
35
|
+
UAProperty,
|
|
36
|
+
fullPath2
|
|
36
37
|
} from "node-opcua-address-space-base";
|
|
37
38
|
import { UAConditionVariable } from "node-opcua-nodeset-ua";
|
|
38
39
|
|
|
@@ -89,7 +90,7 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
|
|
|
89
90
|
namespace: INamespace,
|
|
90
91
|
conditionTypeId: NodeId | string | UAEventType,
|
|
91
92
|
options: any,
|
|
92
|
-
data
|
|
93
|
+
data?: Record<string, VariantOptions>
|
|
93
94
|
): UAConditionImpl {
|
|
94
95
|
return UACondition_instantiate(namespace, conditionTypeId, options, data) as UAConditionImpl;
|
|
95
96
|
}
|
|
@@ -455,9 +456,10 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
|
|
|
455
456
|
}
|
|
456
457
|
} else {
|
|
457
458
|
warningLog(
|
|
458
|
-
"
|
|
459
|
-
this
|
|
460
|
-
"is not linked to a Object with a IsConditionOf(reversed(HasCondition))"
|
|
459
|
+
"raiseConditionEvent: the condition ",
|
|
460
|
+
fullPath2(this),
|
|
461
|
+
"is not linked to a Object with a IsConditionOf(reversed(HasCondition)) reference",
|
|
462
|
+
"therefore event cannot bubble-up to the server object"
|
|
461
463
|
);
|
|
462
464
|
}
|
|
463
465
|
// xx console.log("MMMMMMMM%%%%%%%%%%%%%%%%%%%%% branch " +
|
package/src/base_node_impl.ts
CHANGED
|
@@ -193,7 +193,8 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
|
|
|
193
193
|
return _private._description!;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
public setDescription(value:
|
|
196
|
+
public setDescription(value: LocalizedTextLike): void {
|
|
197
|
+
|
|
197
198
|
this._setDescription(value);
|
|
198
199
|
/**
|
|
199
200
|
* fires when the description attribute is changed.
|