node-opcua-aggregates 2.54.0 → 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 (53) hide show
  1. package/.mocharc.yml +7 -7
  2. package/LICENSE +20 -20
  3. package/bin/sample_aggregate_server.js +14 -14
  4. package/dist/aggregates.js +2 -2
  5. package/dist/aggregates.js.map +1 -1
  6. package/dist/average.js +6 -5
  7. package/dist/average.js.map +1 -1
  8. package/dist/common.js +12 -2
  9. package/dist/common.js.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/interpolate.d.ts +1 -1
  13. package/dist/interpolate.js +8 -12
  14. package/dist/interpolate.js.map +1 -1
  15. package/dist/minmax.js +3 -2
  16. package/dist/minmax.js.map +1 -1
  17. package/dist/read_processed_details.d.ts +2 -2
  18. package/dist/read_processed_details.js +41 -38
  19. package/dist/read_processed_details.js.map +1 -1
  20. package/nyc.config.js +16 -16
  21. package/package.json +17 -15
  22. package/source/aggregates.ts +284 -277
  23. package/source/average.ts +71 -74
  24. package/source/common.ts +23 -10
  25. package/source/index.ts +11 -17
  26. package/source/interpolate.ts +14 -20
  27. package/source/interval.ts +3 -3
  28. package/source/minmax.ts +231 -231
  29. package/source/read_processed_details.ts +149 -139
  30. package/dist2/aggregates.d.ts +0 -7
  31. package/dist2/aggregates.js +0 -201
  32. package/dist2/aggregates.js.map +0 -1
  33. package/dist2/average.d.ts +0 -3
  34. package/dist2/average.js +0 -61
  35. package/dist2/average.js.map +0 -1
  36. package/dist2/common.d.ts +0 -8
  37. package/dist2/common.js +0 -89
  38. package/dist2/common.js.map +0 -1
  39. package/dist2/index.d.ts +0 -11
  40. package/dist2/index.js +0 -29
  41. package/dist2/index.js.map +0 -1
  42. package/dist2/interpolate.d.ts +0 -16
  43. package/dist2/interpolate.js +0 -135
  44. package/dist2/interpolate.js.map +0 -1
  45. package/dist2/interval.d.ts +0 -49
  46. package/dist2/interval.js +0 -165
  47. package/dist2/interval.js.map +0 -1
  48. package/dist2/minmax.d.ts +0 -18
  49. package/dist2/minmax.js +0 -149
  50. package/dist2/minmax.js.map +0 -1
  51. package/dist2/read_processed_details.d.ts +0 -6
  52. package/dist2/read_processed_details.js +0 -116
  53. package/dist2/read_processed_details.js.map +0 -1
