node-opcua-address-space 2.56.2 → 2.57.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 (178) hide show
  1. package/LICENSE +20 -20
  2. package/dist/source/loader/load_nodeset2.js +29 -3
  3. package/dist/source/loader/load_nodeset2.js.map +1 -1
  4. package/dist/source/session_context.js +2 -2
  5. package/dist/source/session_context.js.map +1 -1
  6. package/dist/src/address_space.d.ts +2 -3
  7. package/dist/src/address_space.js +1 -1
  8. package/dist/src/address_space.js.map +1 -1
  9. package/dist/src/address_space_private.d.ts +2 -3
  10. package/dist/src/namespace_impl.d.ts +2 -2
  11. package/dist/src/namespace_impl.js +6 -6
  12. package/dist/src/namespace_impl.js.map +1 -1
  13. package/dist/src/nodeset_tools/nodeset_to_xml.js +1 -1
  14. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
  15. package/generate.js +1 -1
  16. package/nodeJS.d.ts +1 -1
  17. package/package.json +27 -27
  18. package/source/loader/load_nodeset2.ts +39 -3
  19. package/source/session_context.ts +1 -1
  20. package/source_nodejs/index.ts +1 -1
  21. package/src/address_space.ts +6 -5
  22. package/src/address_space_private.ts +3 -3
  23. package/src/namespace_impl.ts +4 -4
  24. package/src/nodeset_tools/nodeset_to_xml.ts +2 -2
  25. package/testHelpers.d.ts +1 -1
  26. package/test_helpers/test_fixtures/dataType_in_separateNamespace.xml +150 -150
  27. package/test_helpers/test_fixtures/dataType_in_separateNamespace_basic.xml +57 -57
  28. package/test_helpers/test_fixtures/dataType_in_separateNamespace_mix.xml +135 -135
  29. package/test_helpers/test_fixtures/dataType_withEnumeration.xml +82 -82
  30. package/test_helpers/test_fixtures/dataType_with_isOptionSet.xml +194 -194
  31. package/test_helpers/test_fixtures/dataType_with_union.xml +1 -1
  32. package/test_helpers/test_fixtures/fixture_empty_nodeset2.xml +106 -106
  33. package/test_helpers/test_fixtures/fixture_simple_statemachine_nodeset2.xml +1303 -1303
  34. package/test_helpers/test_fixtures/fixuture_nodeset_objects_with_some_methods.xml +362 -362
  35. package/test_helpers/test_fixtures/issue_846.xml +3172 -3172
  36. package/test_helpers/test_fixtures/issue_899_variable_with_nodeid_value.xml +32 -32
  37. package/test_helpers/test_fixtures/mini.nodeset.withVariousVariables.xml +194 -194
  38. package/test_helpers/test_fixtures/minimalist_nodeset_with_models.xml +8 -8
  39. package/test_helpers/test_fixtures/minimalist_nodeset_with_models_more_complex.xml +16 -16
  40. package/test_helpers/test_fixtures/nodeset_with_analog_items.xml +45 -45
  41. package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.d.ts +0 -23
  42. package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js +0 -3
  43. package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js.map +0 -1
  44. package/dist/source/interfaces/data_access/ua_discrete_item.d.ts +0 -6
  45. package/dist/source/interfaces/data_access/ua_discrete_item.js +0 -3
  46. package/dist/source/interfaces/data_access/ua_discrete_item.js.map +0 -1
  47. package/dist/source/interfaces/data_access/ua_multistate_discrete.d.ts +0 -25
  48. package/dist/source/interfaces/data_access/ua_multistate_discrete.js +0 -3
  49. package/dist/source/interfaces/data_access/ua_multistate_discrete.js.map +0 -1
  50. package/dist/source/interfaces/data_access/ua_multistate_value_discrete.d.ts +0 -27
  51. package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js +0 -3
  52. package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js.map +0 -1
  53. package/dist/source/interfaces/data_access/ua_two_state_discrete.d.ts +0 -17
  54. package/dist/source/interfaces/data_access/ua_two_state_discrete.js +0 -3
  55. package/dist/source/interfaces/data_access/ua_two_state_discrete.js.map +0 -1
  56. package/dist/source/interfaces/data_access/ua_y_array_item.d.ts +0 -19
  57. package/dist/source/interfaces/data_access/ua_y_array_item.js +0 -3
  58. package/dist/source/interfaces/data_access/ua_y_array_item.js.map +0 -1
  59. package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.d.ts +0 -11
  60. package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js +0 -3
  61. package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js.map +0 -1
  62. package/dist/source/interfaces/state_machine/finite_state_machine.d.ts +0 -70
  63. package/dist/source/interfaces/state_machine/finite_state_machine.js +0 -3
  64. package/dist/source/interfaces/state_machine/finite_state_machine.js.map +0 -1
  65. package/dist/source/interfaces/state_machine/program_finite_state_machine.d.ts +0 -74
  66. package/dist/source/interfaces/state_machine/program_finite_state_machine.js +0 -3
  67. package/dist/source/interfaces/state_machine/program_finite_state_machine.js.map +0 -1
  68. package/dist/source/interfaces/state_machine/state_machine.d.ts +0 -342
  69. package/dist/source/interfaces/state_machine/state_machine.js +0 -3
  70. package/dist/source/interfaces/state_machine/state_machine.js.map +0 -1
  71. package/dist/source/interfaces/state_machine/ua_finite_state_variable.d.ts +0 -18
  72. package/dist/source/interfaces/state_machine/ua_finite_state_variable.js +0 -3
  73. package/dist/source/interfaces/state_machine/ua_finite_state_variable.js.map +0 -1
  74. package/dist/source/interfaces/state_machine/ua_state_variable.d.ts +0 -29
  75. package/dist/source/interfaces/state_machine/ua_state_variable.js +0 -3
  76. package/dist/source/interfaces/state_machine/ua_state_variable.js.map +0 -1
  77. package/dist/source/interfaces/state_machine/ua_two_state_variable.d.ts +0 -26
  78. package/dist/source/interfaces/state_machine/ua_two_state_variable.js +0 -3
  79. package/dist/source/interfaces/state_machine/ua_two_state_variable.js.map +0 -1
  80. package/dist/source/interfaces/subscription_diagnostics_variable.d.ts +0 -41
  81. package/dist/source/interfaces/subscription_diagnostics_variable.js +0 -3
  82. package/dist/source/interfaces/subscription_diagnostics_variable.js.map +0 -1
  83. package/dist/src/alarms_and_conditions/base_event_type.d.ts +0 -26
  84. package/dist/src/alarms_and_conditions/base_event_type.js +0 -41
  85. package/dist/src/alarms_and_conditions/base_event_type.js.map +0 -1
  86. package/dist/src/alarms_and_conditions/shelving_state_machine.d.ts +0 -22
  87. package/dist/src/alarms_and_conditions/shelving_state_machine.js +0 -241
  88. package/dist/src/alarms_and_conditions/shelving_state_machine.js.map +0 -1
  89. package/dist/src/alarms_and_conditions/trip_alarm.d.ts +0 -16
  90. package/dist/src/alarms_and_conditions/trip_alarm.js +0 -21
  91. package/dist/src/alarms_and_conditions/trip_alarm.js.map +0 -1
  92. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.d.ts +0 -54
  93. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js +0 -255
  94. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js.map +0 -1
  95. package/dist/src/alarms_and_conditions/ua_alarm_condition_base.d.ts +0 -138
  96. package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js +0 -460
  97. package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js.map +0 -1
  98. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.d.ts +0 -35
  99. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js +0 -32
  100. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js.map +0 -1
  101. package/dist/src/alarms_and_conditions/ua_condition_base.d.ts +0 -191
  102. package/dist/src/alarms_and_conditions/ua_condition_base.js +0 -1029
  103. package/dist/src/alarms_and_conditions/ua_condition_base.js.map +0 -1
  104. package/dist/src/alarms_and_conditions/ua_discrete_alarm.d.ts +0 -11
  105. package/dist/src/alarms_and_conditions/ua_discrete_alarm.js +0 -58
  106. package/dist/src/alarms_and_conditions/ua_discrete_alarm.js.map +0 -1
  107. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.d.ts +0 -24
  108. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js +0 -59
  109. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js.map +0 -1
  110. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.d.ts +0 -14
  111. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js +0 -17
  112. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js.map +0 -1
  113. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.d.ts +0 -22
  114. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js +0 -87
  115. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js.map +0 -1
  116. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.d.ts +0 -6
  117. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js +0 -11
  118. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js.map +0 -1
  119. package/dist/src/alarms_and_conditions/ua_limit_alarm.d.ts +0 -76
  120. package/dist/src/alarms_and_conditions/ua_limit_alarm.js +0 -237
  121. package/dist/src/alarms_and_conditions/ua_limit_alarm.js.map +0 -1
  122. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.d.ts +0 -27
  123. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js +0 -62
  124. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js.map +0 -1
  125. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.d.ts +0 -49
  126. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js +0 -176
  127. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js.map +0 -1
  128. package/dist/src/alarms_and_conditions/ua_off_normal_alarm.d.ts +0 -47
  129. package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js +0 -151
  130. package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js.map +0 -1
  131. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.d.ts +0 -16
  132. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js +0 -18
  133. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js.map +0 -1
  134. package/dist/src/base_node.d.ts +0 -289
  135. package/dist/src/base_node.js +0 -1345
  136. package/dist/src/base_node.js.map +0 -1
  137. package/dist/src/data_access/ua_analog_item.d.ts +0 -13
  138. package/dist/src/data_access/ua_analog_item.js +0 -37
  139. package/dist/src/data_access/ua_analog_item.js.map +0 -1
  140. package/dist/src/data_access/ua_data_item.d.ts +0 -16
  141. package/dist/src/data_access/ua_data_item.js +0 -66
  142. package/dist/src/data_access/ua_data_item.js.map +0 -1
  143. package/dist/src/data_access/ua_multistate_discrete.d.ts +0 -24
  144. package/dist/src/data_access/ua_multistate_discrete.js +0 -132
  145. package/dist/src/data_access/ua_multistate_discrete.js.map +0 -1
  146. package/dist/src/namespace.d.ts +0 -472
  147. package/dist/src/namespace.js +0 -1751
  148. package/dist/src/namespace.js.map +0 -1
  149. package/dist/src/reference.d.ts +0 -43
  150. package/dist/src/reference.js +0 -138
  151. package/dist/src/reference.js.map +0 -1
  152. package/dist/src/session_context.d.ts +0 -4
  153. package/dist/src/session_context.js +0 -9
  154. package/dist/src/session_context.js.map +0 -1
  155. package/dist/src/ua_data_type.d.ts +0 -83
  156. package/dist/src/ua_data_type.js +0 -289
  157. package/dist/src/ua_data_type.js.map +0 -1
  158. package/dist/src/ua_method.d.ts +0 -41
  159. package/dist/src/ua_method.js +0 -202
  160. package/dist/src/ua_method.js.map +0 -1
  161. package/dist/src/ua_object.d.ts +0 -28
  162. package/dist/src/ua_object.js +0 -153
  163. package/dist/src/ua_object.js.map +0 -1
  164. package/dist/src/ua_object_type.d.ts +0 -49
  165. package/dist/src/ua_object_type.js +0 -123
  166. package/dist/src/ua_object_type.js.map +0 -1
  167. package/dist/src/ua_reference_type.d.ts +0 -42
  168. package/dist/src/ua_reference_type.js +0 -138
  169. package/dist/src/ua_reference_type.js.map +0 -1
  170. package/dist/src/ua_variable.d.ts +0 -339
  171. package/dist/src/ua_variable.js +0 -1706
  172. package/dist/src/ua_variable.js.map +0 -1
  173. package/dist/src/ua_variable_type.d.ts +0 -57
  174. package/dist/src/ua_variable_type.js +0 -530
  175. package/dist/src/ua_variable_type.js.map +0 -1
  176. package/dist/src/ua_view.d.ts +0 -16
  177. package/dist/src/ua_view.js +0 -42
  178. package/dist/src/ua_view.js.map +0 -1
