node-opcua-address-space 2.77.0 → 2.79.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/continuation_points/continuation_point_manager.d.ts +59 -0
- package/dist/source/continuation_points/continuation_point_manager.js +6 -6
- package/dist/source/continuation_points/continuation_point_manager.js.map +1 -1
- package/dist/source/index.d.ts +1 -0
- package/dist/source/index.js +1 -0
- package/dist/source/index.js.map +1 -1
- package/dist/source/loader/ensure_datatype_extracted.js +25 -0
- package/dist/source/loader/ensure_datatype_extracted.js.map +1 -1
- package/dist/source/loader/generateAddressSpaceRaw.d.ts +2 -1
- package/dist/source/loader/generateAddressSpaceRaw.js +2 -2
- package/dist/source/loader/generateAddressSpaceRaw.js.map +1 -1
- package/dist/source/loader/load_nodeset2.d.ts +7 -3
- package/dist/source/loader/load_nodeset2.js +66 -31
- package/dist/source/loader/load_nodeset2.js.map +1 -1
- package/dist/source/xml_writer.d.ts +5 -0
- package/dist/src/alarms_and_conditions/ua_limit_alarm_impl.d.ts +1 -1
- package/dist/src/base_node_impl.d.ts +1 -0
- package/dist/src/base_node_impl.js +30 -3
- package/dist/src/base_node_impl.js.map +1 -1
- package/dist/src/base_node_private.js +5 -0
- package/dist/src/base_node_private.js.map +1 -1
- package/dist/src/historical_access/address_space_historical_data_node.js +14 -3
- package/dist/src/historical_access/address_space_historical_data_node.js.map +1 -1
- package/dist/src/index_current.d.ts +2 -1
- package/dist/src/index_current.js +3 -2
- package/dist/src/index_current.js.map +1 -1
- package/dist/src/namespace_impl.d.ts +2 -0
- package/dist/src/namespace_impl.js +11 -1
- package/dist/src/namespace_impl.js.map +1 -1
- package/dist/src/namespace_private.d.ts +1 -0
- package/dist/src/namespace_private.js.map +1 -1
- package/dist/src/nodeid_manager.d.ts +1 -0
- package/dist/src/nodeid_manager.js +14 -2
- package/dist/src/nodeid_manager.js.map +1 -1
- package/dist/src/nodeset_tools/{typedictionary_to_xml.d.ts → dump_to_bsd.d.ts} +1 -1
- package/dist/src/nodeset_tools/{typedictionary_to_xml.js → dump_to_bsd.js} +14 -5
- package/dist/src/nodeset_tools/dump_to_bsd.js.map +1 -0
- package/dist/src/nodeset_tools/nodeset_to_xml.d.ts +9 -1
- package/dist/src/nodeset_tools/nodeset_to_xml.js +220 -89
- package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
- package/dist/src/tool_isSupertypeOf.js +12 -2
- package/dist/src/tool_isSupertypeOf.js.map +1 -1
- package/dist/src/ua_data_type_impl.js +10 -5
- package/dist/src/ua_data_type_impl.js.map +1 -1
- package/dist/src/ua_method_impl.d.ts +2 -1
- package/dist/src/ua_method_impl.js +9 -1
- package/dist/src/ua_method_impl.js.map +1 -1
- package/dist/src/ua_object_impl.js +8 -1
- package/dist/src/ua_object_impl.js.map +1 -1
- package/dist/src/ua_variable_impl.d.ts +5 -0
- package/dist/src/ua_variable_impl.js +36 -2
- package/dist/src/ua_variable_impl.js.map +1 -1
- package/dist/src/ua_variable_impl_ext_obj.js +1 -1
- package/dist/src/ua_variable_impl_ext_obj.js.map +1 -1
- package/distHelpers/get_mini_address_space.js +1 -1
- package/distHelpers/get_mini_address_space.js.map +1 -1
- package/distNodeJS/generate_address_space.d.ts +3 -1
- package/distNodeJS/generate_address_space.js +13 -2
- package/distNodeJS/generate_address_space.js.map +1 -1
- package/package.json +26 -26
- package/source/continuation_points/continuation_point_manager.ts +13 -12
- package/source/index.ts +1 -0
- package/source/loader/ensure_datatype_extracted.ts +38 -3
- package/source/loader/generateAddressSpaceRaw.ts +4 -3
- package/source/loader/load_nodeset2.ts +86 -33
- package/source/xml_writer.ts +3 -0
- package/source_nodejs/generate_address_space.ts +27 -5
- package/src/alarms_and_conditions/ua_limit_alarm_impl.ts +1 -1
- package/src/base_node_impl.ts +34 -3
- package/src/base_node_private.ts +6 -0
- package/src/historical_access/address_space_historical_data_node.ts +18 -3
- package/src/index_current.ts +3 -1
- package/src/namespace_impl.ts +24 -1
- package/src/namespace_private.ts +2 -0
- package/src/nodeid_manager.ts +14 -5
- package/src/nodeset_tools/{typedictionary_to_xml.ts → dump_to_bsd.ts} +24 -14
- package/src/nodeset_tools/nodeset_to_xml.ts +278 -77
- package/src/tool_isSupertypeOf.ts +14 -2
- package/src/ua_data_type_impl.ts +11 -7
- package/src/ua_method_impl.ts +9 -3
- package/src/ua_object_impl.ts +12 -2
- package/src/ua_variable_impl.ts +42 -4
- package/src/ua_variable_impl_ext_obj.ts +1 -1
- package/test_helpers/get_mini_address_space.ts +1 -1
- package/test_helpers/test_fixtures/mini.Node.Set2.xml +207 -0
- package/test_helpers/test_fixtures/nodeset_no_aliases.xml +30 -0
- package/test_helpers/test_fixtures/nodeset_no_aliases_with_aliases.xml +31 -0
- package/dist/source/helpers/check_event_clause.d.ts +0 -17
- package/dist/source/helpers/check_event_clause.js +0 -53
- package/dist/source/helpers/check_event_clause.js.map +0 -1
- package/dist/src/alarms_and_conditions/check_where_clause.d.ts +0 -4
- package/dist/src/alarms_and_conditions/check_where_clause.js +0 -110
- package/dist/src/alarms_and_conditions/check_where_clause.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_info.d.ts +0 -27
- package/dist/src/alarms_and_conditions/condition_info.js +0 -55
- package/dist/src/alarms_and_conditions/condition_info.js.map +0 -1
- package/dist/src/alarms_and_conditions/condition_snapshot.d.ts +0 -233
- package/dist/src/alarms_and_conditions/condition_snapshot.js +0 -667
- package/dist/src/alarms_and_conditions/condition_snapshot.js.map +0 -1
- package/dist/src/alarms_and_conditions/extract_event_fields.d.ts +0 -10
- package/dist/src/alarms_and_conditions/extract_event_fields.js +0 -90
- package/dist/src/alarms_and_conditions/extract_event_fields.js.map +0 -1
- package/dist/src/data_access/ua_multistate_value_discrete.d.ts +0 -51
- package/dist/src/data_access/ua_multistate_value_discrete.js +0 -250
- package/dist/src/data_access/ua_multistate_value_discrete.js.map +0 -1
- package/dist/src/data_access/ua_two_state_discrete.d.ts +0 -25
- package/dist/src/data_access/ua_two_state_discrete.js +0 -154
- package/dist/src/data_access/ua_two_state_discrete.js.map +0 -1
- package/dist/src/nodeset_tools/typedictionary_to_xml.js.map +0 -1
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkWhereClause = exports.__checkWhereClause = void 0;
|
|
4
|
-
const node_opcua_types_1 = require("node-opcua-types");
|
|
5
|
-
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
6
|
-
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
7
|
-
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
8
|
-
const session_context_1 = require("../../source/session_context");
|
|
9
|
-
const extract_event_fields_1 = require("./extract_event_fields");
|
|
10
|
-
function checkNot(addressSpace, sessionContext, whereClause, eventData, filteredOperands) {
|
|
11
|
-
if (filteredOperands[0] instanceof node_opcua_types_1.ElementOperand) {
|
|
12
|
-
const index = filteredOperands[0].index;
|
|
13
|
-
return !__checkWhereClause(addressSpace, sessionContext, whereClause, index, eventData);
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
function checkOfType(addressSpace, ofType, eventData) {
|
|
18
|
-
var _a;
|
|
19
|
-
// istanbul ignore next
|
|
20
|
-
if (!ofType) {
|
|
21
|
-
throw new Error("invalid operand");
|
|
22
|
-
}
|
|
23
|
-
// istanbul ignore next
|
|
24
|
-
if (ofType.value.dataType !== node_opcua_variant_1.DataType.NodeId) {
|
|
25
|
-
throw new Error("invalid operand type (expecting Nodeid");
|
|
26
|
-
}
|
|
27
|
-
const ofTypeNode = addressSpace.findNode(ofType.value.value);
|
|
28
|
-
// istanbul ignore next
|
|
29
|
-
if (!ofTypeNode) {
|
|
30
|
-
return false; // the ofType node is not known, we don't know what to do
|
|
31
|
-
}
|
|
32
|
-
// istanbul ignore next
|
|
33
|
-
if (ofTypeNode.nodeClass !== node_opcua_data_model_1.NodeClass.ObjectType) {
|
|
34
|
-
throw new Error("operand should be a ObjectType " + ofTypeNode.nodeId.toString());
|
|
35
|
-
}
|
|
36
|
-
const node = eventData.$eventDataSource;
|
|
37
|
-
if (!node) {
|
|
38
|
-
throw new Error("cannot find node " + ((_a = eventData.$eventDataSource) === null || _a === void 0 ? void 0 : _a.toString()));
|
|
39
|
-
}
|
|
40
|
-
if (node.nodeClass === node_opcua_data_model_1.NodeClass.ObjectType) {
|
|
41
|
-
return node.isSupertypeOf(ofTypeNode);
|
|
42
|
-
}
|
|
43
|
-
if (node.nodeClass === node_opcua_data_model_1.NodeClass.Object && node.typeDefinitionObj) {
|
|
44
|
-
return node.typeDefinitionObj.isSupertypeOf(ofTypeNode);
|
|
45
|
-
}
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
function _extractValue(operand, eventData) {
|
|
49
|
-
// eventData.readValue;
|
|
50
|
-
const v = (0, extract_event_fields_1.extractEventFields)(session_context_1.SessionContext.defaultContext, [operand], eventData)[0];
|
|
51
|
-
return v.value;
|
|
52
|
-
}
|
|
53
|
-
function checkInList(addressSpace, filterOperands, eventData) {
|
|
54
|
-
const operand0 = filterOperands[0];
|
|
55
|
-
if (!(operand0 instanceof node_opcua_types_1.SimpleAttributeOperand)) {
|
|
56
|
-
// unsupported case
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
const nodeId = _extractValue(operand0, eventData);
|
|
60
|
-
if (!nodeId) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
function _is(nodeId1, operandX) {
|
|
64
|
-
const operandNode = addressSpace.findNode(operandX.value.value);
|
|
65
|
-
if (!operandNode) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
return (0, node_opcua_nodeid_1.sameNodeId)(nodeId1, operandNode.nodeId);
|
|
69
|
-
}
|
|
70
|
-
for (let i = 1; i < filterOperands.length; i++) {
|
|
71
|
-
const filterOperand = filterOperands[i];
|
|
72
|
-
if (filterOperand instanceof node_opcua_types_1.LiteralOperand && _is(nodeId, filterOperand)) {
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
function __checkWhereClause(addressSpace, sessionContext, whereClause, index, eventData) {
|
|
79
|
-
if (!whereClause.elements || whereClause.elements.length === 0) {
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
const element = whereClause.elements[index];
|
|
83
|
-
if (!element) {
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
switch (element.filterOperator) {
|
|
87
|
-
case node_opcua_types_1.FilterOperator.Not:
|
|
88
|
-
return checkNot(addressSpace, sessionContext, whereClause, eventData, element.filterOperands);
|
|
89
|
-
case node_opcua_types_1.FilterOperator.OfType:
|
|
90
|
-
return checkOfType(addressSpace, element.filterOperands[0], eventData);
|
|
91
|
-
case node_opcua_types_1.FilterOperator.InList:
|
|
92
|
-
return checkInList(addressSpace, element.filterOperands, eventData);
|
|
93
|
-
default:
|
|
94
|
-
// from Spec OPC Unified Architecture, Part 4 133 Release 1.04
|
|
95
|
-
// Any basic FilterOperator in Table 119 may be used in the whereClause, however, only the
|
|
96
|
-
// OfType_14 FilterOperator from Table 120 is permitted.
|
|
97
|
-
// tslint:disable-next-line: no-console
|
|
98
|
-
console.log("whereClause = ", whereClause.toString());
|
|
99
|
-
throw new Error("Only OfType operator are allowed in checkWhereClause");
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.__checkWhereClause = __checkWhereClause;
|
|
103
|
-
function checkWhereClause(addressSpace, sessionContext, whereClause, eventData) {
|
|
104
|
-
if (!whereClause.elements || whereClause.elements.length === 0) {
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
return __checkWhereClause(addressSpace, sessionContext, whereClause, 0, eventData);
|
|
108
|
-
}
|
|
109
|
-
exports.checkWhereClause = checkWhereClause;
|
|
110
|
-
//# sourceMappingURL=check_where_clause.js.map
|
|
@@ -1 +0,0 @@
|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CAAuC;YACvC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;YACtD,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;KAC/E;AACL,CAAC;AA7BD,gDA6BC;AAED,SAAgB,gBAAgB,CAC5B,YAA2B,EAC3B,cAA+B,EAC/B,WAA0B,EAC1B,SAAqB;IAErB,IAAI,CAAC,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QAC5D,OAAO,IAAI,CAAC;KACf;IACD,OAAO,kBAAkB,CAAC,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;AACvF,CAAC;AAVD,4CAUC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { UInt16 } from "node-opcua-basic-types";
|
|
2
|
-
import { LocalizedText } from "node-opcua-data-model";
|
|
3
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
4
|
-
import { ConditionInfoOptions } from "../../source/interfaces/alarms_and_conditions/condition_info_i";
|
|
5
|
-
export interface ConditionInfo {
|
|
6
|
-
message: LocalizedText | null;
|
|
7
|
-
quality: StatusCode | null;
|
|
8
|
-
severity: UInt16 | null;
|
|
9
|
-
retain: boolean | null;
|
|
10
|
-
isDifferentFrom(otherConditionInfo: ConditionInfo): boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @class ConditionInfo
|
|
14
|
-
* @param options {Object}
|
|
15
|
-
* @param options.message {String|LocalizedText} the event message
|
|
16
|
-
* @param options.severity {UInt16} severity
|
|
17
|
-
* @param options.quality {StatusCode} quality
|
|
18
|
-
* @param options.retain {Boolean} retain flag
|
|
19
|
-
* @constructor
|
|
20
|
-
*/
|
|
21
|
-
export declare class ConditionInfo {
|
|
22
|
-
message: LocalizedText | null;
|
|
23
|
-
quality: StatusCode | null;
|
|
24
|
-
severity: UInt16 | null;
|
|
25
|
-
retain: boolean | null;
|
|
26
|
-
constructor(options: ConditionInfoOptions);
|
|
27
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConditionInfo = 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
|
-
/**
|
|
10
|
-
* @class ConditionInfo
|
|
11
|
-
* @param options {Object}
|
|
12
|
-
* @param options.message {String|LocalizedText} the event message
|
|
13
|
-
* @param options.severity {UInt16} severity
|
|
14
|
-
* @param options.quality {StatusCode} quality
|
|
15
|
-
* @param options.retain {Boolean} retain flag
|
|
16
|
-
* @constructor
|
|
17
|
-
*/
|
|
18
|
-
class ConditionInfo {
|
|
19
|
-
constructor(options) {
|
|
20
|
-
this.message = null;
|
|
21
|
-
this.quality = null;
|
|
22
|
-
this.severity = 0;
|
|
23
|
-
this.retain = false;
|
|
24
|
-
this.severity = null;
|
|
25
|
-
this.quality = null;
|
|
26
|
-
this.message = null;
|
|
27
|
-
this.retain = null;
|
|
28
|
-
if (Object.prototype.hasOwnProperty.call(options, "message") && options.message) {
|
|
29
|
-
this.message = node_opcua_data_model_1.LocalizedText.coerce(options.message);
|
|
30
|
-
}
|
|
31
|
-
if (Object.prototype.hasOwnProperty.call(options, "quality") && options.quality !== null) {
|
|
32
|
-
this.quality = options.quality;
|
|
33
|
-
}
|
|
34
|
-
if (Object.prototype.hasOwnProperty.call(options, "severity") && options.severity !== null) {
|
|
35
|
-
(0, node_opcua_assert_1.assert)(typeof options.severity === "number");
|
|
36
|
-
this.severity = options.severity;
|
|
37
|
-
}
|
|
38
|
-
if (Object.prototype.hasOwnProperty.call(options, "retain") && options.retain !== null) {
|
|
39
|
-
(0, node_opcua_assert_1.assert)(typeof options.retain === "boolean");
|
|
40
|
-
this.retain = options.retain;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* @method isDifferentFrom
|
|
45
|
-
* @param otherConditionInfo {ConditionInfo}
|
|
46
|
-
* @return {Boolean}
|
|
47
|
-
*/
|
|
48
|
-
isDifferentFrom(otherConditionInfo) {
|
|
49
|
-
return (this.severity !== otherConditionInfo.severity ||
|
|
50
|
-
this.quality !== otherConditionInfo.quality ||
|
|
51
|
-
this.message !== otherConditionInfo.message);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.ConditionInfo = ConditionInfo;
|
|
55
|
-
//# sourceMappingURL=condition_info.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"condition_info.js","sourceRoot":"","sources":["../../../src/alarms_and_conditions/condition_info.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAE3C,iEAAyE;AAWzE;;;;;;;;GAQG;AACH,MAAa,aAAa;IAMtB,YAAY,OAA6B;QALlC,YAAO,GAAyB,IAAI,CAAC;QACrC,YAAO,GAAsB,IAAI,CAAC;QAClC,aAAQ,GAAkB,CAAC,CAAC;QAC5B,WAAM,GAAmB,KAAK,CAAC;QAGlC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QAEnB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE;YAC7E,IAAI,CAAC,OAAO,GAAG,qCAAa,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SACxD;QACD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,EAAE;YACtF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAQ,CAAC;SACnC;QACD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE;YACxF,IAAA,0BAAM,EAAC,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;YAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAS,CAAC;SACrC;QACD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,EAAE;YACpF,IAAA,0BAAM,EAAC,OAAO,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;YAC5C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAO,CAAC;SACjC;IACL,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAC,kBAAiC;QACpD,OAAO,CACH,IAAI,CAAC,QAAQ,KAAK,kBAAkB,CAAC,QAAQ;YAC7C,IAAI,CAAC,OAAO,KAAK,kBAAkB,CAAC,OAAO;YAC3C,IAAI,CAAC,OAAO,KAAK,kBAAkB,CAAC,OAAO,CAC9C,CAAC;IACN,CAAC;CACJ;AAxCD,sCAwCC"}
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/**
|
|
4
|
-
* @module node-opcua-address-space.AlarmsAndConditions
|
|
5
|
-
*/
|
|
6
|
-
import { EventEmitter } from "events";
|
|
7
|
-
import { IEventData, UAVariable, BaseNode, ISessionContext } from "node-opcua-address-space-base";
|
|
8
|
-
import { UInt16 } from "node-opcua-basic-types";
|
|
9
|
-
import { LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
|
|
10
|
-
import { NodeId } from "node-opcua-nodeid";
|
|
11
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
12
|
-
import { SimpleAttributeOperand, TimeZoneDataType } from "node-opcua-types";
|
|
13
|
-
import { DataType, Variant } from "node-opcua-variant";
|
|
14
|
-
import { UtcTime } from "../../source/interfaces/state_machine/ua_state_machine_type";
|
|
15
|
-
export interface ConditionSnapshot {
|
|
16
|
-
on(eventName: "value_changed", eventHandler: (node: UAVariable, variant: Variant) => void): this;
|
|
17
|
-
}
|
|
18
|
-
declare function normalizeName(str: string): string;
|
|
19
|
-
export declare class ConditionSnapshot extends EventEmitter {
|
|
20
|
-
static normalizeName: typeof normalizeName;
|
|
21
|
-
condition: BaseNode;
|
|
22
|
-
eventData: IEventData | null;
|
|
23
|
-
branchId: NodeId | null;
|
|
24
|
-
private _map;
|
|
25
|
-
private _node_index;
|
|
26
|
-
/**
|
|
27
|
-
* @class ConditionSnapshot
|
|
28
|
-
* @extends EventEmitter
|
|
29
|
-
* @param condition
|
|
30
|
-
* @param branchId
|
|
31
|
-
* @constructor
|
|
32
|
-
*/
|
|
33
|
-
constructor(condition: BaseNode, branchId: NodeId);
|
|
34
|
-
_constructEventData(): IEventData;
|
|
35
|
-
/**
|
|
36
|
-
* @method resolveSelectClause
|
|
37
|
-
* @param selectClause {SelectClause}
|
|
38
|
-
*/
|
|
39
|
-
resolveSelectClause(selectClause: SimpleAttributeOperand): NodeId | null;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
*/
|
|
43
|
-
readValue(sessionContext: ISessionContext, nodeId: NodeId, selectClause: SimpleAttributeOperand): Variant;
|
|
44
|
-
_get_var(varName: string): any;
|
|
45
|
-
_set_var(varName: string, dataType: DataType, value: unknown): void;
|
|
46
|
-
/**
|
|
47
|
-
* @method getBrandId
|
|
48
|
-
* @return {NodeId}
|
|
49
|
-
*/
|
|
50
|
-
getBranchId(): NodeId;
|
|
51
|
-
/**
|
|
52
|
-
* @method getEventId
|
|
53
|
-
* @return {ByteString}
|
|
54
|
-
*/
|
|
55
|
-
getEventId(): Buffer;
|
|
56
|
-
/**
|
|
57
|
-
* @method getRetain
|
|
58
|
-
* @return {Boolean}
|
|
59
|
-
*/
|
|
60
|
-
getRetain(): boolean;
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @method setRetain
|
|
64
|
-
* @param retainFlag {Boolean}
|
|
65
|
-
*/
|
|
66
|
-
setRetain(retainFlag: boolean): void;
|
|
67
|
-
/**
|
|
68
|
-
* @method renewEventId
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
renewEventId(): void;
|
|
72
|
-
/**
|
|
73
|
-
* @method getEnabledState
|
|
74
|
-
* @return {Boolean}
|
|
75
|
-
*/
|
|
76
|
-
getEnabledState(): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* @method setEnabledState
|
|
79
|
-
* @param value {Boolean}
|
|
80
|
-
* @return void
|
|
81
|
-
*/
|
|
82
|
-
setEnabledState(value: boolean): void;
|
|
83
|
-
/**
|
|
84
|
-
* @method getEnabledStateAsString
|
|
85
|
-
* @return {String}
|
|
86
|
-
*/
|
|
87
|
-
getEnabledStateAsString(): string;
|
|
88
|
-
/**
|
|
89
|
-
* @method getComment
|
|
90
|
-
* @return {LocalizedText}
|
|
91
|
-
*/
|
|
92
|
-
getComment(): LocalizedText;
|
|
93
|
-
/**
|
|
94
|
-
* Set condition comment
|
|
95
|
-
*
|
|
96
|
-
* Comment contains the last comment provided for a certain state (ConditionBranch). It may
|
|
97
|
-
* have been provided by an AddComment Method, some other Method or in some other
|
|
98
|
-
* manner. The initial value of this Variable is null, unless it is provided in some other manner. If
|
|
99
|
-
* a Method provides as an option the ability to set a Comment, then the value of this Variable is
|
|
100
|
-
* reset to null if an optional comment is not provided.
|
|
101
|
-
*
|
|
102
|
-
* @method setComment
|
|
103
|
-
* @param txtMessage {LocalizedText}
|
|
104
|
-
*/
|
|
105
|
-
setComment(txtMessage: LocalizedTextLike): void;
|
|
106
|
-
/**
|
|
107
|
-
*
|
|
108
|
-
* @method setMessage
|
|
109
|
-
* @param txtMessage {LocalizedText}
|
|
110
|
-
*/
|
|
111
|
-
setMessage(txtMessage: LocalizedTextLike | LocalizedText): void;
|
|
112
|
-
/**
|
|
113
|
-
* @method setClientUserId
|
|
114
|
-
* @param userIdentity {String}
|
|
115
|
-
*/
|
|
116
|
-
setClientUserId(userIdentity: string): void;
|
|
117
|
-
/**
|
|
118
|
-
* set the condition quality
|
|
119
|
-
* @method setQuality
|
|
120
|
-
* @param quality {StatusCode}
|
|
121
|
-
*/
|
|
122
|
-
setQuality(quality: StatusCode): void;
|
|
123
|
-
/**
|
|
124
|
-
* @method getQuality
|
|
125
|
-
* @return {StatusCode}
|
|
126
|
-
*/
|
|
127
|
-
getQuality(): StatusCode;
|
|
128
|
-
/**
|
|
129
|
-
* @method setSeverity
|
|
130
|
-
* @param severity {UInt16}
|
|
131
|
-
*/
|
|
132
|
-
setSeverity(severity: UInt16): void;
|
|
133
|
-
/**
|
|
134
|
-
* @method getSeverity
|
|
135
|
-
* @return {UInt16}
|
|
136
|
-
*/
|
|
137
|
-
getSeverity(): UInt16;
|
|
138
|
-
/**
|
|
139
|
-
* @method setLastSeverity
|
|
140
|
-
* @param severity {UInt16}
|
|
141
|
-
*/
|
|
142
|
-
setLastSeverity(severity: UInt16): void;
|
|
143
|
-
/**
|
|
144
|
-
* @method getLastSeverity
|
|
145
|
-
* @return {UInt16}
|
|
146
|
-
*/
|
|
147
|
-
getLastSeverity(): UInt16;
|
|
148
|
-
/**
|
|
149
|
-
* setReceiveTime
|
|
150
|
-
*
|
|
151
|
-
* (as per OPCUA 1.0.3 part 5)
|
|
152
|
-
*
|
|
153
|
-
* ReceiveTime provides the time the OPC UA Server received the Event from the underlying
|
|
154
|
-
* device of another Server.
|
|
155
|
-
*
|
|
156
|
-
* ReceiveTime is analogous to ServerTimestamp defined in Part 4, i.e.
|
|
157
|
-
* in the case where the OPC UA Server gets an Event from another OPC UA Server, each Server
|
|
158
|
-
* applies its own ReceiveTime. That implies that a Client may get the same Event, having the
|
|
159
|
-
* same EventId, from different Servers having different values of the ReceiveTime.
|
|
160
|
-
*
|
|
161
|
-
* The ReceiveTime shall always be returned as value and the Server is not allowed to return a
|
|
162
|
-
* StatusCode for the ReceiveTime indicating an error.
|
|
163
|
-
*
|
|
164
|
-
* @method setReceiveTime
|
|
165
|
-
* @param time {Date} : UTCTime
|
|
166
|
-
*/
|
|
167
|
-
setReceiveTime(time: UtcTime): void;
|
|
168
|
-
/**
|
|
169
|
-
* (as per OPCUA 1.0.3 part 5)
|
|
170
|
-
* Time provides the time the Event occurred. This value is set as close to the event generator as
|
|
171
|
-
* possible. It often comes from the underlying system or device. Once set, intermediate OPC UA
|
|
172
|
-
* Servers shall not alter the value.
|
|
173
|
-
*
|
|
174
|
-
* @method setTime
|
|
175
|
-
* @param time {Date}
|
|
176
|
-
*/
|
|
177
|
-
setTime(time: Date): void;
|
|
178
|
-
/**
|
|
179
|
-
* LocalTime is a structure containing the Offset and the DaylightSavingInOffset flag. The Offset
|
|
180
|
-
* specifies the time difference (in minutes) between the Time Property and the time at the location
|
|
181
|
-
* in which the event was issued. If DaylightSavingInOffset is TRUE, then Standard/Daylight
|
|
182
|
-
* savings time (DST) at the originating location is in effect and Offset includes the DST c orrection.
|
|
183
|
-
* If FALSE then the Offset does not include DST correction and DST may or may not have been
|
|
184
|
-
* in effect.
|
|
185
|
-
* @method setLocalTime
|
|
186
|
-
* @param localTime {TimeZone}
|
|
187
|
-
*/
|
|
188
|
-
setLocalTime(localTime: TimeZoneDataType): void;
|
|
189
|
-
getSourceName(): LocalizedText;
|
|
190
|
-
/**
|
|
191
|
-
* @method getSourceNode
|
|
192
|
-
* return {NodeId}
|
|
193
|
-
*/
|
|
194
|
-
getSourceNode(): NodeId;
|
|
195
|
-
/**
|
|
196
|
-
* @method getEventType
|
|
197
|
-
* return {NodeId}
|
|
198
|
-
*/
|
|
199
|
-
getEventType(): NodeId;
|
|
200
|
-
getMessage(): LocalizedText;
|
|
201
|
-
isCurrentBranch(): boolean;
|
|
202
|
-
getAckedState(): boolean;
|
|
203
|
-
setAckedState(ackedState: boolean): StatusCode;
|
|
204
|
-
getConfirmedState(): boolean;
|
|
205
|
-
setConfirmedStateIfExists(confirmedState: boolean): void;
|
|
206
|
-
setConfirmedState(confirmedState: boolean): void;
|
|
207
|
-
/**
|
|
208
|
-
* @class ConditionSnapshot
|
|
209
|
-
*/
|
|
210
|
-
/**
|
|
211
|
-
* @method getSuppressedState
|
|
212
|
-
* @return {Boolean}
|
|
213
|
-
*/
|
|
214
|
-
getSuppressedState(): boolean;
|
|
215
|
-
/**
|
|
216
|
-
* @method setSuppressedState
|
|
217
|
-
* @param suppressed {Boolean}
|
|
218
|
-
*/
|
|
219
|
-
setSuppressedState(suppressed: boolean): void;
|
|
220
|
-
getActiveState(): boolean;
|
|
221
|
-
setActiveState(newActiveState: boolean): StatusCode;
|
|
222
|
-
setShelvingState(): void;
|
|
223
|
-
toString(): string;
|
|
224
|
-
/**
|
|
225
|
-
* @class ConditionSnapshot
|
|
226
|
-
* @param varName
|
|
227
|
-
* @param value
|
|
228
|
-
* @private
|
|
229
|
-
*/
|
|
230
|
-
_set_twoStateVariable(varName: string, value: boolean): void;
|
|
231
|
-
protected _get_twoStateVariable(varName: string): any;
|
|
232
|
-
}
|
|
233
|
-
export {};
|