node-opcua-address-space 2.112.0 → 2.113.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 (65) hide show
  1. package/dist/source/loader/decode_xml_extension_object.js +0 -2
  2. package/dist/source/loader/decode_xml_extension_object.js.map +1 -1
  3. package/dist/source/loader/load_nodeset2.js +4 -2
  4. package/dist/source/loader/load_nodeset2.js.map +1 -1
  5. package/dist/source/loader/make_xml_extension_object_parser.js +1 -3
  6. package/dist/source/loader/make_xml_extension_object_parser.js.map +1 -1
  7. package/dist/source/loader/namespace_post_step.js +1 -0
  8. package/dist/source/loader/namespace_post_step.js.map +1 -1
  9. package/dist/src/address_space.js +6 -14
  10. package/dist/src/address_space.js.map +1 -1
  11. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +2 -5
  12. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
  13. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +6 -2
  14. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
  15. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +5 -5
  16. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
  17. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +0 -1
  18. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
  19. package/dist/src/alarms_and_conditions/ua_condition_impl.js +3 -7
  20. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  21. package/dist/src/base_node_impl.js +9 -19
  22. package/dist/src/base_node_impl.js.map +1 -1
  23. package/dist/src/namespace_impl.js +5 -6
  24. package/dist/src/namespace_impl.js.map +1 -1
  25. package/dist/src/nodeset_tools/construct_namespace_dependency.js +11 -6
  26. package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
  27. package/dist/src/nodeset_tools/nodeset_to_xml.js +8 -9
  28. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
  29. package/dist/src/reference_impl.js +4 -1
  30. package/dist/src/reference_impl.js.map +1 -1
  31. package/dist/src/state_machine/finite_state_machine.js +2 -3
  32. package/dist/src/state_machine/finite_state_machine.js.map +1 -1
  33. package/dist/src/state_machine/ua_shelving_state_machine_ex.js +2 -2
  34. package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
  35. package/dist/src/state_machine/ua_two_state_variable.js +0 -1
  36. package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
  37. package/dist/src/ua_data_type_impl.js +0 -23
  38. package/dist/src/ua_data_type_impl.js.map +1 -1
  39. package/dist/src/ua_reference_type_impl.d.ts +1 -1
  40. package/dist/src/ua_variable_impl_ext_obj.js +15 -8
  41. package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
  42. package/dist/tsconfig_common.tsbuildinfo +1 -1
  43. package/distHelpers/add_event_generator_object.js +0 -4
  44. package/distHelpers/add_event_generator_object.js.map +1 -1
  45. package/package.json +30 -30
  46. package/source/loader/decode_xml_extension_object.ts +0 -2
  47. package/source/loader/load_nodeset2.ts +4 -2
  48. package/source/loader/make_xml_extension_object_parser.ts +1 -4
  49. package/source/loader/namespace_post_step.ts +1 -0
  50. package/src/address_space.ts +7 -15
  51. package/src/alarms_and_conditions/condition_snapshot_impl.ts +2 -6
  52. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +6 -3
  53. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +6 -6
  54. package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +0 -1
  55. package/src/alarms_and_conditions/ua_condition_impl.ts +3 -7
  56. package/src/base_node_impl.ts +12 -20
  57. package/src/namespace_impl.ts +5 -6
  58. package/src/nodeset_tools/construct_namespace_dependency.ts +12 -7
  59. package/src/nodeset_tools/nodeset_to_xml.ts +8 -9
  60. package/src/reference_impl.ts +5 -1
  61. package/src/state_machine/finite_state_machine.ts +3 -4
  62. package/src/state_machine/ua_shelving_state_machine_ex.ts +2 -3
  63. package/src/state_machine/ua_two_state_variable.ts +0 -1
  64. package/src/ua_data_type_impl.ts +0 -24
  65. package/src/ua_variable_impl_ext_obj.ts +110 -82
