node-opcua-address-space 2.91.0 → 2.92.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 (66) hide show
  1. package/dist/source/address_space_ts.d.ts +3 -3
  2. package/dist/source/address_space_ts.js +3 -3
  3. package/dist/source/address_space_ts.js.map +1 -1
  4. package/dist/source/helpers/call_helpers.d.ts +1 -1
  5. package/dist/source/helpers/multiform_func.d.ts +8 -8
  6. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +1 -1
  7. package/dist/source/interfaces/extension_object_constructor.d.ts +1 -1
  8. package/dist/source/interfaces/state_machine/ua_state_machine_type.d.ts +2 -2
  9. package/dist/source/loader/generateAddressSpaceRaw.d.ts +2 -2
  10. package/dist/source/loader/make_xml_extension_object_parser.d.ts +1 -1
  11. package/dist/source/loader/namespace_post_step.d.ts +1 -1
  12. package/dist/source/namespace_machine_state.d.ts +3 -2
  13. package/dist/source/session_context.d.ts +1 -1
  14. package/dist/src/address_space.d.ts +1 -1
  15. package/dist/src/address_space.js +13 -13
  16. package/dist/src/address_space.js.map +1 -1
  17. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +1 -2
  18. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
  19. package/dist/src/apply_condition_refresh.d.ts +1 -1
  20. package/dist/src/base_node_impl.js +44 -44
  21. package/dist/src/base_node_impl.js.map +1 -1
  22. package/dist/src/event_data.d.ts +2 -2
  23. package/dist/src/extension_object_array_node.js +0 -5
  24. package/dist/src/extension_object_array_node.js.map +1 -1
  25. package/dist/src/namespace_impl.d.ts +2 -12
  26. package/dist/src/namespace_impl.js +18 -14
  27. package/dist/src/namespace_impl.js.map +1 -1
  28. package/dist/src/nodeid_manager.d.ts +3 -3
  29. package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +1 -1
  30. package/dist/src/reference_impl.js +6 -6
  31. package/dist/src/reference_impl.js.map +1 -1
  32. package/dist/src/state_machine/finite_state_machine.js +18 -22
  33. package/dist/src/state_machine/finite_state_machine.js.map +1 -1
  34. package/dist/src/tool_isSubtypeOf.d.ts +4 -4
  35. package/dist/src/tool_isSubtypeOf.js +2 -2
  36. package/dist/src/tool_isSubtypeOf.js.map +1 -1
  37. package/dist/src/ua_data_type_impl.js +14 -14
  38. package/dist/src/ua_data_type_impl.js.map +1 -1
  39. package/dist/src/ua_method_impl.js +8 -7
  40. package/dist/src/ua_method_impl.js.map +1 -1
  41. package/dist/src/ua_object_impl.js +7 -7
  42. package/dist/src/ua_object_impl.js.map +1 -1
  43. package/dist/src/ua_object_type_impl.js +8 -8
  44. package/dist/src/ua_object_type_impl.js.map +1 -1
  45. package/dist/src/ua_reference_type_impl.js +6 -6
  46. package/dist/src/ua_reference_type_impl.js.map +1 -1
  47. package/dist/src/ua_variable_impl.d.ts +4 -0
  48. package/dist/src/ua_variable_impl.js +19 -14
  49. package/dist/src/ua_variable_impl.js.map +1 -1
  50. package/dist/src/ua_variable_impl_ext_obj.js +21 -12
  51. package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
  52. package/dist/src/ua_variable_type_impl.js +6 -6
  53. package/dist/src/ua_variable_type_impl.js.map +1 -1
  54. package/dist/src/ua_view_impl.js +3 -3
  55. package/dist/src/ua_view_impl.js.map +1 -1
  56. package/package.json +23 -23
  57. package/source/namespace_machine_state.ts +5 -2
  58. package/src/address_space.ts +15 -15
  59. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +1 -2
  60. package/src/extension_object_array_node.ts +0 -5
  61. package/src/namespace_impl.ts +29 -19
  62. package/src/state_machine/finite_state_machine.ts +24 -31
  63. package/src/tool_isSubtypeOf.ts +2 -2
  64. package/src/ua_method_impl.ts +6 -6
  65. package/src/ua_variable_impl.ts +9 -3
  66. package/src/ua_variable_impl_ext_obj.ts +26 -16
