node-opcua-address-space 2.74.0 → 2.75.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.
- package/dist/source/helpers/argument_list.js +1 -0
- package/dist/source/helpers/argument_list.js.map +1 -1
- package/dist/source/helpers/multiform_func.js +4 -2
- package/dist/source/helpers/multiform_func.js.map +1 -1
- package/dist/source/index.d.ts +0 -2
- package/dist/source/index.js +1 -5
- package/dist/source/index.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.d.ts +5 -11
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js +0 -7
- package/dist/source/interfaces/alarms_and_conditions/condition_snapshot.js.map +1 -1
- package/dist/source/interfaces/alarms_and_conditions/deviation_stuff.d.ts +4 -6
- package/dist/source/interfaces/alarms_and_conditions/install_setpoint_options.d.ts +4 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.d.ts +4 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.d.ts +2 -2
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.d.ts +4 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.d.ts +4 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js +3 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.js.map +1 -0
- package/dist/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.d.ts +16 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.d.ts +1 -1
- package/dist/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.d.ts +2 -4
- package/dist/source/namespace_alarm_and_condition.d.ts +19 -11
- package/dist/src/address_space.js +17 -12
- package/dist/src/address_space.js.map +1 -1
- package/dist/src/alarms_and_conditions/condition.js +1 -1
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.d.ts +3 -12
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js +84 -93
- package/dist/src/alarms_and_conditions/condition_snapshot_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.d.ts +3 -2
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js +27 -12
- package/dist/src/alarms_and_conditions/deviation_alarm_helper.js.map +1 -1
- package/dist/src/alarms_and_conditions/index.d.ts +0 -2
- package/dist/src/alarms_and_conditions/index.js +0 -2
- package/dist/src/alarms_and_conditions/index.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_condition_impl.js +5 -5
- package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.d.ts +4 -6
- package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +13 -13
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js +15 -15
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.d.ts +3 -3
- package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.js.map +1 -1
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +18 -13
- package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
- package/dist/src/event_data.d.ts +22 -17
- package/dist/src/event_data.js +33 -64
- package/dist/src/event_data.js.map +1 -1
- package/dist/src/index_current.d.ts +0 -1
- package/dist/src/index_current.js +0 -1
- package/dist/src/index_current.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +14 -11
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/state_machine/ua_two_state_variable.js +1 -1
- package/dist/src/state_machine/ua_two_state_variable.js.map +1 -1
- package/dist/src/ua_object_impl.js +0 -1
- package/dist/src/ua_object_impl.js.map +1 -1
- package/dist/src/ua_reference_type_impl.d.ts +1 -1
- package/distHelpers/alarms_and_conditions_demo.js +2 -1
- package/distHelpers/alarms_and_conditions_demo.js.map +1 -1
- package/package.json +22 -22
- package/source/helpers/argument_list.ts +2 -0
- package/source/helpers/multiform_func.ts +5 -3
- package/source/index.ts +0 -2
- package/source/interfaces/alarms_and_conditions/condition_snapshot.ts +12 -30
- package/source/interfaces/alarms_and_conditions/deviation_stuff.ts +8 -6
- package/source/interfaces/alarms_and_conditions/install_setpoint_options.ts +9 -0
- package/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts +4 -0
- package/source/interfaces/alarms_and_conditions/instantiate_limit_alarm_options.ts +2 -2
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts +4 -0
- package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts +4 -0
- package/source/interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options.ts +16 -1
- package/source/interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex.ts +1 -0
- package/source/interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex.ts +1 -2
- package/source/namespace_alarm_and_condition.ts +48 -23
- package/src/address_space.ts +22 -16
- package/src/alarms_and_conditions/condition.ts +1 -1
- package/src/alarms_and_conditions/condition_snapshot_impl.ts +95 -102
- package/src/alarms_and_conditions/deviation_alarm_helper.ts +33 -18
- package/src/alarms_and_conditions/index.ts +0 -2
- package/src/alarms_and_conditions/ua_condition_impl.ts +5 -5
- package/src/alarms_and_conditions/ua_exclusive_deviation_alarm_impl.ts +5 -6
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +6 -8
- package/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm_impl.ts +5 -3
- package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +18 -16
- package/src/event_data.ts +47 -77
- package/src/index_current.ts +0 -1
- package/src/namespace_impl.ts +47 -26
- package/src/state_machine/ua_two_state_variable.ts +1 -1
- package/src/ua_object_impl.ts +1 -2
- package/test_helpers/alarms_and_conditions_demo.ts +4 -1
- package/source/helpers/check_event_clause.ts +0 -55
- package/src/alarms_and_conditions/check_where_clause.ts +0 -147
- package/src/alarms_and_conditions/extract_event_fields.ts +0 -103
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-address-space",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.75.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -address-space",
|
|
5
5
|
"main": "./dist/src/index_current.js",
|
|
6
6
|
"types": "./dist/source/index.d.ts",
|
|
@@ -21,34 +21,34 @@
|
|
|
21
21
|
"chalk": "4.1.2",
|
|
22
22
|
"dequeue": "^1.0.5",
|
|
23
23
|
"lodash": "4.17.21",
|
|
24
|
-
"node-opcua-address-space-base": "2.
|
|
24
|
+
"node-opcua-address-space-base": "2.75.0",
|
|
25
25
|
"node-opcua-assert": "2.74.0",
|
|
26
26
|
"node-opcua-basic-types": "2.74.0",
|
|
27
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
27
|
+
"node-opcua-client-dynamic-extension-object": "2.75.0",
|
|
28
28
|
"node-opcua-constants": "2.74.0",
|
|
29
|
-
"node-opcua-data-access": "2.
|
|
30
|
-
"node-opcua-data-model": "2.
|
|
31
|
-
"node-opcua-data-value": "2.
|
|
29
|
+
"node-opcua-data-access": "2.75.0",
|
|
30
|
+
"node-opcua-data-model": "2.75.0",
|
|
31
|
+
"node-opcua-data-value": "2.75.0",
|
|
32
32
|
"node-opcua-date-time": "2.74.0",
|
|
33
33
|
"node-opcua-debug": "2.74.0",
|
|
34
34
|
"node-opcua-enum": "2.74.0",
|
|
35
|
-
"node-opcua-factory": "2.
|
|
35
|
+
"node-opcua-factory": "2.75.0",
|
|
36
36
|
"node-opcua-nodeid": "2.74.0",
|
|
37
|
-
"node-opcua-nodeset-ua": "2.
|
|
38
|
-
"node-opcua-numeric-range": "2.
|
|
37
|
+
"node-opcua-nodeset-ua": "2.75.0",
|
|
38
|
+
"node-opcua-numeric-range": "2.75.0",
|
|
39
39
|
"node-opcua-object-registry": "2.74.0",
|
|
40
|
-
"node-opcua-pseudo-session": "2.
|
|
41
|
-
"node-opcua-schemas": "2.
|
|
42
|
-
"node-opcua-service-browse": "2.
|
|
43
|
-
"node-opcua-service-call": "2.
|
|
44
|
-
"node-opcua-service-filter": "2.
|
|
45
|
-
"node-opcua-service-history": "2.
|
|
46
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
47
|
-
"node-opcua-service-write": "2.
|
|
40
|
+
"node-opcua-pseudo-session": "2.75.0",
|
|
41
|
+
"node-opcua-schemas": "2.75.0",
|
|
42
|
+
"node-opcua-service-browse": "2.75.0",
|
|
43
|
+
"node-opcua-service-call": "2.75.0",
|
|
44
|
+
"node-opcua-service-filter": "2.75.0",
|
|
45
|
+
"node-opcua-service-history": "2.75.0",
|
|
46
|
+
"node-opcua-service-translate-browse-path": "2.75.0",
|
|
47
|
+
"node-opcua-service-write": "2.75.0",
|
|
48
48
|
"node-opcua-status-code": "2.74.0",
|
|
49
|
-
"node-opcua-types": "2.
|
|
49
|
+
"node-opcua-types": "2.75.0",
|
|
50
50
|
"node-opcua-utils": "2.74.0",
|
|
51
|
-
"node-opcua-variant": "2.
|
|
51
|
+
"node-opcua-variant": "2.75.0",
|
|
52
52
|
"node-opcua-xml2json": "2.74.0",
|
|
53
53
|
"semver": "^7.3.7",
|
|
54
54
|
"set-prototype-of": "^1.0.0",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"humanize": "0.0.9",
|
|
61
61
|
"node-opcua-benchmarker": "2.74.0",
|
|
62
62
|
"node-opcua-binary-stream": "2.74.0",
|
|
63
|
-
"node-opcua-extension-object": "2.
|
|
63
|
+
"node-opcua-extension-object": "2.75.0",
|
|
64
64
|
"node-opcua-leak-detector": "2.74.0",
|
|
65
65
|
"node-opcua-nodesets": "2.74.0",
|
|
66
|
-
"node-opcua-packet-analyzer": "2.
|
|
66
|
+
"node-opcua-packet-analyzer": "2.75.0",
|
|
67
67
|
"node-opcua-test-fixtures": "2.74.0",
|
|
68
68
|
"should": "^13.2.3",
|
|
69
69
|
"sinon": "^14.0.0",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"internet of things"
|
|
85
85
|
],
|
|
86
86
|
"homepage": "http://node-opcua.github.io/",
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "5ccb835ca480c2a8a591ae61b5949a9d8bad4017"
|
|
88
88
|
}
|
|
@@ -57,6 +57,8 @@ export function encode_ArgumentList(definition: ArgumentDef[], args: any[], stre
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export function decode_ArgumentList(definition: ArgumentDef[], stream: BinaryStream): any[] {
|
|
60
|
+
|
|
61
|
+
// istanbul ignore next
|
|
60
62
|
if (!Array.isArray(definition)) {
|
|
61
63
|
throw new Error(
|
|
62
64
|
"This BaseDataType cannot be decoded because it has no definition.\n" +
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { make_warningLog } from "node-opcua-debug";
|
|
2
2
|
import { CallbackT } from "node-opcua-status-code";
|
|
3
3
|
|
|
4
|
+
const warningLog = make_warningLog(__filename);
|
|
5
|
+
|
|
4
6
|
export type StraightFunc<T, This> = (this: This) => T;
|
|
5
7
|
export type PromiseFunc<T, This> = (this: This) => Promise<T>;
|
|
6
8
|
export type CallbackFunc<T, This> = (this: This, callback: CallbackT<T>) => void;
|
|
@@ -31,7 +33,7 @@ export function convertToCallbackFunction<T, This>(func: MultiformFunc<T, This>)
|
|
|
31
33
|
try {
|
|
32
34
|
(func as CallbackFunc<T, This>).call(this, callback);
|
|
33
35
|
} catch (err) {
|
|
34
|
-
|
|
36
|
+
warningLog("internal error", (err as Error).message);
|
|
35
37
|
callback(err as Error);
|
|
36
38
|
}
|
|
37
39
|
};
|
|
@@ -68,7 +70,7 @@ export function convertToCallbackFunction1<T, P, This>(func: MultiformFunc1<T, P
|
|
|
68
70
|
try {
|
|
69
71
|
(func as CallbackFunc1<T, P, This>).call(this, param, callback);
|
|
70
72
|
} catch (err) {
|
|
71
|
-
|
|
73
|
+
warningLog("internal error", (err as Error).message);
|
|
72
74
|
callback(err as Error);
|
|
73
75
|
}
|
|
74
76
|
};
|
package/source/index.ts
CHANGED
|
@@ -48,7 +48,6 @@ export * from "./pseudo_session";
|
|
|
48
48
|
|
|
49
49
|
export * from "./helpers/dump_tools";
|
|
50
50
|
export * from "./helpers/make_optionals_map";
|
|
51
|
-
export * from "./helpers/check_event_clause";
|
|
52
51
|
export * from "./helpers/argument_list";
|
|
53
52
|
export * from "./helpers/call_helpers";
|
|
54
53
|
export * from "./helpers/ensure_secure_access";
|
|
@@ -62,7 +61,6 @@ export * from "./loader/generateAddressSpaceRaw";
|
|
|
62
61
|
export * from "./namespace";
|
|
63
62
|
export * from "./namespace_data_access";
|
|
64
63
|
|
|
65
|
-
export { extractEventFields,checkWhereClause} from "../src/alarms_and_conditions";
|
|
66
64
|
export { instantiateCertificateExpirationAlarm } from "../src/alarms_and_conditions/ua_certificate_expiration_alarm_impl";
|
|
67
65
|
|
|
68
66
|
export { NodeIdManager, ConstructNodeIdOptions } from "../src/nodeid_manager";
|
|
@@ -1,47 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-address-space.AlarmsAndConditions
|
|
3
|
+
*/
|
|
1
4
|
import { EventEmitter } from "events";
|
|
2
5
|
import { Variant } from "node-opcua-variant";
|
|
3
|
-
import { IEventData, UAVariable, BaseNode
|
|
4
|
-
import { assert } from "node-opcua-assert";
|
|
6
|
+
import { IEventData, UAVariable, BaseNode } from "node-opcua-address-space-base";
|
|
5
7
|
import { UInt16 } from "node-opcua-basic-types";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { UAAcknowledgeableCondition } from "node-opcua-nodeset-ua";
|
|
11
|
-
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
12
|
-
import { SimpleAttributeOperand, TimeZoneDataType } from "node-opcua-types";
|
|
13
|
-
import * as utils from "node-opcua-utils";
|
|
8
|
+
import { LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
|
|
9
|
+
import { NodeId } from "node-opcua-nodeid";
|
|
10
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
11
|
+
import { TimeZoneDataType } from "node-opcua-types";
|
|
14
12
|
import { UtcTime } from "../state_machine/ua_state_machine_type";
|
|
15
13
|
|
|
16
14
|
export interface ConditionSnapshot {
|
|
17
15
|
on(eventName: "value_changed", eventHandler: (node: UAVariable, variant: Variant) => void): this;
|
|
18
16
|
}
|
|
19
|
-
/**
|
|
20
|
-
* @module node-opcua-address-space.AlarmsAndConditions
|
|
21
|
-
*/
|
|
22
17
|
|
|
23
|
-
function normalizeName(str: string): string {
|
|
24
|
-
return str.split(".").map(utils.lowerFirstLetter).join(".");
|
|
25
|
-
}
|
|
26
18
|
|
|
27
19
|
export interface ConditionSnapshot extends EventEmitter {
|
|
28
20
|
// static normalizeName = normalizeName;
|
|
29
21
|
|
|
30
22
|
condition: BaseNode;
|
|
31
|
-
eventData: IEventData| null;
|
|
32
|
-
branchId: NodeId| null;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @method resolveSelectClause
|
|
36
|
-
* @param selectClause {SelectClause}
|
|
37
|
-
*/
|
|
38
|
-
resolveSelectClause(selectClause: SimpleAttributeOperand): NodeId | null;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
*/
|
|
43
|
-
readValue(sessionContext: ISessionContext, nodeId: NodeId, selectClause: SimpleAttributeOperand): Variant;
|
|
23
|
+
eventData: IEventData | null;
|
|
24
|
+
branchId: NodeId | null;
|
|
44
25
|
|
|
26
|
+
|
|
45
27
|
/**
|
|
46
28
|
* @method getBrandId
|
|
47
29
|
* @return {NodeId}
|
|
@@ -293,5 +275,5 @@ export interface ConditionSnapshot extends EventEmitter {
|
|
|
293
275
|
/**
|
|
294
276
|
* @private
|
|
295
277
|
*/
|
|
296
|
-
_constructEventData(): IEventData
|
|
278
|
+
_constructEventData(): IEventData;
|
|
297
279
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { UAVariableT, UAVariable, IAddressSpace } from "node-opcua-address-space-base";
|
|
2
2
|
import { DataType } from "node-opcua-basic-types";
|
|
3
3
|
import { DataValue } from "node-opcua-data-value";
|
|
4
|
-
import {
|
|
4
|
+
import { SetPointSupport } from "./install_setpoint_options";
|
|
5
5
|
|
|
6
|
-
export interface DeviationStuff {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export interface DeviationStuff extends SetPointSupport {
|
|
7
|
+
|
|
8
|
+
|
|
9
9
|
_onSetpointDataValueChange(dataValue: DataValue): void;
|
|
10
10
|
_setStateBasedOnInputValue(value: any): void;
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
getSetpointNodeNode(): UAVariableT<number, DataType.Double> | UAVariableT<number, DataType.Float> | undefined ;
|
|
13
|
+
|
|
12
14
|
getInputNodeValue(): any;
|
|
13
15
|
getSetpointValue(): number | null;
|
|
14
16
|
|
|
15
17
|
readonly addressSpace: IAddressSpace;
|
|
16
|
-
}
|
|
18
|
+
}
|
|
@@ -3,5 +3,14 @@ import { DataType } from "node-opcua-basic-types";
|
|
|
3
3
|
import { NodeId } from "node-opcua-nodeid";
|
|
4
4
|
|
|
5
5
|
export interface InstallSetPointOptions {
|
|
6
|
+
|
|
7
|
+
// the set point used in the deviation calculation.
|
|
8
|
+
// In cases where the Alarm is generated by an underlying system and if the Variable is not in the AddressSpace
|
|
9
|
+
// a NULL NodeId shall be provided.
|
|
10
|
+
setpointNode?: UAVariableT<number, DataType.Double> | UAVariableT<number, DataType.Float> | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SetPointSupport {
|
|
14
|
+
setpointNodeNode?: UAVariableT<number, DataType.Double> | UAVariableT<number, DataType.Float>;
|
|
6
15
|
setpointNode: UAVariableT<NodeId, DataType.NodeId>;
|
|
7
16
|
}
|
package/source/interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InstallSetPointOptions } from "./install_setpoint_options";
|
|
2
|
+
import { InstantiateLimitAlarmOptions } from "./instantiate_limit_alarm_options";
|
|
3
|
+
|
|
4
|
+
export interface InstantiateExclusiveDeviationAlarmOptions extends InstantiateLimitAlarmOptions, InstallSetPointOptions {}
|
|
@@ -2,9 +2,9 @@ import { UAVariable } from "node-opcua-address-space-base";
|
|
|
2
2
|
import { InstantiateAlarmConditionOptions } from "./instantiate_alarm_condition_options";
|
|
3
3
|
|
|
4
4
|
export interface InstantiateLimitAlarmOptions extends InstantiateAlarmConditionOptions {
|
|
5
|
-
highHighLimit
|
|
5
|
+
highHighLimit?: number;
|
|
6
6
|
highLimit: number;
|
|
7
7
|
lowLimit: number;
|
|
8
|
-
lowLowLimit
|
|
8
|
+
lowLowLimit?: number;
|
|
9
9
|
inputNode: UAVariable;
|
|
10
10
|
}
|
package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InstallSetPointOptions } from "./install_setpoint_options";
|
|
2
|
+
import { InstantiateLimitAlarmOptions } from "./instantiate_limit_alarm_options";
|
|
3
|
+
|
|
4
|
+
export interface InstantiateNonExclusiveDeviationAlarmOptions extends InstantiateLimitAlarmOptions, InstallSetPointOptions {}
|
package/source/interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InstallSetPointOptions } from "./install_setpoint_options";
|
|
2
|
+
import { InstantiateLimitAlarmOptions } from "./instantiate_limit_alarm_options";
|
|
3
|
+
|
|
4
|
+
export interface InstantiateNonExclusiveLimitAlarmOptions extends InstantiateLimitAlarmOptions, InstallSetPointOptions {}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
+
import { UAVariable } from "node-opcua-address-space-base";
|
|
1
2
|
import { NodeIdLike } from "node-opcua-nodeid";
|
|
2
3
|
import { InstantiateAlarmConditionOptions } from "./instantiate_alarm_condition_options";
|
|
3
4
|
|
|
4
5
|
export interface InstantiateOffNormalAlarmOptions extends InstantiateAlarmConditionOptions {
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* https://reference.opcfoundation.org/v105/Core/docs/Part9/5.8.23/#5.8.23.2
|
|
9
|
+
*
|
|
10
|
+
* The NormalState Property is a Property that points to a Variable which has a value that corresponds
|
|
11
|
+
* to one of the possible values of the Variable pointed to by the InputNode Property where the NormalState
|
|
12
|
+
* Property Variable value is the value that is considered to be the normal state of the Variable
|
|
13
|
+
* pointed to by the InputNode Property.
|
|
14
|
+
*
|
|
15
|
+
* When the value of the Variable referenced by the InputNode Property is not equal to the value of
|
|
16
|
+
* the NormalState Property the Alarm is Active. If this Variable is not in the AddressSpace,
|
|
17
|
+
* a NULL NodeId shall be provided.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
normalState?: NodeIdLike | UAVariable | null;
|
|
6
21
|
}
|
|
@@ -26,6 +26,5 @@ export interface UANonExclusiveDeviationAlarmEx
|
|
|
26
26
|
>,
|
|
27
27
|
UANonExclusiveLimitAlarmEx,
|
|
28
28
|
DeviationStuff {
|
|
29
|
-
|
|
30
|
-
setpointNodeNode: UAVariable;
|
|
29
|
+
setpointNodeNode: UAVariableT<number, DataType.Double> | UAVariableT<number, DataType.Float>;
|
|
31
30
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { UAEventType } from "node-opcua-address-space-base";
|
|
2
1
|
import { NodeId } from "node-opcua-nodeid";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
} from "./interfaces/alarms_and_conditions/
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
} from "./interfaces/alarms_and_conditions/
|
|
2
|
+
import { UAEventType } from "node-opcua-address-space-base";
|
|
3
|
+
import { VariantOptions } from "node-opcua-variant";
|
|
4
|
+
|
|
5
|
+
import { UAOffNormalAlarmEx } from "../src/alarms_and_conditions/ua_off_normal_alarm_impl";
|
|
6
|
+
import { InstantiateAlarmConditionOptions } from "./interfaces/alarms_and_conditions/instantiate_alarm_condition_options";
|
|
7
|
+
import { InstantiateExclusiveLimitAlarmOptions } from "./interfaces/alarms_and_conditions/instantiate_exclusive_limit_alarm_options";
|
|
8
|
+
import { InstantiateLimitAlarmOptions } from "./interfaces/alarms_and_conditions/instantiate_limit_alarm_options";
|
|
9
|
+
import { InstantiateNonExclusiveDeviationAlarmOptions } from "./interfaces/alarms_and_conditions/instantiate_non_exclusive_deviation_alarm_options";
|
|
10
|
+
import { InstantiateOffNormalAlarmOptions } from "./interfaces/alarms_and_conditions/instantiate_off_normal_alarm_options";
|
|
11
|
+
import { UAAcknowledgeableConditionEx } from "./interfaces/alarms_and_conditions/ua_acknowledgeable_condition_ex";
|
|
12
|
+
import { UAAlarmConditionEx } from "./interfaces/alarms_and_conditions/ua_alarm_condition_ex";
|
|
12
13
|
import { UAConditionEx } from "./interfaces/alarms_and_conditions/ua_condition_ex";
|
|
13
14
|
import { UADiscreteAlarmEx } from "./interfaces/alarms_and_conditions/ua_discrete_alarm_ex";
|
|
14
15
|
import { UAExclusiveDeviationAlarmEx } from "./interfaces/alarms_and_conditions/ua_exclusive_deviation_alarm_ex";
|
|
@@ -16,38 +17,62 @@ import { UAExclusiveLimitAlarmEx } from "./interfaces/alarms_and_conditions/ua_e
|
|
|
16
17
|
import { UALimitAlarmEx } from "./interfaces/alarms_and_conditions/ua_limit_alarm_ex";
|
|
17
18
|
import { UANonExclusiveDeviationAlarmEx } from "./interfaces/alarms_and_conditions/ua_non_exclusive_deviation_alarm_ex";
|
|
18
19
|
import { UANonExclusiveLimitAlarmEx } from "./interfaces/alarms_and_conditions/ua_non_exclusive_limit_alarm_ex";
|
|
20
|
+
import { InstantiateNonExclusiveLimitAlarmOptions } from "./interfaces/alarms_and_conditions/instantiate_non_exclusive_limit_alarm_options";
|
|
21
|
+
import { InstantiateExclusiveDeviationAlarmOptions } from "./interfaces/alarms_and_conditions/instantiate_exclusive_deviation_alarm_options";
|
|
19
22
|
|
|
20
23
|
export interface INamespaceAlarmAndCondition {
|
|
21
24
|
// --- Alarms & Conditions -------------------------------------------------
|
|
22
|
-
instantiateCondition(
|
|
25
|
+
instantiateCondition(
|
|
26
|
+
conditionTypeId: UAEventType | NodeId | string,
|
|
27
|
+
options: any,
|
|
28
|
+
data?: Record<string, VariantOptions>
|
|
29
|
+
): UAConditionEx;
|
|
23
30
|
|
|
24
31
|
instantiateAcknowledgeableCondition(
|
|
25
32
|
conditionTypeId: UAEventType | NodeId | string,
|
|
26
|
-
options:
|
|
27
|
-
data?:
|
|
33
|
+
options: InstantiateAlarmConditionOptions,
|
|
34
|
+
data?: Record<string, VariantOptions>
|
|
28
35
|
): UAAcknowledgeableConditionEx;
|
|
29
36
|
|
|
30
|
-
instantiateAlarmCondition(
|
|
37
|
+
instantiateAlarmCondition(
|
|
38
|
+
alarmConditionTypeId: UAEventType | NodeId | string,
|
|
39
|
+
options: InstantiateAlarmConditionOptions,
|
|
40
|
+
data?: Record<string, VariantOptions>
|
|
41
|
+
): UAAlarmConditionEx;
|
|
31
42
|
|
|
32
|
-
instantiateLimitAlarm(
|
|
43
|
+
instantiateLimitAlarm(
|
|
44
|
+
limitAlarmTypeId: UAEventType | NodeId | string,
|
|
45
|
+
options: InstantiateLimitAlarmOptions,
|
|
46
|
+
data?: Record<string, VariantOptions>
|
|
47
|
+
): UALimitAlarmEx;
|
|
33
48
|
|
|
34
49
|
instantiateExclusiveLimitAlarm(
|
|
35
50
|
exclusiveLimitAlarmTypeId: UAEventType | NodeId | string,
|
|
36
|
-
options:
|
|
37
|
-
data?:
|
|
51
|
+
options: InstantiateExclusiveLimitAlarmOptions,
|
|
52
|
+
data?: Record<string, VariantOptions>
|
|
38
53
|
): UAExclusiveLimitAlarmEx;
|
|
39
54
|
|
|
40
|
-
instantiateExclusiveDeviationAlarm(
|
|
55
|
+
instantiateExclusiveDeviationAlarm(
|
|
56
|
+
options: InstantiateExclusiveDeviationAlarmOptions,
|
|
57
|
+
data?: Record<string, VariantOptions>
|
|
58
|
+
): UAExclusiveDeviationAlarmEx;
|
|
41
59
|
|
|
42
60
|
instantiateNonExclusiveLimitAlarm(
|
|
43
61
|
nonExclusiveLimitAlarmTypeId: UAEventType | NodeId | string,
|
|
44
|
-
options:
|
|
45
|
-
data?:
|
|
62
|
+
options: InstantiateNonExclusiveLimitAlarmOptions,
|
|
63
|
+
data?: Record<string, VariantOptions>
|
|
46
64
|
): UANonExclusiveLimitAlarmEx;
|
|
47
65
|
|
|
48
|
-
instantiateNonExclusiveDeviationAlarm(
|
|
66
|
+
instantiateNonExclusiveDeviationAlarm(
|
|
67
|
+
options: InstantiateNonExclusiveDeviationAlarmOptions,
|
|
68
|
+
data?: Record<string, VariantOptions>
|
|
69
|
+
): UANonExclusiveDeviationAlarmEx;
|
|
49
70
|
|
|
50
|
-
instantiateDiscreteAlarm(
|
|
71
|
+
instantiateDiscreteAlarm(
|
|
72
|
+
discreteAlarmType: UAEventType | NodeId | string,
|
|
73
|
+
options: InstantiateAlarmConditionOptions,
|
|
74
|
+
data?: Record<string, VariantOptions>
|
|
75
|
+
): UADiscreteAlarmEx;
|
|
51
76
|
|
|
52
|
-
instantiateOffNormalAlarm(options:
|
|
77
|
+
instantiateOffNormalAlarm(options: InstantiateOffNormalAlarmOptions, data?: Record<string, VariantOptions>): UAOffNormalAlarmEx;
|
|
53
78
|
}
|
package/src/address_space.ts
CHANGED
|
@@ -740,20 +740,25 @@ export class AddressSpace implements AddressSpacePrivate {
|
|
|
740
740
|
throw new Error("BaseObjectType must be defined in the address space");
|
|
741
741
|
}
|
|
742
742
|
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
743
|
+
const hasProperty = (data: any, propertyName: string): boolean => Object.prototype.hasOwnProperty.call(data, propertyName);
|
|
744
|
+
|
|
745
|
+
const visitedProperties: { [key: string]: number } = {};
|
|
746
|
+
const alreadyVisited=(key: string) => Object.prototype.hasOwnProperty.call(visitedProperties, key);
|
|
747
|
+
const markAsVisited=(key: string) => visitedProperties[key] = 1;
|
|
748
|
+
|
|
749
|
+
function _process_var(self: BaseNode, prefixLower: string, prefixStandard: string, node: BaseNode) {
|
|
750
|
+
const lowerName = prefixLower + lowerFirstLetter(node.browseName!.name!);
|
|
751
|
+
const fullBrowsePath = prefixStandard + node.browseName.toString();
|
|
752
|
+
if(alreadyVisited(lowerName)) {
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
markAsVisited(lowerName);
|
|
756
|
+
|
|
757
|
+
if (hasProperty(data, lowerName)) {
|
|
758
|
+
eventData._createValue(fullBrowsePath, node, data[lowerName] as VariantOptions);
|
|
754
759
|
} else {
|
|
755
760
|
// add a property , but with a null variant
|
|
756
|
-
eventData.
|
|
761
|
+
eventData._createValue(fullBrowsePath, node, { dataType: DataType.Null });
|
|
757
762
|
|
|
758
763
|
if (doDebug) {
|
|
759
764
|
if (node.modellingRule === "Mandatory") {
|
|
@@ -779,13 +784,13 @@ export class AddressSpace implements AddressSpacePrivate {
|
|
|
779
784
|
}
|
|
780
785
|
|
|
781
786
|
// verify that all elements of data are valid
|
|
782
|
-
function verify_data_is_valid(data1:
|
|
787
|
+
function verify_data_is_valid(data1: Record<string, unknown>) {
|
|
783
788
|
Object.keys(data1).map((k: string) => {
|
|
784
789
|
if (k === "$eventDataSource") {
|
|
785
790
|
return;
|
|
786
791
|
}
|
|
787
792
|
/* istanbul ignore next */
|
|
788
|
-
if (!
|
|
793
|
+
if (!alreadyVisited(k)) {
|
|
789
794
|
throw new Error(
|
|
790
795
|
" cannot find property '" +
|
|
791
796
|
k +
|
|
@@ -839,7 +844,7 @@ export class AddressSpace implements AddressSpacePrivate {
|
|
|
839
844
|
continue;
|
|
840
845
|
}
|
|
841
846
|
|
|
842
|
-
_process_var(self, "", node);
|
|
847
|
+
_process_var(self, "", "", node);
|
|
843
848
|
|
|
844
849
|
// also store value in index
|
|
845
850
|
// xx eventData.__nodes[node.nodeId.toString()] = eventData[lowerName];
|
|
@@ -847,10 +852,11 @@ export class AddressSpace implements AddressSpacePrivate {
|
|
|
847
852
|
const children2 = node.getAggregates();
|
|
848
853
|
if (children2.length > 0) {
|
|
849
854
|
const lowerName = lowerFirstLetter(node.browseName.name!);
|
|
855
|
+
const standardName = node.browseName.toString();
|
|
850
856
|
// console.log(" Children to visit = ",lowerName,
|
|
851
857
|
// children.map(function(a){ return a.browseName.toString();}).join(" "));
|
|
852
858
|
for (const child2 of children2) {
|
|
853
|
-
_process_var(self, lowerName + ".", child2);
|
|
859
|
+
_process_var(self, lowerName + ".", standardName + ".", child2);
|
|
854
860
|
}
|
|
855
861
|
}
|
|
856
862
|
}
|
|
@@ -21,7 +21,7 @@ export function _setAckedState(
|
|
|
21
21
|
if (ackedState && requestedAckedState) {
|
|
22
22
|
return StatusCodes.BadConditionBranchAlreadyAcked;
|
|
23
23
|
}
|
|
24
|
-
self._set_twoStateVariable("
|
|
24
|
+
self._set_twoStateVariable("AckedState", requestedAckedState);
|
|
25
25
|
return StatusCodes.Good;
|
|
26
26
|
}
|
|
27
27
|
|