@@ -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,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;QACpH,+CAA+C;QAC/C,mCAAmC;QACnC,6CAA6C;QAE7C,mEAAmE;QAEnE,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;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"}
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.113.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,36 +22,36 @@
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.113.0",
26
26
  "node-opcua-assert": "2.105.0",
27
- "node-opcua-basic-types": "2.111.0",
27
+ "node-opcua-basic-types": "2.113.0",
28
28
  "node-opcua-binary-stream": "2.110.0",
29
- "node-opcua-client-dynamic-extension-object": "2.112.0",
29
+ "node-opcua-client-dynamic-extension-object": "2.113.0",
30
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",
31
+ "node-opcua-crypto": "4.5.0",
32
+ "node-opcua-data-access": "2.113.0",
33
+ "node-opcua-data-model": "2.113.0",
34
+ "node-opcua-data-value": "2.113.0",
35
+ "node-opcua-date-time": "2.113.0",
36
+ "node-opcua-debug": "2.113.0",
37
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",
38
+ "node-opcua-extension-object": "2.113.0",
39
+ "node-opcua-factory": "2.113.0",
40
+ "node-opcua-nodeid": "2.113.0",
41
+ "node-opcua-nodeset-ua": "2.113.0",
42
+ "node-opcua-numeric-range": "2.113.0",
43
+ "node-opcua-object-registry": "2.113.0",
44
+ "node-opcua-pseudo-session": "2.113.0",
45
+ "node-opcua-service-browse": "2.113.0",
46
+ "node-opcua-service-call": "2.113.0",
47
+ "node-opcua-service-history": "2.113.0",
48
+ "node-opcua-service-translate-browse-path": "2.113.0",
49
+ "node-opcua-service-write": "2.113.0",
50
50
  "node-opcua-status-code": "2.110.0",
51
- "node-opcua-types": "2.112.0",
51
+ "node-opcua-types": "2.113.0",
52
52
  "node-opcua-utils": "2.110.0",
53
- "node-opcua-variant": "2.112.0",
54
- "node-opcua-xml2json": "2.110.0",
53
+ "node-opcua-variant": "2.113.0",
54
+ "node-opcua-xml2json": "2.113.0",
55
55
  "semver": "^7.5.4",
56
56
  "set-prototype-of": "^1.0.0",
57
57
  "thenify": "^3.3.1",
@@ -60,11 +60,11 @@
60
60
  "devDependencies": {
61
61
  "mocha": "^10.2.0",
62
62
  "node-opcua-benchmarker": "2.110.0",
63
- "node-opcua-leak-detector": "2.110.0",
63
+ "node-opcua-leak-detector": "2.113.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.113.0",
66
+ "node-opcua-service-filter": "2.113.0",
67
+ "node-opcua-test-fixtures": "2.113.0",
68
68
  "should": "^13.2.3",
69
69
  "sinon": "^15.2.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": "af1c21306612b11aa4265e9e6c094c91fe9beebb",
87
+ "gitHead": "36db335391fedd39726990a1b37f7768da16466a",
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 };
@@ -881,10 +881,12 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
881
881
  break;
882
882
  }
883
883
  let captureXmlBody = this.bodyXML;
884
+ // istanbul ignore next
884
885
  if (doDebug) {
885
886
  debugLog("xxxx ", chalk.yellow(captureXmlBody));
886
887
  }
887
888
  // this is a user defined Extension Object
889
+ // istanbul ignore next
888
890
  debugLog(
889
891
  "load nodeset2: typeDefinitionId in ExtensionObject Default XML = " + xmlEncodingNodeId.toString()
890
892
  );
@@ -1699,7 +1701,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
1699
1701
  // istanbul ignore next
1700
1702
  // tslint:disable:no-console
1701
1703
  if (types.isNativeError(err)) {
1702
- console.log(" performPostLoadingTasks Err => ", err.message, "\n", err);
1704
+ errorLog(" performPostLoadingTasks Err => ", err.message, "\n", err);
1703
1705
  }
