node-opcua-address-space 2.182.0 → 2.183.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 (116) hide show
  1. package/api/helpers/argument_list.ts +8 -9
  2. package/api/helpers/call_helpers.ts +2 -0
  3. package/api/index.ts +14 -0
  4. package/api/interfaces/alarms_and_conditions/promote_to_alarm_options.ts +24 -0
  5. package/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.ts +33 -0
  6. package/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.ts +18 -0
  7. package/api/loader/nodeset_record.ts +2 -2
  8. package/api/loader/nodeset_record_applier.ts +1 -0
  9. package/api/loader/nodeset_xml_producer.ts +5 -1
  10. package/api/namespace_of.ts +28 -0
  11. package/dist/api/helpers/argument_list.js +8 -7
  12. package/dist/api/helpers/argument_list.js.map +1 -1
  13. package/dist/api/helpers/call_helpers.js +2 -0
  14. package/dist/api/helpers/call_helpers.js.map +1 -1
  15. package/dist/api/index.d.ts +11 -0
  16. package/dist/api/index.js +16 -3
  17. package/dist/api/index.js.map +1 -1
  18. package/dist/api/interfaces/alarms_and_conditions/promote_to_alarm_options.d.ts +23 -0
  19. package/dist/api/interfaces/alarms_and_conditions/promote_to_alarm_options.js +3 -0
  20. package/dist/api/interfaces/alarms_and_conditions/promote_to_alarm_options.js.map +1 -0
  21. package/dist/api/interfaces/alarms_and_conditions/ua_alarm_condition_ex.d.ts +31 -0
  22. package/dist/api/interfaces/alarms_and_conditions/ua_limit_alarm_ex.d.ts +17 -0
  23. package/dist/api/loader/nodeset_record.d.ts +1 -1
  24. package/dist/api/loader/nodeset_record.js +1 -1
  25. package/dist/api/loader/nodeset_record_applier.js +1 -0
  26. package/dist/api/loader/nodeset_record_applier.js.map +1 -1
  27. package/dist/api/loader/nodeset_xml_producer.js +7 -1
  28. package/dist/api/loader/nodeset_xml_producer.js.map +1 -1
  29. package/dist/api/namespace_of.d.ts +23 -0
  30. package/dist/api/namespace_of.js +29 -0
  31. package/dist/api/namespace_of.js.map +1 -0
  32. package/dist/impl/address_space_change_event_tools.js +4 -1
  33. package/dist/impl/address_space_change_event_tools.js.map +1 -1
  34. package/dist/impl/address_space_private.d.ts +6 -6
  35. package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +7 -0
  36. package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +47 -37
  37. package/dist/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
  38. package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.d.ts +72 -2
  39. package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js +220 -101
  40. package/dist/impl/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
  41. package/dist/impl/alarms_and_conditions/ua_condition_impl.d.ts +19 -0
  42. package/dist/impl/alarms_and_conditions/ua_condition_impl.js +71 -16
  43. package/dist/impl/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  44. package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +1 -1
  45. package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js +2 -2
  46. package/dist/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -1
  47. package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +2 -2
  48. package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +4 -4
  49. package/dist/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -1
  50. package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.d.ts +13 -2
  51. package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js +21 -5
  52. package/dist/impl/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -1
  53. package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +1 -1
  54. package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js +2 -2
  55. package/dist/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -1
  56. package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.d.ts +1 -1
  57. package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js +2 -2
  58. package/dist/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.js.map +1 -1
  59. package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +1 -1
  60. package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js +2 -2
  61. package/dist/impl/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
  62. package/dist/impl/base_node_impl.d.ts +2 -0
  63. package/dist/impl/base_node_impl.js +28 -0
  64. package/dist/impl/base_node_impl.js.map +1 -1
  65. package/dist/impl/base_node_private.d.ts +2 -0
  66. package/dist/impl/base_node_private.js.map +1 -1
  67. package/dist/impl/data_access/adjust_datavalue_status_code.d.ts +2 -2
  68. package/dist/impl/data_access/adjust_datavalue_status_code.js +35 -4
  69. package/dist/impl/data_access/adjust_datavalue_status_code.js.map +1 -1
  70. package/dist/impl/data_access/semantics_changed.d.ts +31 -0
  71. package/dist/impl/data_access/semantics_changed.js +77 -0
  72. package/dist/impl/data_access/semantics_changed.js.map +1 -0
  73. package/dist/impl/data_access/ua_multistate_discrete_impl.js +0 -2
  74. package/dist/impl/data_access/ua_multistate_discrete_impl.js.map +1 -1
  75. package/dist/impl/data_access/ua_two_state_discrete_impl.js +6 -15
  76. package/dist/impl/data_access/ua_two_state_discrete_impl.js.map +1 -1
  77. package/dist/impl/historical_access/read_processed_details_hook.d.ts +22 -0
  78. package/dist/impl/historical_access/read_processed_details_hook.js +12 -0
  79. package/dist/impl/historical_access/read_processed_details_hook.js.map +1 -0
  80. package/dist/impl/namespace_impl.js +2 -4
  81. package/dist/impl/namespace_impl.js.map +1 -1
  82. package/dist/impl/ua_object_impl.js +13 -1
  83. package/dist/impl/ua_object_impl.js.map +1 -1
  84. package/dist/impl/ua_variable_impl.js +12 -1
  85. package/dist/impl/ua_variable_impl.js.map +1 -1
  86. package/dist/tsconfig_base.tsbuildinfo +1 -1
  87. package/distHelpers/get_address_space_fixture.js +2 -1
  88. package/distHelpers/get_address_space_fixture.js.map +1 -1
  89. package/distHelpers/index.d.ts +1 -0
  90. package/distHelpers/index.js +1 -0
  91. package/distHelpers/index.js.map +1 -1
  92. package/distNodeJS/generate_address_space.js +5 -1
  93. package/distNodeJS/generate_address_space.js.map +1 -1
  94. package/impl/address_space_change_event_tools.ts +4 -1
  95. package/impl/address_space_private.ts +5 -17
  96. package/impl/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +53 -41
  97. package/impl/alarms_and_conditions/ua_alarm_condition_impl.ts +262 -111
  98. package/impl/alarms_and_conditions/ua_condition_impl.ts +94 -20
  99. package/impl/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +2 -2
  100. package/impl/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +4 -4
  101. package/impl/alarms_and_conditions/ua_limit_alarm_impl.ts +22 -5
  102. package/impl/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +2 -2
  103. package/impl/alarms_and_conditions/ua_non_exclusive_limit_alarm_impl.ts +2 -2
  104. package/impl/alarms_and_conditions/ua_off_normal_alarm_impl.ts +2 -2
  105. package/impl/base_node_impl.ts +31 -0
  106. package/impl/base_node_private.ts +2 -0
  107. package/impl/data_access/adjust_datavalue_status_code.ts +36 -7
  108. package/impl/data_access/semantics_changed.ts +102 -0
  109. package/impl/data_access/ua_multistate_discrete_impl.ts +0 -2
  110. package/impl/data_access/ua_two_state_discrete_impl.ts +6 -16
  111. package/impl/historical_access/read_processed_details_hook.ts +35 -0
  112. package/impl/namespace_impl.ts +2 -6
  113. package/impl/ua_object_impl.ts +13 -1
  114. package/impl/ua_variable_impl.ts +12 -1
  115. package/package.json +39 -39
  116. package/source_nodejs/generate_address_space.ts +6 -1
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UAAlarmConditionImpl = exports.UAAlarmConditionImplBase = void 0;
4
+ exports._initialize_alarm_condition_node = _initialize_alarm_condition_node;
5
+ exports.promoteToAlarm = promoteToAlarm;
4
6
  /**
5
7
  * @module node-opcua-address-space.AlarmsAndConditions
6
8
  */