package/dist2/minmax.js DELETED
@@ -1,149 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMaxData = exports.getMinData = exports.calculateIntervalMaxValue = exports.calculateIntervalMinValue = void 0;
4
- const node_opcua_data_value_1 = require("node-opcua-data-value");
5
- const node_opcua_status_code_1 = require("node-opcua-status-code");
6
- const common_1 = require("./common");
7
- const interval_1 = require("./interval");
8
- function calculateIntervalMinOrMaxValue(interval, options, predicate) {
9
- // console.log(interval.toString());
10
- const indexStart = interval.index;
11
- let selectedValue = null;
12
- let counter = 0;
13
- let statusCode;
14
- let isPartial = interval.isPartial;
15
- let isRaw = false;
16
- let hasBad = false;
17
- for (let i = indexStart; i < indexStart + interval.count; i++) {
18
- const dataValue = interval.dataValues[i];
19
- if (dataValue.statusCode === node_opcua_status_code_1.StatusCodes.BadNoData) {
20
- isPartial = true;
21
- continue;
22
- }
23
- if (!interval_1.isGood(dataValue.statusCode)) {
24
- hasBad = true;
25
- continue;
26
- }
27
- if (!selectedValue) {
28
- selectedValue = dataValue.value;
29
- counter = 1;
30
- if (i === indexStart && dataValue.sourceTimestamp.getTime() === interval.startTime.getTime()) {
31
- isRaw = true;
32
- }
33
- continue;
34
- }
35
- const compare = predicate(selectedValue, dataValue.value);
36
- if (compare === "equal") {
37
- counter = 1;
38
- continue;
39
- }
40
- if (compare === "select") {
41
- selectedValue = dataValue.value;
42
- counter = 1;
43
- }
44
- }
45
- if (!selectedValue) {
46
- return new node_opcua_data_value_1.DataValue({
47
- sourceTimestamp: interval.startTime,
48
- statusCode: node_opcua_status_code_1.StatusCodes.BadNoData
49
- });
50
- }
51
- if (isRaw) {
52
- if (hasBad) {
53
- statusCode = node_opcua_status_code_1.StatusCodes.UncertainDataSubNormal;
54
- }
55
- else {
56
- statusCode = node_opcua_status_code_1.StatusCodes.Good;
57
- }
58
- }
59
- else if (hasBad) {
60
- statusCode = node_opcua_status_code_1.StatusCode.makeStatusCode(node_opcua_status_code_1.StatusCodes.UncertainDataSubNormal, "HistorianCalculated");
61
- }
62
- else {
63
- statusCode = node_opcua_status_code_1.StatusCode.makeStatusCode(node_opcua_status_code_1.StatusCodes.Good, "HistorianCalculated");
64
- }
65
- if (counter > 1) {
66
- statusCode = node_opcua_status_code_1.StatusCode.makeStatusCode(statusCode, "HistorianMultiValue");
67
- }
68
- if (isPartial || interval.isPartial) {
69
- statusCode = node_opcua_status_code_1.StatusCode.makeStatusCode(statusCode, "HistorianPartial");
70
- }
71
- return new node_opcua_data_value_1.DataValue({
72
- sourceTimestamp: interval.startTime,
73
- statusCode: statusCode,
74
- value: selectedValue
75
- });
76
- }
77
- function calculateIntervalMinValue(interval, options) {
78
- return calculateIntervalMinOrMaxValue(interval, options, (a, b) => a.value > b.value ? "select" : (a.value === b.value ? "equal" : "reject"));
79
- }
80
- exports.calculateIntervalMinValue = calculateIntervalMinValue;
81
- function calculateIntervalMaxValue(interval, options) {
82
- return calculateIntervalMinOrMaxValue(interval, options, (a, b) => a.value < b.value ? "select" : (a.value === b.value ? "equal" : "reject"));
83
- }
84
- exports.calculateIntervalMaxValue = calculateIntervalMaxValue;
85
- // From OPC Unified Architecture, Part 13 26 Release 1.04
86
- // 5.4.3.11 Maximum
87
- // The Maximum Aggregate defined in Table 22 retrieves the maximum Good raw value within
88
- // the interval, and returns that value with the timestamp at the start of the interval. Note that if
89
- // the same maximum exists at more than one timestamp the MultipleValues bit is set.
90
- // Unless otherwise indicated, StatusCodes are Good, Calculated. If the minimum value is on
91
- // the interval start time the status code will be Good, Raw. If only Bad quality values are
92
- // available then the status is returned as Bad_NoData.
93
- // The timestamp of the Aggregate will always be the start of the interval for every
94
- //
95
- // ProcessingInterval.
96
- //
97
- // Table 22 – Maximum Aggregate summary
98
- // Maximum Aggregate Characteristics
99
- //
100
- // Type Calculated
101
- // Data Type Same as Source
102
- // Use Bounds None
103
- // Timestamp StartTime
104
- //
105
- // Status Code Calculations
106
- // Calculation Method Custom
107
- // If no Bad values then the Status is Good. If Bad values exist then
108
- // the Status is Uncertain_SubNormal. If an Uncertain value is greater
109
- // than the maximum Good value the Status is Uncertain_SubNormal
110
- //
111
- // Partial Set Sometimes
112
- // If an interval is not a complete interval
113
- //
114
- // Calculated Set Sometimes
115
- // If the Maximum value is not on the startTime of the interval or if the
116
- // Status was set to Uncertain_SubNormal because of non-Good
117
- // values in the interval
118
- //
119
- // Interpolated Not Set
120
- //
121
- // Raw Set Sometimes
122
- // If Maximum value is on the startTime of the interval
123
- // Multi Value Set Sometimes
124
- // If multiple Good values exist with the Maximum value
125
- //
126
- // Status Code Common Special Cases
127
- // Before Start of Data Bad_NoData
128
- // After End of Data Bad_NoData
129
- // No Start Bound Not Applicable
130
- // No End Bound Not Applicable
131
- // Bound Bad Not Applicable
132
- // Bound Uncertain Not Applicable
133
- /**
134
- *
135
- * @param node
136
- * @param processingInterval
137
- * @param startDate
138
- * @param endDate
139
- * @param callback
140
- */
141
- function getMinData(node, processingInterval, startDate, endDate, callback) {
142
- return common_1.getAggregateData(node, processingInterval, startDate, endDate, calculateIntervalMinValue, callback);
143
- }
144
- exports.getMinData = getMinData;
145
- function getMaxData(node, processingInterval, startDate, endDate, callback) {
146
- return common_1.getAggregateData(node, processingInterval, startDate, endDate, calculateIntervalMaxValue, callback);
147
- }
148
- exports.getMaxData = getMaxData;
149
- //# sourceMappingURL=minmax.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"minmax.js","sourceRoot":"","sources":["../source/minmax.ts"],"names":[],"mappings":";;;AAuDA,iEAAkD;AAClD,mEAAiE;AAGjE,qCAA4C;AAC5C,yCAA6E;AAE7E,SAAS,8BAA8B,CACnC,QAAkB,EAClB,OAA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A+D;IAE/D,OAAO,yBAAgB,CAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AAC/G,CAAC;AARD,gCAQC;AAED,SAAgB,UAAU,CACtB,IAAgB,EAChB,kBAA0B,EAC1B,SAAe,EACf,OAAa,EACb,QAA+D;IAE/D,OAAO,yBAAgB,CAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AAC/G,CAAC;AARD,gCAQC"}
@@ -1,6 +0,0 @@
1
- import { SessionContext, ContinuationPoint, UAVariable } from "node-opcua-address-space";
2
- import { NumericRange } from "node-opcua-numeric-range";
3
- import { QualifiedNameLike } from "node-opcua-data-model";
4
- import { CallbackT } from "node-opcua-status-code";
5
- import { HistoryReadResult, ReadProcessedDetails } from "node-opcua-service-history";
6
- export declare function readProcessedDetails(variable: UAVariable, context: SessionContext, historyReadDetails: ReadProcessedDetails, indexRange: NumericRange | null, dataEncoding: QualifiedNameLike | null, continuationPoint: ContinuationPoint | null, callback: CallbackT<HistoryReadResult>): void;
@@ -1,116 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readProcessedDetails = void 0;
4
- const node_opcua_constants_1 = require("node-opcua-constants");
5
- const node_opcua_status_code_1 = require("node-opcua-status-code");
6
- const minmax_1 = require("./minmax");
7
- const node_opcua_service_history_1 = require("node-opcua-service-history");
8
- const interpolate_1 = require("./interpolate");
9
- const average_1 = require("./average");
10
- function readProcessedDetails(variable, context, historyReadDetails, indexRange, dataEncoding, continuationPoint, callback) {
11
- var _a;
12
- // OPC Unified Architecture, Part 11 27 Release 1.03
13
- //
14
- // This structure is used to compute Aggregate values, qualities, and timestamps from data in
15
- // the history database for the specified time domain for one or more HistoricalDataNodes. The
16
- // time domain is divided into intervals of duration ProcessingInterval. The specified Aggregate
17
- // Type is calculated for each interval beginning with startTime by using the data within the next
18
- // ProcessingInterval.
19
- // For example, this function can provide hourly statistics such as Maximum, Minimum , and
20
- // Average for each item during the specified time domain when ProcessingInterval is 1 hour.
21
- // The domain of the request is defined by startTime, endTime, and ProcessingInterval. All three
22
- // shall be specified. If endTime is less than startTime then the data shall be returned in reverse
23
- // order with the later data coming first. If startTime and endTime are the same then the Server
24
- // shall return Bad_InvalidArgument as there is no meaningful way to interpret such a case. If
25
- // the ProcessingInterval is specified as 0 then Aggregates shall be calculated using one interval
26
- // starting at startTime and ending at endTime.
27
- // The aggregateType[] parameter allows a Client to request multiple Aggregate calculations per
28
- // requested NodeId. If multiple Aggregates are requested then a corresponding number of
29
- // entries are required in the NodesToRead array.
30
- // For example, to request Min Aggregate for NodeId FIC101, FIC102, and both Min and Max
31
- // Aggregates for NodeId FIC103 would require NodeId FIC103 to appear twice in the
32
- // NodesToRead array request parameter.
33
- // aggregateType[] NodesToRead[]
34
- // Min FIC101
35
- // Min FIC102
36
- // Min FIC103
37
- // Max FIC103
38
- // If the array of Aggregates does not match the array of NodesToRead then the Server shall
39
- // return a StatusCode of Bad_AggregateListMismatch.
40
- // The aggregateConfiguration parameter allows a Client to override the Aggregate configuration
41
- // settings supplied by the AggregateConfiguration Object on a per call basis. See Part 13 for
42
- // more information on Aggregate configurations. If the Server does not support the ability to
43
- // override the Aggregate configuration settings then it shall return a StatusCode of Bad_
44
- // AggregateConfigurationRejected. If the Aggregate is not valid for the Node then the
45
- // StatusCode shall be Bad_AggregateNotSupported.
46
- // The values used in computing the Aggregate for each interval shall include any value that
47
- // falls exactly on the timestamp at the beginning of the interval, but shall not include any value
48
- // that falls directly on the timestamp ending the interval. Thus, each value shall be included
49
- // only once in the calculation. If the time domain is in reverse order then we consider the later
50
- // timestamp to be the one beginning the sub interval, and the earlier timestamp to be the one
51
- // ending it. Note that this means that simply swapping the start and end times will not result in
52
- // getting the same values back in reverse order as the intervals being requested in the two
53
- // cases are not the same.
54
- // If an Aggregate is taking a long time to calculate then the Server can return partial results
55
- // with a continuation point. This might be done if the calculation is going to take more time th an
56
- // the Client timeout hint. In some cases it may take longer than the Client timeout hint to
57
- // calculate even one Aggregate result. Then the Server may return zero results with a
58
- // continuation point that allows the Server to resume the calculation on the next Client read
59
- // call.
60
- const startTime = historyReadDetails.startTime;
61
- const endTime = historyReadDetails.endTime;
62
- if (!startTime || !endTime) {
63
- return callback(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadInvalidArgument }));
64
- }
65
- if (startTime.getTime() === endTime.getTime()) {
66
- // Start = End Int = Anything No intervals. Returns a Bad_InvalidArgument StatusCode,
67
- // regardless of whether there is data at the specified time or not
68
- return callback(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadInvalidArgument }));
69
- }
70
- const aggregateTypes = historyReadDetails.aggregateType || [];
71
- // If the ProcessingInterval is specified as 0 then Aggregates shall be calculated using one interval
72
- // starting at startTime and ending at endTime.
73
- const processingInterval = historyReadDetails.processingInterval || endTime.getTime() - startTime.getTime();
74
- // tslint:disable-next-line: prefer-for-of
75
- function applyAggregate(aggregateType, callback2) {
76
- function buildResult(err, dataValues) {
77
- if (err) {
78
- return callback2(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadInternalError }));
79
- }
80
- const result = new node_opcua_service_history_1.HistoryReadResult({
81
- historyData: new node_opcua_service_history_1.HistoryData({
82
- dataValues
83
- }),
84
- statusCode: node_opcua_status_code_1.StatusCodes.Good
85
- });
86
- return callback2(null, result);
87
- }
88
- if (!startTime || !endTime) {
89
- return buildResult(new Error("Invalid date time"));
90
- }
91
- switch (aggregateType.value) {
92
- case node_opcua_constants_1.AggregateFunction.Minimum:
93
- minmax_1.getMinData(variable, processingInterval, startTime, endTime, buildResult);
94
- break;
95
- case node_opcua_constants_1.AggregateFunction.Maximum:
96
- minmax_1.getMaxData(variable, processingInterval, startTime, endTime, buildResult);
97
- break;
98
- case node_opcua_constants_1.AggregateFunction.Interpolative:
99
- interpolate_1.getInterpolatedData(variable, processingInterval, startTime, endTime, buildResult);
100
- break;
101
- case node_opcua_constants_1.AggregateFunction.Average:
102
- average_1.getAverageData(variable, processingInterval, startTime, endTime, buildResult);
103
- break;
104
- case node_opcua_constants_1.AggregateFunction.Count:
105
- default:
106
- // todo provide correct implementation
107
- return callback2(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadAggregateNotSupported }));
108
- }
109
- }
110
- if (((_a = historyReadDetails.aggregateType) === null || _a === void 0 ? void 0 : _a.length) !== 1) {
111
- return callback(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadInternalError }));
112
- }
113
- return applyAggregate(aggregateTypes[0], callback);
114
- }
115
- exports.readProcessedDetails = readProcessedDetails;
116
- //# sourceMappingURL=read_processed_details.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read_processed_details.js","sourceRoot":"","sources":["../source/read_processed_details.ts"],"names":[],"mappings":";;;AACA,+DAAyD;AAIzD,mEAAgE;AAIhE,qCAAkD;AAClD,2EAOoC;AAEpC,+CAAoD;AACpD,uCAA2C;AAE3C,SAAgB,oBAAoB,CAChC,QAAoB,EACpB,OAAuB,EACvB,kBAAwC,EACxC,UAA+B,EAC/B,YAAsC,EACtC,iBAA2C,EAC3C,QAAsC;;IAEtC,oDAAoD;IACpD,EAAE;IACF,6FAA6F;IAC7F,8FAA8F;IAC9F,gGAAgG;IAChG,kGAAkG;IAClG,sBAAsB;IACtB,0FAA0F;IAC1F,4FAA4F;IAC5F,gGAAgG;IAChG,mGAAmG;IACnG,gGAAgG;IAChG,8FAA8F;IAC9F,kGAAkG;IAClG,+CAA+C;IAC/C,+FAA+F;IAC/F,wFAAwF;IACxF,iDAAiD;IACjD,wFAAwF;IACxF,kFAAkF;IAClF,uCAAuC;IACvC,gCAAgC;IAChC,aAAa;IACb,aAAa;IACb,aAAa;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