node-opcua-address-space 2.132.0 → 2.134.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 (126) hide show
  1. package/dist/source/helpers/argument_list.d.ts +1 -6
  2. package/dist/source/helpers/argument_list.js +1 -6
  3. package/dist/source/helpers/argument_list.js.map +1 -1
  4. package/dist/source/helpers/dump_tools.d.ts +0 -4
  5. package/dist/source/helpers/dump_tools.js +0 -4
  6. package/dist/source/helpers/dump_tools.js.map +1 -1
  7. package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +4 -53
  8. package/dist/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.d.ts +1 -1
  9. package/dist/source/interfaces/state_machine/ua_shelved_state_machine_ex.d.ts +1 -1
  10. package/dist/source/loader/load_nodeset2.js +0 -3
  11. package/dist/source/loader/load_nodeset2.js.map +1 -1
  12. package/dist/source/session_context.d.ts +0 -4
  13. package/dist/source/session_context.js +2 -6
  14. package/dist/source/session_context.js.map +1 -1
  15. package/dist/src/address_space.d.ts +0 -27
  16. package/dist/src/address_space.js +0 -29
  17. package/dist/src/address_space.js.map +1 -1
  18. package/dist/src/alarms_and_conditions/condition.js +13 -12
  19. package/dist/src/alarms_and_conditions/condition.js.map +1 -1
  20. package/dist/src/alarms_and_conditions/condition_info_impl.d.ts +2 -10
  21. package/dist/src/alarms_and_conditions/condition_info_impl.js +2 -10
  22. package/dist/src/alarms_and_conditions/condition_info_impl.js.map +1 -1
  23. package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +132 -77
  24. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +120 -123
  25. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
  26. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.d.ts +1 -10
  27. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +1 -10
  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.d.ts +3 -15
  30. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +3 -15
  31. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
  32. package/dist/src/alarms_and_conditions/ua_base_event_impl.d.ts +1 -7
  33. package/dist/src/alarms_and_conditions/ua_base_event_impl.js +1 -7
  34. package/dist/src/alarms_and_conditions/ua_base_event_impl.js.map +1 -1
  35. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.d.ts +1 -1
  36. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js +3 -3
  37. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.js.map +1 -1
  38. package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +0 -28
  39. package/dist/src/alarms_and_conditions/ua_condition_impl.js +0 -31
  40. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  41. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.d.ts +0 -1
  42. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js +0 -1
  43. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.js.map +1 -1
  44. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +0 -28
  45. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +0 -28
  46. package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -1
  47. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.d.ts +0 -3
  48. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +0 -3
  49. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
  50. package/dist/src/base_node_impl.d.ts +2 -6
  51. package/dist/src/base_node_impl.js +3 -7
  52. package/dist/src/base_node_impl.js.map +1 -1
  53. package/dist/src/base_node_private.d.ts +1 -1
  54. package/dist/src/base_node_private.js +1 -1
  55. package/dist/src/event_data.d.ts +0 -3
  56. package/dist/src/event_data.js +0 -3
  57. package/dist/src/event_data.js.map +1 -1
  58. package/dist/src/extension_object_array_node.d.ts +1 -1
  59. package/dist/src/extension_object_array_node.js +1 -1
  60. package/dist/src/historical_access/address_space_historical_data_node.d.ts +0 -5
  61. package/dist/src/historical_access/address_space_historical_data_node.js +0 -5
  62. package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
  63. package/dist/src/namespace_impl.d.ts +21 -28
  64. package/dist/src/namespace_impl.js +22 -29
  65. package/dist/src/namespace_impl.js.map +1 -1
  66. package/dist/src/reference_impl.d.ts +1 -1
  67. package/dist/src/reference_impl.js +1 -1
  68. package/dist/src/state_machine/finite_state_machine.d.ts +0 -5
  69. package/dist/src/state_machine/finite_state_machine.js +0 -8
  70. package/dist/src/state_machine/finite_state_machine.js.map +1 -1
  71. package/dist/src/state_machine/ua_shelving_state_machine_ex.d.ts +1 -1
  72. package/dist/src/state_machine/ua_shelving_state_machine_ex.js +7 -7
  73. package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
  74. package/dist/src/state_machine/ua_two_state_variable.d.ts +0 -8
  75. package/dist/src/state_machine/ua_two_state_variable.js +0 -8
  76. package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
  77. package/dist/src/ua_object_type_impl.d.ts +1 -1
  78. package/dist/src/ua_object_type_impl.js +1 -1
  79. package/dist/src/ua_variable_impl.d.ts +4 -4
  80. package/dist/src/ua_variable_impl.js +3 -3
  81. package/dist/src/ua_variable_impl_ext_obj.js +0 -2
  82. package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
  83. package/dist/src/ua_variable_type_impl.js +1 -1
  84. package/dist/tsconfig_common.tsbuildinfo +1 -1
  85. package/distHelpers/assertHasMatchingReference.d.ts +1 -1
  86. package/distHelpers/assertHasMatchingReference.js +1 -1
  87. package/distHelpers/dump_statemachine.d.ts +1 -0
  88. package/distHelpers/dump_statemachine.js +1 -0
  89. package/distHelpers/dump_statemachine.js.map +1 -1
  90. package/distNodeJS/generate_address_space.js +3 -3
  91. package/distNodeJS/generate_address_space.js.map +1 -1
  92. package/package.json +36 -36
  93. package/source/helpers/argument_list.ts +1 -6
  94. package/source/helpers/dump_tools.ts +0 -4
  95. package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +4 -53
  96. package/source/interfaces/alarms_and_conditions/ua_certificate_expiration_alarm_ex.ts +1 -1
  97. package/source/interfaces/state_machine/ua_shelved_state_machine_ex.ts +1 -1
  98. package/source/loader/load_nodeset2.ts +0 -3
  99. package/source/session_context.ts +3 -7
  100. package/source_nodejs/generate_address_space.ts +1 -1
  101. package/src/address_space.ts +0 -29
  102. package/src/alarms_and_conditions/condition.ts +13 -12
  103. package/src/alarms_and_conditions/condition_info_impl.ts +2 -10
  104. package/src/alarms_and_conditions/condition_snapshot_impl.ts +122 -125
  105. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +1 -10
  106. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +3 -15
  107. package/src/alarms_and_conditions/ua_base_event_impl.ts +1 -7
  108. package/src/alarms_and_conditions/ua_certificate_expiration_alarm_impl.ts +1 -1
  109. package/src/alarms_and_conditions/ua_condition_impl.ts +0 -31
  110. package/src/alarms_and_conditions/ua_exclusive_limit_alarm_impl.ts +0 -1
  111. package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +0 -28
  112. package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +0 -3
  113. package/src/base_node_impl.ts +3 -7
  114. package/src/base_node_private.ts +1 -1
  115. package/src/event_data.ts +2 -3
  116. package/src/extension_object_array_node.ts +1 -1
  117. package/src/historical_access/address_space_historical_data_node.ts +0 -5
  118. package/src/namespace_impl.ts +22 -29
  119. package/src/reference_impl.ts +1 -1
  120. package/src/state_machine/finite_state_machine.ts +0 -8
  121. package/src/state_machine/ua_shelving_state_machine_ex.ts +8 -8
  122. package/src/state_machine/ua_two_state_variable.ts +0 -8
  123. package/src/ua_object_type_impl.ts +1 -1
  124. package/src/ua_variable_impl.ts +4 -4
  125. package/src/ua_variable_impl_ext_obj.ts +0 -2
  126. package/src/ua_variable_type_impl.ts +1 -1
