node-opcua-address-space 2.118.0 → 2.119.2

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/helpers/coerce_enum_value.js +1 -1
  2. package/dist/source/helpers/coerce_enum_value.js.map +1 -1
  3. package/dist/source/index.d.ts +1 -0
  4. package/dist/source/index.js +5 -2
  5. package/dist/source/index.js.map +1 -1
  6. package/dist/source/interfaces/alarms_and_conditions/condition_info_i.d.ts +2 -0
  7. package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +14 -6
  8. package/dist/source/interfaces/alarms_and_conditions/ua_condition_ex.d.ts +3 -2
  9. package/dist/source/interfaces/data_access/ua_multistate_discrete_ex.d.ts +26 -3
  10. package/dist/source/interfaces/data_access/ua_multistate_value_discrete_ex.d.ts +2 -1
  11. package/dist/source/interfaces/data_access/ua_two_state_discrete_ex.d.ts +2 -1
  12. package/dist/source/interfaces/i_condition_variable_type_setter_options.d.ts +3 -0
  13. package/dist/source/interfaces/i_condition_variable_type_setter_options.js +3 -0
  14. package/dist/source/interfaces/i_condition_variable_type_setter_options.js.map +1 -0
  15. package/dist/source/interfaces/i_set_state_options.d.ts +4 -0
  16. package/dist/source/interfaces/i_set_state_options.js +3 -0
  17. package/dist/source/interfaces/i_set_state_options.js.map +1 -0
  18. package/dist/source/ua_two_state_variable_ex.d.ts +2 -1
  19. package/dist/src/alarms_and_conditions/condition.d.ts +2 -1
  20. package/dist/src/alarms_and_conditions/condition.js +2 -2
  21. package/dist/src/alarms_and_conditions/condition.js.map +1 -1
  22. package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +20 -11
  23. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +72 -33
  24. package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
  25. package/dist/src/alarms_and_conditions/ua_condition_impl.d.ts +3 -2
  26. package/dist/src/alarms_and_conditions/ua_condition_impl.js +13 -26
  27. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  28. package/dist/src/data_access/ua_multistate_discrete_impl.d.ts +3 -2
  29. package/dist/src/data_access/ua_multistate_discrete_impl.js +2 -2
  30. package/dist/src/data_access/ua_multistate_discrete_impl.js.map +1 -1
  31. package/dist/src/data_access/ua_multistate_value_discrete_impl.d.ts +8 -5
  32. package/dist/src/data_access/ua_multistate_value_discrete_impl.js +91 -50
  33. package/dist/src/data_access/ua_multistate_value_discrete_impl.js.map +1 -1
  34. package/dist/src/data_access/ua_two_state_discrete_impl.d.ts +2 -1
  35. package/dist/src/data_access/ua_two_state_discrete_impl.js +3 -3
  36. package/dist/src/data_access/ua_two_state_discrete_impl.js.map +1 -1
  37. package/dist/src/get_basic_datatype.d.ts +4 -1
  38. package/dist/src/get_basic_datatype.js +12 -7
  39. package/dist/src/get_basic_datatype.js.map +1 -1
  40. package/dist/src/nodeset_tools/construct_namespace_dependency.js +1 -1
  41. package/dist/src/nodeset_tools/construct_namespace_dependency.js.map +1 -1
  42. package/dist/src/state_machine/ua_two_state_variable.d.ts +2 -1
  43. package/dist/src/state_machine/ua_two_state_variable.js +10 -8
  44. package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
  45. package/dist/tsconfig_common.tsbuildinfo +1 -1
  46. package/package.json +27 -27
  47. package/source/helpers/coerce_enum_value.ts +2 -2
  48. package/source/index.ts +2 -0
  49. package/source/interfaces/alarms_and_conditions/condition_info_i.ts +4 -0
  50. package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +13 -8
  51. package/source/interfaces/alarms_and_conditions/ua_condition_ex.ts +4 -2
  52. package/source/interfaces/data_access/ua_multistate_discrete_ex.ts +39 -3
  53. package/source/interfaces/data_access/ua_multistate_value_discrete_ex.ts +2 -1
  54. package/source/interfaces/data_access/ua_two_state_discrete_ex.ts +2 -1
  55. package/source/interfaces/i_condition_variable_type_setter_options.ts +5 -0
  56. package/source/interfaces/i_set_state_options.ts +4 -0
  57. package/source/ua_two_state_variable_ex.ts +2 -1
  58. package/src/alarms_and_conditions/condition.ts +4 -2
  59. package/src/alarms_and_conditions/condition_snapshot_impl.ts +75 -38
  60. package/src/alarms_and_conditions/ua_condition_impl.ts +14 -27
  61. package/src/data_access/ua_multistate_discrete_impl.ts +5 -3
  62. package/src/data_access/ua_multistate_value_discrete_impl.ts +109 -55
  63. package/src/data_access/ua_two_state_discrete_impl.ts +5 -3
  64. package/src/get_basic_datatype.ts +16 -7
  65. package/src/nodeset_tools/construct_namespace_dependency.ts +1 -1
  66. package/src/state_machine/ua_two_state_variable.ts +14 -8
