node-opcua-aggregates 2.178.0 → 2.180.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/aggregates.d.ts +3 -3
- package/dist/aggregates.js +20 -12
- package/dist/aggregates.js.map +1 -1
- package/dist/average.d.ts +1 -1
- package/dist/average.js +4 -4
- package/dist/average.js.map +1 -1
- package/dist/calculate_bad_good.d.ts +1 -1
- package/dist/calculate_bad_good.js +4 -4
- package/dist/calculate_bad_good.js.map +1 -1
- package/dist/common.d.ts +2 -2
- package/dist/common.js +12 -4
- package/dist/common.js.map +1 -1
- package/dist/count.d.ts +1 -1
- package/dist/count.js +2 -2
- package/dist/count.js.map +1 -1
- package/dist/duration_bad.d.ts +1 -1
- package/dist/duration_bad.js +2 -2
- package/dist/duration_bad.js.map +1 -1
- package/dist/duration_good.d.ts +1 -1
- package/dist/duration_good.js +2 -2
- package/dist/duration_good.js.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/interpolate.d.ts +2 -2
- package/dist/interpolate.js +3 -5
- package/dist/interpolate.js.map +1 -1
- package/dist/interval.d.ts +2 -2
- package/dist/interval.js +22 -16
- package/dist/interval.js.map +1 -1
- package/dist/minmax.d.ts +2 -2
- package/dist/minmax.js +4 -5
- package/dist/minmax.js.map +1 -1
- package/dist/percent_bad.d.ts +1 -1
- package/dist/percent_bad.js +1 -1
- package/dist/percent_bad.js.map +1 -1
- package/dist/percent_good.d.ts +1 -1
- package/dist/percent_good.js +2 -2
- package/dist/percent_good.js.map +1 -1
- package/dist/read_processed_details.d.ts +6 -6
- package/dist/read_processed_details.js +14 -12
- package/dist/read_processed_details.js.map +1 -1
- package/package.json +19 -19
- package/source/aggregates.ts +30 -21
- package/source/average.ts +6 -6
- package/source/calculate_bad_good.ts +8 -9
- package/source/common.ts +18 -10
- package/source/count.ts +4 -4
- package/source/duration_bad.ts +4 -5
- package/source/duration_good.ts +5 -6
- package/source/index.ts +12 -11
- package/source/interpolate.ts +5 -12
- package/source/interval.ts +29 -23
- package/source/minmax.ts +8 -9
- package/source/percent_bad.ts +3 -4
- package/source/percent_good.ts +4 -5
- package/source/read_processed_details.ts +23 -23
package/dist/interval.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @module node-opca-aggregates
|
|
3
3
|
*/
|
|
4
4
|
import { DataValue } from "node-opcua-data-value";
|
|
5
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
6
|
-
import { AggregateConfigurationOptions } from "node-opcua-types";
|
|
5
|
+
import { type StatusCode } from "node-opcua-status-code";
|
|
6
|
+
import type { AggregateConfigurationOptions } from "node-opcua-types";
|
|
7
7
|
export { AggregateConfigurationOptions } from "node-opcua-types";
|
|
8
8
|
export interface AggregateConfigurationOptionsEx extends AggregateConfigurationOptions {
|
|
9
9
|
stepped?: boolean;
|
package/dist/interval.js
CHANGED
|
@@ -22,6 +22,12 @@ function isGoodish2(statusCode, { treatUncertainAsBad }) {
|
|
|
22
22
|
function isUncertain(statusCode) {
|
|
23
23
|
return (statusCode.value & 0x40000000) === 0x40000000 && statusCode.value !== node_opcua_status_code_1.StatusCodes.BadNoData.value;
|
|
24
24
|
}
|
|
25
|
+
function sourceTimestampMs(dataValue) {
|
|
26
|
+
if (!dataValue.sourceTimestamp) {
|
|
27
|
+
throw new Error("expecting dataValue to have a sourceTimestamp");
|
|
28
|
+
}
|
|
29
|
+
return dataValue.sourceTimestamp.getTime();
|
|
30
|
+
}
|
|
25
31
|
function _findGoodDataValueBefore(dataValues, index, bTreatUncertainAsBad) {
|
|
26
32
|
index--;
|
|
27
33
|
while (index >= 0) {
|
|
@@ -68,8 +74,8 @@ function adjustProcessingOptions(options) {
|
|
|
68
74
|
options.treatUncertainAsBad = options.treatUncertainAsBad || false;
|
|
69
75
|
options.useSlopedExtrapolation = options.useSlopedExtrapolation || false;
|
|
70
76
|
options.stepped = options.stepped || false;
|
|
71
|
-
options.percentDataBad = parseInt(options.percentDataBad, 10);
|
|
72
|
-
options.percentDataGood = parseInt(options.percentDataGood, 10);
|
|
77
|
+
options.percentDataBad = parseInt(String(options.percentDataBad ?? 0), 10);
|
|
78
|
+
options.percentDataGood = parseInt(String(options.percentDataGood ?? 0), 10);
|
|
73
79
|
return options;
|
|
74
80
|
}
|
|
75
81
|
class Interval {
|
|
@@ -103,7 +109,7 @@ class Interval {
|
|
|
103
109
|
return false;
|
|
104
110
|
}
|
|
105
111
|
const dataValue1 = this.dataValues[index];
|
|
106
|
-
return this.startTime.getTime() === dataValue1
|
|
112
|
+
return this.startTime.getTime() === sourceTimestampMs(dataValue1);
|
|
107
113
|
}
|
|
108
114
|
/**
|
|
109
115
|
* Find the first good or uncertain dataValue
|
|
@@ -118,14 +124,14 @@ class Interval {
|
|
|
118
124
|
}
|
|
119
125
|
toString() {
|
|
120
126
|
let str = "";
|
|
121
|
-
str +=
|
|
122
|
-
str +=
|
|
123
|
-
str +=
|
|
124
|
-
str +=
|
|
127
|
+
str += `startTime ${this.startTime.toUTCString()}\n`;
|
|
128
|
+
str += `start ${this.index} `;
|
|
129
|
+
str += `count ${this.count} `;
|
|
130
|
+
str += `isPartial ${this.isPartial}\n`;
|
|
125
131
|
if (this.index >= 0) {
|
|
126
132
|
for (let i = this.index; i < this.index + this.count; i++) {
|
|
127
133
|
const dataValue = this.dataValues[i];
|
|
128
|
-
str +=
|
|
134
|
+
str += ` ${dataValue.sourceTimestamp?.toUTCString()}${dataValue.statusCode.toString()}`;
|
|
129
135
|
str += dataValue.value ? dataValue.value.toString() : "";
|
|
130
136
|
str += "\n";
|
|
131
137
|
}
|
|
@@ -145,14 +151,14 @@ class Interval {
|
|
|
145
151
|
return e;
|
|
146
152
|
}
|
|
147
153
|
const lastTimestamp = this.dataValues[i].sourceTimestamp;
|
|
148
|
-
return Math.min(e, lastTimestamp.getTime() + 1);
|
|
154
|
+
return lastTimestamp ? Math.min(e, lastTimestamp.getTime() + 1) : e;
|
|
149
155
|
}
|
|
150
156
|
/**
|
|
151
157
|
*
|
|
152
158
|
* @returns the interval duration
|
|
153
159
|
*/
|
|
154
160
|
duration() {
|
|
155
|
-
const t1 = this.dataValues[this.index]
|
|
161
|
+
const t1 = sourceTimestampMs(this.dataValues[this.index]);
|
|
156
162
|
const e = this.getEffectiveEndTime();
|
|
157
163
|
return e - t1;
|
|
158
164
|
}
|
|
@@ -160,9 +166,9 @@ class Interval {
|
|
|
160
166
|
* returns the region duration starting at index and finishing at index+1 or end limit of the interval
|
|
161
167
|
*/
|
|
162
168
|
regionDuration(index) {
|
|
163
|
-
const t1 = this.dataValues[index]
|
|
169
|
+
const t1 = sourceTimestampMs(this.dataValues[index]);
|
|
164
170
|
const e = this.getEffectiveEndTime();
|
|
165
|
-
const t2 = index < this.dataValues.length - 1 ? Math.min(this.dataValues[index + 1]
|
|
171
|
+
const t2 = index < this.dataValues.length - 1 ? Math.min(sourceTimestampMs(this.dataValues[index + 1]), e) : e;
|
|
166
172
|
return t2 - t1;
|
|
167
173
|
}
|
|
168
174
|
}
|
|
@@ -171,7 +177,7 @@ function getInterval(startTime, processingInterval, indexHint, dataValues) {
|
|
|
171
177
|
let count = 0;
|
|
172
178
|
let index = -1;
|
|
173
179
|
for (let i = indexHint; i < dataValues.length; i++) {
|
|
174
|
-
if (dataValues[i]
|
|
180
|
+
if (sourceTimestampMs(dataValues[i]) < startTime.getTime()) {
|
|
175
181
|
continue;
|
|
176
182
|
}
|
|
177
183
|
index = i;
|
|
@@ -179,7 +185,7 @@ function getInterval(startTime, processingInterval, indexHint, dataValues) {
|
|
|
179
185
|
}
|
|
180
186
|
if (index >= 0) {
|
|
181
187
|
for (let i = index; i < dataValues.length; i++) {
|
|
182
|
-
if (dataValues[i]
|
|
188
|
+
if (sourceTimestampMs(dataValues[i]) >= startTime.getTime() + processingInterval) {
|
|
183
189
|
break;
|
|
184
190
|
}
|
|
185
191
|
count++;
|
|
@@ -188,10 +194,10 @@ function getInterval(startTime, processingInterval, indexHint, dataValues) {
|
|
|
188
194
|
// check if interval is complete or partial (end or start)
|
|
189
195
|
let isPartial = false;
|
|
190
196
|
if (index + count >= dataValues.length &&
|
|
191
|
-
dataValues[dataValues.length - 1]
|
|
197
|
+
sourceTimestampMs(dataValues[dataValues.length - 1]) < startTime.getTime() + processingInterval) {
|
|
192
198
|
isPartial = true;
|
|
193
199
|
}
|
|
194
|
-
if (index <= 0 && dataValues[0]
|
|
200
|
+
if (index <= 0 && sourceTimestampMs(dataValues[0]) > startTime.getTime()) {
|
|
195
201
|
isPartial = true;
|
|
196
202
|
}
|
|
197
203
|
return new Interval({
|
package/dist/interval.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interval.js","sourceRoot":"","sources":["../source/interval.ts"],"names":[],"mappings":";;;AAaA,gCAIC;
|
|
1
|
+
{"version":3,"file":"interval.js","sourceRoot":"","sources":["../source/interval.ts"],"names":[],"mappings":";;;AAaA,gCAIC;AAED,kCAEC;AAsBD,4DAqBC;AAED,0DAsBC;AAED,0DAQC;AAyGD,kCAwCC;AAnPD;;GAEG;AACH,iEAAkD;AAClD,mEAAsE;AAStE,SAAgB,UAAU,CAAC,UAAsB,EAAE,EAAE,mBAAmB,EAAqC;IACzG,IAAI,UAAU,CAAC,SAAS,EAAE;QAAE,OAAO,IAAI,CAAC;IACxC,IAAI,WAAW,CAAC,UAAU,CAAC;QAAE,OAAO,CAAC,mBAAmB,CAAC;IACzD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAgB,WAAW,CAAC,UAAsB;IAC9C,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,UAAU,IAAI,UAAU,CAAC,KAAK,KAAK,oCAAW,CAAC,SAAS,CAAC,KAAK,CAAC;AAC9G,CAAC;AACD,SAAS,iBAAiB,CAAC,SAAoB;IAC3C,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,C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C,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE,GAAG,kBAAkB,EAAE,CAAC;gBAC/E,MAAM;YACV,CAAC;YACD,KAAK,EAAE,CAAC;QACZ,CAAC;IACL,CAAC;IAED,0DAA0D;IAC1D,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IACI,KAAK,GAAG,KAAK,IAAI,UAAU,CAAC,MAAM;QAClC,iBAAiB,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,OAAO,EAAE,GAAG,kBAAkB,EACjG,CAAC;QACC,SAAS,GAAG,IAAI,CAAC;IACrB,CAAC;IACD,IAAI,KAAK,IAAI,CAAC,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;QACvE,SAAS,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,OAAO,IAAI,QAAQ,CAAC;QAChB,KAAK;QACL,UAAU;QACV,KAAK;QACL,SAAS;QACT,SAAS;QACT,kBAAkB;KACrB,CAAC,CAAC;AACP,CAAC"}
|
package/dist/minmax.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module node-opca-aggregates
|
|
3
3
|
*/
|
|
4
|
-
import { UAVariable } from "node-opcua-address-space";
|
|
4
|
+
import type { UAVariable } from "node-opcua-address-space";
|
|
5
5
|
import { DataValue } from "node-opcua-data-value";
|
|
6
|
-
import { AggregateConfigurationOptions, Interval } from "./interval";
|
|
6
|
+
import type { AggregateConfigurationOptions, Interval } from "./interval";
|
|
7
7
|
export declare function calculateIntervalMinValue(interval: Interval, options: AggregateConfigurationOptions): DataValue;
|
|
8
8
|
export declare function calculateIntervalMaxValue(interval: Interval, options: AggregateConfigurationOptions): DataValue;
|
|
9
9
|
/**
|
package/dist/minmax.js
CHANGED
|
@@ -7,8 +7,7 @@ exports.getMaxData = getMaxData;
|
|
|
7
7
|
const node_opcua_data_value_1 = require("node-opcua-data-value");
|
|
8
8
|
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
9
9
|
const common_1 = require("./common");
|
|
10
|
-
|
|
11
|
-
function calculateIntervalMinOrMaxValue(interval, options, predicate) {
|
|
10
|
+
function calculateIntervalMinOrMaxValue(interval, _options, predicate) {
|
|
12
11
|
// debugLog(interval.toString());
|
|
13
12
|
const indexStart = interval.index;
|
|
14
13
|
let selectedValue = null;
|
|
@@ -30,7 +29,7 @@ function calculateIntervalMinOrMaxValue(interval, options, predicate) {
|
|
|
30
29
|
if (!selectedValue) {
|
|
31
30
|
selectedValue = dataValue.value;
|
|
32
31
|
counter = 1;
|
|
33
|
-
if (i === indexStart && dataValue.sourceTimestamp
|
|
32
|
+
if (i === indexStart && dataValue.sourceTimestamp?.getTime() === interval.startTime.getTime()) {
|
|
34
33
|
isRaw = true;
|
|
35
34
|
}
|
|
36
35
|
continue;
|
|
@@ -140,9 +139,9 @@ function calculateIntervalMaxValue(interval, options) {
|
|
|
140
139
|
* @param callback
|
|
141
140
|
*/
|
|
142
141
|
function getMinData(node, processingInterval, startDate, endDate, callback) {
|
|
143
|
-
|
|
142
|
+
(0, common_1.getAggregateData)(node, processingInterval, startDate, endDate, calculateIntervalMinValue, callback);
|
|
144
143
|
}
|
|
145
144
|
function getMaxData(node, processingInterval, startDate, endDate, callback) {
|
|
146
|
-
|
|
145
|
+
(0, common_1.getAggregateData)(node, processingInterval, startDate, endDate, calculateIntervalMaxValue, callback);
|
|
147
146
|
}
|
|
148
147
|
//# sourceMappingURL=minmax.js.map
|
package/dist/minmax.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minmax.js","sourceRoot":"","sources":["../source/minmax.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"minmax.js","sourceRoot":"","sources":["../source/minmax.ts"],"names":[],"mappings":";;A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;AACnC,EAAE;AACF,yCAAyC;AACzC,uDAAuD;AACvD,4BAA4B;AAC5B,uDAAuD;AACvD,EAAE;AACF,mCAAmC;AACnC,sCAAsC;AACtC,sCAAsC;AACtC,0CAA0C;AAC1C,0CAA0C;AAC1C,0CAA0C;AAC1C,6CAA6C;AAC7C;;;;;;;GAOG;AACH,SAAgB,UAAU,CACtB,IAAgB,EAChB,kBAA0B,EAC1B,SAAe,EACf,OAAa,EACb,QAA+D;IAE/D,IAAA,yBAAgB,EAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AACxG,CAAC;AAED,SAAgB,UAAU,CACtB,IAAgB,EAChB,kBAA0B,EAC1B,SAAe,EACf,OAAa,EACb,QAA+D;IAE/D,IAAA,yBAAgB,EAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AACxG,CAAC"}
|
package/dist/percent_bad.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UAVariable } from "node-opcua-address-space";
|
|
1
|
+
import type { UAVariable } from "node-opcua-address-space";
|
|
2
2
|
import { DataValue } from "node-opcua-data-value";
|
|
3
3
|
/**Retrieve the percentage of data (0 to 100) in the interval which has Bad StatusCode. */
|
|
4
4
|
export declare function getPercentBadData(node: UAVariable, processingInterval: number, startDate: Date, endDate: Date, callback: (err: Error | null, dataValues?: DataValue[]) => void): void;
|
package/dist/percent_bad.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getPercentBadData = getPercentBadData;
|
|
4
4
|
const node_opcua_data_value_1 = require("node-opcua-data-value");
|
|
5
5
|
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
6
|
-
const common_1 = require("./common");
|
|
7
6
|
const calculate_bad_good_1 = require("./calculate_bad_good");
|
|
7
|
+
const common_1 = require("./common");
|
|
8
8
|
function calculatePercentBad(interval, options) {
|
|
9
9
|
const { percentBad, statusCode } = (0, calculate_bad_good_1.calculateBadAndGood)(interval, options);
|
|
10
10
|
const value = percentBad;
|
package/dist/percent_bad.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percent_bad.js","sourceRoot":"","sources":["../source/percent_bad.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"percent_bad.js","sourceRoot":"","sources":["../source/percent_bad.ts"],"names":[],"mappings":";;AAoBA,8CAQC;AA3BD,iEAAkD;AAClD,2DAA8C;AAC9C,6DAA2D;AAC3D,qCAA4C;AAG5C,SAAS,mBAAmB,CAAC,QAAkB,EAAE,OAAsC;IACnF,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAA,wCAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1E,MAAM,KAAK,GAAG,UAAU,CAAC;IACzB,IAAI,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC;QACzB,OAAO,IAAI,iCAAS,CAAC;YACjB,eAAe,EAAE,QAAQ,CAAC,SAAS;YACnC,UAAU;YACV,KAAK,EAAE,EAAE,QAAQ,EAAE,6BAAQ,CAAC,MAAM,EAAE,KAAK,EAAE;SAC9C,CAAC,CAAC;IACP,CAAC;IACD,OAAO,IAAI,iCAAS,CAAC,EAAE,eAAe,EAAE,QAAQ,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,6BAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAClH,CAAC;AACD,0FAA0F;AAC1F,SAAgB,iBAAiB,CAC7B,IAAgB,EAChB,kBAA0B,EAC1B,SAAe,EACf,OAAa,EACb,QAA+D;IAE/D,IAAA,yBAAgB,EAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAC;AAClG,CAAC"}
|
package/dist/percent_good.d.ts
CHANGED
package/dist/percent_good.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPercentGoodData = getPercentGoodData;
|
|
4
4
|
const node_opcua_data_value_1 = require("node-opcua-data-value");
|
|
5
|
-
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
6
5
|
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
7
|
-
const
|
|
6
|
+
const node_opcua_variant_1 = require("node-opcua-variant");
|
|
8
7
|
const calculate_bad_good_1 = require("./calculate_bad_good");
|
|
8
|
+
const common_1 = require("./common");
|
|
9
9
|
function calculatePercentGood(interval, options) {
|
|
10
10
|
//
|
|
11
11
|
// The PercentGood Aggregate defined in Table 44 performs the following calculation:
|
package/dist/percent_good.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percent_good.js","sourceRoot":"","sources":["../source/percent_good.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"percent_good.js","sourceRoot":"","sources":["../source/percent_good.ts"],"names":[],"mappings":";;AA6CA,gDAQC;AApDD,iEAAkD;AAClD,mEAAqD;AACrD,2DAA8C;AAC9C,6DAA2D;AAC3D,qCAA4C;AAG5C,SAAS,oBAAoB,CAAC,QAAkB,EAAE,OAAsC;IACpF,EAAE;IACF,oFAAoF;IACpF,EAAE;IACF,4DAA4D;IAC5D,SAAS;IACT,EAAE;IACF,0IAA0I;IAC1I,kDAAkD;IAClD,sGAAsG;IACtG,eAAe;IACf,4GAA4G;IAC5G,EAAE;IACF,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAA,wCAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3E,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;QAClB,8EAA8E;QAC9E,OAAO,IAAI,iCAAS,CAAC;YACjB,eAAe,EAAE,QAAQ,CAAC,SAAS;YACnC,UAAU,EAAE,oCAAW,CAAC,GAAG;YAC3B,KAAK,EAAE,EAAE,QAAQ,EAAE,6BAAQ,CAAC,IAAI,EAAE;SACrC,CAAC,CAAC;IACP,CAAC;IACD,MAAM,KAAK,GAAG,WAAW,CAAC;IAC1B,IAAI,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC;QACzB,OAAO,IAAI,iCAAS,CAAC;YACjB,eAAe,EAAE,QAAQ,CAAC,SAAS;YACnC,UAAU;YACV,KAAK,EAAE,EAAE,QAAQ,EAAE,6BAAQ,CAAC,MAAM,EAAE,KAAK,EAAE;SAC9C,CAAC,CAAC;IACP,CAAC;IACD,OAAO,IAAI,iCAAS,CAAC,EAAE,eAAe,EAAE,QAAQ,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,6BAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAClH,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAC9B,IAAgB,EAChB,kBAA0B,EAC1B,SAAe,EACf,OAAa,EACb,QAA+D;IAE/D,IAAA,yBAAgB,EAAC,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,CAAC,CAAC;AACnG,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ISessionContext, UAVariable
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export declare function readProcessedDetails(variable: UAVariable,
|
|
1
|
+
import type { ContinuationData, ISessionContext, UAVariable } from "node-opcua-address-space";
|
|
2
|
+
import type { QualifiedNameLike } from "node-opcua-data-model";
|
|
3
|
+
import type { NumericRange } from "node-opcua-numeric-range";
|
|
4
|
+
import { HistoryReadResult, type ReadProcessedDetails } from "node-opcua-service-history";
|
|
5
|
+
import { type CallbackT } from "node-opcua-status-code";
|
|
6
|
+
export declare function readProcessedDetails(variable: UAVariable, _context: ISessionContext, historyReadDetails: ReadProcessedDetails, _indexRange: NumericRange | null, _dataEncoding: QualifiedNameLike | null, _continuationData: ContinuationData, callback: CallbackT<HistoryReadResult>): void;
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.readProcessedDetails = readProcessedDetails;
|
|
4
4
|
const node_opcua_constants_1 = require("node-opcua-constants");
|
|
5
|
-
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
6
5
|
const node_opcua_service_history_1 = require("node-opcua-service-history");
|
|
7
|
-
const
|
|
8
|
-
const interpolate_1 = require("./interpolate");
|
|
6
|
+
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
9
7
|
const average_1 = require("./average");
|
|
10
8
|
const count_1 = require("./count");
|
|
9
|
+
const duration_bad_1 = require("./duration_bad");
|
|
10
|
+
const duration_good_1 = require("./duration_good");
|
|
11
|
+
const interpolate_1 = require("./interpolate");
|
|
12
|
+
const minmax_1 = require("./minmax");
|
|
11
13
|
const percent_bad_1 = require("./percent_bad");
|
|
12
14
|
const percent_good_1 = require("./percent_good");
|
|
13
|
-
const duration_good_1 = require("./duration_good");
|
|
14
|
-
const duration_bad_1 = require("./duration_bad");
|
|
15
15
|
function _buildResult(err, dataValues, callback2) {
|
|
16
16
|
if (err) {
|
|
17
17
|
return callback2(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadInternalError }));
|
|
@@ -71,7 +71,7 @@ function applyAggregate(variable, processingInterval, startTime, endTime, aggreg
|
|
|
71
71
|
return callback2(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadAggregateNotSupported }));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function readProcessedDetails(variable,
|
|
74
|
+
function readProcessedDetails(variable, _context, historyReadDetails, _indexRange, _dataEncoding, _continuationData, callback) {
|
|
75
75
|
// OPC Unified Architecture, Part 11 27 Release 1.03
|
|
76
76
|
//
|
|
77
77
|
// This structure is used to compute Aggregate values, qualities, and timestamps from data in
|
|
@@ -123,21 +123,23 @@ function readProcessedDetails(variable, context, historyReadDetails, indexRange,
|
|
|
123
123
|
const startTime = historyReadDetails.startTime;
|
|
124
124
|
const endTime = historyReadDetails.endTime;
|
|
125
125
|
if (!startTime || !endTime) {
|
|
126
|
-
|
|
126
|
+
callback(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadInvalidArgument }));
|
|
127
|
+
return;
|
|
127
128
|
}
|
|
128
129
|
if (startTime.getTime() === endTime.getTime()) {
|
|
129
130
|
// Start = End Int = Anything No intervals. Returns a Bad_InvalidArgument StatusCode,
|
|
130
131
|
// regardless of whether there is data at the specified time or not
|
|
131
|
-
|
|
132
|
+
callback(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadInvalidArgument }));
|
|
133
|
+
return;
|
|
132
134
|
}
|
|
133
135
|
const aggregateTypes = historyReadDetails.aggregateType || [];
|
|
134
136
|
// If the ProcessingInterval is specified as 0 then Aggregates shall be calculated using one interval
|
|
135
137
|
// starting at startTime and ending at endTime.
|
|
136
138
|
const processingInterval = historyReadDetails.processingInterval || endTime.getTime() - startTime.getTime();
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return
|
|
139
|
+
if (historyReadDetails.aggregateType?.length !== 1) {
|
|
140
|
+
callback(null, new node_opcua_service_history_1.HistoryReadResult({ statusCode: node_opcua_status_code_1.StatusCodes.BadInternalError }));
|
|
141
|
+
return;
|
|
140
142
|
}
|
|
141
|
-
|
|
143
|
+
applyAggregate(variable, processingInterval, startTime, endTime, aggregateTypes[0], callback);
|
|
142
144
|
}
|
|
143
145
|
//# sourceMappingURL=read_processed_details.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read_processed_details.js","sourceRoot":"","sources":["../source/read_processed_details.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"read_processed_details.js","sourceRoot":"","sources":["../source/read_processed_details.ts"],"names":[],"mappings":";;AAmFA,oDAiFC;AAnKD,+DAAyD;AAKzD,2EAAuG;AACvG,mEAAqE;AACrE,uCAA2C;AAC3C,mCAAuC;AACvC,iDAAoD;AACpD,mDAAsD;AACtD,+CAAoD;AACpD,qCAAkD;AAClD,+CAAkD;AAClD,iDAAoD;AAEpD,SAAS,YAAY,CAAC,GAAiB,EAAE,UAAmC,EAAE,SAAuC;IACjH,IAAI,GAAG,EAAE,CAAC;QACN,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,8CAAiB,CAAC,EAAE,UAAU,EAAE,oCAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IAChG,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,8CAAiB,CAAC;QACjC,WAAW,EAAE,IAAI,wCAAW,CAAC;YACzB,UAAU;SACb,CAAC;QACF,UAAU,EAAE,oCAAW,CAAC,IAAI;KAC/B,CAAC,CAAC;IACH,OAAO,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,cAAc,CACnB,QAAoB,EACpB,kBAA0B,EAC1B,SAAe,EACf,OAAa,EACb,aAAqB,EACrB,SAAuC;IAEvC,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,OAAO,YAAY,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,WAAW,GAAG,CAAC,GAAiB,EAAE,UAAmC,EAAE,EAAE;QAC3E,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IAC7C,CAAC,CAAC;IACF,IAAI,aAAa,CAAC,SAAS,KAAK,CAAC,EAAE,CAAC;QAChC,QAAQ,aAAa,CAAC,KAAK,EAAE,CAAC;YAC1B,KAAK,wCAAiB,CAAC,OAAO;gBAC1B,I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AM,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC;IAC3C,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,EAAE,CAAC;QACzB,QAAQ,CAAC,IAAI,EAAE,IAAI,8CAAiB,CAAC,EAAE,UAAU,EAAE,oCAAW,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC;QACtF,OAAO;IACX,CAAC;IACD,IAAI,SAAS,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC5C,qFAAqF;QACrF,mEAAmE;QACnE,QAAQ,CAAC,IAAI,EAAE,IAAI,8CAAiB,CAAC,EAAE,UAAU,EAAE,oCAAW,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC;QACtF,OAAO;IACX,CAAC;IAED,MAAM,cAAc,GAAa,kBAAkB,CAAC,aAAa,IAAI,EAAE,CAAC;IAExE,qGAAqG;IACrG,+CAA+C;IAC/C,MAAM,kBAAkB,GAAG,kBAAkB,CAAC,kBAAkB,IAAI,OAAO,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;IAE5G,IAAI,kBAAkB,CAAC,aAAa,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;QACjD,QAAQ,CAAC,IAAI,EAAE,IAAI,8CAAiB,CAAC,EAAE,UAAU,EAAE,oCAAW,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACpF,OAAO;IACX,CAAC;IACD,cAAc,CAAC,QAAQ,EAAE,kBAAkB,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAClG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-aggregates",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.180.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module aggregates",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,28 +8,28 @@
|
|
|
8
8
|
"build": "tsc -b",
|
|
9
9
|
"test": "mocha test/*.ts",
|
|
10
10
|
"test:check": "tsc --noEmit -p test/tsconfig.json",
|
|
11
|
-
"lint": "
|
|
12
|
-
"format": "
|
|
11
|
+
"lint": "biome check --no-errors-on-unmatched .",
|
|
12
|
+
"format": "biome check --write --no-errors-on-unmatched .",
|
|
13
13
|
"clean": "npx rimraf -g node_modules dist *.tsbuildinfo"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"node-opcua-address-space": "2.
|
|
17
|
-
"node-opcua-assert": "2.
|
|
18
|
-
"node-opcua-constants": "2.
|
|
19
|
-
"node-opcua-data-model": "2.
|
|
20
|
-
"node-opcua-data-value": "2.
|
|
21
|
-
"node-opcua-nodeid": "2.
|
|
22
|
-
"node-opcua-numeric-range": "2.
|
|
23
|
-
"node-opcua-server": "2.
|
|
24
|
-
"node-opcua-service-history": "2.
|
|
25
|
-
"node-opcua-status-code": "2.
|
|
26
|
-
"node-opcua-types": "2.
|
|
27
|
-
"node-opcua-utils": "2.
|
|
28
|
-
"node-opcua-variant": "2.
|
|
16
|
+
"node-opcua-address-space": "2.180.0",
|
|
17
|
+
"node-opcua-assert": "2.179.0",
|
|
18
|
+
"node-opcua-constants": "2.179.0",
|
|
19
|
+
"node-opcua-data-model": "2.180.0",
|
|
20
|
+
"node-opcua-data-value": "2.180.0",
|
|
21
|
+
"node-opcua-nodeid": "2.179.0",
|
|
22
|
+
"node-opcua-numeric-range": "2.180.0",
|
|
23
|
+
"node-opcua-server": "2.180.0",
|
|
24
|
+
"node-opcua-service-history": "2.180.0",
|
|
25
|
+
"node-opcua-status-code": "2.180.0",
|
|
26
|
+
"node-opcua-types": "2.180.0",
|
|
27
|
+
"node-opcua-utils": "2.179.0",
|
|
28
|
+
"node-opcua-variant": "2.180.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"node-opcua-leak-detector": "2.
|
|
32
|
-
"node-opcua-nodesets": "2.
|
|
31
|
+
"node-opcua-leak-detector": "2.179.0",
|
|
32
|
+
"node-opcua-nodesets": "2.179.0"
|
|
33
33
|
},
|
|
34
34
|
"author": "Etienne Rossignon",
|
|
35
35
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"internet of things"
|
|
47
47
|
],
|
|
48
48
|
"homepage": "http://node-opcua.github.io/",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "11ad1e0894355cd279e19443c6c9a4fc090e7d7a",
|
|
50
50
|
"files": [
|
|
51
51
|
"dist",
|
|
52
52
|
"source"
|
package/source/aggregates.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module node-opcua-aggregates
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import { DataType } from "node-opcua-variant";
|
|
7
|
-
import { lowerFirstLetter } from "node-opcua-utils";
|
|
8
|
-
import {
|
|
4
|
+
|
|
5
|
+
import type {
|
|
9
6
|
AddressSpace,
|
|
10
7
|
BaseNode,
|
|
11
8
|
IAddressSpace,
|
|
@@ -15,11 +12,14 @@ import {
|
|
|
15
12
|
UAServerCapabilities,
|
|
16
13
|
UAVariable
|
|
17
14
|
} from "node-opcua-address-space";
|
|
18
|
-
import { AddressSpacePrivate } from "node-opcua-address-space/src/address_space_private";
|
|
15
|
+
import type { AddressSpacePrivate } from "node-opcua-address-space/src/address_space_private";
|
|
16
|
+
import { AggregateFunction, ObjectIds, ObjectTypeIds, ReferenceTypeIds } from "node-opcua-constants";
|
|
19
17
|
import { BrowseDirection, coerceQualifiedName, NodeClass, NodeClassMask } from "node-opcua-data-model";
|
|
20
|
-
import {
|
|
18
|
+
import { coerceNodeId, makeNodeId, type NodeId, type NodeIdLike, resolveNodeId, sameNodeId } from "node-opcua-nodeid";
|
|
19
|
+
import { lowerFirstLetter } from "node-opcua-utils";
|
|
20
|
+
import { DataType } from "node-opcua-variant";
|
|
21
21
|
|
|
22
|
-
import { AggregateConfigurationOptionsEx } from "./interval";
|
|
22
|
+
import type { AggregateConfigurationOptionsEx } from "./interval";
|
|
23
23
|
import { readProcessedDetails } from "./read_processed_details";
|
|
24
24
|
|
|
25
25
|
// import { HistoryServerCapabilities } from "node-opcua-server";
|
|
@@ -63,7 +63,7 @@ export function createHistoryServerCapabilities(addressSpace: AddressSpace, serv
|
|
|
63
63
|
throw new Error("Expecting server Capabilities");
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
const historyServerCapabilitiesType = addressSpace.getNamespace(0).findObjectType("HistoryServerCapabilitiesType")
|
|
66
|
+
const historyServerCapabilitiesType = addressSpace.getNamespace(0).findObjectType("HistoryServerCapabilitiesType");
|
|
67
67
|
|
|
68
68
|
/* c8 ignore next */
|
|
69
69
|
if (!historyServerCapabilitiesType) {
|
|
@@ -75,20 +75,20 @@ export function createHistoryServerCapabilities(addressSpace: AddressSpace, serv
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
function setHistoricalServerCapabilities(historyServerCapabilities:
|
|
78
|
+
function setHistoricalServerCapabilities(historyServerCapabilities: UAObject, defaultProperties: Record<string, boolean | number>) {
|
|
79
79
|
function setBoolean(propName: string) {
|
|
80
80
|
const lowerCase = lowerFirstLetter(propName);
|
|
81
81
|
|
|
82
82
|
/* c8 ignore next */
|
|
83
|
-
if (!Object.
|
|
84
|
-
throw new Error(
|
|
83
|
+
if (!Object.hasOwn(defaultProperties, lowerCase)) {
|
|
84
|
+
throw new Error(`cannot find ${lowerCase}`);
|
|
85
85
|
}
|
|
86
86
|
const value = defaultProperties[lowerCase];
|
|
87
|
-
const prop = historyServerCapabilities.getChildByName(propName);
|
|
87
|
+
const prop = historyServerCapabilities.getChildByName(propName) as UAVariable | null;
|
|
88
88
|
|
|
89
89
|
/* c8 ignore next */
|
|
90
90
|
if (!prop) {
|
|
91
|
-
throw new Error(
|
|
91
|
+
throw new Error(` Cannot find property ${propName}`);
|
|
92
92
|
}
|
|
93
93
|
prop.setValueFromSource({ dataType: DataType.Boolean, value });
|
|
94
94
|
}
|
|
@@ -96,11 +96,15 @@ function setHistoricalServerCapabilities(historyServerCapabilities: any, default
|
|
|
96
96
|
function setUInt32(propName: string) {
|
|
97
97
|
const lowerCase = lowerFirstLetter(propName);
|
|
98
98
|
/* c8 ignore next */
|
|
99
|
-
if (!Object.
|
|
100
|
-
throw new Error(
|
|
99
|
+
if (!Object.hasOwn(historyServerCapabilities, lowerCase)) {
|
|
100
|
+
throw new Error(`cannot find ${lowerCase}`);
|
|
101
101
|
}
|
|
102
102
|
const value = defaultProperties[lowerCase];
|
|
103
|
-
const prop = historyServerCapabilities.getChildByName(propName);
|
|
103
|
+
const prop = historyServerCapabilities.getChildByName(propName) as UAVariable | null;
|
|
104
|
+
/* c8 ignore next */
|
|
105
|
+
if (!prop) {
|
|
106
|
+
throw new Error(` Cannot find property ${propName}`);
|
|
107
|
+
}
|
|
104
108
|
prop.setValueFromSource({ dataType: DataType.UInt32, value });
|
|
105
109
|
}
|
|
106
110
|
|
|
@@ -145,7 +149,7 @@ export function addAggregateFunctionSupport(addressSpace: AddressSpace, aggregat
|
|
|
145
149
|
|
|
146
150
|
/* c8 ignore next */
|
|
147
151
|
if (!functionNode) {
|
|
148
|
-
throw new Error(
|
|
152
|
+
throw new Error(`Cannot find node ${aggregateFunctionNodeId.toString()} in addressSpace`);
|
|
149
153
|
}
|
|
150
154
|
/* c8 ignore next */
|
|
151
155
|
if (functionNode.nodeClass !== NodeClass.Object) {
|
|
@@ -205,10 +209,15 @@ export function addAggregateSupport(addressSpace: AddressSpace, aggregatedFuncti
|
|
|
205
209
|
}
|
|
206
210
|
// xx serverObject.
|
|
207
211
|
|
|
208
|
-
const serverCapabilities = serverObject.getChildByName("ServerCapabilities")
|
|
212
|
+
const serverCapabilities = serverObject.getChildByName("ServerCapabilities") as UAServerCapabilities | null;
|
|
213
|
+
|
|
214
|
+
/* c8 ignore next */
|
|
215
|
+
if (!serverCapabilities) {
|
|
216
|
+
throw new Error("addressSpace do not expose a ServerCapabilities object");
|
|
217
|
+
}
|
|
209
218
|
|
|
210
219
|
// Let see if HistoryServer Capabilities object exists
|
|
211
|
-
let historyServerCapabilities = serverCapabilities.getChildByName("HistoryServerCapabilities");
|
|
220
|
+
let historyServerCapabilities = serverCapabilities.getChildByName("HistoryServerCapabilities") as UAObject | null;
|
|
212
221
|
|
|
213
222
|
/* c8 ignore next */
|
|
214
223
|
if (!historyServerCapabilities) {
|
|
@@ -309,7 +318,7 @@ export function installAggregateConfigurationOptions(
|
|
|
309
318
|
|
|
310
319
|
const referenceType = resolveNodeId(ReferenceTypeIds.Organizes);
|
|
311
320
|
for (const nodeId of aggregateFunctions) {
|
|
312
|
-
uaAggregateFunctions
|
|
321
|
+
uaAggregateFunctions?.addReference({
|
|
313
322
|
nodeId,
|
|
314
323
|
referenceType,
|
|
315
324
|
isForward: true
|
package/source/average.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { UAVariable } from "node-opcua-address-space";
|
|
1
|
+
import type { UAVariable } from "node-opcua-address-space";
|
|
2
2
|
import { DataValue } from "node-opcua-data-value";
|
|
3
|
-
import { DataType } from "node-opcua-variant";
|
|
4
3
|
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
4
|
+
import { DataType } from "node-opcua-variant";
|
|
5
5
|
|
|
6
6
|
import { getAggregateData } from "./common";
|
|
7
|
-
import {
|
|
7
|
+
import type { AggregateConfigurationOptions, Interval } from "./interval";
|
|
8
8
|
|
|
9
|
-
function calculateIntervalAverageValue(interval: Interval,
|
|
9
|
+
function calculateIntervalAverageValue(interval: Interval, _options: AggregateConfigurationOptions): DataValue {
|
|
10
10
|
const indexStart = interval.index;
|
|
11
11
|
let statusCode: StatusCode;
|
|
12
|
-
let
|
|
12
|
+
let _isPartial = interval.isPartial;
|
|
13
13
|
|
|
14
14
|
const isRaw = false;
|
|
15
15
|
let hasBad = false;
|
|
@@ -20,7 +20,7 @@ function calculateIntervalAverageValue(interval: Interval, options: AggregateCon
|
|
|
20
20
|
const dataValue = interval.dataValues[i];
|
|
21
21
|
|
|
22
22
|
if (dataValue.statusCode.equals(StatusCodes.BadNoData)) {
|
|
23
|
-
|
|
23
|
+
_isPartial = true;
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
26
26
|
|