node-opcua-address-space 2.112.0 → 2.114.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.
Files changed (113) hide show
  1. package/dist/source/helpers/call_helpers.js +1 -2
  2. package/dist/source/helpers/call_helpers.js.map +1 -1
  3. package/dist/source/helpers/resolve_opaque_on_address_space.js +15 -26
  4. package/dist/source/helpers/resolve_opaque_on_address_space.js.map +1 -1
  5. package/dist/source/loader/decode_xml_extension_object.js +0 -2
  6. package/dist/source/loader/decode_xml_extension_object.js.map +1 -1
  7. package/dist/source/loader/ensure_datatype_extracted.js +19 -30
  8. package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
  9. package/dist/source/loader/generateAddressSpaceRaw.js +16 -27
  10. package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -1
  11. package/dist/source/loader/load_nodeset2.js +101 -98
  12. package/dist/source/loader/load_nodeset2.js.map +1 -1
  13. package/dist/source/loader/make_xml_extension_object_parser.js +2 -4
  14. package/dist/source/loader/make_xml_extension_object_parser.js.map +1 -1
  15. package/dist/source/loader/namespace_post_step.js +24 -37
  16. package/dist/source/loader/namespace_post_step.js.map +1 -1
  17. package/dist/source/session_context.js +3 -6
  18. package/dist/source/session_context.js.map +1 -1
  19. package/dist/source/set_namespace_meta_data.js +2 -3
  20. package/dist/source/set_namespace_meta_data.js.map +1 -1
  21. package/dist/src/address_space.js +18 -37
  22. package/dist/src/address_space.js.map +1 -1
  23. package/dist/src/address_space_change_event_tools.js +1 -1
  24. package/dist/src/address_space_change_event_tools.js.map +1 -1
  25. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +2 -5
  26. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
  27. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +7 -4
  28. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
  29. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +6 -7
  30. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
  31. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +2 -5
  32. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
  33. package/dist/src/alarms_and_conditions/ua_condition_impl.js +3 -7
  34. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  35. package/dist/src/base_node_impl.js +9 -19
  36. package/dist/src/base_node_impl.js.map +1 -1
  37. package/dist/src/base_node_private.js +17 -11
  38. package/dist/src/base_node_private.js.map +1 -1
  39. package/dist/src/data_access/ua_multistate_discrete_impl.js +7 -1
  40. package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -1
  41. package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +2 -2
  42. package/dist/src/data_access/ua_multistate_value_discrete_impl.js +10 -5
  43. package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +1 -1
  44. package/dist/src/extension_object_array_node.js +1 -2
  45. package/dist/src/extension_object_array_node.js.map +1 -1
  46. package/dist/src/get_basic_datatype.d.ts +8 -0
  47. package/dist/src/get_basic_datatype.js +26 -0
  48. package/dist/src/get_basic_datatype.js.map +1 -0
  49. package/dist/src/historical_access/address_space_historical_data_node.js +31 -48
  50. package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
  51. package/dist/src/namespace_impl.js +17 -13
  52. package/dist/src/namespace_impl.js.map +1 -1
  53. package/dist/src/nodeset_tools/construct_namespace_dependency.js +58 -9
  54. package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
  55. package/dist/src/nodeset_tools/dump_to_bsd.js +4 -6
  56. package/dist/src/nodeset_tools/dump_to_bsd.js.map +1 -1
  57. package/dist/src/nodeset_tools/nodeset_to_xml.js +36 -35
  58. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
  59. package/dist/src/private_namespace.js +1 -1
  60. package/dist/src/private_namespace.js.map +1 -1
  61. package/dist/src/reference_impl.js +5 -2
  62. package/dist/src/reference_impl.js.map +1 -1
  63. package/dist/src/state_machine/finite_state_machine.js +2 -3
  64. package/dist/src/state_machine/finite_state_machine.js.map +1 -1
  65. package/dist/src/state_machine/ua_shelving_state_machine_ex.js +2 -2
  66. package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
  67. package/dist/src/state_machine/ua_two_state_variable.js +1 -3
  68. package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
  69. package/dist/src/ua_data_type_impl.js +6 -29
  70. package/dist/src/ua_data_type_impl.js.map +1 -1
  71. package/dist/src/ua_method_impl.js +6 -4
  72. package/dist/src/ua_method_impl.js.map +1 -1
  73. package/dist/src/ua_object_impl.js +5 -1
  74. package/dist/src/ua_object_impl.js.map +1 -1
  75. package/dist/src/ua_object_type_impl.js +1 -2
  76. package/dist/src/ua_object_type_impl.js.map +1 -1
  77. package/dist/src/ua_variable_impl.js +18 -26
  78. package/dist/src/ua_variable_impl.js.map +1 -1
  79. package/dist/src/ua_variable_impl_ext_obj.js +25 -17
  80. package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
  81. package/dist/src/ua_variable_type_impl.d.ts +2 -0
  82. package/dist/src/ua_variable_type_impl.js +7 -6
  83. package/dist/src/ua_variable_type_impl.js.map +1 -1
  84. package/dist/tsconfig_common.tsbuildinfo +1 -1
  85. package/distHelpers/add_event_generator_object.js +0 -4
  86. package/distHelpers/add_event_generator_object.js.map +1 -1
  87. package/distNodeJS/generate_address_space.js +10 -21
  88. package/distNodeJS/generate_address_space.js.map +1 -1
  89. package/package.json +39 -39
  90. package/source/loader/decode_xml_extension_object.ts +0 -2
  91. package/source/loader/load_nodeset2.ts +16 -12
  92. package/source/loader/make_xml_extension_object_parser.ts +1 -4
  93. package/source/loader/namespace_post_step.ts +1 -0
  94. package/src/address_space.ts +7 -15
  95. package/src/alarms_and_conditions/condition_snapshot_impl.ts +2 -6
  96. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +6 -3
  97. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +6 -6
  98. package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +0 -1
  99. package/src/alarms_and_conditions/ua_condition_impl.ts +3 -7
  100. package/src/base_node_impl.ts +12 -20
  101. package/src/data_access/ua_multistate_value_discrete_impl.ts +9 -11
  102. package/src/get_basic_datatype.ts +32 -0
  103. package/src/namespace_impl.ts +5 -6
  104. package/src/nodeset_tools/construct_namespace_dependency.ts +60 -18
  105. package/src/nodeset_tools/nodeset_to_xml.ts +42 -39
  106. package/src/reference_impl.ts +5 -1
  107. package/src/state_machine/finite_state_machine.ts +3 -4
  108. package/src/state_machine/ua_shelving_state_machine_ex.ts +2 -3
  109. package/src/state_machine/ua_two_state_variable.ts +0 -1
  110. package/src/ua_data_type_impl.ts +6 -26
  111. package/src/ua_variable_impl.ts +5 -22
  112. package/src/ua_variable_impl_ext_obj.ts +119 -86
  113. package/src/ua_variable_type_impl.ts +5 -4