@@ -42,19 +42,20 @@ function prepare_date(sourceTimestamp: { value: Date } | null) {
42
42
  A Condition’s EnabledState effects the generation of Event Notifications and as such results
43
43
  in the following specific behaviour:
44
44
  * When the Condition instance enters the Disabled state, the Retain Property of this
45
- Condition shall be set to FALSE by the Server to indicate to the Client that the
46
- Condition instance is currently not of interest to Clients.
45
+ Condition shall be set to FALSE by the Server to indicate to the Client that the
46
+ Condition instance is currently not of interest to Clients.
47
47
  * When the Condition instance enters the enabled state, the Condition shall be
48
- evaluated and all of its Properties updated to reflect the current values. If this
49
- evaluation causes the Retain Property to transition to TRUE for any ConditionBranch,
50
- then an Event Notification shall be generated for that ConditionBranch.
48
+ evaluated and all of its Properties updated to reflect the current values. If this
49
+ evaluation causes the Retain Property to transition to TRUE for any ConditionBranch,
50
+ then an Event Notification shall be generated for that ConditionBranch.
51
51
  * The Server may choose to continue to test for a Condition instance while it is
52
- Disabled. However, no Event Notifications will be generated while the Condition
53
- instance is disabled.
52
+ Disabled. However, no Event Notifications will be generated while the Condition
53
+ instance is disabled.
54
54
  * For any Condition that exists in the Address Space the Attributes and the following
55
- Variables will continue to have valid values even in the Disabled state; EventId, Event
56
- Type, Source Node, Source Name, Time, and EnabledState.
57
- Other properties may no longer provide current valid values.
55
+ Variables will continue to have valid values even in the Disabled state; EventId, Event
56
+ Type, Source Node, Source Name, Time, and EnabledState.
57
+ Other properties may no longer provide current valid values.
58
+
58
59
  All Variables that are no longer provided shall return a status of BadConditionDisabled.
59
60
  The Event that reports the Disabled state should report the properties as NULL or with a status
60
61
  of BadConditionDisabled.
@@ -75,9 +76,9 @@ function prepare_date(sourceTimestamp: { value: Date } | null) {
75
76
  // case, the SourceNode of this ReferenceType shall be an ObjectType or VariableType Node or
76
77
  // one of their InstanceDeclaration Nodes. The TargetNode shall be a Condition instance
77
78
  // declaration or a ConditionType. The following rules for instantiation apply:
78
- // All HasCondition References used in a Type shall exist in instances of these Types as
79
+ // * All HasCondition References used in a Type shall exist in instances of these Types as
79
80
  // well.
80
- // If the TargetNode in the Type definition is a ConditionType, the same TargetNode will
81
+ // * If the TargetNode in the Type definition is a ConditionType, the same TargetNode will
81
82
  // be referenced on the instance.
82
83
  // HasCondition References may be used solely in the instance space when they are not
83
84
  // available in Type definitions. In this case the SourceNode of this ReferenceType shall be an
@@ -9,13 +9,7 @@ import { ConditionInfo, ConditionInfoOptions } from "../../source/interfaces/ala
9
9
 
10
10
 
11
11
  /**
12
- * @class ConditionInfo
13
- * @param options {Object}
14
- * @param options.message {String|LocalizedText} the event message
15
- * @param options.severity {UInt16} severity
16
- * @param options.quality {StatusCode} quality
17
- * @param options.retain {Boolean} retain flag
18
- * @constructor
12
+ * @private
19
13
  */
20
14
  export class ConditionInfoImpl implements ConditionInfo {
21
15
  public message: LocalizedText | null = null;
@@ -46,9 +40,7 @@ export class ConditionInfoImpl implements ConditionInfo {
46
40
  }
47
41
 
48
42
  /**
49
- * @method isDifferentFrom
50
- * @param otherConditionInfo {ConditionInfo}
51
- * @return {Boolean}
43
+ *
52
44
  */
53
45
  public isDifferentFrom(otherConditionInfo: ConditionInfo): boolean {
54
46
  return (
@@ -158,11 +158,6 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
158
158
  private _node_index: Record<FullBrowsePath, UAVariable> = {};
159
159
 
160
160
  /**
161
- * @class ConditionSnapshot
162
- * @extends EventEmitter
163
- * @param condition
164
- * @param branchId
165
- * @constructor
166
161
  */
167
162
  constructor(condition: BaseNode, branchId: NodeId) {
168
163
  super();
@@ -222,6 +217,9 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
222
217
  // return variant;
223
218
  // }
224
219
 
220
+ /**
221
+ * @internal
222
+ */
225
223
  public _get_var(varName: string): any {
226
224
  const c = this.condition as UAConditionImpl;
227
225
  if (!c.getEnabledState() && !Object.prototype.hasOwnProperty.call(_varTable, varName)) {
@@ -237,6 +235,9 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
237
235
  return variant.value;
238
236
  }
239
237
 
238
+ /**
239
+ * @internal
240
+ */
240
241
  public _set_var(varName: string, dataType: DataType, value: unknown, options?: IConditionVariableTypeSetterOptions): void {
241
242
  const key = normalizeName(varName);
242
243
  // istanbul ignore next
@@ -281,24 +282,21 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
281
282
  }
282
283
 
283
284
  /**
284
- * @method getBrandId
285
- * @return {NodeId}
285
+ *
286
286
  */
287
287
  public getBranchId(): NodeId {
288
288
  return this._get_var("BranchId") as NodeId;
289
289
  }
290
290
 
291
291
  /**
292
- * @method getEventId
293
- * @return {ByteString}
292
+ *
294
293
  */
295
294
  public getEventId(): Buffer {
296
295
  return this._get_var("EventId") as Buffer;
297
296
  }
298
297
 
299
298
  /**
300
- * @method getRetain
301
- * @return {Boolean}
299
+ *
302
300
  */
303
301
  public getRetain(): boolean {
304
302
  return this._get_var("Retain") as boolean;
@@ -306,8 +304,6 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
306
304
 
307
305
  /**
308
306
  *
309
- * @method setRetain
310
- * @param retainFlag {Boolean}
311
307
  */
312
308
  public setRetain(retainFlag: boolean): void {
313
309
  retainFlag = !!retainFlag;
@@ -315,7 +311,6 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
315
311
  }
316
312
 
317
313
  /**
318
- * @method renewEventId
319
314
  *
320
315
  */
321
316
  public renewEventId(): void {
@@ -328,33 +323,28 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
328
323
  }
329
324
 
330
325
  /**
331
- * @method getEnabledState
332
- * @return {Boolean}
326
+ *
333
327
  */
334
328
  public getEnabledState(): boolean {
335
329
  return this._get_twoStateVariable("EnabledState");
336
330
  }
337
331
 
338
332
  /**
339
- * @method setEnabledState
340
- * @param value {Boolean}
341
- * @return void
333
+ *
342
334
  */
343
335
  public setEnabledState(value: boolean, options?: ISetStateOptions): void {
344
336
  return this._set_twoStateVariable("EnabledState", value, options);
345
337
  }
346
338
 
347
339
  /**
348
- * @method getEnabledStateAsString
349
- * @return {String}
340
+ *
350
341
  */
351
342
  public getEnabledStateAsString(): string {
352
343
  return this._get_var("EnabledState").text;
353
344
  }
354
345
 
355
346
  /**
356
- * @method getComment
357
- * @return {LocalizedText}
347
+ *
358
348
  */
359
349
  public getComment(): LocalizedText {
360
350
  return this._get_var("Comment");
@@ -369,8 +359,6 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
369
359
  * a Method provides as an option the ability to set a Comment, then the value of this Variable is
370
360
  * reset to null if an optional comment is not provided.
371
361
  *
372
- * @method setComment
373
- * @param txtMessage {LocalizedText}
374
362
  */
375
363
  public setComment(txtMessage: LocalizedTextLike, options?: IConditionVariableTypeSetterOptions): void {
376
364
  const txtMessage1 = coerceLocalizedText(txtMessage);
@@ -378,9 +366,7 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
378
366
  }
379
367
 
380
368
  /**
381
- *
382
- * @method setMessage
383
- * @param txtMessage {LocalizedText}
369
+ * set the condition message (localized text)
384
370
  */
385
371
  public setMessage(txtMessage: LocalizedTextLike | LocalizedText): void {
386
372
  const txtMessage1 = coerceLocalizedText(txtMessage);
@@ -388,88 +374,111 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
388
374
  }
389
375
 
390
376
  /**
391
- * @method setClientUserId
392
- * @param userIdentity {String}
377
+ *
393
378
  */
394
379
  public setClientUserId(userIdentity: string): void {
395
380
  return this._set_var("ClientUserId", DataType.String, userIdentity.toString());
396
381
  }
397
382
 
398
383
  /*
384
+ *
385
+ */
386
+
387
+ /**
388
+ * set the condition quality
399
389
  *
400
390
  *
401
391
  * as per spec 1.0.3 - Part 9
402
392
  *
403
- * Quality reveals the status of process values or other resources that this Condition instance is
404
- * based upon. If, for example, a process value is “Uncertain”, the associated “LevelAlarm”
405
- * Condition is also questionable. Values for the Quality can be any of the OPC StatusCodes
406
- * defined in Part 8 as well as Good, Uncertain and Bad as defined in Part 4. These
407
- * StatusCodes are similar to but slightly more generic than the description of data quality in the
408
- * various field bus specifications. It is the responsibility of the Server to map internal status
409
- * information to these codes. A Server which supports no quality information shall return Good.
393
+ * Quality reveals the status of process values or other resources that this Condition
394
+ * instance is based upon.
395
+ *
396
+ * If, for example, a process value is Uncertain”, the associated “LevelAlarm”
397
+ * Condition is also questionable.
398
+ *
399
+ * Values for the Quality can be any of the OPC StatusCodes defined in Part 8
400
+ * as well as Good, Uncertain and Bad as defined in Part 4.
401
+ *
402
+ * These StatusCodes are similar to but slightly more generic than the description
403
+ * of data quality in the various field bus specifications.
404
+ *
405
+ * It is the responsibility of the Server to map internal status information to these codes.
406
+ *
407
+ * A Server which supports no quality information shall return Good.
408
+ *
410
409
  * This quality can also reflect the communication status associated with the system that this
411
410
  * value or resource is based on and from which this Alarm was received. For communication
412
- * errors to the underlying system, especially those that result in some unavailable Event fields,
413
- * the quality shall be BadNoCommunication error.
414
- *
415
- * Quality refers to the quality of the data value(s) upon which this Condition is based. Since a
416
- * Condition is usually based on one or more Variables, the Condition inherits the quality of
417
- * these Variables. E.g., if the process value is “Uncertain”, the “LevelAlarm” Condition is also
418
- * questionable. If more than one variable is represented by a given condition or if the condition
419
- * is from an underlining system and no direct mapping to a variable is available, it is up to the
420
- * application to determine what quality is displayed as part of the condition.
421
- */
422
-
423
- /**
424
- * set the condition quality
425
- * @method setQuality
426
- * @param quality {StatusCode}
411
+ * errors to the underlying system, especially those that result in some unavailable
412
+ * Event fields, the quality shall be BadNoCommunication error.
413
+ *
414
+ * Quality refers to the quality of the data value(s) upon which this Condition is based.
415
+ *
416
+ * Since a Condition is usually based on one or more Variables, the Condition inherits
417
+ * the quality of these Variables. E.g., if the process value is “Uncertain”,
418
+ * the “LevelAlarm” Condition is also questionable.
419
+ *
420
+ * If more than one variable is represented by a given condition or if the condition
421
+ * is from an underlining system and no direct mapping to a variable is available,
422
+ * it is up to the application to determine what quality is displayed as part of the condition.
427
423
  */
428
424
  public setQuality(quality: StatusCode, options?: IConditionVariableTypeSetterOptions): void {
429
425
  this._set_var("Quality", DataType.StatusCode, quality, options);
430
426
  }
431
427
 
432
428
  /**
433
- * @method getQuality
434
- * @return {StatusCode}
429
+ *
435
430
  */
436
431
  public getQuality(): StatusCode {
437
432
  return this._get_var("Quality") as StatusCode;
438
433
  }
439
434
 
440
- /*
441
- * as per spec 1.0.3 - Part 9
435
+ /**
436
+ * **as per spec 1.0.3 - Part 9**
437
+ *
442
438
  * The Severity of a Condition is inherited from the base Event model defined in Part 5. It
443
439
  * indicates the urgency of the Condition and is also commonly called ‘priority’, especially in
444
440
  * relation to Alarms in the ProcessConditionClass.
445
441
  *
446
- * as per spec 1.0.3 - PArt 5
447
- * Severity is an indication of the urgency of the Event. This is also commonly called “priority”.
448
- * Values will range from 1 to 1 000, with 1 being the lowest severity and 1 000 being the highest.
449
- * Typically, a severity of 1 would indicate an Event which is informational in nature, while a value
450
- * of 1 000 would indicate an Event of catastrophic nature, which could potentially result in severe
451
- * financial loss or loss of life.
452
- * It is expected that very few Server implementations will support 1 000 distinct severity levels.
453
- * Therefore, Server developers are responsible for distributing their severity levels across the
454
- * 1 to 1 000 range in such a manner that clients can assume a linear distribution. For example, a
455
- * client wishing to present five severity levels to a user should be able to do the following
456
- * mapping:
442
+ * **as per spec 1.0.3 - Part 5**
443
+ *
444
+ * Severity is an indication of the urgency of the Event. This is also commonly
445
+ * called “priority”.
446
+ *
447
+ * Values will range from 1 to 1 000, with 1 being the lowest severity and 1 000
448
+ * being the highest.
449
+ *
450
+ * Typically, a severity of 1 would indicate an Event which is informational in nature,
451
+ * while a value of 1 000 would indicate an Event of catastrophic nature, which could
452
+ * potentially result in severe financial loss or loss of life.
453
+ *
454
+ * It is expected that very few Server implementations will support 1 000 distinct
455
+ * severity levels.
456
+ *
457
+ * Therefore, Server developers are responsible for distributing their severity levels
458
+ * across the 1 to 1 000 range in such a manner that clients can assume a linear
459
+ * distribution.
460
+ *
461
+ *
462
+ * For example, a client wishing to present five severity levels to a user should be
463
+ * able to do the following mapping:
464
+ *
465
+ *
457
466
  * Client Severity OPC Severity
458
467
  * HIGH 801 – 1 000
459
468
  * MEDIUM HIGH 601 – 800
460
469
  * MEDIUM 401 – 600
461
470
  * MEDIUM LOW 201 – 400
462
471
  * LOW 1 – 200
463
- * In many cases a strict linear mapping of underlying source severities to the OPC Severity range
464
- * is not appropriate. The Server developer will instead intelligently map the underlying source
465
- * severities to the 1 to 1 000 OPC Severity range in some other fashion. In particular, it is
466
- * recommended that Server developers map Events of high urgency into the OPC severity range
467
- * of 667 to 1 000, Events of medium urgency into the OPC severity range of 334 to 666 and
468
- * Events of low urgency into OPC severities of 1 to 333.
469
- */
470
- /**
471
- * @method setSeverity
472
- * @param severity {UInt16}
472
+ *
473
+ * In many cases a strict linear mapping of underlying source severities to the OPC
474
+ * Severity range is not appropriate. The Server developer will instead intelligently
475
+ * map the underlying source severities to the 1 to 1 000 OPC Severity range in some
476
+ * other fashion.
477
+ *
478
+ * In particular, it it recommended that Server developers map Events of high urgency
479
+ * into the OPC severity range of 667 to 1 000, Events of medium urgency into the
480
+ * OPC severity range of 334 to 666 and Events of low urgency into OPC severities
481
+ * of 1 to 333.
473
482
  */
474
483
  public setSeverity(severity: UInt16, options?: IConditionVariableTypeSetterOptions): void {
475
484
  assert(isFinite(severity), "expecting a UInt16");
@@ -483,8 +492,6 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
483
492
  }
484
493
 
485
494
  /**
486
- * @method getSeverity
487
- * @return {UInt16}
488
495
  */
489
496
  public getSeverity(): UInt16 {
490
497
  const c = this.condition as UAConditionImpl;
@@ -497,25 +504,24 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
497
504
  return c.severity.readValue().sourceTimestamp || new Date();
498
505
  }
499
506
 
500
- /*
501
- * as per spec 1.0.3 - part 9:
502
- * LastSeverity provides the previous severity of the ConditionBranch. Initially this Variable
503
- * contains a zero value; it will return a value only after a severity change. The new severity is
507
+ /**
508
+ * LastSeverity provides the previous severity of the ConditionBranch.
509
+ *
510
+ * **as per spec 1.0.3 - part 9**
511
+ *
512
+ *
513
+ * Initially this Variable contains a zero value;
514
+ * it will return a value only after a severity change. The new severity is
504
515
  * supplied via the Severity Property which is inherited from the BaseEventType.
505
516
  *
506
517
  */
507
- /**
508
- * @method setLastSeverity
509
- * @param severity {UInt16}
510
- */
511
518
  public setLastSeverity(severity: UInt16, options?: IConditionVariableTypeSetterOptions): void {
512
519
  severity = +severity;
513
520
  return this._set_var("LastSeverity", DataType.UInt16, severity, options);
514
521
  }
515
522
 
516
523
  /**
517
- * @method getLastSeverity
518
- * @return {UInt16}
524
+ *
519
525
  */
520
526
  public getLastSeverity(): UInt16 {
521
527
  const value = this._get_var("LastSeverity");
@@ -525,7 +531,7 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
525
531
  /**
526
532
  * setReceiveTime
527
533
  *
528
- * (as per OPCUA 1.0.3 part 5)
534
+ * **as per OPCUA 1.0.3 part 5**:
529
535
  *
530
536
  * ReceiveTime provides the time the OPC UA Server received the Event from the underlying
531
537
  * device of another Server.
@@ -538,35 +544,39 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
538
544
  * The ReceiveTime shall always be returned as value and the Server is not allowed to return a
539
545
  * StatusCode for the ReceiveTime indicating an error.
540
546
  *
541
- * @method setReceiveTime
542
- * @param time {Date} : UTCTime
543
547
  */
544
548
  public setReceiveTime(time: UtcTime): void {
545
- return this._set_var("ReceiveTime", DataType.DateTime, time, { sourceTimestamp: time || undefined });
549
+ return this._set_var("ReceiveTime", DataType.DateTime, time, { sourceTimestamp: time || undefined });
546
550
  }
547
551
 
548
552
  /**
549
- * (as per OPCUA 1.0.3 part 5)
550
- * Time provides the time the Event occurred. This value is set as close to the event generator as
551
- * possible. It often comes from the underlying system or device. Once set, intermediate OPC UA
552
- * Servers shall not alter the value.
553
+ * Time provides the time the Event occurred.
554
+ *
555
+ * **as per OPCUA 1.0.3 part 5**:
556
+ *
557
+ * This value is set as close to the event generator as
558
+ * possible. It often comes from the underlying system or device.
559
+ *
560
+ * Once set, intermediate OPC UA Servers shall not alter the value.
553
561
  *
554
- * @method setTime
555
- * @param time {Date}
556
562
  */
557
563
  public setTime(time: Date): void {
558
564
  return this._set_var("Time", DataType.DateTime, time, { sourceTimestamp: time });
559
565
  }
560
566
 
561
567
  /**
562
- * LocalTime is a structure containing the Offset and the DaylightSavingInOffset flag. The Offset
563
- * specifies the time difference (in minutes) between the Time Property and the time at the location
564
- * in which the event was issued. If DaylightSavingInOffset is TRUE, then Standard/Daylight
565
- * savings time (DST) at the originating location is in effect and Offset includes the DST c orrection.
566
- * If FALSE then the Offset does not include DST correction and DST may or may not have been
568
+ * LocalTime is a structure containing the Offset and the DaylightSavingInOffset flag.
569
+ *
570
+ * The Offset specifies the time difference (in minutes) between the Time Property
571
+ * and the time at the location in which the event was issued.
572
+ *
573
+ *
574
+ * If DaylightSavingInOffset is TRUE, then Standard/Daylight savings time (DST) at
575
+ * the originating location is in effect and Offset includes the DST correction.
576
+ *
577
+ * If `false` then the Offset does not include DST correction and DST may or may not have been
567
578
  * in effect.
568
- * @method setLocalTime
569
- * @param localTime {TimeZone}
579
+ *
570
580
  */
571
581
  public setLocalTime(localTime: TimeZoneDataType): void {
572
582
  assert(localTime instanceof TimeZoneDataType);
@@ -579,16 +589,14 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
579
589
  }
580
590
 
581
591
  /**
582
- * @method getSourceNode
583
- * return {NodeId}
592
+ *
584
593
  */
585
594
  public getSourceNode(): NodeId {
586
595
  return this._get_var("SourceNode");
587
596
  }
588
597
 
589
598
  /**
590
- * @method getEventType
591
- * return {NodeId}
599
+ *
592
600
  */
593
601
  public getEventType(): NodeId {
594
602
  return this._get_var("EventType");
@@ -648,21 +656,10 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
648
656
  }
649
657
 
650
658
  // ---- Shelving
651
- /**
652
- * @class ConditionSnapshot
653
- */
654
- /**
655
- * @method getSuppressedState
656
- * @return {Boolean}
657
- */
658
659
  public getSuppressedState(): boolean {
659
660
  return this._get_twoStateVariable("SuppressedState");
660
661
  }
661
662
 
662
- /**
663
- * @method setSuppressedState
664
- * @param suppressed {Boolean}
665
- */
666
663
  public setSuppressedState(suppressed: boolean, options?: ISetStateOptions): void {
667
664
  suppressed = !!suppressed;
668
665
  this._set_twoStateVariable("SuppressedState", suppressed, options);
@@ -734,10 +731,7 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
734
731
  );
735
732
  }
736
733
  /**
737
- * @class ConditionSnapshot
738
- * @param varName
739
- * @param value
740
- * @private
734
+ * @internal
741
735
  */
742
736
  public _set_twoStateVariable(varName: string, value: boolean, options?: ISetStateOptions): void {
743
737
  value = !!value;
@@ -774,6 +768,9 @@ export class ConditionSnapshotImpl extends EventEmitter implements ConditionSnap
774
768
  this.emit("valueChanged", node, variant, { sourceTimestamp });
775
769
  }
776
770
 
771
+ /**
772
+ * @internal
773
+ */
777
774
  protected _get_twoStateVariable(varName: string): any {
778
775
  const key = ConditionSnapshotImpl.normalizeName(varName) + ".Id";
779
776
  const variant = this._map[key];
@@ -208,11 +208,7 @@ export class UAAcknowledgeableConditionImpl extends UAConditionImpl implements U
208
208
  }
209
209
 
210
210
  /**
211
- * @method _confirm_branch
212
211
  * @param conditionEventId The ConditionEventId field shall contain the id of the Event that was conformed
213
- * @param comment
214
- * @param branch
215
- * @param message
216
212
  * @private
217
213
  */
218
214
  public _confirm_branch(
@@ -248,9 +244,6 @@ export class UAAcknowledgeableConditionImpl extends UAConditionImpl implements U
248
244
  }
249
245
 
250
246
  /**
251
- * @method autoConfirmBranch
252
- * @param branch
253
- * @param comment
254
247
  */
255
248
  public autoConfirmBranch(branch: ConditionSnapshot, comment: LocalizedTextLike): void {
256
249
  assert(branch instanceof ConditionSnapshotImpl);
@@ -267,9 +260,7 @@ export class UAAcknowledgeableConditionImpl extends UAConditionImpl implements U
267
260
  }
268
261
 
269
262
  /**
270
- * @method acknowledgeAndAutoConfirmBranch
271
- * @param branch {ConditionSnapshot}
272
- * @param comment {String|LocalizedText}
263
+ *
273
264
  */
274
265
  public acknowledgeAndAutoConfirmBranch(branch: ConditionSnapshot, comment: string | LocalizedTextLike | LocalizedText): void {
275
266
  comment = LocalizedText.coerce(comment)!;
@@ -265,7 +265,7 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
265
265
  }
266
266
 
267
267
  /**
268
- * @method getInputNodeNode
268
+
269
269
  * @return {BaseNode} return the node in the address space pointed by the inputNode value
270
270
  *
271
271
  * Note: please note the difference between alarm.inputNode
@@ -280,8 +280,7 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
280
280
  return this.addressSpace.findNode(nodeId) as UAVariable | null;
281
281
  }
282
282
  /**
283
- * @method getInputNodeValue
284
- * @return {*}
283
+ *
285
284
  */
286
285
  public getInputNodeValue(): any | null {
287
286
  const node = this.getInputNodeNode();
@@ -303,9 +302,8 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
303
302
  }
304
303
 
305
304
  /**
306
- * @method installInputNodeMonitoring
307
305
  * install mechanism that listen to input node datavalue changes so that alarm status
308
- * can be automatically updated appropriatly.
306
+ * can be automatically updated appropriately.
309
307
  * @param inputNode {BaseNode}
310
308
  * @return {void}
311
309
  * @protected
@@ -379,16 +377,6 @@ export class UAAlarmConditionImpl extends UAAcknowledgeableConditionImpl impleme
379
377
  }
380
378
 
381
379
  /***
382
- * @method _calculateConditionInfo
383
- * @param stateData {Object} the new calculated state of the alarm
384
- * @param isActive {Boolean}
385
- * @param value {Number} the new value of the limit alarm
386
- * @param oldCondition {ConditionInfo} given for information purpose
387
- * @param oldCondition.severity
388
- * @param oldCondition.quality
389
- * @param oldCondition.message
390
- * @param oldCondition.retain
391
- * @return {ConditionInfo} the new condition info
392
380
  *
393
381
  * this method need to be overridden by the instantiate to allow custom message and severity
394
382
  * to be set based on specific context of the alarm.
@@ -14,14 +14,10 @@ export interface UABaseEventEx extends UABaseEvent_Base, UABaseEventHelper {}
14
14
  export declare interface UABaseEventImpl extends UABaseEventEx {}
15
15
 
16
16
  /**
17
- * @class BaseEventType
18
- * @class UAObject
19
- * @constructor
17
+ * @internal
20
18
  */
21
19
  export class UABaseEventImpl extends UAObjectImpl implements UABaseEventEx {
22
20
  /**
23
- * @method setSourceName
24
- * @param name
25
21
  */
26
22
  public setSourceName(name: string): void {
27
23
  assert(typeof name === "string");
@@ -34,8 +30,6 @@ export class UABaseEventImpl extends UAObjectImpl implements UABaseEventEx {
34
30
  }
35
31
 
36
32
  /**
37
- * @method setSourceNode
38
- * @param node {NodeId|UAObject}
39
33
  */
40
34
  public setSourceNode(node: NodeId | BaseNode): void {
41
35
  this.sourceNode.setValueFromSource(
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @module node-opcua-address-space.AlarmsAndConditions
3
3
  */
4
- import { Certificate, exploreCertificate, makeSHA1Thumbprint } from "node-opcua-crypto";
4
+ import { Certificate, exploreCertificate, makeSHA1Thumbprint } from "node-opcua-crypto/web";
5
5
  import { DateTime, getMinOPCUADate, isMinDate, StatusCodes } from "node-opcua-basic-types";
6
6
  import { make_warningLog } from "node-opcua-debug";
7
7
  import { NodeId } from "node-opcua-nodeid";