@@ -16,7 +16,7 @@ function coerceEnumValues(enumValues) {
16
16
  (0, node_opcua_assert_1.assert)(Object.prototype.hasOwnProperty.call(en, "displayName"));
17
17
  return new node_opcua_types_1.EnumValueType({
18
18
  displayName: (0, node_opcua_data_model_1.coerceLocalizedText)(en.displayName),
19
- value: (0, node_opcua_basic_types_1.coerceInt64)(en.value)
19
+ value: (0, node_opcua_basic_types_1.coerceInt64)(en.value || 0)
20
20
  });
21
21
  });
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"coerce_enum_value.js","sourceRoot":"","sources":["../../../source/helpers/coerce_enum_value.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAC3C,mEAA4D;AAC5D,iEAA4D;AAC5D,uDAAiD;AAGjD,SAAgB,gBAAgB,CAAC,UAA0E;IACvG,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC3B,EAAE;QACF,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,EAAO,EAAE,EAAE;YAC9B,IAAA,0BAAM,EAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;YAC1D,IAAA,0BAAM,EAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC;YAChE,OAAO,IAAI,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B,EAAC,EAAE,CAAC,WAAW,CAAC;gBAChD,KAAK,EAAE,IAAA,oCAAW,EAAC,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC;aACpC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;KACN;SAAM;QACH,OAAO,gBAAgB,CACnB,MAAM,CAAC,OAAO,CAAC,UAAsC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAsB,EAAE,EAAE;YAClF,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC;YAC3B,OAAO,IAAI,gCAAa,CAAC;gBACrB,WAAW,EAAE,IAAA,2CAAmB,EAAC,GAAG,CAAC;gBACrC,WAAW,EAAE,IAAA,2CAAmB,EAAC,GAAG,CAAC;gBACrC,KAAK,EAAE,IAAA,oCAAW,EAAC,KAAK,CAAC;aAC5B,CAAC,CAAC;QACP,CAAC,CAAC,CACL,CAAC;KACL;AACL,CAAC;AAvBD,4CAuBC"}
@@ -34,6 +34,7 @@ export * from "./interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_e
34
34
  export { promoteToMultiStateDiscrete } from "../src/data_access/ua_multistate_discrete_impl";
35
35
  export { promoteToMultiStateValueDiscrete } from "../src/data_access/ua_multistate_value_discrete_impl";
36
36
  export { promoteToTwoStateDiscrete } from "../src/data_access/ua_two_state_discrete_impl";
37
+ export { validateIsNumericDataType } from "../src/data_access/ua_multistate_value_discrete_impl";
37
38
  export { validateDataType } from "../src/data_access/ua_multistate_value_discrete_impl";
38
39
  export { validateDataTypeCorrectness } from "../src/validate_data_type_correctness";
39
40
  export * from "./ua_root_folder";
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.NodeIdManager = exports.instantiateCertificateExpirationAlarm = exports.ensureDatatypeExtractedWithCallback = exports.ensureDatatypeExtracted = exports.ContinuationPointManager = exports.resolveOpaqueOnAddressSpace = exports.adjustBrowseDirection = exports.validateDataTypeCorrectness = exports.validateDataType = exports.promoteToTwoStateDiscrete = exports.promoteToMultiStateValueDiscrete = exports.promoteToMultiStateDiscrete = void 0;
17
+ exports.NodeIdManager = exports.instantiateCertificateExpirationAlarm = exports.ensureDatatypeExtractedWithCallback = exports.ensureDatatypeExtracted = exports.ContinuationPointManager = exports.resolveOpaqueOnAddressSpace = exports.adjustBrowseDirection = exports.validateDataTypeCorrectness = exports.validateDataType = exports.validateIsNumericDataType = exports.promoteToTwoStateDiscrete = exports.promoteToMultiStateValueDiscrete = exports.promoteToMultiStateDiscrete = void 0;
18
18
  /**
19
19
  * @module node-opcua-address-space
20
20
  */