@@ -15,6 +17,7 @@ const ua_shelving_state_machine_ex_js_1 = require("../state_machine/ua_shelving_
15
17
  const ua_two_state_variable_js_1 = require("../state_machine/ua_two_state_variable.js");
16
18
  const condition_info_impl_js_1 = require("./condition_info_impl.js");
17
19
  const ua_acknowledgeable_condition_impl_js_1 = require("./ua_acknowledgeable_condition_impl.js");
20
+ const ua_condition_impl_js_1 = require("./ua_condition_impl.js");
18
21
  const debugLog = (0, node_opcua_debug_1.make_debugLog)("ua_alarm_condition_impl");
19
22
  const doDebug = (0, node_opcua_debug_1.checkDebugFlag)("ua_alarm_condition_impl");
20
23
  function _update_suppressedOrShelved(alarmNode) {
@@ -30,6 +33,7 @@ class UAAlarmConditionImplBase extends ua_acknowledgeable_condition_impl_js_1.UA
30
33
  const addressSpace = namespace.addressSpace;
31
34
  // xx assert(Object.prototype.hasOwnProperty.call(options,"conditionOf")); // must provide a conditionOf
32
35
  (0, node_opcua_assert_1.assert)(Object.hasOwn(options, "inputNode")); // must provide a inputNode
36
+ (0, node_opcua_assert_1.assert)(options.inputNode, " must provide options.inputNode (NodeId or BaseNode object)");
33
37
  const alarmConditionType = addressSpace.findEventType(alarmConditionTypeId);
34
38
  /* c8 ignore next */
35
39
  if (!alarmConditionType) {
@@ -51,105 +55,7 @@ class UAAlarmConditionImplBase extends ua_acknowledgeable_condition_impl_js_1.UA
51
55
  }
52
56
  (0, node_opcua_assert_1.assert)(alarmConditionTypeBase === alarmConditionType || alarmConditionType.isSubtypeOf(alarmConditionTypeBase));
53
57
  const alarmNode = ua_acknowledgeable_condition_impl_js_1.UAAcknowledgeableConditionImplBase.instantiate(namespace, alarmConditionTypeId, options, data);
54
- Object.setPrototypeOf(alarmNode, exports.UAAlarmConditionImpl.prototype);
55
- // ----------------------- Install Alarm specifics
56
- //
57
- // Specs 1.03:
58
- // ActiveState/Id when set to TRUE indicates that the situation the Condition is representing
59
- // currently exists. When a Condition instance is in the inactive state (ActiveState/Id when set to
60
- // FALSE) it is representing a situation that has returned to a normal state. The transitions of
61
- // Conditions to the inactive and Active states are triggered by Server specific actions. Sub-
62
- // Types of the AlarmConditionType specified later in this document will have sub-state models
63
- // that further define the Active state. Recommended state names are described in Annex A.
64
- // install activeState - Mandatory
65
- /**
66
- * @property activeState
67
- * @type {UATwoStateVariable}
68
- */
69
- (0, ua_two_state_variable_js_1._install_TwoStateVariable_machinery)(alarmNode.activeState, {
70
- falseState: "Inactive",
71
- trueState: "Active"
72
- });
73
- alarmNode.currentBranch().setActiveState(false);
74
- // Specs 1.03:
75
- /**
76
- *
77
- * SuppressState is used internally by a Server to automatically suppress Alarms due to system
78
- * specific reasons. For example a system may be configured to suppress Alarms that are
79
- * associated with machinery that is shutdown, such as a low level Alarm for a tank that is
80
- * currently not in use.
81
- *
82
- * @property suppressedState
83
- * @type UATwoStateVariable
84
- */
85
- if (alarmNode.suppressedState) {
86
- // install activeState - Optional
87
- (0, ua_two_state_variable_js_1._install_TwoStateVariable_machinery)(alarmNode.suppressedState, {
88
- falseState: "Unsuppressed",
89
- trueState: "Suppressed"
90
- });
91
- }
92
- // Specs 1.03:
93
- /**
94
- * ShelvingState suggests whether an Alarm shall (temporarily) be prevented from being
95
- * displayed to the user. It is quite often used to block nuisance Alarms.
96
- *
97
- * @property shelvingState
98
- * @type ShelvingStateMachine
99
- */
100
- if (alarmNode.shelvingState) {
101
- ua_shelving_state_machine_ex_js_1.UAShelvedStateMachineExImplBase.promote(alarmNode.shelvingState);
102
- }
103
- // SuppressedOrShelved : Mandatory
104
- // install suppressedOrShelved automatic detection
105
- /**
106
- * The SuppressedState and the ShelvingState together result in the SuppressedOrShelved status of the
107
- * Condition. When an Alarm is in one of the states, the SuppressedOrShelved property will be set TRUE
108
- * and this Alarm is then typically not displayed by the Client. State transitions associated with the
109
- * Alarm do occur, but they are not typically displayed by the Clients as long as the Alarm remains in
110
- * either the Suppressed or Shelved state.
111
- * The dataType is Boolean.
112
- * @property suppressedState
113
- * @type UAVariable
114
- *
115
- */
116
- if (alarmNode.suppressedState) {
117
- alarmNode.suppressedState.on("value_changed", (_newDataValue) => {
118
- _update_suppressedOrShelved(alarmNode);
119
- });
120
- }
121
- if (alarmNode.shelvingState) {
122
- alarmNode.shelvingState.currentState.on("value_changed", (_newDataValue) => {
123
- _update_suppressedOrShelved(alarmNode);
124
- });
125
- }
126
- _update_suppressedOrShelved(alarmNode);
127
- /**
128
- * The optional Property MaxTimeShelved is used to set the maximum time that an Alarm Condition may be shelved.
129
- * The value is expressed as duration. Systems can use this Property to prevent permanent Shelving of an Alarm.
130
- * If this Property is present it will be an upper limit on the duration passed into a TimedShelve Method call.
131
- * If a value that exceeds the value of this property is passed to the TimedShelve Method,
132
- * than a BadShelvingTimeOutOfRange error code is returned on the call. If this Property is present it will
133
- * also be enforced for the OneShotShelved state, in that an Alarm Condition will transition to the Unshelved
134
- * state from the OneShotShelved state if the duration specified in this Property expires following a
135
- * OneShotShelve operation without a change of any of the other items associated with the Condition.
136
- *
137
- * @property maxTimeShelved
138
- * @type {UAVariable}
139
- */
140
- if (alarmNode.maxTimeShelved) {
141
- options.maxTimeShelved = options.maxTimeShelved || 60.0 * 1000; // 60 seconds
142
- alarmNode.maxTimeShelved.setValueFromSource({
143
- dataType: "Duration",
144
- value: options.maxTimeShelved
145
- });
146
- }
147
- // ---------- install inputNode
148
- (0, node_opcua_assert_1.assert)(options.inputNode, " must provide options.inputNode (NodeId or BaseNode object)");
149
- alarmNode.installInputNodeMonitoring(options.inputNode);
150
- (0, node_opcua_assert_1.assert)(alarmNode instanceof ua_acknowledgeable_condition_impl_js_1.UAAcknowledgeableConditionImpl);
151
- (0, node_opcua_assert_1.assert)(alarmNode instanceof exports.UAAlarmConditionImpl);
152
- return alarmNode;
58
+ return _initialize_alarm_condition_node(alarmNode, options);
153
59
  }
154
60
  dispose() {
155
61
  if (this.shelvingState) {
@@ -255,9 +161,34 @@ class UAAlarmConditionImplBase extends ua_acknowledgeable_condition_impl_js_1.UA
255
161
  const dataValue = node.readValue();
256
162
  this._onInputDataValueChange(dataValue);
257
163
  }
258
- _onInputDataValueChange(_newValue) {
164
+ /**
165
+ * What the alarm does when the value of its input node changes. Assign to it to give an
166
+ * alarm a state machine of its own, without deriving from anything.
167
+ *
168
+ * @example
169
+ *
170
+ * ```ts
171
+ * const myAlarm = namespace.instantiateAlarmCondition("AlarmConditionType", { ... });
172
+ * myAlarm.onInputDataValueChange = (newValue) => {
173
+ * const tooHot = newValue.value.value > 80;
174
+ * if (tooHot !== myAlarm.activeState.getValue()) {
175
+ * myAlarm.signalNewCondition(tooHot ? "Active" : "Inactive", tooHot, `${newValue.value.value}`);
176
+ * }
177
+ * };
178
+ * ```
179
+ *
180
+ * The default does nothing: a plain AlarmConditionType has no idea what its input means.
181
+ * The alarm types that do (limit alarms, off-normal alarms) override this.
182
+ */
183
+ onInputDataValueChange(_newValue) {
259
184
  /** */
260
185
  }
186
+ /**
187
+ * @deprecated assign {@link onInputDataValueChange} instead; this delegates to it.
188
+ */
189
+ _onInputDataValueChange(newValue) {
190
+ this.onInputDataValueChange(newValue);
191
+ }
261
192
  /**
262
193
  * install mechanism that listen to input node datavalue changes so that alarm status
263
194
  * can be automatically updated appropriately.
@@ -379,7 +310,20 @@ class UAAlarmConditionImplBase extends ua_acknowledgeable_condition_impl_js_1.UA
379
310
  this.currentBranch().setActiveState(false);
380
311
  this.currentBranch().setAckedState(true);
381
312
  }
313
+ /**
314
+ * @deprecated call {@link signalNewCondition} instead; this delegates to it.
315
+ */
382
316
  _signalNewCondition(stateName, isActive, value) {
317
+ this.signalNewCondition(stateName, isActive, value);
318
+ }
319
+ /**
320
+ * Raise a new condition event for this alarm.
321
+ *
322
+ * Call this only when the condition has actually changed: it throws when the new
323
+ * ConditionInfo is equal to the current one, because raising an event that reports
324
+ * nothing new is a bug in the caller rather than a state the alarm can represent.
325
+ */
326
+ signalNewCondition(stateName, isActive, value) {
383
327
  // xx if(stateName === null) {
384
328
  // xx alarm.currentBranch().setActiveState(false);
385
329
  // xx alarm.currentBranch().setAckedState(true);
@@ -393,7 +337,7 @@ class UAAlarmConditionImplBase extends ua_acknowledgeable_condition_impl_js_1.UA
393
337
  // still takes effect through it, and code that assigns the published
394
338
  // `calculateConditionInfo` is reached by the default below. Both work.
395
339
  const newConditionInfo = this._calculateConditionInfo(stateName, isActive, value, oldConditionInfo);
396
- // detect potential internal bugs due to misused of _signalNewCondition
340
+ // detect potential internal bugs due to misused of signalNewCondition
397
341
  if ((0, node_util_1.isDeepStrictEqual)(oldConditionInfo, newConditionInfo)) {
398
342
  // c8 ignore next
399
343
  if (doDebug) {
@@ -429,4 +373,179 @@ class UAAlarmConditionImplBase extends ua_acknowledgeable_condition_impl_js_1.UA
429
373
  exports.UAAlarmConditionImplBase = UAAlarmConditionImplBase;
430
374
  /** @internal */
431
375
  exports.UAAlarmConditionImpl = UAAlarmConditionImplBase;
376
+ /**
377
+ * The alarm half of the wiring, everything that follows the creation of the node.
378
+ *
379
+ * Shared by {@link UAAlarmConditionImplBase.instantiate} and by {@link promoteToAlarm}, so a node
380
+ * that was created some other way ends up with exactly the same machinery rather than an
381
+ * approximation of it. `inputNode` is optional here because a node being promoted may already
382
+ * carry its InputNode property, or may be given one later.
383
+ *
384
+ * @internal
385
+ */
386
+ function _initialize_alarm_condition_node(alarmNode, options) {
387
+ Object.setPrototypeOf(alarmNode, exports.UAAlarmConditionImpl.prototype);
388
+ // ----------------------- Install Alarm specifics
389
+ //
390
+ // Specs 1.03:
391
+ // ActiveState/Id when set to TRUE indicates that the situation the Condition is representing
392
+ // currently exists. When a Condition instance is in the inactive state (ActiveState/Id when set to
393
+ // FALSE) it is representing a situation that has returned to a normal state. The transitions of
394
+ // Conditions to the inactive and Active states are triggered by Server specific actions. Sub-
395
+ // Types of the AlarmConditionType specified later in this document will have sub-state models
396
+ // that further define the Active state. Recommended state names are described in Annex A.
397
+ // install activeState - Mandatory
398
+ /**
399
+ * @property activeState
400
+ * @type {UATwoStateVariable}
401
+ */
402
+ (0, ua_two_state_variable_js_1._install_TwoStateVariable_machinery)(alarmNode.activeState, {
403
+ falseState: "Inactive",
404
+ trueState: "Active"
405
+ });
406
+ alarmNode.currentBranch().setActiveState(false);
407
+ // Specs 1.03:
408
+ /**
409
+ *
410
+ * SuppressState is used internally by a Server to automatically suppress Alarms due to system
411
+ * specific reasons. For example a system may be configured to suppress Alarms that are
412
+ * associated with machinery that is shutdown, such as a low level Alarm for a tank that is
413
+ * currently not in use.
414
+ *
415
+ * @property suppressedState
416
+ * @type UATwoStateVariable
417
+ */
418
+ if (alarmNode.suppressedState) {
419
+ // install activeState - Optional
420
+ (0, ua_two_state_variable_js_1._install_TwoStateVariable_machinery)(alarmNode.suppressedState, {
421
+ falseState: "Unsuppressed",
422
+ trueState: "Suppressed"
423
+ });
424
+ }
425
+ // Specs 1.03:
426
+ /**
427
+ * ShelvingState suggests whether an Alarm shall (temporarily) be prevented from being
428
+ * displayed to the user. It is quite often used to block nuisance Alarms.
429
+ *
430
+ * @property shelvingState
431
+ * @type ShelvingStateMachine
432
+ */
433
+ if (alarmNode.shelvingState) {
434
+ ua_shelving_state_machine_ex_js_1.UAShelvedStateMachineExImplBase.promote(alarmNode.shelvingState);
435
+ }
436
+ // SuppressedOrShelved : Mandatory
437
+ // install suppressedOrShelved automatic detection
438
+ /**
439
+ * The SuppressedState and the ShelvingState together result in the SuppressedOrShelved status of the
440
+ * Condition. When an Alarm is in one of the states, the SuppressedOrShelved property will be set TRUE
441
+ * and this Alarm is then typically not displayed by the Client. State transitions associated with the
442
+ * Alarm do occur, but they are not typically displayed by the Clients as long as the Alarm remains in
443
+ * either the Suppressed or Shelved state.
444
+ * The dataType is Boolean.
445
+ * @property suppressedState
446
+ * @type UAVariable
447
+ *
448
+ */
449
+ if (alarmNode.suppressedState) {
450
+ alarmNode.suppressedState.on("value_changed", (_newDataValue) => {
451
+ _update_suppressedOrShelved(alarmNode);
452
+ });
453
+ }
454
+ if (alarmNode.shelvingState) {
455
+ alarmNode.shelvingState.currentState.on("value_changed", (_newDataValue) => {
456
+ _update_suppressedOrShelved(alarmNode);
457
+ });
458
+ }
459
+ _update_suppressedOrShelved(alarmNode);
460
+ /**
461
+ * The optional Property MaxTimeShelved is used to set the maximum time that an Alarm Condition may be shelved.
462
+ * The value is expressed as duration. Systems can use this Property to prevent permanent Shelving of an Alarm.
463
+ * If this Property is present it will be an upper limit on the duration passed into a TimedShelve Method call.
464
+ * If a value that exceeds the value of this property is passed to the TimedShelve Method,
465
+ * than a BadShelvingTimeOutOfRange error code is returned on the call. If this Property is present it will
466
+ * also be enforced for the OneShotShelved state, in that an Alarm Condition will transition to the Unshelved
467
+ * state from the OneShotShelved state if the duration specified in this Property expires following a
468
+ * OneShotShelve operation without a change of any of the other items associated with the Condition.
469
+ *
470
+ * @property maxTimeShelved
471
+ * @type {UAVariable}
472
+ */
473
+ if (alarmNode.maxTimeShelved) {
474
+ options.maxTimeShelved = options.maxTimeShelved || 60.0 * 1000; // 60 seconds
475
+ alarmNode.maxTimeShelved.setValueFromSource({
476
+ dataType: "Duration",
477
+ value: options.maxTimeShelved
478
+ });
479
+ }
480
+ // ---------- install inputNode
481
+ if (options.inputNode) {
482
+ alarmNode.installInputNodeMonitoring(options.inputNode);
483
+ }
484
+ (0, node_opcua_assert_1.assert)(alarmNode instanceof ua_acknowledgeable_condition_impl_js_1.UAAcknowledgeableConditionImpl);
485
+ (0, node_opcua_assert_1.assert)(alarmNode instanceof exports.UAAlarmConditionImpl);
486
+ return alarmNode;
487
+ }
488
+ /**
489
+ * Give an existing node the behaviour of the alarm its type says it is.
490
+ *
491
+ * A node only becomes a working alarm when `namespace.instantiateAlarmCondition` builds it; a node
492
+ * that arrived any other way - `objectType.instantiate()`, or a nodeset XML - carries the right
493
+ * children but none of the machinery, so `activateAlarm` and `signalNewCondition` are simply not
494
+ * there. This retypes the node in place, keeping its identity in the address space index and every
495
+ * reference already pointing at it, and then runs the same initialization the factory runs.
496
+ *
497
+ * Limit alarms are refused rather than half-promoted: their behaviour lives in
498
+ * UALimitAlarmImpl and its subclasses, and a node wearing the plain alarm prototype would look
499
+ * promoted while ignoring its own limit set points.
500
+ */
501
+ function promoteToAlarm(node, options) {
502
+ if (node instanceof UAAlarmConditionImplBase) {
503
+ return node; // already promoted
504
+ }
505
+ const addressSpace = node.addressSpace;
506
+ const typeDefinition = node.typeDefinitionObj;
507
+ const alarmConditionType = addressSpace.findObjectType("AlarmConditionType");
508
+ /* c8 ignore next */
509
+ if (!alarmConditionType) {
510
+ throw new Error("promoteToAlarm: cannot find AlarmConditionType - is the standard nodeset loaded ?");
511
+ }
512
+ if (!typeDefinition || (typeDefinition !== alarmConditionType && !typeDefinition.isSubtypeOf(alarmConditionType))) {
513
+ throw new Error(`promoteToAlarm: ${node.browseName.toString()} has type definition ` +
514
+ `${typeDefinition ? typeDefinition.browseName.toString() : "<none>"} ` +
515
+ "which does not derive from AlarmConditionType - only alarms can be promoted");
516
+ }
517
+ const limitAlarmType = addressSpace.findObjectType("LimitAlarmType");
518
+ if (limitAlarmType && (typeDefinition === limitAlarmType || typeDefinition.isSubtypeOf(limitAlarmType))) {
519
+ throw new Error(`promoteToAlarm: ${node.browseName.toString()} is a ${typeDefinition.browseName.toString()}, ` +
520
+ "a limit alarm - promoting limit alarms is not supported, use namespace.instantiateLimitAlarm instead");
521
+ }
522
+ // CertificateExpirationAlarmType carries behaviour of its own - promoteToCertificateExpirationAlarm
523
+ // starts an expiry timer and registers a shutdown task. Promoting one here would give it plain
524
+ // alarm behaviour and silently drop that, which is worse than refusing: the node would look
525
+ // promoted and never fire.
526
+ const certificateExpirationAlarmType = addressSpace.findObjectType("CertificateExpirationAlarmType");
527
+ if (certificateExpirationAlarmType &&
528
+ (typeDefinition === certificateExpirationAlarmType || typeDefinition.isSubtypeOf(certificateExpirationAlarmType))) {
529
+ throw new Error(`promoteToAlarm: ${node.browseName.toString()} is a ${typeDefinition.browseName.toString()}, ` +
530
+ "which has its own expiry machinery - use promoteToCertificateExpirationAlarm instead");
531
+ }
532
+ const alarmConditionEventType = addressSpace.findEventType(typeDefinition.nodeId);
533
+ /* c8 ignore next */
534
+ if (!alarmConditionEventType) {
535
+ throw new Error(`promoteToAlarm: cannot find event type for ${typeDefinition.browseName.toString()}`);
536
+ }
537
+ // conditionSource has to be an own property even when it is absent: the condition
538
+ // initialization tells "no source" from "source not considered" by its presence.
539
+ const initializationOptions = {
540
+ conditionClass: options?.conditionClass,
541
+ conditionName: options?.conditionName || node.browseName.name || undefined,
542
+ conditionSource: options?.conditionSource ?? null,
543
+ inputNode: options?.inputNode,
544
+ maxTimeShelved: options?.maxTimeShelved
545
+ };
546
+ const conditionNode = node;
547
+ (0, ua_condition_impl_js_1._initialize_condition_node)(node.namespace, conditionNode, alarmConditionEventType, initializationOptions);
548
+ (0, ua_acknowledgeable_condition_impl_js_1._initialize_acknowledgeable_condition_node)(conditionNode);
549
+ return _initialize_alarm_condition_node(conditionNode, initializationOptions);
550
+ }
432
551
  //# sourceMappingURL=ua_alarm_condition_impl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ua_alarm_condition_impl.js","sourceRoot":"","sources":["../../../impl/alarms_and_conditions/ua_alarm_condition_impl.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yCAAyD;AAEzD,yDAA2C;AAC3C,iEAAkD;AAElD,uDAAiE;AACjE,yDAAuD;AACvD,mEAAqD;AACrD,2DAAmE;AAOnE,sGAI0D;AAC1D,wFAAgG;AAChG,qEAA6D;AAC7D,iGAA4H;AAE5H,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,yBAAyB,CAAC,CAAC;AAC1D,MAAM,OAAO,GAAG,IAAA,i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CAAC,CAAC,CAAC;oBAChE,qEAAqE;oBACrE,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBACxC,CAAC;YACL,CAAC;YAED,IAAI,CAAC,aAAa,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAC3C,IAAI,CAAC,aAAa,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAEzC,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;QAC7C,CAAC;IACL,CAAC;;AAheL,4DAieC;AAID,gBAAgB;AACH,QAAA,oBAAoB,GAAG,wBAAwB,CAAC"}
1
+ {"version":3,"file":"ua_alarm_condition_impl.js","sourceRoot":"","sources":["../../../impl/alarms_and_conditions/ua_alarm_condition_impl.ts"],"names":[],"mappings":";;;AAueA,4EAiHC;AAeD,wCA4DC;AAnqBD;;GAEG;AACH,yCAAyD;AAEzD,yDAA2C;AAC3C,iEAAkD;AAElD,uDAAiE;AACjE,yDAAuD;AACvD,mEAAqD;AACrD,2DAAmE;AAQnE,sGAI0D;AAC1D,wFAAgG;AAChG,qEAA6D;AAC7D,iGAIgD;AAChD,iEAAyG;AAEzG,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,yBAAyB,CAAC,CAAC;AAC1D,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,yBAAyB,CAAC,CAAC;AAE1D,SAAS,2BAA2B,CAAC,SAA+B;IAChE,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,CAAC;QAC7C,QAAQ,EAAE,6BAAQ,CAAC,OAAO;QAC1B,KAAK,EAAE,SAAS,CAAC,qBAAqB,EAAE;KAC3C,CAAC,CAAC;AACP,CAAC;AAED,gBAAgB;AAChB,MAAa,wBAAyB,SAAQ,yEAAkC;IAerE,MAAM,CAAC,WAAW,GAAG,CAAC,IAAI,EAAE,CAAC;IAE7B,MAAM,CAAC,WAAW,CACrB,SAAqB,EACrB,oBAAmD,EACnD,OAAyC,EACzC,IAAqC;Q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AE,eAAe,IAAI,IAAI;QACjD,SAAS,EAAE,OAAO,EAAE,SAAS;QAC7B,cAAc,EAAE,OAAO,EAAE,cAAc;KAC1C,CAAC;IAEF,MAAM,aAAa,GAAG,IAAuC,CAAC;IAC9D,IAAA,iDAA0B,EAAC,IAAI,CAAC,SAAS,EAAE,aAAa,EAAE,uBAAuB,EAAE,qBAAqB,CAAC,CAAC;IAC1G,IAAA,iFAA0C,EAAC,aAAa,CAAC,CAAC;IAC1D,OAAO,gCAAgC,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;AAClF,CAAC"}
@@ -150,3 +150,22 @@ export declare class UAConditionImplBase<T extends UAConditionEvents & ListenerS
150
150
  export type UAConditionImpl = UAConditionImplBase;
151
151
  /** @internal */
152
152
  export declare const UAConditionImpl: typeof UAConditionImplBase;
153
+ /**
154
+ * The part of {@link InstantiateConditionOptions} that the initialization step below reads.
155
+ *
156
+ * Named separately so a caller that is wiring an existing node - which has no browseName or
157
+ * parent to give - does not have to invent the creation-time half of the options.
158
+ *
159
+ * @internal
160
+ */
161
+ export type ConditionInitializationOptions = Pick<InstantiateConditionOptions, "conditionSource" | "conditionOf" | "conditionClass" | "conditionName">;
162
+ /**
163
+ * Everything that turns a freshly created node into a working condition.
164
+ *
165
+ * Split out of {@link UACondition_instantiate} so that a node that already exists - one built by
166
+ * `objectType.instantiate` or loaded from a nodeset - can be given the very same wiring without
167
+ * being rebuilt, and so the two routes cannot drift apart.
168
+ *
169
+ * @internal
170
+ */
171
+ export declare function _initialize_condition_node(namespace: INamespace, conditionNode: UAConditionImpl, conditionType: UAEventType, options: ConditionInitializationOptions, data?: Record<string, VariantOptions>): UAConditionEx;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.UAConditionImpl = exports.UAConditionImplBase = void 0;
7
+ exports._initialize_condition_node = _initialize_condition_node;
7
8
  /**
8
9
  * @module node-opcua-address-space.AlarmsAndConditions
9
10
  */
@@ -567,6 +568,19 @@ function UACondition_instantiate(namespace, conditionTypeId, options, data) {
567
568
  namespace: options.namespace || namespace
568
569
  };
569
570
  const conditionNode = conditionType.instantiate(options2);
571
+ return _initialize_condition_node(namespace, conditionNode, conditionType, options, data);
572
+ }
573
+ /**
574
+ * Everything that turns a freshly created node into a working condition.
575
+ *
576
+ * Split out of {@link UACondition_instantiate} so that a node that already exists - one built by
577
+ * `objectType.instantiate` or loaded from a nodeset - can be given the very same wiring without
578
+ * being rebuilt, and so the two routes cannot drift apart.
579
+ *
580
+ * @internal
581
+ */
582
+ function _initialize_condition_node(namespace, conditionNode, conditionType, options, data) {
583
+ const addressSpace = namespace.addressSpace;
570
584
  Object.setPrototypeOf(conditionNode, exports.UAConditionImpl.prototype);
571
585
  conditionNode.initialize();
572
586
  (0, node_opcua_assert_1.assert)(Object.hasOwn(options, "conditionSource"), "must specify a condition source either as null or as a UAObject");
@@ -841,9 +855,11 @@ function _condition_refresh_method(inputArguments, context, callback) {
841
855
  debugLog(chalk_1.default.red(" ConditionType.ConditionRefresh ! subscriptionId ="), inputArguments[0].toString());
842
856
  }
843
857
  const subscriptionId = inputArguments[0].value;
858
+ // a rejected argument is answered in the Call result, never thrown: the Call service
859
+ // turns an exception into Bad_InternalError and the CTT reads that as a broken server
844
860
  let statusCode = _check_subscription_id_is_valid(subscriptionId, context);
845
861
  if (statusCode.isNotGood()) {
846
- return statusCode;
862
+ return callback(null, { statusCode });
847
863
  }
848
864
  statusCode = _perform_condition_refresh(addressSpace, inputArguments, context);
849
865
  return callback(null, {
@@ -854,6 +870,7 @@ function _perform_condition_refresh(addressSpace, _inputArguments, context) {
854
870
  // --- possible StatusCodes:
855
871
  //
856
872
  // Bad_SubscriptionIdInvalid See Part 4 for the description of this result code
873
+ // (checked by the caller, before we get here)
857
874
  // Bad_RefreshInProgress See Table 74 for the description of this result code
858
875
  // Bad_UserAccessDenied The Method was not called in the context of the Session
859
876
  // that owns the Subscription
@@ -863,7 +880,6 @@ function _perform_condition_refresh(addressSpace, _inputArguments, context) {
863
880
  // a refresh operation is already in progress....
864
881
  return node_opcua_status_code_1.StatusCodes.BadRefreshInProgress;
865
882
  }
866
- addressSpace._condition_refresh_in_progress = true;
867
883
  const server = context.object?.addressSpace.rootFolder.objects.server;
868
884
  const refreshStartEventType = addressSpace.findEventType("RefreshStartEventType");
869
885
  if (!refreshStartEventType) {
@@ -873,14 +889,20 @@ function _perform_condition_refresh(addressSpace, _inputArguments, context) {
873
889
  if (!refreshEndEventType) {
874
890
  throw new Error("cannot find RefreshEndEventType");
875
891
  }
876
- server?.raiseEvent(refreshStartEventType, {});
877
- // todo : resend retained conditions
878
- const _server = server;
879
- // starting from server object ..
880
- // evaluated all --> hasNotifier/hasEventSource -> node
881
- _server._conditionRefresh();
882
- server?.raiseEvent(refreshEndEventType, {});
883
- addressSpace._condition_refresh_in_progress = false;
892
+ addressSpace._condition_refresh_in_progress = true;
893
+ try {
894
+ server?.raiseEvent(refreshStartEventType, {});
895
+ const _server = server;
896
+ // starting from server object ..
897
+ // evaluated all --> hasNotifier/hasEventSource -> node
898
+ _server._conditionRefresh();
899
+ server?.raiseEvent(refreshEndEventType, {});
900
+ }
901
+ finally {
902
+ // whatever a condition's event handler throws, the next refresh must not be
903
+ // answered Bad_RefreshInProgress for ever
904
+ addressSpace._condition_refresh_in_progress = false;
905
+ }
884
906
  return node_opcua_status_code_1.StatusCodes.Good;
885
907
  }
886
908
  function _condition_refresh2_method(inputArguments, context, callback) {
@@ -895,9 +917,17 @@ function _condition_refresh2_method(inputArguments, context, callback) {
895
917
  if (doDebug) {
896
918
  debugLog(chalk_1.default.cyan.bgWhite(" ConditionType.conditionRefresh2 !"));
897
919
  }
898
- // xx var subscriptionId = inputArguments[0].value;
899
- // xx var monitoredItemId = inputArguments[1].value;
900
- const statusCode = _perform_condition_refresh(addressSpace, inputArguments, context);
920
+ const subscriptionId = inputArguments[0].value;
921
+ const monitoredItemId = inputArguments[1].value;
922
+ let statusCode = _check_subscription_id_is_valid(subscriptionId, context);
923
+ if (statusCode.isNotGood()) {
924
+ return callback(null, { statusCode });
925
+ }
926
+ statusCode = _check_monitored_item_id_is_valid(subscriptionId, monitoredItemId, context);
927
+ if (statusCode.isNotGood()) {
928
+ return callback(null, { statusCode });
929
+ }
930
+ statusCode = _perform_condition_refresh(addressSpace, inputArguments, context);
901
931
  return callback(null, {
902
932
  statusCode
903
933
  });
@@ -1009,8 +1039,33 @@ function _getCompositeKey(node, key) {
1009
1039
  * @param context {Object}
1010
1040
  * @private
1011
1041
  */
1012
- function _check_subscription_id_is_valid(_subscriptionId, _context) {
1013
- /// todo: return StatusCodes.BadSubscriptionIdInvalid; if subscriptionId doesn't belong to session...
1014
- return node_opcua_status_code_1.StatusCodes.Good;
1042
+ function _check_subscription_id_is_valid(subscriptionId, context) {
1043
+ // Part 9 5.5.7: Bad_SubscriptionIdInvalid when the SubscriptionId is not one of the
1044
+ // calling Session's. A Subscription of another Session is not reachable from this one
1045
+ // (Part 4: SubscriptionIds are Session-scoped), so it gets the same answer.
1046
+ const session = context.session;
1047
+ if (!session || typeof session.getSubscription !== "function") {
1048
+ // no Session behind the call (an in-process caller, a PseudoSession, a unit test):
1049
+ // there is nothing to check the argument against
1050
+ return node_opcua_status_code_1.StatusCodes.Good;
1051
+ }
1052
+ return session.getSubscription(subscriptionId) ? node_opcua_status_code_1.StatusCodes.Good : node_opcua_status_code_1.StatusCodes.BadSubscriptionIdInvalid;
1053
+ }
1054
+ /**
1055
+ * ConditionRefresh2 (Part 9 5.5.8): the MonitoredItemId must name a MonitoredItem of the
1056
+ * given Subscription, else Bad_MonitoredItemIdInvalid. Call after
1057
+ * _check_subscription_id_is_valid, which has established that the Subscription is ours.
1058
+ * @private
1059
+ */
1060
+ function _check_monitored_item_id_is_valid(subscriptionId, monitoredItemId, context) {
1061
+ const session = context.session;
1062
+ if (!session || typeof session.getSubscription !== "function") {
1063
+ return node_opcua_status_code_1.StatusCodes.Good;
1064
+ }
1065
+ const subscription = session.getSubscription(subscriptionId);
1066
+ if (!subscription) {
1067
+ return node_opcua_status_code_1.StatusCodes.BadSubscriptionIdInvalid;
1068
+ }
1069
+ return subscription.getMonitoredItem(monitoredItemId) ? node_opcua_status_code_1.StatusCodes.Good : node_opcua_status_code_1.StatusCodes.BadMonitoredItemIdInvalid;
1015
1070
  }
1016
1071
  //# sourceMappingURL=ua_condition_impl.js.map