node-opcua-aggregates 2.73.1 → 2.76.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/LICENSE +3 -1
- package/dist/aggregates.d.ts +7 -7
- package/dist/aggregates.js +200 -200
- package/dist/average.d.ts +3 -3
- package/dist/average.js +61 -61
- package/dist/common.d.ts +8 -8
- package/dist/common.js +99 -99
- package/dist/index.d.ts +11 -11
- package/dist/index.js +32 -32
- package/dist/interpolate.d.ts +16 -16
- package/dist/interpolate.js +130 -130
- package/dist/interval.d.ts +49 -49
- package/dist/interval.js +164 -164
- package/dist/minmax.d.ts +18 -18
- package/dist/minmax.js +149 -149
- package/dist/read_processed_details.d.ts +6 -6
- package/dist/read_processed_details.js +118 -118
- package/dist/read_processed_details.js.map +1 -1
- package/package.json +17 -21
- package/source/read_processed_details.ts +2 -7
package/dist/interval.d.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opca-aggregates
|
|
3
|
-
*/
|
|
4
|
-
import { DataValue } from "node-opcua-data-value";
|
|
5
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
6
|
-
import { AggregateConfigurationOptions } from "node-opcua-types";
|
|
7
|
-
export { AggregateConfigurationOptions } from "node-opcua-types";
|
|
8
|
-
export interface AggregateConfigurationOptionsEx extends AggregateConfigurationOptions {
|
|
9
|
-
stepped?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function isGoodish(statusCode: StatusCode): boolean;
|
|
12
|
-
export declare function isBad(statusCode: StatusCode): boolean;
|
|
13
|
-
export declare function isGood(statusCode: StatusCode): boolean;
|
|
14
|
-
export interface IntervalOptions {
|
|
15
|
-
startTime: Date;
|
|
16
|
-
dataValues: DataValue[];
|
|
17
|
-
index: number;
|
|
18
|
-
count: number;
|
|
19
|
-
isPartial: boolean;
|
|
20
|
-
}
|
|
21
|
-
interface DataValueWithIndex {
|
|
22
|
-
index: number;
|
|
23
|
-
dataValue: DataValue;
|
|
24
|
-
}
|
|
25
|
-
export declare function _findGoodDataValueBefore(dataValues: DataValue[], index: number, bTreatUncertainAsBad: boolean): DataValueWithIndex;
|
|
26
|
-
export declare function _findGoodDataValueAfter(dataValues: DataValue[], index: number, bTreatUncertainAsBad: boolean): DataValueWithIndex;
|
|
27
|
-
export declare function adjustProcessingOptions(options: AggregateConfigurationOptionsEx | null): AggregateConfigurationOptionsEx;
|
|
28
|
-
export declare class Interval {
|
|
29
|
-
startTime: Date;
|
|
30
|
-
dataValues: DataValue[];
|
|
31
|
-
index: number;
|
|
32
|
-
count: number;
|
|
33
|
-
isPartial: boolean;
|
|
34
|
-
constructor(options: IntervalOptions);
|
|
35
|
-
getPercentBad(): number;
|
|
36
|
-
/**
|
|
37
|
-
* returns true if a raw data exists at start
|
|
38
|
-
*/
|
|
39
|
-
hasRawDataAsStart(): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Find the first good or uncertain dataValue
|
|
42
|
-
* just preceding this interval
|
|
43
|
-
* @returns {*}
|
|
44
|
-
*/
|
|
45
|
-
beforeStartDataValue(bTreatUncertainAsBad: boolean): DataValueWithIndex;
|
|
46
|
-
nextStartDataValue(bTreatUncertainAsBad: boolean): DataValueWithIndex;
|
|
47
|
-
toString(): string;
|
|
48
|
-
}
|
|
49
|
-
export declare function getInterval(startTime: Date, duration: number, indexHint: number, dataValues: DataValue[]): Interval;
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opca-aggregates
|
|
3
|
+
*/
|
|
4
|
+
import { DataValue } from "node-opcua-data-value";
|
|
5
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
6
|
+
import { AggregateConfigurationOptions } from "node-opcua-types";
|
|
7
|
+
export { AggregateConfigurationOptions } from "node-opcua-types";
|
|
8
|
+
export interface AggregateConfigurationOptionsEx extends AggregateConfigurationOptions {
|
|
9
|
+
stepped?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function isGoodish(statusCode: StatusCode): boolean;
|
|
12
|
+
export declare function isBad(statusCode: StatusCode): boolean;
|
|
13
|
+
export declare function isGood(statusCode: StatusCode): boolean;
|
|
14
|
+
export interface IntervalOptions {
|
|
15
|
+
startTime: Date;
|
|
16
|
+
dataValues: DataValue[];
|
|
17
|
+
index: number;
|
|
18
|
+
count: number;
|
|
19
|
+
isPartial: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface DataValueWithIndex {
|
|
22
|
+
index: number;
|
|
23
|
+
dataValue: DataValue;
|
|
24
|
+
}
|
|
25
|
+
export declare function _findGoodDataValueBefore(dataValues: DataValue[], index: number, bTreatUncertainAsBad: boolean): DataValueWithIndex;
|
|
26
|
+
export declare function _findGoodDataValueAfter(dataValues: DataValue[], index: number, bTreatUncertainAsBad: boolean): DataValueWithIndex;
|
|
27
|
+
export declare function adjustProcessingOptions(options: AggregateConfigurationOptionsEx | null): AggregateConfigurationOptionsEx;
|
|
28
|
+
export declare class Interval {
|
|
29
|
+
startTime: Date;
|
|
30
|
+
dataValues: DataValue[];
|
|
31
|
+
index: number;
|
|
32
|
+
count: number;
|
|
33
|
+
isPartial: boolean;
|
|
34
|
+
constructor(options: IntervalOptions);
|
|
35
|
+
getPercentBad(): number;
|
|
36
|
+
/**
|
|
37
|
+
* returns true if a raw data exists at start
|
|
38
|
+
*/
|
|
39
|
+
hasRawDataAsStart(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Find the first good or uncertain dataValue
|
|
42
|
+
* just preceding this interval
|
|
43
|
+
* @returns {*}
|
|
44
|
+
*/
|
|
45
|
+
beforeStartDataValue(bTreatUncertainAsBad: boolean): DataValueWithIndex;
|
|
46
|
+
nextStartDataValue(bTreatUncertainAsBad: boolean): DataValueWithIndex;
|
|
47
|
+
toString(): string;
|
|
48
|
+
}
|
|
49
|
+
export declare function getInterval(startTime: Date, duration: number, indexHint: number, dataValues: DataValue[]): Interval;
|
package/dist/interval.js
CHANGED
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInterval = exports.Interval = exports.adjustProcessingOptions = exports._findGoodDataValueAfter = exports._findGoodDataValueBefore = exports.isGood = exports.isBad = exports.isGoodish = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opca-aggregates
|
|
6
|
-
*/
|
|
7
|
-
const node_opcua_data_value_1 = require("node-opcua-data-value");
|
|
8
|
-
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
9
|
-
function isGoodish(statusCode) {
|
|
10
|
-
return statusCode.value < 0x40000000;
|
|
11
|
-
}
|
|
12
|
-
exports.isGoodish = isGoodish;
|
|
13
|
-
function isBad(statusCode) {
|
|
14
|
-
return statusCode.value >= 0x80000000;
|
|
15
|
-
}
|
|
16
|
-
exports.isBad = isBad;
|
|
17
|
-
function isGood(statusCode) {
|
|
18
|
-
return statusCode.value === 0x0;
|
|
19
|
-
}
|
|
20
|
-
exports.isGood = isGood;
|
|
21
|
-
function _findGoodDataValueBefore(dataValues, index, bTreatUncertainAsBad) {
|
|
22
|
-
index--;
|
|
23
|
-
while (index >= 0) {
|
|
24
|
-
const dataValue1 = dataValues[index];
|
|
25
|
-
if (!bTreatUncertainAsBad && !isBad(dataValue1.statusCode)) {
|
|
26
|
-
return { index, dataValue: dataValue1 };
|
|
27
|
-
}
|
|
28
|
-
if (bTreatUncertainAsBad && isGood(dataValue1.statusCode)) {
|
|
29
|
-
return { index, dataValue: dataValue1 };
|
|
30
|
-
}
|
|
31
|
-
index -= 1;
|
|
32
|
-
}
|
|
33
|
-
// not found
|
|
34
|
-
return {
|
|
35
|
-
dataValue: new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNoData }),
|
|
36
|
-
index: -1
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
exports._findGoodDataValueBefore = _findGoodDataValueBefore;
|
|
40
|
-
function _findGoodDataValueAfter(dataValues, index, bTreatUncertainAsBad) {
|
|
41
|
-
while (index < dataValues.length) {
|
|
42
|
-
const dataValue1 = dataValues[index];
|
|
43
|
-
if (!bTreatUncertainAsBad && !isBad(dataValue1.statusCode)) {
|
|
44
|
-
return {
|
|
45
|
-
dataValue: dataValue1,
|
|
46
|
-
index
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
if (bTreatUncertainAsBad && isGood(dataValue1.statusCode)) {
|
|
50
|
-
return {
|
|
51
|
-
dataValue: dataValue1,
|
|
52
|
-
index
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
index += 1;
|
|
56
|
-
}
|
|
57
|
-
// not found
|
|
58
|
-
return {
|
|
59
|
-
dataValue: new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNoData }),
|
|
60
|
-
index: -1
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
exports._findGoodDataValueAfter = _findGoodDataValueAfter;
|
|
64
|
-
function adjustProcessingOptions(options) {
|
|
65
|
-
options = options || {};
|
|
66
|
-
options.treatUncertainAsBad = options.treatUncertainAsBad || false;
|
|
67
|
-
options.useSlopedExtrapolation = options.useSlopedExtrapolation || false;
|
|
68
|
-
options.stepped = options.stepped || false;
|
|
69
|
-
options.percentDataBad = parseInt(options.percentDataBad, 10);
|
|
70
|
-
options.percentDataGood = parseInt(options.percentDataGood, 10);
|
|
71
|
-
return options;
|
|
72
|
-
}
|
|
73
|
-
exports.adjustProcessingOptions = adjustProcessingOptions;
|
|
74
|
-
class Interval {
|
|
75
|
-
// startTime
|
|
76
|
-
// dataValues
|
|
77
|
-
// index: index of first dataValue inside the interval
|
|
78
|
-
// count: number of dataValue inside the interval
|
|
79
|
-
constructor(options) {
|
|
80
|
-
this.startTime = options.startTime;
|
|
81
|
-
this.dataValues = options.dataValues;
|
|
82
|
-
this.index = options.index;
|
|
83
|
-
this.count = options.count;
|
|
84
|
-
this.isPartial = options.isPartial;
|
|
85
|
-
}
|
|
86
|
-
getPercentBad() {
|
|
87
|
-
return 100;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* returns true if a raw data exists at start
|
|
91
|
-
*/
|
|
92
|
-
hasRawDataAsStart() {
|
|
93
|
-
const index = this.index;
|
|
94
|
-
if (index < 0) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
const dataValue1 = this.dataValues[index];
|
|
98
|
-
return this.startTime.getTime() === dataValue1.sourceTimestamp.getTime();
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Find the first good or uncertain dataValue
|
|
102
|
-
* just preceding this interval
|
|
103
|
-
* @returns {*}
|
|
104
|
-
*/
|
|
105
|
-
beforeStartDataValue(bTreatUncertainAsBad) {
|
|
106
|
-
return _findGoodDataValueBefore(this.dataValues, this.index, bTreatUncertainAsBad);
|
|
107
|
-
}
|
|
108
|
-
nextStartDataValue(bTreatUncertainAsBad) {
|
|
109
|
-
return _findGoodDataValueAfter(this.dataValues, this.index, bTreatUncertainAsBad);
|
|
110
|
-
}
|
|
111
|
-
toString() {
|
|
112
|
-
let str = "";
|
|
113
|
-
str += "startTime " + this.startTime.toUTCString() + "\n";
|
|
114
|
-
str += "start " + this.index + " ";
|
|
115
|
-
str += "count " + this.count + " ";
|
|
116
|
-
str += "isPartial " + this.isPartial + "\n";
|
|
117
|
-
if (this.index >= 0) {
|
|
118
|
-
for (let i = this.index; i < this.index + this.count; i++) {
|
|
119
|
-
const dataValue = this.dataValues[i];
|
|
120
|
-
str += " " + dataValue.sourceTimestamp.toUTCString() + dataValue.statusCode.toString();
|
|
121
|
-
str += dataValue.value ? dataValue.value.toString() : "";
|
|
122
|
-
str += "\n";
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return str;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
exports.Interval = Interval;
|
|
129
|
-
function getInterval(startTime, duration, indexHint, dataValues) {
|
|
130
|
-
let count = 0;
|
|
131
|
-
let index = -1;
|
|
132
|
-
for (let i = indexHint; i < dataValues.length; i++) {
|
|
133
|
-
if (dataValues[i].sourceTimestamp.getTime() < startTime.getTime()) {
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
index = i;
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
if (index >= 0) {
|
|
140
|
-
for (let i = index; i < dataValues.length; i++) {
|
|
141
|
-
if (dataValues[i].sourceTimestamp.getTime() >= startTime.getTime() + duration) {
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
count++;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
// check if interval is complete or partial (end or start)
|
|
148
|
-
let isPartial = false;
|
|
149
|
-
if (index + count >= dataValues.length &&
|
|
150
|
-
dataValues[dataValues.length - 1].sourceTimestamp.getTime() < startTime.getTime() + duration) {
|
|
151
|
-
isPartial = true;
|
|
152
|
-
}
|
|
153
|
-
if (index <= 0 && dataValues[0].sourceTimestamp.getTime() > startTime.getTime()) {
|
|
154
|
-
isPartial = true;
|
|
155
|
-
}
|
|
156
|
-
return new Interval({
|
|
157
|
-
count,
|
|
158
|
-
dataValues,
|
|
159
|
-
index,
|
|
160
|
-
isPartial,
|
|
161
|
-
startTime
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
exports.getInterval = getInterval;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInterval = exports.Interval = exports.adjustProcessingOptions = exports._findGoodDataValueAfter = exports._findGoodDataValueBefore = exports.isGood = exports.isBad = exports.isGoodish = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opca-aggregates
|
|
6
|
+
*/
|
|
7
|
+
const node_opcua_data_value_1 = require("node-opcua-data-value");
|
|
8
|
+
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
9
|
+
function isGoodish(statusCode) {
|
|
10
|
+
return statusCode.value < 0x40000000;
|
|
11
|
+
}
|
|
12
|
+
exports.isGoodish = isGoodish;
|
|
13
|
+
function isBad(statusCode) {
|
|
14
|
+
return statusCode.value >= 0x80000000;
|
|
15
|
+
}
|
|
16
|
+
exports.isBad = isBad;
|
|
17
|
+
function isGood(statusCode) {
|
|
18
|
+
return statusCode.value === 0x0;
|
|
19
|
+
}
|
|
20
|
+
exports.isGood = isGood;
|
|
21
|
+
function _findGoodDataValueBefore(dataValues, index, bTreatUncertainAsBad) {
|
|
22
|
+
index--;
|
|
23
|
+
while (index >= 0) {
|
|
24
|
+
const dataValue1 = dataValues[index];
|
|
25
|
+
if (!bTreatUncertainAsBad && !isBad(dataValue1.statusCode)) {
|
|
26
|
+
return { index, dataValue: dataValue1 };
|
|
27
|
+
}
|
|
28
|
+
if (bTreatUncertainAsBad && isGood(dataValue1.statusCode)) {
|
|
29
|
+
return { index, dataValue: dataValue1 };
|
|
30
|
+
}
|
|
31
|
+
index -= 1;
|
|
32
|
+
}
|
|
33
|
+
// not found
|
|
34
|
+
return {
|
|
35
|
+
dataValue: new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNoData }),
|
|
36
|
+
index: -1
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
exports._findGoodDataValueBefore = _findGoodDataValueBefore;
|
|
40
|
+
function _findGoodDataValueAfter(dataValues, index, bTreatUncertainAsBad) {
|
|
41
|
+
while (index < dataValues.length) {
|
|
42
|
+
const dataValue1 = dataValues[index];
|
|
43
|
+
if (!bTreatUncertainAsBad && !isBad(dataValue1.statusCode)) {
|
|
44
|
+
return {
|
|
45
|
+
dataValue: dataValue1,
|
|
46
|
+
index
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (bTreatUncertainAsBad && isGood(dataValue1.statusCode)) {
|
|
50
|
+
return {
|
|
51
|
+
dataValue: dataValue1,
|
|
52
|
+
index
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
index += 1;
|
|
56
|
+
}
|
|
57
|
+
// not found
|
|
58
|
+
return {
|
|
59
|
+
dataValue: new node_opcua_data_value_1.DataValue({ statusCode: node_opcua_status_code_1.StatusCodes.BadNoData }),
|
|
60
|
+
index: -1
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
exports._findGoodDataValueAfter = _findGoodDataValueAfter;
|
|
64
|
+
function adjustProcessingOptions(options) {
|
|
65
|
+
options = options || {};
|
|
66
|
+
options.treatUncertainAsBad = options.treatUncertainAsBad || false;
|
|
67
|
+
options.useSlopedExtrapolation = options.useSlopedExtrapolation || false;
|
|
68
|
+
options.stepped = options.stepped || false;
|
|
69
|
+
options.percentDataBad = parseInt(options.percentDataBad, 10);
|
|
70
|
+
options.percentDataGood = parseInt(options.percentDataGood, 10);
|
|
71
|
+
return options;
|
|
72
|
+
}
|
|
73
|
+
exports.adjustProcessingOptions = adjustProcessingOptions;
|
|
74
|
+
class Interval {
|
|
75
|
+
// startTime
|
|
76
|
+
// dataValues
|
|
77
|
+
// index: index of first dataValue inside the interval
|
|
78
|
+
// count: number of dataValue inside the interval
|
|
79
|
+
constructor(options) {
|
|
80
|
+
this.startTime = options.startTime;
|
|
81
|
+
this.dataValues = options.dataValues;
|
|
82
|
+
this.index = options.index;
|
|
83
|
+
this.count = options.count;
|
|
84
|
+
this.isPartial = options.isPartial;
|
|
85
|
+
}
|
|
86
|
+
getPercentBad() {
|
|
87
|
+
return 100;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* returns true if a raw data exists at start
|
|
91
|
+
*/
|
|
92
|
+
hasRawDataAsStart() {
|
|
93
|
+
const index = this.index;
|
|
94
|
+
if (index < 0) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
const dataValue1 = this.dataValues[index];
|
|
98
|
+
return this.startTime.getTime() === dataValue1.sourceTimestamp.getTime();
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Find the first good or uncertain dataValue
|
|
102
|
+
* just preceding this interval
|
|
103
|
+
* @returns {*}
|
|
104
|
+
*/
|
|
105
|
+
beforeStartDataValue(bTreatUncertainAsBad) {
|
|
106
|
+
return _findGoodDataValueBefore(this.dataValues, this.index, bTreatUncertainAsBad);
|
|
107
|
+
}
|
|
108
|
+
nextStartDataValue(bTreatUncertainAsBad) {
|
|
109
|
+
return _findGoodDataValueAfter(this.dataValues, this.index, bTreatUncertainAsBad);
|
|
110
|
+
}
|
|
111
|
+
toString() {
|
|
112
|
+
let str = "";
|
|
113
|
+
str += "startTime " + this.startTime.toUTCString() + "\n";
|
|
114
|
+
str += "start " + this.index + " ";
|
|
115
|
+
str += "count " + this.count + " ";
|
|
116
|
+
str += "isPartial " + this.isPartial + "\n";
|
|
117
|
+
if (this.index >= 0) {
|
|
118
|
+
for (let i = this.index; i < this.index + this.count; i++) {
|
|
119
|
+
const dataValue = this.dataValues[i];
|
|
120
|
+
str += " " + dataValue.sourceTimestamp.toUTCString() + dataValue.statusCode.toString();
|
|
121
|
+
str += dataValue.value ? dataValue.value.toString() : "";
|
|
122
|
+
str += "\n";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return str;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.Interval = Interval;
|
|
129
|
+
function getInterval(startTime, duration, indexHint, dataValues) {
|
|
130
|
+
let count = 0;
|
|
131
|
+
let index = -1;
|
|
132
|
+
for (let i = indexHint; i < dataValues.length; i++) {
|
|
133
|
+
if (dataValues[i].sourceTimestamp.getTime() < startTime.getTime()) {
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
index = i;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
if (index >= 0) {
|
|
140
|
+
for (let i = index; i < dataValues.length; i++) {
|
|
141
|
+
if (dataValues[i].sourceTimestamp.getTime() >= startTime.getTime() + duration) {
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
count++;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// check if interval is complete or partial (end or start)
|
|
148
|
+
let isPartial = false;
|
|
149
|
+
if (index + count >= dataValues.length &&
|
|
150
|
+
dataValues[dataValues.length - 1].sourceTimestamp.getTime() < startTime.getTime() + duration) {
|
|
151
|
+
isPartial = true;
|
|
152
|
+
}
|
|
153
|
+
if (index <= 0 && dataValues[0].sourceTimestamp.getTime() > startTime.getTime()) {
|
|
154
|
+
isPartial = true;
|
|
155
|
+
}
|
|
156
|
+
return new Interval({
|
|
157
|
+
count,
|
|
158
|
+
dataValues,
|
|
159
|
+
index,
|
|
160
|
+
isPartial,
|
|
161
|
+
startTime
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
exports.getInterval = getInterval;
|
|
165
165
|
//# sourceMappingURL=interval.js.map
|
package/dist/minmax.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opca-aggregates
|
|
3
|
-
*/
|
|
4
|
-
import { UAVariable } from "node-opcua-address-space";
|
|
5
|
-
import { DataValue } from "node-opcua-data-value";
|
|
6
|
-
import { AggregateConfigurationOptions, Interval } from "./interval";
|
|
7
|
-
export declare function calculateIntervalMinValue(interval: Interval, options: AggregateConfigurationOptions): DataValue;
|
|
8
|
-
export declare function calculateIntervalMaxValue(interval: Interval, options: AggregateConfigurationOptions): DataValue;
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @param node
|
|
12
|
-
* @param processingInterval
|
|
13
|
-
* @param startDate
|
|
14
|
-
* @param endDate
|
|
15
|
-
* @param callback
|
|
16
|
-
*/
|
|
17
|
-
export declare function getMinData(node: UAVariable, processingInterval: number, startDate: Date, endDate: Date, callback: (err: Error | null, dataValues?: DataValue[]) => void): void;
|
|
18
|
-
export declare function getMaxData(node: UAVariable, processingInterval: number, startDate: Date, endDate: Date, callback: (err: Error | null, dataValues?: DataValue[]) => void): void;
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opca-aggregates
|
|
3
|
+
*/
|
|
4
|
+
import { UAVariable } from "node-opcua-address-space";
|
|
5
|
+
import { DataValue } from "node-opcua-data-value";
|
|
6
|
+
import { AggregateConfigurationOptions, Interval } from "./interval";
|
|
7
|
+
export declare function calculateIntervalMinValue(interval: Interval, options: AggregateConfigurationOptions): DataValue;
|
|
8
|
+
export declare function calculateIntervalMaxValue(interval: Interval, options: AggregateConfigurationOptions): DataValue;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param node
|
|
12
|
+
* @param processingInterval
|
|
13
|
+
* @param startDate
|
|
14
|
+
* @param endDate
|
|
15
|
+
* @param callback
|
|
16
|
+
*/
|
|
17
|
+
export declare function getMinData(node: UAVariable, processingInterval: number, startDate: Date, endDate: Date, callback: (err: Error | null, dataValues?: DataValue[]) => void): void;
|
|
18
|
+
export declare function getMaxData(node: UAVariable, processingInterval: number, startDate: Date, endDate: Date, callback: (err: Error | null, dataValues?: DataValue[]) => void): void;
|