node-opcua-aggregates 2.55.0 → 2.58.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/.mocharc.yml +7 -7
- package/LICENSE +20 -20
- package/bin/sample_aggregate_server.js +14 -14
- package/dist/aggregates.js +2 -2
- package/dist/aggregates.js.map +1 -1
- package/dist/average.js +6 -5
- package/dist/average.js.map +1 -1
- package/dist/common.js +12 -2
- package/dist/common.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interpolate.d.ts +1 -1
- package/dist/interpolate.js +8 -12
- package/dist/interpolate.js.map +1 -1
- package/dist/minmax.js +3 -2
- package/dist/minmax.js.map +1 -1
- package/dist/read_processed_details.d.ts +2 -2
- package/dist/read_processed_details.js +41 -38
- package/dist/read_processed_details.js.map +1 -1
- package/nyc.config.js +16 -16
- package/package.json +15 -13
- package/source/aggregates.ts +284 -277
- package/source/average.ts +71 -74
- package/source/common.ts +23 -10
- package/source/index.ts +11 -17
- package/source/interpolate.ts +14 -20
- package/source/interval.ts +3 -3
- package/source/minmax.ts +231 -231
- package/source/read_processed_details.ts +149 -139
package/source/minmax.ts
CHANGED
|
@@ -1,231 +1,231 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opca-aggregates
|
|
3
|
-
*/
|
|
4
|
-
//
|
|
5
|
-
// 5.4.3.10 Minimum
|
|
6
|
-
// The Minimum Aggregate defined in Table 21 retrieves the minimum Good raw value within the
|
|
7
|
-
// interval, and returns that value with the timestamp at the start of the interval. Note that if the
|
|
8
|
-
// same minimum exists at more than one timestamp the MultipleValues bit is set.
|
|
9
|
-
//
|
|
10
|
-
// Unless otherwise indicated, StatusCodes are Good, Calculated. If the minimum value is on
|
|
11
|
-
// the start time the status code will be Good, Raw. If only Bad quality values are available then
|
|
12
|
-
// the status is returned as Bad_NoData.
|
|
13
|
-
//
|
|
14
|
-
// The timestamp of the Aggregate will always be the start of the interval for every
|
|
15
|
-
// ProcessingInterval.
|
|
16
|
-
//
|
|
17
|
-
// Table 21 – Minimum Aggregate summary
|
|
18
|
-
//
|
|
19
|
-
// Minimum Aggregate Characteristics
|
|
20
|
-
//
|
|
21
|
-
// Type Calculated
|
|
22
|
-
// Data Type Same as Source
|
|
23
|
-
// Use Bounds None
|
|
24
|
-
// Timestamp StartTime
|
|
25
|
-
//
|
|
26
|
-
// Status Code Calculations
|
|
27
|
-
//
|
|
28
|
-
// Calculation Method Custom
|
|
29
|
-
// If no Bad values then the Status is Good. If Bad values exist then
|
|
30
|
-
// the Status is Uncertain_SubNormal. If an Uncertain value is less
|
|
31
|
-
// than the minimum Good value the Status is Uncertain_SubNormal.
|
|
32
|
-
//
|
|
33
|
-
// Partial Set Sometimes
|
|
34
|
-
// If an interval is not a complete interval
|
|
35
|
-
//
|
|
36
|
-
// Calculated Set Sometimes
|
|
37
|
-
// If the Minimum value is not on the StartTime of the interval or if the
|
|
38
|
-
// Status was set to Uncertain_SubNormal because of non-Good
|
|
39
|
-
// values in the interval
|
|
40
|
-
//
|
|
41
|
-
// Interpolated Not Set
|
|
42
|
-
// Raw Set Sometimes
|
|
43
|
-
// If Minimum value is on the StartTime of the interval
|
|
44
|
-
//
|
|
45
|
-
// Multi Value Set Sometimes
|
|
46
|
-
// If multiple Good values exist with the Minimum value
|
|
47
|
-
//
|
|
48
|
-
// Status Code Common Special Cases
|
|
49
|
-
// Before Start of Data Bad_NoData
|
|
50
|
-
// After End of Data Bad_NoData
|
|
51
|
-
// No Start Bound Not Applicable
|
|
52
|
-
// No End Bound Not Applicable
|
|
53
|
-
// Bound Bad Not Applicable
|
|
54
|
-
// Bound Uncertain Not Applicable
|
|
55
|
-
import { UAVariable } from "node-opcua-address-space";
|
|
56
|
-
import { DataValue } from "node-opcua-data-value";
|
|
57
|
-
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
58
|
-
import { Variant } from "node-opcua-variant";
|
|
59
|
-
|
|
60
|
-
import { getAggregateData } from "./common";
|
|
61
|
-
import { AggregateConfigurationOptions, Interval, isGood } from "./interval";
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// console.log(interval.toString());
|
|
70
|
-
|
|
71
|
-
const indexStart = interval.index;
|
|
72
|
-
let selectedValue: Variant | null = null;
|
|
73
|
-
|
|
74
|
-
let counter = 0;
|
|
75
|
-
let statusCode: StatusCode;
|
|
76
|
-
let isPartial = interval.isPartial;
|
|
77
|
-
|
|
78
|
-
let isRaw = false;
|
|
79
|
-
let hasBad = false;
|
|
80
|
-
|
|
81
|
-
for (let i = indexStart; i < indexStart + interval.count; i++) {
|
|
82
|
-
const dataValue = interval.dataValues[i];
|
|
83
|
-
|
|
84
|
-
if (dataValue.statusCode === StatusCodes.BadNoData) {
|
|
85
|
-
isPartial = true;
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (!isGood(dataValue.statusCode)) {
|
|
90
|
-
hasBad = true;
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (!selectedValue) {
|
|
95
|
-
selectedValue = dataValue.value;
|
|
96
|
-
counter = 1;
|
|
97
|
-
if (i === indexStart && dataValue.sourceTimestamp!.getTime() === interval.startTime.getTime()) {
|
|
98
|
-
isRaw = true;
|
|
99
|
-
}
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
const compare = predicate(selectedValue, dataValue.value);
|
|
103
|
-
if (compare === "equal") {
|
|
104
|
-
counter = 1;
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
if (compare === "select") {
|
|
108
|
-
selectedValue = dataValue.value;
|
|
109
|
-
counter = 1;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (!selectedValue) {
|
|
114
|
-
return new DataValue({
|
|
115
|
-
sourceTimestamp: interval.startTime,
|
|
116
|
-
statusCode: StatusCodes.BadNoData
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
if (isRaw) {
|
|
120
|
-
if (hasBad) {
|
|
121
|
-
statusCode = StatusCodes.UncertainDataSubNormal;
|
|
122
|
-
} else {
|
|
123
|
-
statusCode = StatusCodes.Good;
|
|
124
|
-
}
|
|
125
|
-
} else if (hasBad) {
|
|
126
|
-
statusCode = StatusCode.makeStatusCode(StatusCodes.UncertainDataSubNormal, "HistorianCalculated");
|
|
127
|
-
} else {
|
|
128
|
-
statusCode = StatusCode.makeStatusCode(StatusCodes.Good, "HistorianCalculated");
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (counter > 1) {
|
|
132
|
-
statusCode = StatusCode.makeStatusCode(statusCode, "HistorianMultiValue");
|
|
133
|
-
}
|
|
134
|
-
if (isPartial || interval.isPartial) {
|
|
135
|
-
statusCode = StatusCode.makeStatusCode(statusCode, "HistorianPartial");
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return new DataValue({
|
|
139
|
-
sourceTimestamp: interval.startTime,
|
|
140
|
-
statusCode: statusCode as StatusCode,
|
|
141
|
-
value: selectedValue!
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export function calculateIntervalMinValue(interval: Interval, options: AggregateConfigurationOptions): DataValue {
|
|
146
|
-
return calculateIntervalMinOrMaxValue(interval, options,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export function calculateIntervalMaxValue(interval: Interval, options: AggregateConfigurationOptions): DataValue {
|
|
152
|
-
return calculateIntervalMinOrMaxValue(interval, options,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// From OPC Unified Architecture, Part 13 26 Release 1.04
|
|
158
|
-
// 5.4.3.11 Maximum
|
|
159
|
-
// The Maximum Aggregate defined in Table 22 retrieves the maximum Good raw value within
|
|
160
|
-
// the interval, and returns that value with the timestamp at the start of the interval. Note that if
|
|
161
|
-
// the same maximum exists at more than one timestamp the MultipleValues bit is set.
|
|
162
|
-
// Unless otherwise indicated, StatusCodes are Good, Calculated. If the minimum value is on
|
|
163
|
-
// the interval start time the status code will be Good, Raw. If only Bad quality values are
|
|
164
|
-
// available then the status is returned as Bad_NoData.
|
|
165
|
-
// The timestamp of the Aggregate will always be the start of the interval for every
|
|
166
|
-
//
|
|
167
|
-
// ProcessingInterval.
|
|
168
|
-
//
|
|
169
|
-
// Table 22 – Maximum Aggregate summary
|
|
170
|
-
// Maximum Aggregate Characteristics
|
|
171
|
-
//
|
|
172
|
-
// Type Calculated
|
|
173
|
-
// Data Type Same as Source
|
|
174
|
-
// Use Bounds None
|
|
175
|
-
// Timestamp StartTime
|
|
176
|
-
//
|
|
177
|
-
// Status Code Calculations
|
|
178
|
-
// Calculation Method Custom
|
|
179
|
-
// If no Bad values then the Status is Good. If Bad values exist then
|
|
180
|
-
// the Status is Uncertain_SubNormal. If an Uncertain value is greater
|
|
181
|
-
// than the maximum Good value the Status is Uncertain_SubNormal
|
|
182
|
-
//
|
|
183
|
-
// Partial Set Sometimes
|
|
184
|
-
// If an interval is not a complete interval
|
|
185
|
-
//
|
|
186
|
-
// Calculated Set Sometimes
|
|
187
|
-
// If the Maximum value is not on the startTime of the interval or if the
|
|
188
|
-
// Status was set to Uncertain_SubNormal because of non-Good
|
|
189
|
-
// values in the interval
|
|
190
|
-
//
|
|
191
|
-
// Interpolated Not Set
|
|
192
|
-
//
|
|
193
|
-
// Raw Set Sometimes
|
|
194
|
-
// If Maximum value is on the startTime of the interval
|
|
195
|
-
// Multi Value Set Sometimes
|
|
196
|
-
// If multiple Good values exist with the Maximum value
|
|
197
|
-
//
|
|
198
|
-
// Status Code Common Special Cases
|
|
199
|
-
// Before Start of Data Bad_NoData
|
|
200
|
-
// After End of Data Bad_NoData
|
|
201
|
-
// No Start Bound Not Applicable
|
|
202
|
-
// No End Bound Not Applicable
|
|
203
|
-
// Bound Bad Not Applicable
|
|
204
|
-
// Bound Uncertain Not Applicable
|
|
205
|
-
/**
|
|
206
|
-
*
|
|
207
|
-
* @param node
|
|
208
|
-
* @param processingInterval
|
|
209
|
-
* @param startDate
|
|
210
|
-
* @param endDate
|
|
211
|
-
* @param callback
|
|
212
|
-
*/
|
|
213
|
-
export function getMinData(
|
|
214
|
-
node: UAVariable,
|
|
215
|
-
processingInterval: number,
|
|
216
|
-
startDate: Date,
|
|
217
|
-
endDate: Date,
|
|
218
|
-
callback: (err: Error | null, dataValues?: DataValue[]) => void
|
|
219
|
-
) {
|
|
220
|
-
return getAggregateData(node, processingInterval, startDate, endDate, calculateIntervalMinValue, callback);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export function getMaxData(
|
|
224
|
-
node: UAVariable,
|
|
225
|
-
processingInterval: number,
|
|
226
|
-
startDate: Date,
|
|
227
|
-
endDate: Date,
|
|
228
|
-
callback: (err: Error | null, dataValues?: DataValue[]) => void
|
|
229
|
-
) {
|
|
230
|
-
return getAggregateData(node, processingInterval, startDate, endDate, calculateIntervalMaxValue, callback);
|
|
231
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opca-aggregates
|
|
3
|
+
*/
|
|
4
|
+
// excerpt from OPC Unified Architecture, Part 13 21 Release 1.04
|
|
5
|
+
// 5.4.3.10 Minimum
|
|
6
|
+
// The Minimum Aggregate defined in Table 21 retrieves the minimum Good raw value within the
|
|
7
|
+
// interval, and returns that value with the timestamp at the start of the interval. Note that if the
|
|
8
|
+
// same minimum exists at more than one timestamp the MultipleValues bit is set.
|
|
9
|
+
//
|
|
10
|
+
// Unless otherwise indicated, StatusCodes are Good, Calculated. If the minimum value is on
|
|
11
|
+
// the start time the status code will be Good, Raw. If only Bad quality values are available then
|
|
12
|
+
// the status is returned as Bad_NoData.
|
|
13
|
+
//
|
|
14
|
+
// The timestamp of the Aggregate will always be the start of the interval for every
|
|
15
|
+
// ProcessingInterval.
|
|
16
|
+
//
|
|
17
|
+
// Table 21 – Minimum Aggregate summary
|
|
18
|
+
//
|
|
19
|
+
// Minimum Aggregate Characteristics
|
|
20
|
+
//
|
|
21
|
+
// Type Calculated
|
|
22
|
+
// Data Type Same as Source
|
|
23
|
+
// Use Bounds None
|
|
24
|
+
// Timestamp StartTime
|
|
25
|
+
//
|
|
26
|
+
// Status Code Calculations
|
|
27
|
+
//
|
|
28
|
+
// Calculation Method Custom
|
|
29
|
+
// If no Bad values then the Status is Good. If Bad values exist then
|
|
30
|
+
// the Status is Uncertain_SubNormal. If an Uncertain value is less
|
|
31
|
+
// than the minimum Good value the Status is Uncertain_SubNormal.
|
|
32
|
+
//
|
|
33
|
+
// Partial Set Sometimes
|
|
34
|
+
// If an interval is not a complete interval
|
|
35
|
+
//
|
|
36
|
+
// Calculated Set Sometimes
|
|
37
|
+
// If the Minimum value is not on the StartTime of the interval or if the
|
|
38
|
+
// Status was set to Uncertain_SubNormal because of non-Good
|
|
39
|
+
// values in the interval
|
|
40
|
+
//
|
|
41
|
+
// Interpolated Not Set
|
|
42
|
+
// Raw Set Sometimes
|
|
43
|
+
// If Minimum value is on the StartTime of the interval
|
|
44
|
+
//
|
|
45
|
+
// Multi Value Set Sometimes
|
|
46
|
+
// If multiple Good values exist with the Minimum value
|
|
47
|
+
//
|
|
48
|
+
// Status Code Common Special Cases
|
|
49
|
+
// Before Start of Data Bad_NoData
|
|
50
|
+
// After End of Data Bad_NoData
|
|
51
|
+
// No Start Bound Not Applicable
|
|
52
|
+
// No End Bound Not Applicable
|
|
53
|
+
// Bound Bad Not Applicable
|
|
54
|
+
// Bound Uncertain Not Applicable
|
|
55
|
+
import { UAVariable } from "node-opcua-address-space";
|
|
56
|
+
import { DataValue } from "node-opcua-data-value";
|
|
57
|
+
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
58
|
+
import { Variant } from "node-opcua-variant";
|
|
59
|
+
|
|
60
|
+
import { getAggregateData } from "./common";
|
|
61
|
+
import { AggregateConfigurationOptions, Interval, isGood } from "./interval";
|
|
62
|
+
|
|
63
|
+
// eslint-disable-next-line max-statements
|
|
64
|
+
function calculateIntervalMinOrMaxValue(
|
|
65
|
+
interval: Interval,
|
|
66
|
+
options: AggregateConfigurationOptions,
|
|
67
|
+
predicate: (a: Variant, b: Variant) => "equal" | "select" | "reject"
|
|
68
|
+
): DataValue {
|
|
69
|
+
// console.log(interval.toString());
|
|
70
|
+
|
|
71
|
+
const indexStart = interval.index;
|
|
72
|
+
let selectedValue: Variant | null = null;
|
|
73
|
+
|
|
74
|
+
let counter = 0;
|
|
75
|
+
let statusCode: StatusCode;
|
|
76
|
+
let isPartial = interval.isPartial;
|
|
77
|
+
|
|
78
|
+
let isRaw = false;
|
|
79
|
+
let hasBad = false;
|
|
80
|
+
|
|
81
|
+
for (let i = indexStart; i < indexStart + interval.count; i++) {
|
|
82
|
+
const dataValue = interval.dataValues[i];
|
|
83
|
+
|
|
84
|
+
if (dataValue.statusCode === StatusCodes.BadNoData) {
|
|
85
|
+
isPartial = true;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!isGood(dataValue.statusCode)) {
|
|
90
|
+
hasBad = true;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!selectedValue) {
|
|
95
|
+
selectedValue = dataValue.value;
|
|
96
|
+
counter = 1;
|
|
97
|
+
if (i === indexStart && dataValue.sourceTimestamp!.getTime() === interval.startTime.getTime()) {
|
|
98
|
+
isRaw = true;
|
|
99
|
+
}
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const compare = predicate(selectedValue, dataValue.value);
|
|
103
|
+
if (compare === "equal") {
|
|
104
|
+
counter = 1;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (compare === "select") {
|
|
108
|
+
selectedValue = dataValue.value;
|
|
109
|
+
counter = 1;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (!selectedValue) {
|
|
114
|
+
return new DataValue({
|
|
115
|
+
sourceTimestamp: interval.startTime,
|
|
116
|
+
statusCode: StatusCodes.BadNoData
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (isRaw) {
|
|
120
|
+
if (hasBad) {
|
|
121
|
+
statusCode = StatusCodes.UncertainDataSubNormal;
|
|
122
|
+
} else {
|
|
123
|
+
statusCode = StatusCodes.Good;
|
|
124
|
+
}
|
|
125
|
+
} else if (hasBad) {
|
|
126
|
+
statusCode = StatusCode.makeStatusCode(StatusCodes.UncertainDataSubNormal, "HistorianCalculated");
|
|
127
|
+
} else {
|
|
128
|
+
statusCode = StatusCode.makeStatusCode(StatusCodes.Good, "HistorianCalculated");
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (counter > 1) {
|
|
132
|
+
statusCode = StatusCode.makeStatusCode(statusCode, "HistorianMultiValue");
|
|
133
|
+
}
|
|
134
|
+
if (isPartial || interval.isPartial) {
|
|
135
|
+
statusCode = StatusCode.makeStatusCode(statusCode, "HistorianPartial");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return new DataValue({
|
|
139
|
+
sourceTimestamp: interval.startTime,
|
|
140
|
+
statusCode: statusCode as StatusCode,
|
|
141
|
+
value: selectedValue!
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function calculateIntervalMinValue(interval: Interval, options: AggregateConfigurationOptions): DataValue {
|
|
146
|
+
return calculateIntervalMinOrMaxValue(interval, options, (a: Variant, b: Variant) =>
|
|
147
|
+
a.value > b.value ? "select" : a.value === b.value ? "equal" : "reject"
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function calculateIntervalMaxValue(interval: Interval, options: AggregateConfigurationOptions): DataValue {
|
|
152
|
+
return calculateIntervalMinOrMaxValue(interval, options, (a: Variant, b: Variant) =>
|
|
153
|
+
a.value < b.value ? "select" : a.value === b.value ? "equal" : "reject"
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// From OPC Unified Architecture, Part 13 26 Release 1.04
|
|
158
|
+
// 5.4.3.11 Maximum
|
|
159
|
+
// The Maximum Aggregate defined in Table 22 retrieves the maximum Good raw value within
|
|
160
|
+
// the interval, and returns that value with the timestamp at the start of the interval. Note that if
|
|
161
|
+
// the same maximum exists at more than one timestamp the MultipleValues bit is set.
|
|
162
|
+
// Unless otherwise indicated, StatusCodes are Good, Calculated. If the minimum value is on
|
|
163
|
+
// the interval start time the status code will be Good, Raw. If only Bad quality values are
|
|
164
|
+
// available then the status is returned as Bad_NoData.
|
|
165
|
+
// The timestamp of the Aggregate will always be the start of the interval for every
|
|
166
|
+
//
|
|
167
|
+
// ProcessingInterval.
|
|
168
|
+
//
|
|
169
|
+
// Table 22 – Maximum Aggregate summary
|
|
170
|
+
// Maximum Aggregate Characteristics
|
|
171
|
+
//
|
|
172
|
+
// Type Calculated
|
|
173
|
+
// Data Type Same as Source
|
|
174
|
+
// Use Bounds None
|
|
175
|
+
// Timestamp StartTime
|
|
176
|
+
//
|
|
177
|
+
// Status Code Calculations
|
|
178
|
+
// Calculation Method Custom
|
|
179
|
+
// If no Bad values then the Status is Good. If Bad values exist then
|
|
180
|
+
// the Status is Uncertain_SubNormal. If an Uncertain value is greater
|
|
181
|
+
// than the maximum Good value the Status is Uncertain_SubNormal
|
|
182
|
+
//
|
|
183
|
+
// Partial Set Sometimes
|
|
184
|
+
// If an interval is not a complete interval
|
|
185
|
+
//
|
|
186
|
+
// Calculated Set Sometimes
|
|
187
|
+
// If the Maximum value is not on the startTime of the interval or if the
|
|
188
|
+
// Status was set to Uncertain_SubNormal because of non-Good
|
|
189
|
+
// values in the interval
|
|
190
|
+
//
|
|
191
|
+
// Interpolated Not Set
|
|
192
|
+
//
|
|
193
|
+
// Raw Set Sometimes
|
|
194
|
+
// If Maximum value is on the startTime of the interval
|
|
195
|
+
// Multi Value Set Sometimes
|
|
196
|
+
// If multiple Good values exist with the Maximum value
|
|
197
|
+
//
|
|
198
|
+
// Status Code Common Special Cases
|
|
199
|
+
// Before Start of Data Bad_NoData
|
|
200
|
+
// After End of Data Bad_NoData
|
|
201
|
+
// No Start Bound Not Applicable
|
|
202
|
+
// No End Bound Not Applicable
|
|
203
|
+
// Bound Bad Not Applicable
|
|
204
|
+
// Bound Uncertain Not Applicable
|
|
205
|
+
/**
|
|
206
|
+
*
|
|
207
|
+
* @param node
|
|
208
|
+
* @param processingInterval
|
|
209
|
+
* @param startDate
|
|
210
|
+
* @param endDate
|
|
211
|
+
* @param callback
|
|
212
|
+
*/
|
|
213
|
+
export function getMinData(
|
|
214
|
+
node: UAVariable,
|
|
215
|
+
processingInterval: number,
|
|
216
|
+
startDate: Date,
|
|
217
|
+
endDate: Date,
|
|
218
|
+
callback: (err: Error | null, dataValues?: DataValue[]) => void
|
|
219
|
+
): void {
|
|
220
|
+
return getAggregateData(node, processingInterval, startDate, endDate, calculateIntervalMinValue, callback);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export function getMaxData(
|
|
224
|
+
node: UAVariable,
|
|
225
|
+
processingInterval: number,
|
|
226
|
+
startDate: Date,
|
|
227
|
+
endDate: Date,
|
|
228
|
+
callback: (err: Error | null, dataValues?: DataValue[]) => void
|
|
229
|
+
): void {
|
|
230
|
+
return getAggregateData(node, processingInterval, startDate, endDate, calculateIntervalMaxValue, callback);
|
|
231
|
+
}
|