@@ -104,12 +104,9 @@ export function _touchValue(property: UAVariableImpl, now: PreciseClock): void {
104
104
  property.$dataValue.serverTimestamp = now.timestamp;
105
105
  property.$dataValue.serverPicoseconds = now.picoseconds;
106
106
  property.$dataValue.statusCode = StatusCodes.Good;
107
- // if (property.minimumSamplingInterval === 0) {
108
107
  if (property.listenerCount("value_changed") > 0) {
109
- const clonedDataValue = property.readValue();
110
- property.emit("value_changed", clonedDataValue);
108
+ property.emit("value_changed", property.$dataValue.clone());
111
109
  }
112
- // }
113
110
  }
114
111
 
115
112
  export function propagateTouchValueUpward(self: UAVariableImpl, now: PreciseClock, cache?: Set<UAVariable>): void {
@@ -346,6 +343,7 @@ function _installFields2(uaVariable: UAVariableImpl, { get, set }: {
346
343
  const sourceTime = coerceClock(dataValue.sourceTimestamp, dataValue.sourcePicoseconds);
347
344
  const value = dataValue.value.value;
348
345
  set(field.name!, value, sourceTime);
346
+ propertyNode.touchValue(sourceTime);
349
347
  }
350
348
 
351
349
  if (propertyNode.dataTypeObj.basicDataType === DataType.ExtensionObject) {
@@ -396,9 +394,10 @@ function isVariableContainingExtensionObject(uaVariable: UAVariableImpl): boolea
396
394
  }
397
395
 
398
396
  function _innerBindExtensionObjectScalar(uaVariable: UAVariableImpl,
399
- { get, set }: {
397
+ { get, set, setField }: {
400
398
  get: () => ExtensionObject;
401
399
  set: (value: ExtensionObject, sourceTimestamp: PreciseClock, cache: Set<UAVariableImpl>) => void;
400
+ setField: (fieldName: string, value: any, sourceTimestamp: PreciseClock, cache?: Set<UAVariableImpl>) => void;
402
401
  },
403
402
  options?: BindExtensionObjectOptions
404
403
  ) {
@@ -420,10 +419,7 @@ function _innerBindExtensionObjectScalar(uaVariable: UAVariableImpl,
420
419
  return extObj[lowerFirstLetter(fieldName)];
421
420
  },
422
421
  set: (fieldName: string, value: any, sourceTime: PreciseClock) => {
423
- const extObj = get() as any;
424
- extObj[lowerFirstLetter(fieldName)] = value;
425
- //1 propagateTouchValueDownward(uaVariable, sourceTime);
426
- //1 propagateTouchValueUpward(uaVariable, sourceTime);
422
+ setField(fieldName, value, sourceTime);
427
423
  }
428
424
  }, options);
429
425
 
@@ -497,7 +493,7 @@ export function _bindExtensionObject(
497
493
  "bindExtensionObject: $extensionObject is incorrect: we are expecting a " +
498
494
  uaVariable.dataType.toString({ addressSpace: uaVariable.addressSpace }) +
499
495
  " but we got a " +
500
- uaVariable.$extensionObject?.constructor.name
496
+ uaVariable.$extensionObject?.schema.name
501
497
  );
502
498
  }
503
499
  return uaVariable.$extensionObject;
@@ -530,7 +526,12 @@ export function _bindExtensionObject(
530
526
  _innerBindExtensionObjectScalar(uaVariable,
531
527
  {
532
528
  get: () => uaVariable.$extensionObject,
533
- set: (value: ExtensionObject) => installExt(uaVariable, value)
529
+ set: (value: ExtensionObject) => installExt(uaVariable, value),
530
+ setField: (fieldName: string, value: any) => {
531
+ const extObj = uaVariable.$extensionObject;
532
+ getProxyTarget(extObj)[lowerFirstLetter(fieldName)] = value;
533
+ }
534
+
534
535
  }, options);
535
536
  return;
536
537
  } else if (uaVariable.valueRank === 1 /** Array */) {
@@ -546,7 +547,11 @@ export function _bindExtensionObject(
546
547
  _innerBindExtensionObjectScalar(uaVariable,
547
548
  {
548
549
  get: () => uaVariable.$extensionObject,
549
- set: (value: ExtensionObject) => installExt(uaVariable, value)
550
+ set: (value: ExtensionObject) => installExt(uaVariable, value),
551
+ setField: (fieldName: string, value: any) => {
552
+ const extObj = uaVariable.$extensionObject;
553
+ getProxyTarget(extObj)[lowerFirstLetter(fieldName)] = value;
554
+ }
550
555
  }, options);
551
556
  }
552
557
  }
@@ -575,7 +580,7 @@ export function _bindExtensionObjectArrayOrMatrix(
575
580
  options?: BindExtensionObjectOptions
576
581
  ): ExtensionObject[] {
577
582
 
578
- options = options || { createMissingProp: false};
583
+ options = options || { createMissingProp: false };
579
584
  options.createMissingProp = options.createMissingProp || false;
580
585
 
581
586
  // istanbul ignore next
@@ -592,7 +597,7 @@ export function _bindExtensionObjectArrayOrMatrix(
592
597
  assert(Array.isArray(uaVariable.$dataValue.value.value));
593
598
  optionalExtensionObjectArray = uaVariable.$dataValue.value.value;
594
599
  }
595
-
600
+
596
601
  if ((arrayDimensions.length === 0 || arrayDimensions.length === 1 && arrayDimensions[0] === 0) && optionalExtensionObjectArray) {
597
602
  arrayDimensions[0] = optionalExtensionObjectArray.length;
598
603
  }
@@ -652,7 +657,7 @@ export function _bindExtensionObjectArrayOrMatrix(
652
657
  if (!options.createMissingProp) {
653
658
  continue;
654
659
  }
655
-
660
+
656
661
  uaElement = namespace.addVariable({
657
662
  browseName,
658
663
  nodeId,
@@ -678,7 +683,6 @@ export function _bindExtensionObjectArrayOrMatrix(
678
683
  {
679
684
  get: () => uaVariable.$$extensionObjectArray[capturedIndex],
680
685
  set: (newValue: ExtensionObject, sourceTimestamp: PreciseClock, cache: Set<UAVariableImpl>) => {
681
-
682
686
  assert(!isProxy(uaVariable.$$extensionObjectArray[capturedIndex]));
683
687
  uaVariable.$$extensionObjectArray[capturedIndex] = newValue;
684
688
  if (uaVariable.$$extensionObjectArray !== uaVariable.$dataValue.value.value) {
@@ -687,6 +691,12 @@ export function _bindExtensionObjectArrayOrMatrix(
687
691
  }
688
692
  propagateTouchValueDownward(capturedUaElement, sourceTimestamp, cache);
689
693
  propagateTouchValueUpward(capturedUaElement, sourceTimestamp, cache);
694
+ },
695
+ setField: (fieldName: string, newValue: any, sourceTimestamp: PreciseClock, cache?: Set<UAVariableImpl>) => {
696
+ // istanbul ignore next doDebug && debugLog("setField", fieldName, newValue, sourceTimestamp, cache);
697
+ const extObj = uaVariable.$$extensionObjectArray[capturedIndex];
698
+ (isProxy(extObj) ? getProxyTarget(extObj) : extObj)[lowerFirstLetter(fieldName)] = newValue;
699
+ propagateTouchValueUpward(capturedUaElement, sourceTimestamp, cache);
690
700
  }
691
701
  }, { ...options, force: true });
692
702