@@ -55,7 +55,10 @@ Object.defineProperty(exports, "promoteToMultiStateValueDiscrete", { enumerable:
55
55
  var ua_two_state_discrete_impl_1 = require("../src/data_access/ua_two_state_discrete_impl");
56
56
  Object.defineProperty(exports, "promoteToTwoStateDiscrete", { enumerable: true, get: function () { return ua_two_state_discrete_impl_1.promoteToTwoStateDiscrete; } });
57
57
  var ua_multistate_value_discrete_impl_2 = require("../src/data_access/ua_multistate_value_discrete_impl");
58
- Object.defineProperty(exports, "validateDataType", { enumerable: true, get: function () { return ua_multistate_value_discrete_impl_2.validateDataType; } });
58
+ Object.defineProperty(exports, "validateIsNumericDataType", { enumerable: true, get: function () { return ua_multistate_value_discrete_impl_2.validateIsNumericDataType; } });
59
+ // deprecated: validateDataType
60
+ var ua_multistate_value_discrete_impl_3 = require("../src/data_access/ua_multistate_value_discrete_impl");
61
+ Object.defineProperty(exports, "validateDataType", { enumerable: true, get: function () { return ua_multistate_value_discrete_impl_3.validateDataType; } });
59
62
  var validate_data_type_correctness_1 = require("../src/validate_data_type_correctness");
60
63
  Object.defineProperty(exports, "validateDataTypeCorrectness", { enumerable: true, get: function () { return validate_data_type_correctness_1.validateDataTypeCorrectness; } });
61
64
  __exportStar(require("./ua_root_folder"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qDAAmC;AAEnC,mFAAiE;AACjE,sGAAoF;AACpF,0FAAwE;AACxE,2FAAyE;AACzE,yFAAuE;AAEvE,8EAA4D;AAE5D,uFAAqE;AAErE,qFAAmE;AACnE,2FAAyE;AACzE,oFAAkE;AAClE,8EAA4D;AAC5D,4EAA0D;AAE1D,sFAAoE;AACpE,wFAAsE;AACtE,yGAAuF;AACvF,mGAAiF;AACjF,+GAA6F;AAC7F,qGAAmF;AACnF,0GAAwF;AACxF,qGAAmF;AACnF,2FAAyE;AACzE,wGAAsF;AACtF,qFAAmE;AACnE,0FAAwE;AACxE,qGAAmF;AACnF,iGAA+E;AAC/E,uFAAqE;AACrE,yGAAuF;AACvF,qGAAmF;AAEnF,8FAA6F;AAApF,0IAAA,2BAA2B,OAAA;AACpC,0GAAwG;AAA/F,qJAAA,gCAAgC,OAAA;AACzC,4FAA0F;AAAjF,uIAAA,yBAAyB,OAAA;AAClC,0GAAwF;AAA/E,qIAAA,gBAAgB,OAAA;AACzB,wFAAqF;AAA5E,6IAAA,2BAA2B,OAAA;AACpC,mDAAiC;AACjC,oDAAkC;AAClC,mDAAiC;AAEjC,uDAAqC;AACrC,+DAA6C;AAC7C,0DAAwC;AACxC,yDAAuC;AACvC,iEAA+C;AAC/C,6EAA0E;AAAjE,gIAAA,qBAAqB,OAAA;AAC9B,6FAAwF;AAA/E,8IAAA,2BAA2B,OAAA;AAEpC,+FAA4F;AAAnF,sIAAA,wBAAwB,OAAA;AACjC,gFAAkH;AAAzG,oIAAA,uBAAuB,OAAA;AAAE,gJAAA,mCAAmC,OAAA;AAErE,mEAAiD;AACjD,kEAAgD;AAEhD,8CAA4B;AAC5B,0DAAwC;AACxC,2DAAyC;AAEzC,0HAA0H;AAAjH,6JAAA,qCAAqC,OAAA;AAE9C,wDA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C,OAAA;AAErE,mEAAiD;AACjD,kEAAgD;AAEhD,8CAA4B;AAC5B,0DAAwC;AACxC,2DAAyC;AAEzC,0HAA0H;AAAjH,6JAAA,qCAAqC,OAAA;AAE9C,wDAA8E;AAArE,+GAAA,aAAa,OAAA;AACtB,oDAAkC;AAClC,4DAA0C;AAE1C,gEAA8C;AAC9C,wDAAsC;AACtC,sFAAoE"}
@@ -9,6 +9,8 @@ export interface ConditionInfoOptions {
9
9
  quality?: StatusCode | null;
10
10
  severity?: UInt16 | null;
11
11
  retain?: boolean | null;
12
+ time?: Date | null;
13
+ receiveTime?: Date | null;
12
14
  }
13
15
  export interface ConditionInfo {
14
16
  message: LocalizedText | null;
@@ -12,10 +12,18 @@ import { NodeId } from "node-opcua-nodeid";
12
12
  import { StatusCode } from "node-opcua-status-code";
13
13
  import { TimeZoneDataType } from "node-opcua-types";
14
14
  import { UtcTime } from "../state_machine/ua_state_machine_type";
15
+ import { ISetStateOptions } from "../i_set_state_options";
16
+ import { IConditionVariableTypeSetterOptions } from "../i_condition_variable_type_setter_options";
15
17
  export interface ConditionSnapshot {
16
- on(eventName: "value_changed", eventHandler: (node: UAVariable, variant: Variant) => void): this;
18
+ on(eventName: "valueChanged", eventHandler: (node: UAVariable, variant: Variant, options: {
19
+ sourceTimestamp: Date;
20
+ }) => void): this;
17
21
  }
18
22
  export interface ConditionSnapshot extends EventEmitter {
23
+ emit(eventName: "valueChanged", node: UAVariable, variant: Variant, options: {
24
+ sourceTimestamp: Date;
25
+ }): boolean;
26
+ emit(eventName: string | symbol): boolean;
19
27
  condition: BaseNode;
20
28
  eventData: IEventData | null;
21
29
  branchId: NodeId | null;
@@ -55,7 +63,7 @@ export interface ConditionSnapshot extends EventEmitter {
55
63
  * @param value {Boolean}
56
64
  * @return void
57
65
  */
58
- setEnabledState(value: boolean): void;
66
+ setEnabledState(value: boolean, options?: ISetStateOptions): void;
59
67
  /**
60
68
  * @method getEnabledStateAsString
61
69
  * @return {String}
@@ -78,7 +86,7 @@ export interface ConditionSnapshot extends EventEmitter {
78
86
  * @method setComment
79
87
  * @param txtMessage {LocalizedText}
80
88
  */
81
- setComment(txtMessage: LocalizedTextLike): void;
89
+ setComment(txtMessage: LocalizedTextLike, options?: IConditionVariableTypeSetterOptions): void;
82
90
  /**
83
91
  *
84
92
  * @method setMessage
@@ -95,7 +103,7 @@ export interface ConditionSnapshot extends EventEmitter {
95
103
  * @method setQuality
96
104
  * @param quality {StatusCode}
97
105
  */
98
- setQuality(quality: StatusCode): void;
106
+ setQuality(quality: StatusCode, options?: IConditionVariableTypeSetterOptions): void;
99
107
  /**
100
108
  * @method getQuality
101
109
  * @return {StatusCode}
@@ -105,7 +113,7 @@ export interface ConditionSnapshot extends EventEmitter {
105
113
  * @method setSeverity
106
114
  * @param severity {UInt16}
107
115
  */
108
- setSeverity(severity: UInt16): void;
116
+ setSeverity(severity: UInt16, options?: IConditionVariableTypeSetterOptions): void;
109
117
  /**
110
118
  * @method getSeverity
111
119
  * @return {UInt16}
@@ -115,7 +123,7 @@ export interface ConditionSnapshot extends EventEmitter {
115
123
  * @method setLastSeverity
116
124
  * @param severity {UInt16}
117
125
  */
118
- setLastSeverity(severity: UInt16): void;
126
+ setLastSeverity(severity: UInt16, options?: IConditionVariableTypeSetterOptions): void;
119
127
  /**
120
128
  * @method getLastSeverity
121
129
  * @return {UInt16}
@@ -5,10 +5,11 @@ import { NodeId } from "node-opcua-nodeid";
5
5
  import { UACondition_Base } from "node-opcua-nodeset-ua";
6
6
  import { StatusCode } from "node-opcua-status-code";
7
7
  import { TimeZoneDataType } from "node-opcua-types";
8
+ import { DataType } from "node-opcua-basic-types";
9
+ import { ISetStateOptions } from "../i_set_state_options";
8
10
  import { UATwoStateVariableEx } from "../../ua_two_state_variable_ex";
9
11
  import { ConditionInfoOptions } from "./condition_info_i";
10
12
  import { ConditionSnapshot } from "./condition_snapshot";
11
- import { DataType } from "node-opcua-basic-types";
12
13
  export interface UABaseEventHelper {
13
14
  setSourceName(name: string): void;
14
15
  setSourceNode(node: NodeId | BaseNode): void;
@@ -27,7 +28,7 @@ export interface UAConditionHelper extends UABaseEventHelper {
27
28
  deleteBranch(branch: ConditionSnapshot): void;
28
29
  getEnabledState(): boolean;
29
30
  getEnabledStateAsString(): string;
30
- setEnabledState(requestedEnabledState: boolean): StatusCode;
31
+ setEnabledState(requestedEnabledState: boolean, options?: ISetStateOptions): StatusCode;
31
32
  setReceiveTime(time: Date): void;
32
33
  setLocalTime(time: TimeZoneDataType): void;
33
34
  setTime(time: Date): void;
@@ -9,13 +9,36 @@ import { DataType, Variant } from "node-opcua-variant";
9
9
  * @module node-opcua-address-space.DataAccess
10
10
  */
11
11
  import { StatusCode } from "node-opcua-status-code";
12
- import { UAMultiStateDiscrete_Base } from "node-opcua-nodeset-ua";
13
- import { UAVariableT } from "node-opcua-address-space-base";
12
+ import { DTEnumValue, UADiscreteItem, UADiscreteItem_Base, UAMultiStateDiscrete_Base } from "node-opcua-nodeset-ua";
13
+ import { UAProperty, UAVariableT } from "node-opcua-address-space-base";
14
+ import { Int64, UInt64 } from "node-opcua-basic-types";
15
+ import { LocalizedText } from "node-opcua-data-model";
16
+ import { ISetStateOptions } from "../i_set_state_options";
14
17
  export { UAMultiStateDiscrete } from "node-opcua-nodeset-ua";
15
18
  export interface UAMultiStateDiscreteEx<T, DT extends DataType> extends UAVariableT<T, DT>, UAMultiStateDiscrete_Base<T, DT> {
16
19
  getValue(): number;
17
20
  getValueAsString(): string;
18
21
  getIndex(value: string): number;
19
- setValue(value: string | number): void;
22
+ setValue(value: string | number, options?: ISetStateOptions): void;
20
23
  checkVariantCompatibility(value: Variant): StatusCode;
21
24
  }
25
+ export interface UAMultiStateValueDiscreteArray_Base<T, DT extends DataType> extends UADiscreteItem_Base<T, DT> {
26
+ enumValues: UAProperty<DTEnumValue[], DataType.ExtensionObject>;
27
+ valueAsText: UAProperty<LocalizedText[], DataType.LocalizedText>;
28
+ }
29
+ export interface UAMultiStateValueDiscreteArray<T, DT extends DataType> extends UADiscreteItem<T, DT>, UAMultiStateValueDiscreteArray_Base<T, DT> {
30
+ }
31
+ export interface UAMultiStateValueDiscreteArrayEx<T, DT extends DataType> extends UAVariableT<T, DT>, UAMultiStateValueDiscreteArray_Base<T, DT> {
32
+ /**
33
+ * EnumValues is an array of EnumValueType. Each entry of the array represents one enumeration
34
+ * value with its integer notation, a human-readable representation, and help information.
35
+ * This represents enumerations with integers that are not zero-based or have gaps (e.g. 1, 2, 4, 8, 16).
36
+ * See OPC 10000-3 for the definition of this type. MultiStateValueDiscrete Variables expose the
37
+ * current integer notation in their Value Attribute. Clients will often read the EnumValues
38
+ * Property in advance and cache it to lookup a name or help whenever they receive the numeric representation.
39
+ */
40
+ getValueAsString(): string[];
41
+ getValueAsNumber(): number[];
42
+ setValue(value: string | number | Int64, options?: ISetStateOptions): void;
43
+ findValueAsText(value: number | UInt64): Variant;
44
+ }
@@ -5,6 +5,7 @@ import { DataType, Variant } from "node-opcua-variant";
5
5
  import { Int64, UInt64 } from "node-opcua-basic-types";
6
6
  import { UAMultiStateValueDiscrete_Base } from "node-opcua-nodeset-ua";
7
7
  import { UAVariableT } from "node-opcua-address-space-base";
8
+ import { ISetStateOptions } from "../i_set_state_options";
8
9
  /**
9
10
  * @see https://reference.opcfoundation.org/v104/Core/docs/Part8/5.3.3/#5.3.3.4
10
11
  */
@@ -19,6 +20,6 @@ export interface UAMultiStateValueDiscreteEx<T, DT extends DataType> extends UAV
19
20
  */
20
21
  getValueAsString(): string;
21
22
  getValueAsNumber(): number;
22
- setValue(value: string | number | Int64): void;
23
+ setValue(value: string | number | Int64, options?: ISetStateOptions): void;
23
24
  findValueAsText(value: number | UInt64): Variant;
24
25
  }
@@ -2,11 +2,12 @@ import { LocalizedTextLike } from "node-opcua-data-model";
2
2
  import { DataType } from "node-opcua-variant";
3
3
  import { UAVariableT } from "node-opcua-address-space-base";
4
4
  import { UATwoStateDiscrete_Base } from "node-opcua-nodeset-ua";
5
+ import { ISetStateOptions } from "../i_set_state_options";
5
6
  /**
6
7
  * @see https://reference.opcfoundation.org/v104/Core/VariableTypes/TwoStateDiscreteType/
7
8
  */
8
9
  export interface UATwoStateDiscreteEx extends UAVariableT<boolean, DataType.Boolean>, UATwoStateDiscrete_Base<boolean> {
9
10
  getValue(): boolean;
10
11
  getValueAsString(): string;
11
- setValue(value: boolean | LocalizedTextLike): void;
12
+ setValue(value: boolean | LocalizedTextLike, options?: ISetStateOptions): void;
12
13
  }
@@ -0,0 +1,3 @@
1
+ export interface IConditionVariableTypeSetterOptions {
2
+ sourceTimestamp?: Date;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=i_condition_variable_type_setter_options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i_condition_variable_type_setter_options.js","sourceRoot":"","sources":["../../../source/interfaces/i_condition_variable_type_setter_options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export interface ISetStateOptions {
2
+ transitionTime?: Date;
3
+ effectiveTransitionTime?: Date;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=i_set_state_options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i_set_state_options.js","sourceRoot":"","sources":["../../../source/interfaces/i_set_state_options.ts"],"names":[],"mappings":""}
@@ -5,6 +5,7 @@ import { UAVariableT } from "node-opcua-address-space-base";
5
5
  import { LocalizedText } from "node-opcua-data-model";
6
6
  import { UAStateVariable, UATwoStateVariable_Base } from "node-opcua-nodeset-ua";
7
7
  import { DataType } from "node-opcua-variant";
8
+ import { ISetStateOptions } from "./interfaces/i_set_state_options";
8
9
  /**
9
10
  * @see https://reference.opcfoundation.org/v104/Core/docs/Part9/5.2/
10
11
  * @see https://reference.opcfoundation.org/v104/Core/VariableTypes/TwoStateVariableType/
@@ -13,7 +14,7 @@ import { DataType } from "node-opcua-variant";
13
14
  export interface UATwoStateVariableHelper {
14
15
  readonly isFalseSubStateOf: UAStateVariable<LocalizedText> | null;
15
16
  readonly isTrueSubStateOf: UAStateVariable<LocalizedText> | null;
16
- setValue(boolValue: boolean): void;
17
+ setValue(boolValue: boolean, options?: ISetStateOptions): void;
17
18
  getValue(): boolean;
18
19
  getValueAsString(): string;
19
20
  getFalseSubStates(): UAStateVariable<LocalizedText>[];
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
3
3
  import { StatusCode } from "node-opcua-status-code";
4
+ import { ISetStateOptions } from "../../source/interfaces/i_set_state_options";
4
5
  import { ConditionSnapshotImpl } from "./condition_snapshot_impl";
5
- export declare function _setAckedState(self: ConditionSnapshotImpl, requestedAckedState: boolean, conditionEventId?: Buffer, comment?: string | LocalizedText | LocalizedTextLike): StatusCode;
6
+ export declare function _setAckedState(self: ConditionSnapshotImpl, requestedAckedState: boolean, conditionEventId?: Buffer, comment?: string | LocalizedText | LocalizedTextLike, options?: ISetStateOptions): StatusCode;
@@ -9,13 +9,13 @@ const node_opcua_assert_1 = require("node-opcua-assert");
9
9
  const node_opcua_basic_types_1 = require("node-opcua-basic-types");
10
10
  const node_opcua_status_code_1 = require("node-opcua-status-code");
11
11
  const condition_snapshot_impl_1 = require("./condition_snapshot_impl");
12
- function _setAckedState(self, requestedAckedState, conditionEventId, comment) {
12
+ function _setAckedState(self, requestedAckedState, conditionEventId, comment, options) {
13
13
  (0, node_opcua_assert_1.assert)(self instanceof condition_snapshot_impl_1.ConditionSnapshotImpl);
14
14
  const ackedState = self.getAckedState();
15
15
  if (ackedState && requestedAckedState) {
16
16
  return node_opcua_status_code_1.StatusCodes.BadConditionBranchAlreadyAcked;
17
17
  }
18
- self._set_twoStateVariable("AckedState", requestedAckedState);
18
+ self._set_twoStateVariable("AckedState", requestedAckedState, options);
19
19
  return node_opcua_status_code_1.StatusCodes.Good;
20
20
  }
21
21
  exports._setAckedState = _setAckedState;
@@ -1 +1 @@
1
- {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../src/alarms_and_conditions/condition.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC5B,yDAA2C;AAE3C,mEAAiD;AACjD,mEAAiE;AACjE,uEAAkE;AAElE,SAAgB,cAAc,CAC1B,IAA2B,EAC3B,mBAA4B,EAC5B,gBAAyB,EACzB,OAAoD;IAEpD,IAAA,0BAAM,EAAC,IAAI,YAAY,+CAAqB,CAAC,CAAC;IAE9C,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IAExC,IAAI,UAAU,IAAI,mBAAmB,EAAE;QACnC,OAAO,oCAAW,CAAC,8BAA8B,CAAC;KACrD;IACD,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC;IAC9D,OAAO,oCAAW,CAAC,IAAI,CAAC;AAC5B,CAAC;AAfD,wCAeC;AAED,sCAAsC;AACtC,SAAS,YAAY,CAAC,eAAuC;IACzD,IAAI,CAAC,eAAe,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;QAC5C,OAAO,gCAAO,CAAC;KAClB;IACD,IAAA,0BAAM,EAAC,eAAe,CAAC,KAAK,YAAY,IAAI,CAAC,CAAC;IAC9C,OAAO,eAAe,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG"}
1
+ {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../src/alarms_and_conditions/condition.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC5B,yDAA2C;AAE3C,mEAAiD;AACjD,mEAAiE;AAEjE,uEAAkE;AAElE,SAAgB,cAAc,CAC1B,IAA2B,EAC3B,mBAA4B,EAC5B,gBAAyB,EACzB,OAAoD,EACpD,OAA0B;IAE1B,IAAA,0BAAM,EAAC,IAAI,YAAY,+CAAqB,CAAC,CAAC;IAE9C,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IAExC,IAAI,UAAU,IAAI,mBAAmB,EAAE;QACnC,OAAO,oCAAW,CAAC,8BAA8B,CAAC;KACrD;IACD,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACvE,OAAO,oCAAW,CAAC,IAAI,CAAC;AAC5B,CAAC;AAhBD,wCAgBC;AAED,sCAAsC;AACtC,SAAS,YAAY,CAAC,eAAuC;IACzD,IAAI,CAAC,eAAe,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;QAC5C,OAAO,gCAAO,CAAC;KAClB;IACD,IAAA,0BAAM,EAAC,eAAe,CAAC,KAAK,YAAY,IAAI,CAAC,CAAC;IAC9C,OAAO,eAAe,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG"}
@@ -12,7 +12,9 @@ import { StatusCode } from "node-opcua-status-code";
12
12
  import { TimeZoneDataType } from "node-opcua-types";
13
13
  import { DataType } from "node-opcua-variant";
14
14
  import { ConditionSnapshot } from "../../source/interfaces/alarms_and_conditions/condition_snapshot";
15
+ import { IConditionVariableTypeSetterOptions } from "../../source/interfaces/i_condition_variable_type_setter_options";
15
16
  import { UtcTime } from "../../source/interfaces/state_machine/ua_state_machine_type";
17
+ import { ISetStateOptions } from "../../source/interfaces/i_set_state_options";
16
18
  declare function normalizeName(str: string): string;
17
19
  export declare class ConditionSnapshotImpl extends EventEmitter implements ConditionSnapshot {
18
20
  static normalizeName: typeof normalizeName;
@@ -31,7 +33,7 @@ export declare class ConditionSnapshotImpl extends EventEmitter implements Condi
31
33
  constructor(condition: BaseNode, branchId: NodeId);
32
34
  _constructEventData(): IEventData;
33
35
  _get_var(varName: string): any;
34
- _set_var(varName: string, dataType: DataType, value: unknown): void;
36
+ _set_var(varName: string, dataType: DataType, value: unknown, options?: IConditionVariableTypeSetterOptions): void;
35
37
  /**
36
38
  * @method getBrandId
37
39
  * @return {NodeId}
@@ -68,7 +70,7 @@ export declare class ConditionSnapshotImpl extends EventEmitter implements Condi
68
70
  * @param value {Boolean}
69
71
  * @return void
70
72
  */
71
- setEnabledState(value: boolean): void;
73
+ setEnabledState(value: boolean, options?: ISetStateOptions): void;
72
74
  /**
73
75
  * @method getEnabledStateAsString
74
76
  * @return {String}
@@ -91,7 +93,7 @@ export declare class ConditionSnapshotImpl extends EventEmitter implements Condi
91
93
  * @method setComment
92
94
  * @param txtMessage {LocalizedText}
93
95
  */
94
- setComment(txtMessage: LocalizedTextLike): void;
96
+ setComment(txtMessage: LocalizedTextLike, options?: IConditionVariableTypeSetterOptions): void;
95
97
  /**
96
98
  *
97
99
  * @method setMessage
@@ -108,7 +110,7 @@ export declare class ConditionSnapshotImpl extends EventEmitter implements Condi
108
110
  * @method setQuality
109
111
  * @param quality {StatusCode}
110
112
  */
111
- setQuality(quality: StatusCode): void;
113
+ setQuality(quality: StatusCode, options?: IConditionVariableTypeSetterOptions): void;
112
114
  /**
113
115
  * @method getQuality
114
116
  * @return {StatusCode}
@@ -118,17 +120,18 @@ export declare class ConditionSnapshotImpl extends EventEmitter implements Condi
118
120
  * @method setSeverity
119
121
  * @param severity {UInt16}
120
122
  */
121
- setSeverity(severity: UInt16): void;
123
+ setSeverity(severity: UInt16, options?: IConditionVariableTypeSetterOptions): void;
122
124
  /**
123
125
  * @method getSeverity
124
126
  * @return {UInt16}
125
127
  */
126
128
  getSeverity(): UInt16;
129
+ getSeveritySourceTimestamp(): Date;
127
130
  /**
128
131
  * @method setLastSeverity
129
132
  * @param severity {UInt16}
130
133
  */
131
- setLastSeverity(severity: UInt16): void;
134
+ setLastSeverity(severity: UInt16, options?: IConditionVariableTypeSetterOptions): void;
132
135
  /**
133
136
  * @method getLastSeverity
134
137
  * @return {UInt16}
@@ -189,9 +192,9 @@ export declare class ConditionSnapshotImpl extends EventEmitter implements Condi
189
192
  getMessage(): LocalizedText;
190
193
  isCurrentBranch(): boolean;
191
194
  getAckedState(): boolean;
192
- setAckedState(ackedState: boolean): StatusCode;
195
+ setAckedState(ackedState: boolean, options?: ISetStateOptions): StatusCode;
193
196
  getConfirmedState(): boolean;
194
- setConfirmedStateIfExists(confirmedState: boolean): void;
197
+ setConfirmedStateIfExists(confirmedState: boolean, options?: ISetStateOptions): void;
195
198
  setConfirmedState(confirmedState: boolean): void;
196
199
  /**
197
200
  * @class ConditionSnapshot
@@ -205,9 +208,15 @@ export declare class ConditionSnapshotImpl extends EventEmitter implements Condi
205
208
  * @method setSuppressedState
206
209
  * @param suppressed {Boolean}
207
210
  */
208
- setSuppressedState(suppressed: boolean): void;
211
+ setSuppressedState(suppressed: boolean, options?: ISetStateOptions): void;
209
212
  getActiveState(): boolean;
210
- setActiveState(newActiveState: boolean): StatusCode;
213
+ setActiveState(newActiveState: boolean, options?: ISetStateOptions): StatusCode;
214
+ setLatchedState(newLatchedState: boolean, options?: ISetStateOptions): StatusCode;
215
+ getLatchedState(): boolean;
216
+ setOutOfServiceState(newOutOfServiceState: boolean, options?: ISetStateOptions): StatusCode;
217
+ getOutOfServiceState(): boolean;
218
+ setSilentState(newSilentState: boolean, options?: ISetStateOptions): StatusCode;
219
+ getSilentState(): boolean;
211
220
  setShelvingState(): void;
212
221
  toString(): string;
213
222
  /**
@@ -216,7 +225,7 @@ export declare class ConditionSnapshotImpl extends EventEmitter implements Condi
216
225
  * @param value
217
226
  * @private
218
227
  */
219
- _set_twoStateVariable(varName: string, value: boolean): void;
228
+ _set_twoStateVariable(varName: string, value: boolean, options?: ISetStateOptions): void;
220
229
  protected _get_twoStateVariable(varName: string): any;
221
230
  }
222
231
  export {};