@@ -37,10 +37,6 @@ function add_eventGeneratorObject(namespace, parentFolder) {
37
37
  outputArguments: []
38
38
  });
39
39
  method.bindMethod((inputArguments, context, callback) => {
40
- // xx console.log("In Event Generator Method");
41
- // xx console.log(this.toString());
42
- // xx console.log(context.object.toString());
43
- // xx console.log("inputArguments ", inputArguments[0].toString());
44
40
  const message = inputArguments[0].value || "Hello from Event Generator Object";
45
41
  const severity = inputArguments[1].value || 0;
46
42
  const myEventType = namespace.addressSpace.findEventType("MyEventType", namespace.index);
@@ -1 +1 @@
1
- {"version":3,"file":"add_event_generator_object.js","sourceRoot":"","sources":["../test_helpers/add_event_generator_object.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAAgE;AAChE,2DAAuD;AAKvD,SAAgB,wBAAwB,CAAC,SAAqB,EAAE,YAA+B;IAC3F,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC;QACrC,UAAU,EAAE,aAAa;QACzB,SAAS,EAAE,eAAe,CAAC,qBAAq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O,EAAE;aAC3B;YACD,QAAQ,EAAE;gBACN,QAAQ,EAAE,6BAAQ,CAAC,MAAM;gBACzB,KAAK,EAAE,QAAQ;aAClB;SACJ,CAAC,CAAC;QACH,MAAM,gBAAgB,GAAG;YACrB,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,oCAAW,CAAC,IAAI;SAC/B,CAAC;QACF,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC;AA7DD,4DA6DC"}
1
+ {"version":3,"file":"add_event_generator_object.js","sourceRoot":"","sources":["../test_helpers/add_event_generator_object.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAAgE;AAChE,2DAAuD;AAKvD,SAAgB,wBAAwB,CAAC,SAAqB,EAAE,YAA+B;IAC3F,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC;QACrC,UAAU,EAAE,aAAa;QACzB,SAAS,EAAE,eAAe,CAAC,qBAAqB;KACnD,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC;QACjC,UAAU,EAAE,sBAAsB;QAClC,aAAa,EAAE,CAAC;QAChB,WAAW,EAAE,YAAY;KAC5B,CAAC,CAAC;IAEH,QAAQ,CAAC,YAAY,CAAC;QAClB,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,sBAAsB;KACxC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE;QACzC,UAAU,EAAE,sBAAsB;QAClC,cAAc,EAAE;YACZ;gBACI,QAAQ,EAAE,6BAAQ,CAAC,MAAM;gBACzB,WAAW,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;gBACtC,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,QAAQ,EAAE,6BAAQ,CAAC,MAAM;gBACzB,WAAW,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;gBACvC,IAAI,EAAE,UAAU;aACnB;SACJ;QACD,eAAe,EAAE,EAAE;KACtB,CAAC,CAAC;IAEH,MAAM,CAAC,UAAU,CAAC,CAAC,cAAyB,EAAE,OAAwB,EAAE,QAA4C,EAAE,EAAE;QAEpH,MAAM,OAAO,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,mCAAmC,CAAC;QAC/E,MAAM,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;QAE9C,MAAM,WAAW,GAAG,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,aAAa,EAAE,SAAS,CAAC,KAAK,CAAE,CAAC;QACzF,OAAO,CAAC,MAAmB,CAAC,UAAU,CAAC,WAAW,EAAE;YACjD,OAAO,EAAE;gBACL,QAAQ,EAAE,6BAAQ,CAAC,aAAa;gBAChC,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;aAC3B;YACD,QAAQ,EAAE;gBACN,QAAQ,EAAE,6BAAQ,CAAC,MAAM;gBACzB,KAAK,EAAE,QAAQ;aAClB;SACJ,CAAC,CAAC;QACH,MAAM,gBAAgB,GAAG;YACrB,eAAe,EAAE,EAAE;YACnB,UAAU,EAAE,oCAAW,CAAC,IAAI;SAC/B,CAAC;QACF,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC;AAxDD,4DAwDC"}
@@ -22,15 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
25
  Object.defineProperty(exports, "__esModule", { value: true });
35
26
  exports.generateAddressSpace = exports.readNodeSet2XmlFile = void 0;
36
27
  const fs = __importStar(require("fs"));
@@ -40,18 +31,16 @@ const __1 = require("..");
40
31
  const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
41
32
  const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
42
33
  const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
43
- function readNodeSet2XmlFile(xmlFile) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- // istanbul ignore next
46
- if (!fs.existsSync(xmlFile)) {
47
- const msg = "[NODE-OPCUA-E02] generateAddressSpace : cannot find nodeset2 xml file at " + xmlFile;
48
- errorLog(msg);
49
- throw new Error(msg);
50
- }
51
- debugLog(" parsing ", xmlFile);
52
- const xmlData = yield fs.promises.readFile(xmlFile, "utf-8");
53
- return xmlData;
54
- });
34
+ async function readNodeSet2XmlFile(xmlFile) {
35
+ // istanbul ignore next
36
+ if (!fs.existsSync(xmlFile)) {
37
+ const msg = "[NODE-OPCUA-E02] generateAddressSpace : cannot find nodeset2 xml file at " + xmlFile;
38
+ errorLog(msg);
39
+ throw new Error(msg);
40
+ }
41
+ debugLog(" parsing ", xmlFile);
42
+ const xmlData = await fs.promises.readFile(xmlFile, "utf-8");
43
+ return xmlData;
55
44
  }
56
45
  exports.readNodeSet2XmlFile = readNodeSet2XmlFile;
57
46
  function generateAddressSpace(...args) {
@@ -1 +1 @@
1
- {"version":3,"file":"generate_address_space.js","sourceRoot":"","sources":["../source_nodejs/generate_address_space.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,+BAAmC;AAEnC,uDAAgF;AAGhF,0BAA6C;AAG7C,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;A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C,MAAM,KAAK,CAAC,EAAE;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAqC,CAAC;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAA2B,CAAC;QACnD,IAAA,kBAAW,EAAC,2BAAuB,CAAC,CAAC,YAAY,EAAE,QAAQ,EAAE,mBAAmB,EAAE,OAAO,IAAG,EAAE,EAAE,QAAS,CAAC,CAAC;KAC9G;SAAM;QACH,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAA2B,CAAC;QACnD,IAAA,kBAAW,EAAC,2BAAuB,CAAC,CAAC,YAAY,EAAE,QAAQ,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAS,CAAC,CAAC;KACzG;AACL,CAAC;AAdD,oDAcC;AAED,iCAAiC;AACjC,iCAAiC;AACjC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,MAAM,CAAC,OAAe,CAAC,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAE,MAAM,CAAC,OAAe,CAAC,oBAAoB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-address-space",
3
- "version": "2.112.0",
3
+ "version": "2.114.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",
@@ -16,42 +16,42 @@
16
16
  "c": "mocha --version"
17
17
  },
18
18
  "dependencies": {
19
- "@types/lodash": "4.14.198",
20
- "@types/semver": "^7.5.1",
19
+ "@types/lodash": "4.14.199",
20
+ "@types/semver": "^7.5.3",
21
21
  "async": "^3.2.4",
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.112.0",
25
+ "node-opcua-address-space-base": "2.114.0",
26
26
  "node-opcua-assert": "2.105.0",
27
- "node-opcua-basic-types": "2.111.0",
28
- "node-opcua-binary-stream": "2.110.0",
29
- "node-opcua-client-dynamic-extension-object": "2.112.0",
30
- "node-opcua-constants": "2.98.1",
31
- "node-opcua-crypto": "4.4.0",
32
- "node-opcua-data-access": "2.112.0",
33
- "node-opcua-data-model": "2.112.0",
34
- "node-opcua-data-value": "2.112.0",
35
- "node-opcua-date-time": "2.111.0",
36
- "node-opcua-debug": "2.110.0",
37
- "node-opcua-enum": "2.110.0",
38
- "node-opcua-extension-object": "2.112.0",
39
- "node-opcua-factory": "2.112.0",
40
- "node-opcua-nodeid": "2.110.0",
41
- "node-opcua-nodeset-ua": "2.112.0",
42
- "node-opcua-numeric-range": "2.112.0",
43
- "node-opcua-object-registry": "2.110.0",
44
- "node-opcua-pseudo-session": "2.112.0",
45
- "node-opcua-service-browse": "2.112.0",
46
- "node-opcua-service-call": "2.112.0",
47
- "node-opcua-service-history": "2.112.0",
48
- "node-opcua-service-translate-browse-path": "2.112.0",
49
- "node-opcua-service-write": "2.112.0",
50
- "node-opcua-status-code": "2.110.0",
51
- "node-opcua-types": "2.112.0",
52
- "node-opcua-utils": "2.110.0",
53
- "node-opcua-variant": "2.112.0",
54
- "node-opcua-xml2json": "2.110.0",
27
+ "node-opcua-basic-types": "2.114.0",
28
+ "node-opcua-binary-stream": "2.114.0",
29
+ "node-opcua-client-dynamic-extension-object": "2.114.0",
30
+ "node-opcua-constants": "2.114.0",
31
+ "node-opcua-crypto": "4.5.0",
32
+ "node-opcua-data-access": "2.114.0",
33
+ "node-opcua-data-model": "2.114.0",
34
+ "node-opcua-data-value": "2.114.0",
35
+ "node-opcua-date-time": "2.114.0",
36
+ "node-opcua-debug": "2.114.0",
37
+ "node-opcua-enum": "2.114.0",
38
+ "node-opcua-extension-object": "2.114.0",
39
+ "node-opcua-factory": "2.114.0",
40
+ "node-opcua-nodeid": "2.114.0",
41
+ "node-opcua-nodeset-ua": "2.114.0",
42
+ "node-opcua-numeric-range": "2.114.0",
43
+ "node-opcua-object-registry": "2.114.0",
44
+ "node-opcua-pseudo-session": "2.114.0",
45
+ "node-opcua-service-browse": "2.114.0",
46
+ "node-opcua-service-call": "2.114.0",
47
+ "node-opcua-service-history": "2.114.0",
48
+ "node-opcua-service-translate-browse-path": "2.114.0",
49
+ "node-opcua-service-write": "2.114.0",
50
+ "node-opcua-status-code": "2.114.0",
51
+ "node-opcua-types": "2.114.0",
52
+ "node-opcua-utils": "2.114.0",
53
+ "node-opcua-variant": "2.114.0",
54
+ "node-opcua-xml2json": "2.114.0",
55
55
  "semver": "^7.5.4",
56
56
  "set-prototype-of": "^1.0.0",
57
57
  "thenify": "^3.3.1",
@@ -59,14 +59,14 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "mocha": "^10.2.0",
62
- "node-opcua-benchmarker": "2.110.0",
63
- "node-opcua-leak-detector": "2.110.0",
62
+ "node-opcua-benchmarker": "2.114.0",
63
+ "node-opcua-leak-detector": "2.114.0",
64
64
  "node-opcua-nodesets": "2.110.0",
65
- "node-opcua-packet-analyzer": "2.112.0",
66
- "node-opcua-service-filter": "2.112.0",
67
- "node-opcua-test-fixtures": "2.112.0",
65
+ "node-opcua-packet-analyzer": "2.114.0",
66
+ "node-opcua-service-filter": "2.114.0",
67
+ "node-opcua-test-fixtures": "2.114.0",
68
68
  "should": "^13.2.3",
69
- "sinon": "^15.2.0",
69
+ "sinon": "^16.0.0",
70
70
  "source-map-support": "^0.5.21"
71
71
  },
72
72
  "author": "Etienne Rossignon",
@@ -84,7 +84,7 @@
84
84
  "internet of things"
85
85
  ],
86
86
  "homepage": "http://node-opcua.github.io/",
87
- "gitHead": "af1c21306612b11aa4265e9e6c094c91fe9beebb",
87
+ "gitHead": "358d284a696c88e383eedac1ab75d950fb28ec35",
88
88
  "files": [
89
89
  "dist",
90
90
  "distHelpers",
@@ -18,7 +18,6 @@ function encodingNodeIdToDataTypeNode(addressSpace: IAddressSpace, encodingNodeI
18
18
  if (!encodingNode) {
19
19
  throw new Error("findDataTypeNode: Cannot find encoding NodeId" + encodingNodeId.toString());
20
20
  }
21
- // xx console.log("encodingNode", encodingNode.toString());
22
21
  const refs = encodingNode.findReferences("HasEncoding", false);
23
22
  const dataTypes = refs.map((ref) => addressSpace.findNode(ref.nodeId)).filter((obj: any) => obj !== null);
24
23
  // istanbul ignore next
@@ -40,7 +39,6 @@ export function makeDefinitionMap(addressSpace: IAddressSpace): DefinitionMap2 {
40
39
  throw new Error("Expecting a DataType node here");
41
40
  }
42
41
  const name = dataTypeNode.browseName.name || "";
43
- // console.log("yy)=", dataTypeNode.toString());
44
42
  if (dataTypeNode.isStructure()) {
45
43
  const definition = dataTypeNode.getStructureDefinition();
46
44
  return { name, definition };
@@ -5,7 +5,7 @@
5
5
  import { promisify, types } from "util";
6
6
  import chalk from "chalk";
7
7
 
8
- import { coerceByte , coerceBoolean, coerceInt32} from "node-opcua-basic-types";
8
+ import { coerceByte, coerceBoolean, coerceInt32 } from "node-opcua-basic-types";
9
9
  import {
10
10
  AddReferenceTypeOptions,
11
11
  BaseNode,
@@ -231,8 +231,8 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
231
231
  if (!namespace) {
232
232
  throw new Error(
233
233
  "cannot find namespace for " +
234
- namespaceUri +
235
- "\nplease make sure to initialize your address space with the corresponding nodeset files"
234
+ namespaceUri +
235
+ "\nplease make sure to initialize your address space with the corresponding nodeset files"
236
236
  );
237
237
  }
238
238
  found_namespace_in_uri[namespaceUri] = namespace;
@@ -315,7 +315,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
315
315
  }
316
316
  } else {
317
317
  namespace = addressSpace1.registerNamespace(model.modelUri);
318
- namespace.setRequiredModels(model.requiredModels)
318
+ namespace.setRequiredModels(model.requiredModels);
319
319
  }
320
320
 
321
321
  namespace.version = model.version;
@@ -470,7 +470,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
470
470
 
471
471
  this.obj = {};
472
472
  this.obj.nodeClass = NodeClass.ReferenceType;
473
- this.obj.isAbstract =coerceBoolean(attrs.IsAbstract);
473
+ this.obj.isAbstract = coerceBoolean(attrs.IsAbstract);
474
474
  this.obj.nodeId = convertToNodeId(attrs.NodeId) || null;
475
475
  this.obj.browseName = convertQualifiedName(attrs.BrowseName);
476
476
  },
@@ -641,11 +641,12 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
641
641
  this.enumValueType = new EnumValueType({
642
642
  description: undefined,
643
643
  displayName: undefined,
644
- value: [0, 0] // Int64
644
+ value: coerceInt64(-1)
645
645
  });
646
646
  },
647
647
  parser: {
648
648
  Value: {
649
+ // note: Value may be missing, in this case value shall be set to -1(64)
649
650
  finish(this: any) {
650
651
  // Low part
651
652
  this.parent.enumValueType.value = coerceInt64(parseInt(this.text, 10));
@@ -881,10 +882,12 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
881
882
  break;
882
883
  }
883
884
  let captureXmlBody = this.bodyXML;
885
+ // istanbul ignore next
884
886
  if (doDebug) {
885
887
  debugLog("xxxx ", chalk.yellow(captureXmlBody));
886
888
  }
887
889
  // this is a user defined Extension Object
890
+ // istanbul ignore next
888
891
  debugLog(
889
892
  "load nodeset2: typeDefinitionId in ExtensionObject Default XML = " + xmlEncodingNodeId.toString()
890
893
  );
@@ -1326,7 +1329,6 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
1326
1329
  const v = node as UAVariable;
1327
1330
  assert(v.getBasicDataType() === DataType.ExtensionObject, "expecting an extension object");
1328
1331
  v.bindExtensionObject(variant.value, { createMissingProp: false });
1329
-
1330
1332
  } else if (node.nodeClass === NodeClass.VariableType) {
1331
1333
  const v = node as UAVariableType;
1332
1334
  (v as any) /*fix me*/.value.value = variant.value;
@@ -1533,7 +1535,6 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
1533
1535
  }
1534
1536
  };
1535
1537
 
1536
-
1537
1538
  interface Model {
1538
1539
  modelUri: string;
1539
1540
  version: string;
@@ -1688,7 +1689,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
1688
1689
  doDebug &&
1689
1690
  debugLog(
1690
1691
  chalk.bgGreenBright("Performing post loading tasks -------------------------------------------") +
1691
- chalk.green("DONE")
1692
+ chalk.green("DONE")
1692
1693
  );
1693
1694
 
1694
1695
  async function performPostLoadingTasks(tasks: Task[]): Promise<void> {
@@ -1699,7 +1700,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
1699
1700
  // istanbul ignore next
1700
1701
  // tslint:disable:no-console
1701
1702
  if (types.isNativeError(err)) {
1702
- console.log(" performPostLoadingTasks Err => ", err.message, "\n", err);
1703
+ errorLog(" performPostLoadingTasks Err => ", err.message, "\n", err);
1703
1704
  }
1704
1705
  await task(addressSpace1);
1705
1706
  }
@@ -1748,7 +1749,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
1748
1749
  finalSteps()
1749
1750
  .then(() => callback!())
1750
1751
  .catch((err1: Error) => {
1751
- console.log("Error ", renderError(err1));
1752
+ errorLog("Error ", renderError(err1));
1752
1753
  callback!(err1);
1753
1754
  });
1754
1755
  }
@@ -1765,7 +1766,10 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
1765
1766
 
1766
1767
  export class NodeSetLoader {
1767
1768
  _s: NodeSet2ParserEngine;
1768
- constructor(addressSpace: IAddressSpace, private options?: NodeSetLoaderOptions) {
1769
+ constructor(
1770
+ addressSpace: IAddressSpace,
1771
+ private options?: NodeSetLoaderOptions
1772
+ ) {
1769
1773
  this._s = makeNodeSetParserEngine(addressSpace, options || {});
1770
1774
  }
1771
1775
 
@@ -210,7 +210,7 @@ const partials: { [key: string]: ReaderStateParserLike } = {
210
210
  Variant: {
211
211
  finish(this: any) {
212
212
  /** to do */
213
- console.log(" Missing Implemntation contact sterfive.com!");
213
+ warningLog(" Missing Implemntation contact sterfive.com!");
214
214
  }
215
215
  },
216
216
 
@@ -279,8 +279,6 @@ function _makeTypeReader(
279
279
  const { name, definition } = definitionMap.findDefinition(n);
280
280
  const dataTypeName = name;
281
281
 
282
- // console.log("NAME = ", dataTypeNodeId.toString(), name, definition);
283
-
284
282
  let reader: ReaderStateParserLike = readerMap[dataTypeName]!;
285
283
 
286
284
  if (reader) {
@@ -355,7 +353,6 @@ function _makeTypeReader(
355
353
  readerMap[dataTypeName] = reader;
356
354
  return { name, parser: reader };
357
355
  } else if (definition instanceof EnumDefinition) {
358
- // console.log("xxxx enum found !", definition.toString());
359
356
  const turnToInt = (value: any) => {
360
357
  // Green_100
361
358
  return parseInt(value.split("_")[1], 10);
@@ -43,6 +43,7 @@ export async function promoteObjectAndVariablesInNamespace(namespace: INamespace
43
43
 
44
44
  promoter.promoter(a as any);
45
45
  const after = a.constructor.name;
46
+ // istanbul ignore next
46
47
  if (doDebug) {
47
48
  debugLog(`promoting ${a.browseName.toString()} from ${before} to ${after}`);
48
49
  }
@@ -56,7 +56,7 @@ import {
56
56
  ShutdownTask,
57
57
  RaiseEventData
58
58
  } from "node-opcua-address-space-base";
59
- import { make_errorLog } from "node-opcua-debug";
59
+ import { make_debugLog, make_errorLog } from "node-opcua-debug";
60
60
 
61
61
  import { adjustBrowseDirection } from "../source/helpers/adjust_browse_direction";
62
62
  import { UARootFolder } from "../source/ua_root_folder";
@@ -79,6 +79,7 @@ import { BaseNodeImpl } from "./base_node_impl";
79
79
 
80
80
  const doDebug = false;
81
81
  const errorLog = make_errorLog(__filename);
82
+ const debugLog = make_debugLog(__filename);
82
83
 
83
84
  // tslint:disable-next-line:no-var-requires
84
85
  const Dequeue = require("dequeue");
@@ -773,17 +774,18 @@ export class AddressSpace implements AddressSpacePrivate {
773
774
  // add a property , but with a null variant
774
775
  eventData._createValue(fullBrowsePath, node, { dataType: DataType.Null });
775
776
 
777
+ // istanbul ignore next
776
778
  if (doDebug) {
777
779
  if (node.modellingRule === "Mandatory") {
778
780
  // tslint:disable:no-console
779
- console.log(
781
+ errorLog(
780
782
  chalk.red("ERROR : AddressSpace#constructEventData(eventType,options) " + "cannot find property ") +
781
783
  self.browseName.toString() +
782
784
  " => " +
783
785
  chalk.cyan(lowerName)
784
786
  );
785
787
  } else {
786
- console.log(
788
+ errorLog(
787
789
  chalk.yellow(
788
790
  "Warning : AddressSpace#constructEventData(eventType,options)" + " cannot find property "
789
791
  ) +
@@ -842,18 +844,16 @@ export class AddressSpace implements AddressSpacePrivate {
842
844
 
843
845
  // istanbul ignore next
844
846
  if (doDebug) {
845
- console.log(" " + chalk.bgWhite.cyan(self.browseName.toString()));
847
+ debugLog(" " + chalk.bgWhite.cyan(self.browseName.toString()));
846
848
  }
847
849
 
848
850
  for (const node of children) {
849
851
  // only keep those that have a "HasModellingRule"
850
852
  if (!(node as any).modellingRule) {
851
- // xx console.log(" skipping node without modelling rule", node.browseName.toString());
852
853
  continue;
853
854
  }
854
855
  // ignore also methods
855
856
  if (node.nodeClass === NodeClass.Method) {
856
- // xx console.log(" skipping method ", node.browseName.toString());
857
857
  continue;
858
858
  }
859
859
 
@@ -866,8 +866,6 @@ export class AddressSpace implements AddressSpacePrivate {
866
866
  if (children2.length > 0) {
867
867
  const lowerName = lowerFirstLetter(node.browseName.name!);
868
868
  const standardName = node.browseName.toString();
869
- // console.log(" Children to visit = ",lowerName,
870
- // children.map(function(a){ return a.browseName.toString();}).join(" "));
871
869
  for (const child2 of children2) {
872
870
  _process_var(self, lowerName + ".", standardName + ".", child2);
873
871
  }
@@ -1027,7 +1025,7 @@ export class AddressSpace implements AddressSpacePrivate {
1027
1025
  // to do verify that dataType is of type "Structure"
1028
1026
  /* istanbul ignore next */
1029
1027
  if (!_dataType.isSubtypeOf(this.findDataType("Structure")!)) {
1030
- console.log(_dataType.toString());
1028
+ debugLog(_dataType.toString());
1031
1029
  }
1032
1030
  assert(_dataType.isSubtypeOf(this.findDataType("Structure")!));
1033
1031
  if (!_dataType._extensionObjectConstructor) {
@@ -1144,7 +1142,6 @@ export class AddressSpace implements AddressSpacePrivate {
1144
1142
  if (!obj) {
1145
1143
  // Object Not Found
1146
1144
  browseResult.statusCode = StatusCodes.BadNodeIdUnknown;
1147
- // xx console.log("xxxxxx browsing ",nodeId.toString() , " not found" );
1148
1145
  } else {
1149
1146
  browseResult.statusCode = StatusCodes.Good;
1150
1147
  browseResult.references = obj.browseNode(browseDescription, context);
@@ -1172,7 +1169,6 @@ export class AddressSpace implements AddressSpacePrivate {
1172
1169
  * @private
1173
1170
  */
1174
1171
  public _collectModelChange(view: UAView | null, modelChange: ModelChangeStructureDataType): void {
1175
- // xx console.log("in _collectModelChange", modelChange.verb, verbFlags.get(modelChange.verb).toString());
1176
1172
  this._modelChanges.push(modelChange);
1177
1173
  }
1178
1174
 
@@ -1253,7 +1249,6 @@ export class AddressSpace implements AddressSpacePrivate {
1253
1249
  if (this._modelChanges.length === 0) {
1254
1250
  return; // nothing to do
1255
1251
  }
1256
- // xx console.log( "xx dealing with ",this._modelChanges.length);
1257
1252
  // increase version number of participating nodes
1258
1253
 
1259
1254
  // https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore
@@ -1269,7 +1264,6 @@ export class AddressSpace implements AddressSpacePrivate {
1269
1264
  const eventTypeNode = this.findEventType("GeneralModelChangeEventType");
1270
1265
 
1271
1266
  if (eventTypeNode) {
1272
- // xx console.log("xx raising event on server object");
1273
1267
  this.rootFolder.objects.server.raiseEvent(eventTypeNode, {
1274
1268
  // Part 5 - 6.4.32 GeneralModelChangeEventType
1275
1269
  changes: {
@@ -1421,7 +1415,6 @@ export class AddressSpace implements AddressSpacePrivate {
1421
1415
  const typeDefinitionNode = this.findNode(typeDefinition)!;
1422
1416
  typeDefinition = typeDefinitionNode.nodeId;
1423
1417
  }
1424
- // xx console.log("typeDefinition = ",typeDefinition);
1425
1418
  assert(typeDefinition instanceof NodeId);
1426
1419
  return typeDefinition;
1427
1420
  }
@@ -1573,6 +1566,5 @@ function _increase_version_number(node: BaseNode | null) {
1573
1566
  dataType: DataType.String,
1574
1567
  value: (previousValue + 1).toString()
1575
1568
  });
1576
- // xx console.log("xxx increasing version number of node ", node.browseName.toString(),previousValue);
1577
1569
  }
1578
1570
  }
@@ -222,7 +222,7 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
222
222
  public _get_var(varName: string): any {
223
223
  const c = this.condition as UAConditionImpl;
224
224
  if (!c.getEnabledState() && !Object.prototype.hasOwnProperty.call(_varTable, varName)) {
225
- // xx console.log("ConditionSnapshot#_get_var condition enabled =", self.condition.getEnabledState());
225
+ // xx debuglog("ConditionSnapshot#_get_var condition enabled =", self.condition.getEnabledState());
226
226
  return disabledVar;
227
227
  }
228
228
 
@@ -238,6 +238,7 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
238
238
  const key = normalizeName(varName);
239
239
  // istanbul ignore next
240
240
  if (!Object.prototype.hasOwnProperty.call(this._map, key)) {
241
+ // istanbul ignore next
241
242
  if (doDebug) {
242
243
  debugLog(" cannot find node " + varName);
243
244
  debugLog(" map=", Object.keys(this._map).join(" "));
@@ -310,9 +311,6 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
310
311
  const eventId = addressSpace.generateEventId();
311
312
  const ret = this._set_var("EventId", DataType.ByteString, eventId.value);
312
313
 
313
- // xx var branch = self; console.log("MMMMMMMMrenewEventId branch " +
314
- // branch.getBranchId().toString() + " eventId = " + branch.getEventId().toString("hex"));
315
-
316
314
  return ret;
317
315
  }
318
316
 
@@ -736,8 +734,6 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
736
734
  if (this.isCurrentBranch()) {
737
735
  assert(twoStateNode instanceof UATwoStateVariableImpl);
738
736
  twoStateNode.setValue(value as boolean);
739
- // xx console.log("Is current branch", twoStateNode.toString(),variant.toString());
740
- // xx console.log(" = ",twoStateNode.getValue());
741
737
  }
742
738
  this.emit("value_changed", node, variant);
743
739
  }
@@ -9,6 +9,7 @@ import { CallbackT, StatusCode, StatusCodes } from "node-opcua-status-code";
9
9
  import { DataType, VariantLike, VariantOptions } from "node-opcua-variant";
10
10
  import { INamespace, RaiseEventData, ISessionContext, UAEventType, UAMethod } from "node-opcua-address-space-base";
11
11
  import { CallMethodResultOptions } from "node-opcua-service-call";
12
+ import { make_debugLog } from "node-opcua-debug";
12
13
 
13
14
  import { AddressSpacePrivate } from "../address_space_private";
14
15
  import { _install_TwoStateVariable_machinery } from "../state_machine/ua_two_state_variable";
@@ -20,7 +21,8 @@ import { _setAckedState } from "./condition";
20
21
  import { ConditionSnapshotImpl } from "./condition_snapshot_impl";
21
22
  import { UAConditionImpl } from "./ua_condition_impl";
22
23
 
23
-
24
+ const debugLog = make_debugLog(__filename);
25
+ const doDebug = false;;
24
26
  export declare interface UAAcknowledgeableConditionImpl extends UAAcknowledgeableConditionEx, UAConditionImpl {
25
27
  on(eventName: string, eventHandler: any): this;
26
28
  }
@@ -258,8 +260,9 @@ export class UAAcknowledgeableConditionImpl extends UAConditionImpl implements U
258
260
  }
259
261
  assert(!branch.getConfirmedState(), "already confirmed ?");
260
262
  const conditionEventId = branch.getEventId();
261
- // tslint:disable-next-line:no-console
262
- console.log("autoConfirmBranch getAckedState ", branch.getAckedState());
263
+
264
+ // istanbul ignore next
265
+ doDebug && debugLog("autoConfirmBranch getAckedState ", branch.getAckedState());
263
266
  this._confirm_branch(conditionEventId, comment, branch, "Server/Confirm");
264
267
  }
265
268
 
@@ -9,7 +9,7 @@ import { DataValue } from "node-opcua-data-value";
9
9
  import { NodeId, sameNodeId } from "node-opcua-nodeid";
10
10
  import { StatusCodes } from "node-opcua-status-code";
11
11
  import { DataType, VariantOptions } from "node-opcua-variant";
12
- import { UAShelvedStateMachine } from "node-opcua-nodeset-ua";
12
+ import { make_debugLog } from "node-opcua-debug";
13
13
  import { BaseNode, INamespace, UAEventType, UAVariable } from "node-opcua-address-space-base";
14
14
 
15
15
  import { _install_TwoStateVariable_machinery } from "../state_machine/ua_two_state_variable";
@@ -22,6 +22,8 @@ import { InstantiateAlarmConditionOptions } from "../../source/interfaces/alarms
22
22
  import { ConditionInfoImpl } from "./condition_info_impl";
23
23
  import { UAAcknowledgeableConditionImpl } from "./ua_acknowledgeable_condition_impl";
24
24
 
25
+ const debugLog = make_debugLog(__filename);
26
+
25
27
  function _update_suppressedOrShelved(alarmNode: UAAlarmConditionImpl) {
26
28
  alarmNode.suppressedOrShelved.setValueFromSource({
27
29
  dataType: DataType.Boolean,
@@ -226,9 +228,7 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
226
228
  if (shelvedValue && shelvedValue.text !== "Unshelved") {
227
229
  shelved = true;
228
230
  }
229
- // console.log("shelved = shelved",shelvedValue,shelved);
230
231
  }
231
- // xx console.log(" isSuppressedOrShelved ",suppressed,shelved);
232
232
  return suppressed || shelved;
233
233
  }
234
234
 
@@ -339,8 +339,7 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
339
339
 
340
340
  const _node = addressSpace._coerceNode(inputNode);
341
341
  if (_node === null) {
342
- // tslint:disable-next-line:no-console
343
- console.log(" cannot find nodeId ", inputNode);
342
+ debugLog(" cannot find nodeId ", inputNode);
344
343
  } else {
345
344
  assert(_node, "Expecting a valid input node");
346
345
  this.inputNode.setValueFromSource({
@@ -451,7 +450,8 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
451
450
  // detect potential internal bugs due to misused of _signalNewCondition
452
451
  if (isEqual(oldConditionInfo, newConditionInfo)) {
453
452
  // tslint:disable-next-line:no-console
454
- console.log(oldConditionInfo);
453
+ debugLog("oldConditionInfo", oldConditionInfo);
454
+ debugLog("oldConditionInfo", newConditionInfo);
455
455
  throw new Error(
456
456
  "condition values have not change, shall we really raise an event ? alarm " + this.browseName.toString()
457
457
  );
@@ -72,7 +72,6 @@ class UACertificateExpirationAlarmImpl extends UASystemOffNormalAlarmImpl implem
72
72
  }
73
73
 
74
74
  public updateAlarmState2(isActive: boolean, severity: number, message: string) {
75
- //xx console.log(`${message} ${severity} ${d(new Date())}`);
76
75
  isActive ? this.activateAlarm() : this.deactivateAlarm();
77
76
 
78
77
  this.raiseNewCondition({