1704
1706
  await task(addressSpace1);
1705
1707
  }
@@ -1748,7 +1750,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
1748
1750
  finalSteps()
1749
1751
  .then(() => callback!())
1750
1752
  .catch((err1: Error) => {
1751
- console.log("Error ", renderError(err1));
1753
+ errorLog("Error ", renderError(err1));
1752
1754
  callback!(err1);
1753
1755
  });
1754
1756
  }
@@ -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({
@@ -143,7 +143,6 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
143
143
  ): void {
144
144
  const conditionNode = context.object;
145
145
 
146
- // xx console.log(inputArguments.map(function(a){return a.toString()}));
147
146
  if (!(conditionNode instanceof UAConditionImpl)) {
148
147
  callback(null, {
149
148
  statusCode: StatusCodes.BadNodeIdInvalid
@@ -426,7 +425,6 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
426
425
  branch.renewEventId();
427
426
  }
428
427
 
429
- // xx console.log("MMMMMMMM%%%%%%%%%%%%%%%%%%%%% branch " +
430
428
  // branch.getBranchId().toString() + " eventId = " + branch.getEventId().toString("hex"));
431
429
 
432
430
  assert(branch instanceof ConditionSnapshotImpl);
@@ -462,7 +460,6 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
462
460
  "therefore event cannot bubble-up to the server object"
463
461
  );
464
462
  }
465
- // xx console.log("MMMMMMMM%%%%%%%%%%%%%%%%%%%%% branch " +
466
463
  // branch.getBranchId().toString() + " eventId = " + branch.getEventId().toString("hex"));
467
464
  }
468
465
 
@@ -536,7 +533,6 @@ export class UAConditionImpl extends UABaseEventImpl implements UAConditionEx {
536
533
  this.raiseConditionEvent(branch, true);
537
534
 
538
535
  if (!sameNodeId(branch.getBranchId(), NodeId.nullNodeId) && !branch.getRetain()) {
539
- // xx console.log(" Deleting not longer needed branch ", branch.getBranchId().toString());
540
536
  // branch can be deleted
541
537
  this.deleteBranch(branch);
542
538
  }
@@ -854,8 +850,7 @@ function UACondition_instantiate(
854
850
  if (options.conditionSource) {
855
851
  options.conditionSource = addressSpace._coerceNode(options.conditionSource)!;
856
852
  if (options.conditionSource.nodeClass !== NodeClass.Object && options.conditionSource.nodeClass !== NodeClass.Variable) {
857
- // tslint:disable:no-console
858
- console.log(options.conditionSource);
853
+ debugLog(options.conditionSource);
859
854
  throw new Error("Expecting condition source to be NodeClass.Object or Variable");
860
855
  }
861
856
 
@@ -1013,7 +1008,7 @@ function _disable_method(inputArguments: VariantLike[], context: ISessionContext
1013
1008
 
1014
1009
  // istanbul ignore next
1015
1010
  if (!(conditionNode instanceof UAConditionImpl)) {
1016
- console.log("conditionNode is not a UACondition ", conditionNode?.toString());
1011
+ debugLog("conditionNode is not a UACondition ", conditionNode?.toString());
1017
1012
  return callback(null, {
1018
1013
  statusCode: StatusCodes.BadNodeIdInvalid
1019
1014
  });
@@ -1048,6 +1043,7 @@ function _condition_refresh_method(
1048
1043
  // arguments : IntegerId SubscriptionId
1049
1044
  assert(inputArguments.length === 1);
1050
1045
  const addressSpace = context.object!.addressSpace as AddressSpacePrivate;
1046
+ // istanbul ignore next
1051
1047
  if (doDebug) {
1052
1048
  debugLog(chalk.red(" ConditionType.ConditionRefresh ! subscriptionId ="), inputArguments[0].toString());
1053
1049
  }
@@ -38,7 +38,7 @@ import {
38
38
  AccessRestrictionsFlag
39
39
  } from "node-opcua-data-model";
40
40
  import { DataValue } from "node-opcua-data-value";
41
- import { dumpIf, make_warningLog, make_errorLog } from "node-opcua-debug";
41
+ import { dumpIf, make_debugLog, make_warningLog, make_errorLog } from "node-opcua-debug";
42
42
  import { coerceNodeId, makeNodeId, NodeId, NodeIdLike, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
43
43
  import { NumericRange } from "node-opcua-numeric-range";
44
44
  import { ReferenceDescription } from "node-opcua-service-browse";
@@ -85,6 +85,8 @@ import { coerceRolePermissions } from "./role_permissions";
85
85
  const doDebug = false;
86
86
  const warningLog = make_warningLog(__filename);
87
87
  const errorLog = make_errorLog(__filename);
88
+ const debugLog = make_debugLog(__filename);
89
+
88
90
 
89
91
  function defaultBrowseFilterFunc(context?: ISessionContext): boolean {
90
92
  return true;
@@ -867,7 +869,7 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
867
869
 
868
870
  /* istanbul ignore next */
869
871
  if (do_debug) {
870
- console.log("all references :", this.nodeId.toString(), this.browseName.toString());
872
+ debugLog("all references :", this.nodeId.toString(), this.browseName.toString());
871
873
  dumpReferences(addressSpace, (Object as any).values(_private._referenceIdx));
872
874
  }
873
875
 
@@ -940,7 +942,7 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
940
942
 
941
943
  // istanbul ignore next
942
944
  if (!addressSpace) {
943
- console.log(" Where is addressSpace ?");
945
+ debugLog("Where is addressSpace ?");
944
946
  }
945
947
  const reference = addressSpace.normalizeReferenceTypes([referenceOpts!])![0];
946
948
  const h = (<ReferenceImpl>reference).hash;
@@ -1021,7 +1023,7 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
1021
1023
  // istanbul ignore next
1022
1024
  if (doDebug) {
1023
1025
  // tslint:disable-next-line:no-console
1024
- console.log(chalk.bgWhite.red("Ignoring reserved keyword " + name));
1026
+ debugLog(chalk.bgWhite.red("Ignoring reserved keyword " + name));
1025
1027
  }
1026
1028
  return;
1027
1029
  }
@@ -1508,9 +1510,8 @@ function _asObject<T extends BaseNode>(references: UAReference[], addressSpace:
1508
1510
  function toObject(reference: UAReference): T {
1509
1511
  const obj = resolveReferenceNode(addressSpace, reference);
1510
1512
  // istanbul ignore next
1511
- if (false && !obj) {
1512
- // tslint:disable-next-line:no-console
1513
- console.log(
1513
+ if (doDebug&& !obj) {
1514
+ debugLog(
1514
1515
  chalk.red(" Warning : object with nodeId ") +
1515
1516
  chalk.cyan(reference.nodeId.toString()) +
1516
1517
  chalk.red(" cannot be found in the address space !")
@@ -1584,16 +1585,7 @@ function _propagate_ref(this: BaseNode, addressSpace: MinimalistAddressSpace, re
1584
1585
  displayWarningReferencePointingToItSelf = false;
1585
1586
  }
1586
1587
  }
1587
- // xx ignore this assert(reference.nodeId.toString() !== this.nodeId.toString());
1588
- // function w(s,l) { return (s+" ").substring(0,l);}
1589
- // if (reference.isForward) {
1590
- // console.log(" CHILD => ",w(related_node.browseName + " " + related_node.nodeId.toString(),30),
1591
- // " PARENT ",w(this.browseName + " " + this.nodeId.toString(),30) , reference.toString());
1592
- // } else {
1593
- // console.log(" CHILD => ",w(this.browseName + " " + this.nodeId.toString(),30),
1594
- // " PARENT ",w(related_node.browseName + " " + related_node.nodeId.toString(),30) , reference.toString());
1595
- //
1596
- // }
1588
+
1597
1589
  (related_node as BaseNodeImpl)._add_backward_reference(
1598
1590
  new ReferenceImpl({
1599
1591
  _referenceType: getReferenceType(reference),
@@ -1630,7 +1622,7 @@ function normalize_referenceTypeId(addressSpace: IAddressSpace, referenceTypeId?
1630
1622
  try {
1631
1623
  nodeId = addressSpace.resolveNodeId(referenceTypeId);
1632
1624
  } catch (err) {
1633
- console.log("cannot normalize_referenceTypeId", referenceTypeId);
1625
+ errorLog("cannot normalize_referenceTypeId", referenceTypeId);
1634
1626
  throw err;
1635
1627
  }
1636
1628
  assert(nodeId);
@@ -1790,14 +1782,14 @@ function install_components_as_object_properties(parentObj: BaseNode) {
1790
1782
  if (Object.prototype.hasOwnProperty.call(reservedNames, name)) {
1791
1783
  // ignore reserved names
1792
1784
  if (doDebug) {
1793
- console.log(chalk.bgWhite.red("Ignoring reserved keyword " + name));
1785
+ debugLog(chalk.bgWhite.red("Ignoring reserved keyword " + name));
1794
1786
  }
1795
1787
  continue;
1796
1788
  }
1797
1789
 
1798
1790
  // ignore reserved names
1799
1791
  if (doDebug) {
1800
- console.log("Installing property " + name, " on ", parentObj.browseName.toString());
1792
+ debugLog("Installing property " + name, " on ", parentObj.browseName.toString());
1801
1793
  }
1802
1794
 
1803
1795
  /* istanbul ignore next */
@@ -1709,7 +1709,7 @@ export class NamespaceImpl implements NamespacePrivate {
1709
1709
  break;
1710
1710
  default:
1711
1711
  // tslint:disable-next-line:no-console
1712
- console.log("Invalid class Name", node.nodeClass);
1712
+ errorLog("Invalid class Name", node.nodeClass);
1713
1713
  throw new Error("Invalid class name specified");
1714
1714
  }
1715
1715
  }
@@ -1733,13 +1733,13 @@ export class NamespaceImpl implements NamespacePrivate {
1733
1733
  if (match) {
1734
1734
  const correctedName = match[1];
1735
1735
  // the application is using an old scheme
1736
- console.log(
1736
+ warningLog(
1737
1737
  chalk.green(
1738
1738
  "Warning : since node-opcua 0.4.2 " + "namespace index should not be prepended to the browse name anymore"
1739
1739
  )
1740
1740
  );
1741
- console.log(" ", options.browseName, " will be replaced with ", correctedName);
1742
- console.log(" Please update your code");
1741
+ warningLog(" ", options.browseName, " will be replaced with ", correctedName);
1742
+ warningLog(" Please update your code");
1743
1743
 
1744
1744
  const indexVerify = parseInt(match[0], 10);
1745
1745
  if (indexVerify !== this.index) {
@@ -1819,7 +1819,7 @@ export class NamespaceImpl implements NamespacePrivate {
1819
1819
  break;
1820
1820
  default:
1821
1821
  // tslint:disable:no-console
1822
- console.log("Invalid class Name", node.nodeClass);
1822
+ warningLog("Invalid class Name", node.nodeClass);
1823
1823
  throw new Error("Invalid class name specified");
1824
1824
  }
1825
1825
  const deleted = this._nodeid_index.delete(hashKey);
@@ -2234,7 +2234,6 @@ function _create_node_version_if_needed(node: BaseNode, options: { nodeVersion:
2234
2234
  propertyOf: node
2235
2235
  });
2236
2236
  const initialValue = typeof options.nodeVersion === "string" ? options.nodeVersion : "0";
2237
- // xx console.log(" init value =",initialValue);
2238
2237
  nodeVersion.setValueFromSource({ dataType: "String", value: initialValue });
2239
2238
  }
2240
2239
  }