@@ -1,237 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UALimitAlarm = void 0;
4
- /**
5
- * @module node-opcua-address-space.AlarmsAndConditions
6
- */
7
- const node_opcua_assert_1 = require("node-opcua-assert");
8
- const node_opcua_data_model_1 = require("node-opcua-data-model");
9
- const node_opcua_data_value_1 = require("node-opcua-data-value");
10
- const node_opcua_status_code_1 = require("node-opcua-status-code");
11
- const node_opcua_variant_1 = require("node-opcua-variant");
12
- const ua_alarm_condition_base_1 = require("./ua_alarm_condition_base");
13
- class UALimitAlarm extends ua_alarm_condition_base_1.UAAlarmConditionBase {
14
- /**
15
- * @method (static)UALimitAlarm.instantiate
16
- * @param namespace {Namespace}
17
- * @param limitAlarmTypeId
18
- * @param options
19
- * @param options.inputNode
20
- * @param options.optionals
21
- * @param options.highHighLimit {Double}
22
- * @param options.highLimit {Double}
23
- * @param options.lowLimit {Double}
24
- * @param options.lowLowLimit {Double}
25
- * @param data
26
- * @return {UALimitAlarm}
27
- */
28
- static instantiate(namespace, limitAlarmTypeId, options, data) {
29
- const addressSpace = namespace.addressSpace;
30
- /* eslint max-instructions: off */
31
- // must provide a inputNode
32
- // xx assert(options.hasOwnProperty("conditionOf")); // must provide a conditionOf
33
- node_opcua_assert_1.assert(options.hasOwnProperty("inputNode"), "UALimitAlarm.instantiate: options must provide the inputNode");
34
- options.optionals = options.optionals || [];
35
- let count = 0;
36
- if (options.hasOwnProperty("highHighLimit")) {
37
- options.optionals.push("HighHighLimit");
38
- options.optionals.push("HighHighState");
39
- count++;
40
- }
41
- if (options.hasOwnProperty("highLimit")) {
42
- options.optionals.push("HighLimit");
43
- options.optionals.push("HighState");
44
- count++;
45
- }
46
- if (options.hasOwnProperty("lowLimit")) {
47
- options.optionals.push("LowLimit");
48
- options.optionals.push("LowState");
49
- count++;
50
- }
51
- if (options.hasOwnProperty("lowLowLimit")) {
52
- options.optionals.push("LowLowLimit");
53
- options.optionals.push("LowLowState");
54
- count++;
55
- }
56
- // xx assert(options.optionals,"must provide an optionals");
57
- const alarmNode = ua_alarm_condition_base_1.UAAlarmConditionBase.instantiate(namespace, limitAlarmTypeId, options, data);
58
- Object.setPrototypeOf(alarmNode, UALimitAlarm.prototype);
59
- node_opcua_assert_1.assert(alarmNode.conditionOfNode() !== null);
60
- const inputNode = addressSpace._coerceNode(options.inputNode);
61
- if (!inputNode) {
62
- throw new Error("Expecting a valid input node");
63
- }
64
- node_opcua_assert_1.assert(inputNode.nodeClass === node_opcua_data_model_1.NodeClass.Variable);
65
- // ----------------------- Install Limit Alarm specifics
66
- // from spec 1.03:
67
- // Four optional limits are defined that configure the states of the derived limit Alarm Types.
68
- // These Properties shall be set for any Alarm limits that are exposed by the derived limit Alarm
69
- // Types. These Properties are listed as optional but at least one is required. For cases where
70
- // an underlying system cannot provide the actual value of a limit, the limit Property shall still be
71
- // provided, but will have its AccessLevel set to not readable. It is assumed that the limits are
72
- // described using the same Engineering Unit that is assigned to the variable that is the source
73
- // of the alarm. For Rate of change limit alarms, it is assumed this rate is units per second
74
- // unless otherwise specified.
75
- if (count === 0) {
76
- throw new Error("at least one limit is required");
77
- }
78
- const dataType = addressSpace.findCorrespondingBasicDataType(options.inputNode.dataType);
79
- alarmNode._dataType = dataType;
80
- if (options.hasOwnProperty("highHighLimit")) {
81
- alarmNode.setHighHighLimit(options.highHighLimit);
82
- }
83
- if (options.hasOwnProperty("highLimit")) {
84
- alarmNode.setHighLimit(options.highLimit);
85
- }
86
- if (options.hasOwnProperty("lowLimit")) {
87
- alarmNode.setLowLimit(options.lowLimit);
88
- }
89
- if (options.hasOwnProperty("lowLowLimit")) {
90
- alarmNode.setLowLowLimit(options.lowLowLimit);
91
- }
92
- /*
93
- * The InputNode Property provides the NodeId of the Variable the Value of which is used as
94
- * primary input in the calculation of the Alarm state. If this Variable is not in the AddressSpace,
95
- * a Null NodeId shall be provided. In some systems, an Alarm may be calculated based on
96
- * multiple Variables Values; it is up to the system to determine which Variable’s NodeId is used.
97
- */
98
- node_opcua_assert_1.assert(alarmNode.inputNode.nodeClass === node_opcua_data_model_1.NodeClass.Variable);
99
- alarmNode.inputNode.setValueFromSource({ dataType: "NodeId", value: inputNode.nodeId });
100
- // install inputNode monitoring for change
101
- alarmNode._installInputNodeMonitoring(options.inputNode);
102
- alarmNode._watchLimits();
103
- return alarmNode;
104
- }
105
- /**
106
- * @method getHighHighLimit
107
- * @return {Number}
108
- */
109
- getHighHighLimit() {
110
- if (!this.highHighLimit) {
111
- throw new Error("Alarm do not expose highHighLimit");
112
- }
113
- return this.highHighLimit.readValue().value.value;
114
- }
115
- /**
116
- * @method getHighLimit
117
- * @return {Number}
118
- */
119
- getHighLimit() {
120
- if (!this.highLimit) {
121
- throw new Error("Alarm do not expose highLimit");
122
- }
123
- return this.highLimit.readValue().value.value;
124
- }
125
- /**
126
- * @method getLowLimit
127
- * @return {Float}
128
- */
129
- getLowLimit() {
130
- if (!this.lowLimit) {
131
- throw new Error("Alarm do not expose lowLimit");
132
- }
133
- return this.lowLimit.readValue().value.value;
134
- }
135
- /**
136
- * @method getLowLowLimit
137
- * @return {Float}
138
- */
139
- getLowLowLimit() {
140
- if (!this.lowLowLimit) {
141
- throw new Error("Alarm do not expose lowLowLimit");
142
- }
143
- return this.lowLowLimit.readValue().value.value;
144
- }
145
- /**
146
- * @method setHighHighLimit
147
- * @param value {Float}
148
- */
149
- setHighHighLimit(value) {
150
- if (!this.highHighLimit) {
151
- throw new Error("LimitAlarm instance must expose the optional HighHighLimit property");
152
- }
153
- this.highHighLimit.setValueFromSource({ dataType: this._dataType, value });
154
- }
155
- /**
156
- * @method setHighLimit
157
- * @param value {Float}
158
- */
159
- setHighLimit(value) {
160
- if (!this.highLimit) {
161
- throw new Error("LimitAlarm instance must expose the optional HighLimit property");
162
- }
163
- this.highLimit.setValueFromSource({ dataType: this._dataType, value });
164
- }
165
- /**
166
- * @method setLowLimit
167
- * @param value {Float}
168
- */
169
- setLowLimit(value) {
170
- if (!this.lowLimit) {
171
- throw new Error("LimitAlarm instance must expose the optional LowLimit property");
172
- }
173
- this.lowLimit.setValueFromSource({ dataType: this._dataType, value });
174
- }
175
- /**
176
- * @method setLowLowLimit
177
- * @param value {Float}
178
- */
179
- setLowLowLimit(value) {
180
- if (!this.lowLowLimit) {
181
- throw new Error("LimitAlarm instance must expose the optional LowLowLimit property");
182
- }
183
- this.lowLowLimit.setValueFromSource({ dataType: this._dataType, value });
184
- }
185
- _onInputDataValueChange(dataValue) {
186
- node_opcua_assert_1.assert(dataValue instanceof node_opcua_data_value_1.DataValue);
187
- if (dataValue.statusCode === node_opcua_status_code_1.StatusCodes.BadWaitingForInitialData
188
- && dataValue.statusCode === node_opcua_status_code_1.StatusCodes.UncertainInitialValue) {
189
- // we are not ready yet to use the input node value
190
- return;
191
- }
192
- if (dataValue.statusCode !== node_opcua_status_code_1.StatusCodes.Good) {
193
- // what shall we do ?
194
- this._signalNewCondition(null);
195
- return;
196
- }
197
- if (dataValue.value.dataType === node_opcua_variant_1.DataType.Null) {
198
- // what shall we do ?
199
- this._signalNewCondition(null);
200
- return;
201
- }
202
- const value = dataValue.value.value;
203
- this._setStateBasedOnInputValue(value);
204
- }
205
- _setStateBasedOnInputValue(value) {
206
- throw new Error("_setStateBasedOnInputValue must be overriden");
207
- }
208
- _watchLimits() {
209
- /// ----------------------------------------------------------------------
210
- /// Installing Limits monitored
211
- const _updateState = () => this.updateState();
212
- if (this.highHighLimit) {
213
- this.highHighLimit.on("value_changed", _updateState);
214
- }
215
- if (this.highLimit) {
216
- this.highLimit.on("value_changed", _updateState);
217
- }
218
- if (this.lowLimit) {
219
- this.lowLimit.on("value_changed", _updateState);
220
- }
221
- if (this.lowLowLimit) {
222
- this.lowLowLimit.on("value_changed", _updateState);
223
- }
224
- }
225
- evaluateConditionsAfterEnabled() {
226
- node_opcua_assert_1.assert(this.getEnabledState() === true);
227
- // simulate input value event
228
- const input = this.getInputNodeNode();
229
- if (!input) {
230
- return;
231
- }
232
- const dataValue = input.readValue();
233
- this._onInputDataValueChange(dataValue);
234
- }
235
- }
236
- exports.UALimitAlarm = UALimitAlarm;
237
- //# sourceMappingURL=ua_limit_alarm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ua_limit_alarm.js","sourceRoot":"","sources":["../../../src/alarms_and_conditions/ua_limit_alarm.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAC3C,iEAAkD;AAClD,iEAAkD;AAElD,mEAAqD;AACrD,2DAA8C;AAK9C,uEAAiE;AASjE,MAAa,YAAa,SAAQ,8CAAoB;IAElD;;;;;;;;;;;;;OAaG;IACI,MAAM,CAAC,WAAW,CACvB,SAA2B,EAC3B,gBAA+C,EAC/C,OAAY,EACZ,IAAS;QAGP,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;QAE5C,kCAAkC;QAClC,2BAA2B;QAC3B,kFAAkF;QAClF,0BAAM,CAAC,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,8DAA8D,CAAC,CAAC;QAE5G,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;QAC5C,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE;YACzC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACxC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACxC,KAAK,EAAE,CAAC;SACX;QACD,IAAI,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;YACrC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACpC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACpC,KAAK,EAAE,CAAC;SACX;QACD,IAAI,OAAO,CAAC,cAAc,C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CAAC,aAAa,CAAC,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;SACxD;QACD,IAAI,IAAI,CAAC,SAAS,EAAE;YAChB,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;SACpD;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;SACnD;QACD,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;SACtD;IACL,CAAC;IAES,8BAA8B;QACpC,0BAAM,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,IAAI,CAAC,CAAC;QACxC,6BAA6B;QAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,EAAgB,CAAC;QACpD,IAAI,CAAC,KAAK,EAAE;YACR,OAAO;SACV;QACD,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QACpC,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;CACJ;AArQD,oCAqQC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * @module node-opcua-address-space.AlarmsAndConditions
3
- */
4
- import { DataValue } from "node-opcua-data-value";
5
- import { NodeId } from "node-opcua-nodeid";
6
- import { DataType } from "node-opcua-variant";
7
- import { UAVariable, UAVariableT } from "../../source";
8
- import { NamespacePrivate } from "../namespace_private";
9
- import { DeviationStuff } from "./deviation_alarm_helper";
10
- import { UANonExclusiveLimitAlarm } from "./ua_non_exclusive_limit_alarm";
11
- export interface UANonExclusiveDeviationAlarm extends UANonExclusiveLimitAlarm {
12
- setpointNode: UAVariableT<NodeId, DataType.NodeId>;
13
- setpointNodeNode: UAVariable;
14
- }
15
- /**
16
- * @class UANonExclusiveDeviationAlarm
17
- * @extends UANonExclusiveLimitAlarm
18
- * @constructor
19
- */
20
- export declare class UANonExclusiveDeviationAlarm extends UANonExclusiveLimitAlarm implements DeviationStuff {
21
- static instantiate(namespace: NamespacePrivate, type: string | NodeId, options: any, data: any): UANonExclusiveDeviationAlarm;
22
- _setStateBasedOnInputValue(value: number): void;
23
- getSetpointNodeNode(): UAVariable;
24
- getSetpointValue(): number | null;
25
- _onSetpointDataValueChange(dataValue: DataValue): void;
26
- _install_setpoint(options: any): any;
27
- }
@@ -1,62 +0,0 @@
1
- "use strict";
2
- /**
3
- * @module node-opcua-address-space.AlarmsAndConditions
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UANonExclusiveDeviationAlarm = void 0;
7
- const node_opcua_assert_1 = require("node-opcua-assert");
8
- const deviation_alarm_helper_1 = require("./deviation_alarm_helper");
9
- const ua_limit_alarm_1 = require("./ua_limit_alarm");
10
- const ua_non_exclusive_limit_alarm_1 = require("./ua_non_exclusive_limit_alarm");
11
- /**
12
- * @class UANonExclusiveDeviationAlarm
13
- * @extends UANonExclusiveLimitAlarm
14
- * @constructor
15
- */
16
- class UANonExclusiveDeviationAlarm extends ua_non_exclusive_limit_alarm_1.UANonExclusiveLimitAlarm {
17
- static instantiate(namespace, type, options, data) {
18
- const addressSpace = namespace.addressSpace;
19
- const nonExclusiveDeviationAlarmType = addressSpace.findEventType("NonExclusiveDeviationAlarmType");
20
- /* istanbul ignore next */
21
- if (!nonExclusiveDeviationAlarmType) {
22
- throw new Error("cannot find ExclusiveDeviationAlarmType");
23
- }
24
- node_opcua_assert_1.assert(type === nonExclusiveDeviationAlarmType.browseName.toString());
25
- const alarm = ua_non_exclusive_limit_alarm_1.UANonExclusiveLimitAlarm.instantiate(namespace, type, options, data);
26
- Object.setPrototypeOf(alarm, UANonExclusiveDeviationAlarm.prototype);
27
- node_opcua_assert_1.assert(alarm instanceof UANonExclusiveDeviationAlarm);
28
- node_opcua_assert_1.assert(alarm instanceof ua_non_exclusive_limit_alarm_1.UANonExclusiveLimitAlarm);
29
- node_opcua_assert_1.assert(alarm instanceof ua_limit_alarm_1.UALimitAlarm);
30
- alarm._install_setpoint(options);
31
- return alarm;
32
- }
33
- _setStateBasedOnInputValue(value) {
34
- const setpointValue = this.getSetpointValue();
35
- if (setpointValue === null) {
36
- throw new Error("Cannot access setpoint Value");
37
- }
38
- node_opcua_assert_1.assert(isFinite(setpointValue), "expecting a valid setpoint value");
39
- // call base class implementation
40
- super._setStateBasedOnInputValue(value - setpointValue);
41
- }
42
- getSetpointNodeNode() {
43
- return deviation_alarm_helper_1.DeviationAlarmHelper_getSetpointNodeNode.call(this);
44
- }
45
- getSetpointValue() {
46
- return deviation_alarm_helper_1.DeviationAlarmHelper_getSetpointValue.call(this);
47
- }
48
- _onSetpointDataValueChange(dataValue) {
49
- deviation_alarm_helper_1.DeviationAlarmHelper_onSetpointDataValueChange.call(this, dataValue);
50
- }
51
- _install_setpoint(options) {
52
- return deviation_alarm_helper_1.DeviationAlarmHelper_install_setpoint.call(this, options);
53
- }
54
- }
55
- exports.UANonExclusiveDeviationAlarm = UANonExclusiveDeviationAlarm;
56
- /*
57
- UANonExclusiveDeviationAlarm.prototype.getSetpointNodeNode = DeviationAlarmHelper.getSetpointNodeNode;
58
- UANonExclusiveDeviationAlarm.prototype.getSetpointValue = DeviationAlarmHelper.getSetpointValue;
59
- UANonExclusiveDeviationAlarm.prototype._onSetpointDataValueChange = DeviationAlarmHelper._onSetpointDataValueChange;
60
- UANonExclusiveDeviationAlarm.prototype._install_setpoint = DeviationAlarmHelper._install_setpoint;
61
- */
62
- //# sourceMappingURL=ua_non_exclusive_deviation_alarm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ua_non_exclusive_deviation_alarm.js","sourceRoot":"","sources":["../../../src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yDAA2C;AAQ3C,qEAMkC;AAClC,qDAAgD;AAChD,iFAA0E;AAO1E;;;;GAIG;AACH,MAAa,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AC,CAAC;IAC/D,CAAC;IAEM,gBAAgB;QACnB,OAAO,8DAAqC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAEM,0BAA0B,CAAC,SAAoB;QAClD,uEAA8C,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;IAEM,iBAAiB,CAAC,OAAY;QACjC,OAAO,8DAAqC,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;CACJ;AArDD,oEAqDC;AAED;;;;;EAKE"}
@@ -1,49 +0,0 @@
1
- import { NodeId } from "node-opcua-nodeid";
2
- import { UAEventType } from "../../source";
3
- import { NamespacePrivate } from "../namespace_private";
4
- import { UATwoStateVariable } from "../state_machine/ua_two_state_variable";
5
- import { ConditionInfo } from "./condition_info";
6
- import { UALimitAlarm } from "./ua_limit_alarm";
7
- export interface UANonExclusiveLimitAlarm {
8
- /**
9
- * @property lowLowState
10
- * @type UATwoStateVariable
11
- */
12
- lowLowState: UATwoStateVariable;
13
- /**
14
- * @property lowState
15
- * @type UATwoStateVariable
16
- */
17
- lowState: UATwoStateVariable;
18
- /**
19
- * @property highState
20
- * @type UATwoStateVariable
21
- */
22
- highState: UATwoStateVariable;
23
- /**
24
- * @property highHighState
25
- * @type UATwoStateVariable
26
- */
27
- highHighState: UATwoStateVariable;
28
- }
29
- /***
30
- * @class UANonExclusiveLimitAlarm
31
- * @extends UALimitAlarm
32
- * @constructor
33
- */
34
- export declare class UANonExclusiveLimitAlarm extends UALimitAlarm {
35
- /**
36
- * @method (static)instantiate
37
- * @param namespace {Namespace}
38
- * @param type
39
- * @param options
40
- * @param data
41
- * @return {UANonExclusiveLimitAlarm}
42
- */
43
- static instantiate(namespace: NamespacePrivate, type: UAEventType | NodeId | string, options: any, data: any): UANonExclusiveLimitAlarm;
44
- _calculateConditionInfo(states: string | null, isActive: boolean, value: string, oldConditionInfo: ConditionInfo): ConditionInfo;
45
- _signalNewCondition2(states: {
46
- [key: string]: string;
47
- }, isActive: boolean, value: string): void;
48
- protected _setStateBasedOnInputValue(value: number): void;
49
- }
@@ -1,176 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UANonExclusiveLimitAlarm = void 0;
4
- /**
5
- * @module node-opcua-address-space.AlarmsAndConditions
6
- */
7
- const node_opcua_assert_1 = require("node-opcua-assert");
8
- const node_opcua_status_code_1 = require("node-opcua-status-code");
9
- const ua_two_state_variable_1 = require("../state_machine/ua_two_state_variable");
10
- const condition_info_1 = require("./condition_info");
11
- const ua_limit_alarm_1 = require("./ua_limit_alarm");
12
- /***
13
- * @class UANonExclusiveLimitAlarm
14
- * @extends UALimitAlarm
15
- * @constructor
16
- */
17
- class UANonExclusiveLimitAlarm extends ua_limit_alarm_1.UALimitAlarm {
18
- /**
19
- * @method (static)instantiate
20
- * @param namespace {Namespace}
21
- * @param type
22
- * @param options
23
- * @param data
24
- * @return {UANonExclusiveLimitAlarm}
25
- */
26
- static instantiate(namespace, type, options, data) {
27
- const addressSpace = namespace.addressSpace;
28
- options.optionals = options.optionals || [];
29
- if (options.hasOwnProperty("lowLowLimit")) {
30
- options.optionals.push("LowLowLimit");
31
- options.optionals.push("LowLowState");
32
- }
33
- if (options.hasOwnProperty("lowLimit")) {
34
- options.optionals.push("LowLimit");
35
- options.optionals.push("LowState");
36
- }
37
- if (options.hasOwnProperty("highLimit")) {
38
- options.optionals.push("HighLimit");
39
- options.optionals.push("HighState");
40
- }
41
- if (options.hasOwnProperty("highHighLimit")) {
42
- options.optionals.push("HighHighLimit");
43
- options.optionals.push("HighHighState");
44
- }
45
- const nonExclusiveAlarmType = addressSpace.findEventType(type);
46
- /* istanbul ignore next */
47
- if (!nonExclusiveAlarmType) {
48
- throw new Error(" cannot find Alarm Condition Type for " + type);
49
- }
50
- const nonExclusiveLimitAlarmType = addressSpace.findEventType("NonExclusiveLimitAlarmType");
51
- /* istanbul ignore next */
52
- if (!nonExclusiveLimitAlarmType) {
53
- throw new Error("cannot find NonExclusiveLimitAlarmType");
54
- }
55
- // assert(type nonExclusiveLimitAlarmType.browseName.toString());
56
- const alarm = ua_limit_alarm_1.UALimitAlarm.instantiate(namespace, type, options, data);
57
- Object.setPrototypeOf(alarm, UANonExclusiveLimitAlarm.prototype);
58
- node_opcua_assert_1.assert(alarm instanceof ua_limit_alarm_1.UALimitAlarm);
59
- node_opcua_assert_1.assert(alarm instanceof UANonExclusiveLimitAlarm);
60
- // ---------------- install States
61
- if (alarm.lowLowState) {
62
- ua_two_state_variable_1._install_TwoStateVariable_machinery(alarm.lowLowState, {
63
- falseState: "LowLow inactive",
64
- trueState: "LowLow active"
65
- });
66
- alarm.lowLowState.setValue(false);
67
- node_opcua_assert_1.assert(alarm.hasOwnProperty("lowLowLimit"));
68
- }
69
- if (alarm.lowState) {
70
- ua_two_state_variable_1._install_TwoStateVariable_machinery(alarm.lowState, {
71
- falseState: "Low inactive",
72
- trueState: "Low active"
73
- });
74
- alarm.lowState.setValue(false);
75
- node_opcua_assert_1.assert(alarm.hasOwnProperty("lowLimit"));
76
- }
77
- if (alarm.highState) {
78
- ua_two_state_variable_1._install_TwoStateVariable_machinery(alarm.highState, {
79
- falseState: "High inactive",
80
- trueState: "High active"
81
- });
82
- alarm.highState.setValue(false);
83
- node_opcua_assert_1.assert(alarm.hasOwnProperty("highLimit"));
84
- }
85
- if (alarm.highHighState) {
86
- ua_two_state_variable_1._install_TwoStateVariable_machinery(alarm.highHighState, {
87
- falseState: "HighHigh inactive",
88
- trueState: "HighHigh active"
89
- });
90
- alarm.highHighState.setValue(false);
91
- node_opcua_assert_1.assert(alarm.hasOwnProperty("highHighLimit"));
92
- }
93
- alarm.activeState.setValue(false);
94
- alarm.updateState();
95
- return alarm;
96
- }
97
- _calculateConditionInfo(states, isActive, value, oldConditionInfo) {
98
- if (!isActive) {
99
- return new condition_info_1.ConditionInfo({
100
- message: "Back to normal",
101
- quality: node_opcua_status_code_1.StatusCodes.Good,
102
- retain: true,
103
- severity: 0
104
- });
105
- }
106
- else {
107
- return new condition_info_1.ConditionInfo({
108
- message: "Condition value is " + value + " and state is " + states,
109
- quality: node_opcua_status_code_1.StatusCodes.Good,
110
- retain: true,
111
- severity: 150
112
- });
113
- }
114
- }
115
- _signalNewCondition2(states, isActive, value) {
116
- const alarm = this;
117
- if (typeof states === "string") {
118
- return;
119
- }
120
- function _install(name) {
121
- if (states[name] !== "unset") {
122
- alarm[name + "State"].setValue(states[name]);
123
- }
124
- }
125
- _install("highHigh");
126
- _install("high");
127
- _install("low");
128
- _install("lowLow");
129
- // build-up state string
130
- let state_str = Object.keys(states)
131
- .map((s) => (states[s] ? s : null))
132
- .filter((a) => a !== null)
133
- .join(";"); //
134
- state_str = JSON.stringify(states);
135
- ua_limit_alarm_1.UALimitAlarm.prototype._signalNewCondition.call(this, state_str, isActive, value);
136
- }
137
- _setStateBasedOnInputValue(value) {
138
- node_opcua_assert_1.assert(isFinite(value), "expecting a valid value here");
139
- const alarm = this;
140
- let isActive = false;
141
- const states = {
142
- highHigh: alarm.highHighState ? alarm.highHighState.getValue() : "unset",
143
- high: alarm.highState ? alarm.highState.getValue() : "unset",
144
- low: alarm.lowState ? alarm.lowState.getValue() : "unset",
145
- lowLow: alarm.lowLowState ? alarm.lowLowState.getValue() : "unset"
146
- };
147
- let count = 0;
148
- function ___p(stateName, func_value) {
149
- if (states[stateName] !== "unset") {
150
- const val = func_value();
151
- isActive = isActive || val;
152
- if (states[stateName] !== val) {
153
- states[stateName] = val;
154
- count += 1;
155
- }
156
- }
157
- }
158
- ___p("highHigh", () => {
159
- return alarm.getHighHighLimit() < value;
160
- });
161
- ___p("high", () => {
162
- return alarm.getHighLimit() < value;
163
- });
164
- ___p("low", () => {
165
- return alarm.getLowLimit() > value;
166
- });
167
- ___p("lowLow", () => {
168
- return alarm.getLowLowLimit() > value;
169
- });
170
- if (count > 0) {
171
- alarm._signalNewCondition2(states, isActive, value.toString());
172
- }
173
- }
174
- }
175
- exports.UANonExclusiveLimitAlarm = UANonExclusiveLimitAlarm;
176
- //# sourceMappingURL=ua_non_exclusive_limit_alarm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ua_non_exclusive_limit_alarm.js","sourceRoot":"","sources":["../../../src/alarms_and_conditions/ua_non_exclusive_limit_alarm.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAE3C,mEAAqD;AAIrD,kFAAiH;AACjH,qDAAiD;AACjD,qDAAgD;AA2BhD;;;;GAIG;AACH,MAAa,wBAAyB,SAAQ,6BAAY;IACtD;;;;;;;OAOG;IACI,MAAM,CAAC,WAAW,CACrB,SAA2B,EAC3B,IAAmC,EACnC,OAAY,EACZ,IAAS;QAET,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;QAE5C,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;QAE5C,IAAI,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE;YACvC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACtC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SACzC;QACD,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;YACpC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACnC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACtC;QACD,IAAI,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;YACrC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACpC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACvC;QACD,IAAI,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE;YACzC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACxC,OAAO,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,CAAC;QACvC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;YAChB,OAAO,KAAK,CAAC,cAAc,EAAE,GAAG,KAAK,CAAC;QAC1C,CAAC,CAAC,CAAC;QAEH,IAAI,KAAK,GAAG,CAAC,EAAE;YACX,KAAK,CAAC,oBAAoB,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;SAClE;IACL,CAAC;CACJ;AA/LD,4DA+LC"}
@@ -1,47 +0,0 @@
1
- import { DataValue } from "node-opcua-data-value";
2
- import { NodeId } from "node-opcua-nodeid";
3
- import { Namespace, UAVariable } from "../../source";
4
- import { UADiscreteAlarm } from "./ua_discrete_alarm";
5
- export interface UAOffNormalAlarm extends UADiscreteAlarm {
6
- normalState: UAVariable;
7
- }
8
- /**
9
- * The OffNormalAlarmType is a specialization of the DiscreteAlarmType intended to represent a
10
- * discrete Condition that is considered to be not normal.
11
- * This sub type is usually used to indicate that a discrete value is in an Alarm state, it is active as
12
- * long as a non-normal value is present.
13
- *
14
- * @class UAOffNormalAlarm
15
- * @extends UADiscreteAlarm
16
- * @constructor
17
- *
18
- *
19
- */
20
- export declare class UAOffNormalAlarm extends UADiscreteAlarm {
21
- /**
22
- * @method (static)UAOffNormalAlarm.instantiate
23
- * @param namespace {Namespace}
24
- * @param limitAlarmTypeId
25
- * @param options
26
- * @param options.inputNode {NodeId|UAVariable} the input node
27
- * @param options.normalState {NodeId|UAVariable} the normalStateNode node
28
- * @param data
29
- *
30
- * When the value of inputNode doesn't match the normalState node value, then the alarm is raised.
31
- *
32
- */
33
- static instantiate(namespace: Namespace, limitAlarmTypeId: string | NodeId, options: any, data: any): UAOffNormalAlarm;
34
- getNormalStateNode(): UAVariable;
35
- /**
36
- * @method getNormalStateValue
37
- */
38
- getNormalStateValue(): any;
39
- /**
40
- * @method setNormalStateValue
41
- * @param value
42
- */
43
- setNormalStateValue(value: any): void;
44
- _updateAlarmState(normalStateValue?: any, inputValue?: any): void;
45
- _onInputDataValueChange(dataValue: DataValue): void;
46
- protected _onNormalStateDataValueChange(dataValue: DataValue): void;
47
- }