@utiliread/primitives 1.0.0-63 → 1.0.0-65

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.
@@ -1,36 +1,36 @@
1
- import { invariantDecimalSeparator } from ".";
2
- import { localeDecimalSeparator, NumberFormatter } from "./number-formatter";
3
-
4
- export class PrecisionNumber {
5
- constructor(public value: number, public precision: number) {
6
- }
7
-
8
- static parse(input: string) {
9
- let normalized = input.trim().replace(",", ".").replace(localeDecimalSeparator, invariantDecimalSeparator);
10
- if (normalized.endsWith(invariantDecimalSeparator)) {
11
- normalized += "0";
12
- }
13
- const precision = normalized.replace(".", "").replace("+", "").replace("-", "").length;
14
- return new PrecisionNumber(parseFloat(normalized), precision);
15
- }
16
-
17
- toString() {
18
- return this.value.toString();
19
- }
20
-
21
- toFixed() {
22
- return NumberFormatter.toFixed(this.value, this.precision);
23
- }
24
-
25
- toPrecision() {
26
- return NumberFormatter.toPrecision(this.value, this.precision);
27
- }
28
-
29
- toLocaleFixed() {
30
- return NumberFormatter.toLocaleFixed(this.value, this.precision);
31
- }
32
-
33
- toLocalePrecision() {
34
- return NumberFormatter.toLocalePrecision(this.value, this.precision);
35
- }
36
- }
1
+ import { invariantDecimalSeparator } from ".";
2
+ import { localeDecimalSeparator, NumberFormatter } from "./number-formatter";
3
+
4
+ export class PrecisionNumber {
5
+ constructor(public value: number, public precision: number) {
6
+ }
7
+
8
+ static parse(input: string) {
9
+ let normalized = input.trim().replace(",", ".").replace(localeDecimalSeparator, invariantDecimalSeparator);
10
+ if (normalized.endsWith(invariantDecimalSeparator)) {
11
+ normalized += "0";
12
+ }
13
+ const precision = normalized.replace(".", "").replace("+", "").replace("-", "").length;
14
+ return new PrecisionNumber(parseFloat(normalized), precision);
15
+ }
16
+
17
+ toString() {
18
+ return this.value.toString();
19
+ }
20
+
21
+ toFixed() {
22
+ return NumberFormatter.toFixed(this.value, this.precision);
23
+ }
24
+
25
+ toPrecision() {
26
+ return NumberFormatter.toPrecision(this.value, this.precision);
27
+ }
28
+
29
+ toLocaleFixed() {
30
+ return NumberFormatter.toLocaleFixed(this.value, this.precision);
31
+ }
32
+
33
+ toLocalePrecision() {
34
+ return NumberFormatter.toLocalePrecision(this.value, this.precision);
35
+ }
36
+ }
@@ -1,23 +1,23 @@
1
- import { UnitId } from ".";
2
- import { AggregateId } from "./aggregate-id";
3
- import { MeasureId } from "./measure-id";
4
- import { RegisterId } from "./register-id";
5
-
6
- export interface RegisterDefinition {
7
- /// The id of the register
8
- id: RegisterId;
9
- /// The register measure
10
- measure: MeasureId;
11
- /// The aggregate of the register
12
- aggregate: AggregateId;
13
- /// The possible register units
14
- units: ReadonlyArray<UnitId>;
15
- /// Whether the register can only be resolved by "present value".
16
- immediate?: true;
17
- /// An optional concise register name.
18
- /// Only used for custom registers as locales exist for standard registers.
19
- name?: string;
20
- /// An optional register description.
21
- /// Only used for custom registers as locales exist for standard registers.
22
- description?: string;
23
- }
1
+ import { UnitId } from ".";
2
+ import { AggregateId } from "./aggregate-id";
3
+ import { MeasureId } from "./measure-id";
4
+ import { RegisterId } from "./register-id";
5
+
6
+ export interface RegisterDefinition {
7
+ /// The id of the register
8
+ id: RegisterId;
9
+ /// The register measure
10
+ measure: MeasureId;
11
+ /// The aggregate of the register
12
+ aggregate: AggregateId;
13
+ /// The possible register units
14
+ units: ReadonlyArray<UnitId>;
15
+ /// Whether the register can only be resolved by "present value".
16
+ immediate?: true;
17
+ /// An optional concise register name.
18
+ /// Only used for custom registers as locales exist for standard registers.
19
+ name?: string;
20
+ /// An optional register description.
21
+ /// Only used for custom registers as locales exist for standard registers.
22
+ description?: string;
23
+ }
@@ -1,271 +1,279 @@
1
- export type RegisterId =
2
- "none" |
3
-
4
- "heatEnergy" |
5
- "diffHeatEnergy" |
6
- "cntHeatEnergy" |
7
-
8
- "heatEnergyVolumeInInlet" |
9
- "diffHeatEnergyVolumeInInlet" |
10
- "cntHeatEnergyVolumeInInlet" |
11
-
12
- "heatEnergyVolumeInOutlet" |
13
- "diffHeatEnergyVolumeInOutlet" |
14
- "cntHeatEnergyVolumeInOutlet" |
15
-
16
- "coolingEnergy" |
17
- "diffCoolingEnergy" |
18
- "cntCoolingEnergy" |
19
-
20
- "coolingEnergyVolumeInInlet" |
21
- "diffCoolingEnergyVolumeInInlet" |
22
- "cntCoolingEnergyVolumeInInlet" |
23
-
24
- "coolingEnergyVolumeInOutlet" |
25
- "diffCoolingEnergyVolumeInOutlet" |
26
- "cntCoolingEnergyVolumeInOutlet" |
27
-
28
- "electricalEnergy" |
29
- "diffElectricalEnergy" |
30
- "cntElectricalEnergy" |
31
-
32
- "reactiveEnergy" |
33
- "diffReactiveEnergy" |
34
- "cntReactiveEnergy" |
35
-
36
- "volume" |
37
- "diffVolume" |
38
- "cntVolume" |
39
-
40
- "inletVolume" |
41
- "diffInletVolume" |
42
- "cntInletVolume" |
43
-
44
- "outletVolume" |
45
- "diffOutletVolume" |
46
- "cntOutletVolume" |
47
-
48
- "pulseInputAVolume" |
49
- "diffPulseInputAVolume" |
50
- "cntPulseInputAVolume" |
51
-
52
- "pulseInputBVolume" |
53
- "diffPulseInputBVolume" |
54
- "cntPulseInputBVolume" |
55
-
56
- "mass" |
57
- "diffMass" |
58
- "cntMass" |
59
-
60
- "inletMass" |
61
- "diffInletMass" |
62
- "cntInletMass" |
63
-
64
- "outletMass" |
65
- "diffOutletMass" |
66
- "cntOutletMass" |
67
-
68
- "power" |
69
- "maxPower" |
70
- "minPower" |
71
- "avgPower" |
72
- "sumPower" |
73
- "cntPower" |
74
- "ssqPower" |
75
-
76
- "inletPower" |
77
- "maxInletPower" |
78
- "minInletPower" |
79
- "avgInletPower" |
80
- "sumInletPower" |
81
- "cntInletPower" |
82
- "ssqInletPower" |
83
-
84
- "outletPower" |
85
- "maxOutletPower" |
86
- "minOutletPower" |
87
- "avgOutletPower" |
88
- "sumOutletPower" |
89
- "cntOutletPower" |
90
- "ssqOutletPower" |
91
-
92
- "volumeFlow" |
93
- "maxVolumeFlow" |
94
- "minVolumeFlow" |
95
- "avgVolumeFlow" |
96
- "sumVolumeFlow" |
97
- "cntVolumeFlow" |
98
- "ssqVolumeFlow" |
99
-
100
- "inletVolumeFlow" |
101
- "maxInletVolumeFlow" |
102
- "minInletVolumeFlow" |
103
- "avgInletVolumeFlow" |
104
- "sumInletVolumeFlow" |
105
- "cntInletVolumeFlow" |
106
- "ssqInletVolumeFlow" |
107
-
108
- "outletVolumeFlow" |
109
- "maxOutletVolumeFlow" |
110
- "minOutletVolumeFlow" |
111
- "avgOutletVolumeFlow" |
112
- "sumOutletVolumeFlow" |
113
- "cntOutletVolumeFlow" |
114
- "ssqOutletVolumeFlow" |
115
-
116
- "massFlow" |
117
- "maxMassFlow" |
118
- "minMassFlow" |
119
- "avgMassFlow" |
120
- "sumMassFlow" |
121
- "cntMassFlow" |
122
- "ssqMassFlow" |
123
-
124
- "inletMassFlow" |
125
- "maxInletMassFlow" |
126
- "minInletMassFlow" |
127
- "avgInletMassFlow" |
128
- "sumInletMassFlow" |
129
- "cntInletMassFlow" |
130
- "ssqInletMassFlow" |
131
-
132
- "outletMassFlow" |
133
- "maxOutletMassFlow" |
134
- "minOutletMassFlow" |
135
- "avgOutletMassFlow" |
136
- "sumOutletMassFlow" |
137
- "cntOutletMassFlow" |
138
- "ssqOutletMassFlow" |
139
-
140
- "flowTemperature" |
141
- "maxFlowTemperature" |
142
- "minFlowTemperature" |
143
- "avgFlowTemperature" |
144
- "sumFlowTemperature" |
145
- "cntFlowTemperature" |
146
- "ssqFlowTemperature" |
147
-
148
- "inletFlowTemperature" |
149
- "maxInletFlowTemperature" |
150
- "minInletFlowTemperature" |
151
- "avgInletFlowTemperature" |
152
- "sumInletFlowTemperature" |
153
- "cntInletFlowTemperature" |
154
- "ssqInletFlowTemperature" |
155
-
156
- "outletFlowTemperature" |
157
- "maxOutletFlowTemperature" |
158
- "minOutletFlowTemperature" |
159
- "avgOutletFlowTemperature" |
160
- "sumOutletFlowTemperature" |
161
- "cntOutletFlowTemperature" |
162
- "ssqOutletFlowTemperature" |
163
-
164
- "inletMinusOutletFlowTemperatureDifference" |
165
- "maxInletMinusOutletFlowTemperatureDifference" |
166
- "minInletMinusOutletFlowTemperatureDifference" |
167
- "avgInletMinusOutletFlowTemperatureDifference" |
168
- "sumInletMinusOutletFlowTemperatureDifference" |
169
- "cntInletMinusOutletFlowTemperatureDifference" |
170
- "ssqInletMinusOutletFlowTemperatureDifference" |
171
-
172
- "outletMinusInletFlowTemperatureDifference" |
173
- "maxOutletMinusInletFlowTemperatureDifference" |
174
- "minOutletMinusInletFlowTemperatureDifference" |
175
- "avgOutletMinusInletFlowTemperatureDifference" |
176
- "sumOutletMinusInletFlowTemperatureDifference" |
177
- "cntOutletMinusInletFlowTemperatureDifference" |
178
- "ssqOutletMinusInletFlowTemperatureDifference" |
179
-
180
- "ambientTemperature" |
181
- "maxAmbientTemperature" |
182
- "minAmbientTemperature" |
183
- "avgAmbientTemperature" |
184
- "sumAmbientTemperature" |
185
- "cntAmbientTemperature" |
186
- "ssqAmbientTemperature" |
187
-
188
- "radiatorTemperature" |
189
- "maxRadiatorTemperature" |
190
- "minRadiatorTemperature" |
191
- "avgRadiatorTemperature" |
192
- "sumRadiatorTemperature" |
193
- "cntRadiatorTemperature" |
194
- "ssqRadiatorTemperature" |
195
-
196
- "relativeHumidity" |
197
-
198
- "kamstrupE8Inlet" |
199
- "diffKamstrupE8Inlet" |
200
- "cntKamstrupE8Inlet" |
201
- "kamstrupE9Outlet" |
202
- "diffKamstrupE9Outlet" |
203
- "cntKamstrupE9Outlet" |
204
-
205
- "operatingTime" |
206
- "diffOperatingTime" |
207
- "cntOperatingTime" |
208
-
209
- "errorOperatingTime" |
210
- "diffErrorOperatingTime" |
211
- "cntErrorOperatingTime" |
212
-
213
- "remainingBatteryTime" |
214
- "diffRemainingBatteryTime" |
215
- "cntRemainingBatteryTime" |
216
-
217
- "deviceDate" |
218
- "deviceTime" |
219
- "deviceDateTime" |
220
-
221
- "timeSinceLastExactOverhearingArrived" |
222
- "timeAtLastExactOverhearingArrived" |
223
-
224
- "timeSinceLastPossibleCandidateOverhearingArrived" |
225
- "timeAtLastPossibleCandidateOverhearingArrived" |
226
-
227
- "timeSinceLastSampled" |
228
- "timeAtLastSampled" |
229
-
230
- "timeSinceLastInstallationMounted" |
231
- "timeAtLastInstallationMounted" |
232
-
233
- "basetime" |
234
- "instantTime" |
235
- "periodStartTime" |
236
- "periodEndTime" |
237
- "instantOrPeriodStartTime" |
238
- "instantOrPeriodEndTime" |
239
-
240
- "device" |
241
- "wMBusDeviceAddresses" |
242
- "kamdraftDeviceAddresses" |
243
- "tchlrDeviceAddresses" |
244
- "kamdaDeviceAddresses" |
245
- "msisdnDeviceAddresses" |
246
-
247
- "deviceRegisters" |
248
-
249
- "consumptionZone" |
250
-
251
- "mBusFormatStringSignature" |
252
- "deviceSoftwareVersion" |
253
-
254
- "kamstrupMulticalInfocodeType1" |
255
- "kamstrupMulticalInfocodeType2" |
256
- "kamstrupMulticalInfocodeType3" |
257
- "kamstrupMulticalInfocodeType4" |
258
- "kamstrupMulticalInfocode" |
259
- "kamstrupModuleType" |
260
-
261
- "diehlInfocodeType1" |
262
- "diehlInfocode" |
263
-
264
- "landisGyrMBusStatusType1" |
265
- "landisGyrMBusStatusType2" |
266
- "landisGyrMBusStatus" |
267
- "landisGyrInfocodeType1" |
268
- "landisGyrInfocodeType2" |
269
- "landisGyrInfocode" |
270
-
271
- "infocode";
1
+ export type RegisterId =
2
+ "none" |
3
+
4
+ "heatEnergy" |
5
+ "diffHeatEnergy" |
6
+ "cntHeatEnergy" |
7
+
8
+ "heatEnergyVolumeInInlet" |
9
+ "diffHeatEnergyVolumeInInlet" |
10
+ "cntHeatEnergyVolumeInInlet" |
11
+
12
+ "heatEnergyVolumeInOutlet" |
13
+ "diffHeatEnergyVolumeInOutlet" |
14
+ "cntHeatEnergyVolumeInOutlet" |
15
+
16
+ "coolingEnergy" |
17
+ "diffCoolingEnergy" |
18
+ "cntCoolingEnergy" |
19
+
20
+ "coolingEnergyVolumeInInlet" |
21
+ "diffCoolingEnergyVolumeInInlet" |
22
+ "cntCoolingEnergyVolumeInInlet" |
23
+
24
+ "coolingEnergyVolumeInOutlet" |
25
+ "diffCoolingEnergyVolumeInOutlet" |
26
+ "cntCoolingEnergyVolumeInOutlet" |
27
+
28
+ "electricalEnergy" |
29
+ "diffElectricalEnergy" |
30
+ "cntElectricalEnergy" |
31
+
32
+ "reactiveEnergy" |
33
+ "diffReactiveEnergy" |
34
+ "cntReactiveEnergy" |
35
+
36
+ "volume" |
37
+ "diffVolume" |
38
+ "cntVolume" |
39
+
40
+ "inletVolume" |
41
+ "diffInletVolume" |
42
+ "cntInletVolume" |
43
+
44
+ "outletVolume" |
45
+ "diffOutletVolume" |
46
+ "cntOutletVolume" |
47
+
48
+ "pulseInputAVolume" |
49
+ "diffPulseInputAVolume" |
50
+ "cntPulseInputAVolume" |
51
+
52
+ "pulseInputBVolume" |
53
+ "diffPulseInputBVolume" |
54
+ "cntPulseInputBVolume" |
55
+
56
+ "mass" |
57
+ "diffMass" |
58
+ "cntMass" |
59
+
60
+ "inletMass" |
61
+ "diffInletMass" |
62
+ "cntInletMass" |
63
+
64
+ "outletMass" |
65
+ "diffOutletMass" |
66
+ "cntOutletMass" |
67
+
68
+ "power" |
69
+ "maxPower" |
70
+ "minPower" |
71
+ "avgPower" |
72
+ "sumPower" |
73
+ "cntPower" |
74
+ "ssqPower" |
75
+
76
+ "inletPower" |
77
+ "maxInletPower" |
78
+ "minInletPower" |
79
+ "avgInletPower" |
80
+ "sumInletPower" |
81
+ "cntInletPower" |
82
+ "ssqInletPower" |
83
+
84
+ "outletPower" |
85
+ "maxOutletPower" |
86
+ "minOutletPower" |
87
+ "avgOutletPower" |
88
+ "sumOutletPower" |
89
+ "cntOutletPower" |
90
+ "ssqOutletPower" |
91
+
92
+ "volumeFlow" |
93
+ "maxVolumeFlow" |
94
+ "minVolumeFlow" |
95
+ "avgVolumeFlow" |
96
+ "sumVolumeFlow" |
97
+ "cntVolumeFlow" |
98
+ "ssqVolumeFlow" |
99
+
100
+ "inletVolumeFlow" |
101
+ "maxInletVolumeFlow" |
102
+ "minInletVolumeFlow" |
103
+ "avgInletVolumeFlow" |
104
+ "sumInletVolumeFlow" |
105
+ "cntInletVolumeFlow" |
106
+ "ssqInletVolumeFlow" |
107
+
108
+ "outletVolumeFlow" |
109
+ "maxOutletVolumeFlow" |
110
+ "minOutletVolumeFlow" |
111
+ "avgOutletVolumeFlow" |
112
+ "sumOutletVolumeFlow" |
113
+ "cntOutletVolumeFlow" |
114
+ "ssqOutletVolumeFlow" |
115
+
116
+ "massFlow" |
117
+ "maxMassFlow" |
118
+ "minMassFlow" |
119
+ "avgMassFlow" |
120
+ "sumMassFlow" |
121
+ "cntMassFlow" |
122
+ "ssqMassFlow" |
123
+
124
+ "inletMassFlow" |
125
+ "maxInletMassFlow" |
126
+ "minInletMassFlow" |
127
+ "avgInletMassFlow" |
128
+ "sumInletMassFlow" |
129
+ "cntInletMassFlow" |
130
+ "ssqInletMassFlow" |
131
+
132
+ "outletMassFlow" |
133
+ "maxOutletMassFlow" |
134
+ "minOutletMassFlow" |
135
+ "avgOutletMassFlow" |
136
+ "sumOutletMassFlow" |
137
+ "cntOutletMassFlow" |
138
+ "ssqOutletMassFlow" |
139
+
140
+ "flowTemperature" |
141
+ "maxFlowTemperature" |
142
+ "minFlowTemperature" |
143
+ "avgFlowTemperature" |
144
+ "sumFlowTemperature" |
145
+ "cntFlowTemperature" |
146
+ "ssqFlowTemperature" |
147
+
148
+ "inletFlowTemperature" |
149
+ "maxInletFlowTemperature" |
150
+ "minInletFlowTemperature" |
151
+ "avgInletFlowTemperature" |
152
+ "sumInletFlowTemperature" |
153
+ "cntInletFlowTemperature" |
154
+ "ssqInletFlowTemperature" |
155
+
156
+ "outletFlowTemperature" |
157
+ "maxOutletFlowTemperature" |
158
+ "minOutletFlowTemperature" |
159
+ "avgOutletFlowTemperature" |
160
+ "sumOutletFlowTemperature" |
161
+ "cntOutletFlowTemperature" |
162
+ "ssqOutletFlowTemperature" |
163
+
164
+ "inletMinusOutletFlowTemperatureDifference" |
165
+ "maxInletMinusOutletFlowTemperatureDifference" |
166
+ "minInletMinusOutletFlowTemperatureDifference" |
167
+ "avgInletMinusOutletFlowTemperatureDifference" |
168
+ "sumInletMinusOutletFlowTemperatureDifference" |
169
+ "cntInletMinusOutletFlowTemperatureDifference" |
170
+ "ssqInletMinusOutletFlowTemperatureDifference" |
171
+
172
+ "outletMinusInletFlowTemperatureDifference" |
173
+ "maxOutletMinusInletFlowTemperatureDifference" |
174
+ "minOutletMinusInletFlowTemperatureDifference" |
175
+ "avgOutletMinusInletFlowTemperatureDifference" |
176
+ "sumOutletMinusInletFlowTemperatureDifference" |
177
+ "cntOutletMinusInletFlowTemperatureDifference" |
178
+ "ssqOutletMinusInletFlowTemperatureDifference" |
179
+
180
+ "ambientTemperature" |
181
+ "maxAmbientTemperature" |
182
+ "minAmbientTemperature" |
183
+ "avgAmbientTemperature" |
184
+ "sumAmbientTemperature" |
185
+ "cntAmbientTemperature" |
186
+ "ssqAmbientTemperature" |
187
+
188
+ "radiatorTemperature" |
189
+ "maxRadiatorTemperature" |
190
+ "minRadiatorTemperature" |
191
+ "avgRadiatorTemperature" |
192
+ "sumRadiatorTemperature" |
193
+ "cntRadiatorTemperature" |
194
+ "ssqRadiatorTemperature" |
195
+
196
+ "auxFlowTemperature" |
197
+ "maxAuxFlowTemperature" |
198
+ "minAuxFlowTemperature" |
199
+ "avgAuxFlowTemperature" |
200
+ "sumAuxFlowTemperature" |
201
+ "cntAuxFlowTemperature" |
202
+ "ssqAuxFlowTemperature" |
203
+
204
+ "relativeHumidity" |
205
+
206
+ "kamstrupE8Inlet" |
207
+ "diffKamstrupE8Inlet" |
208
+ "cntKamstrupE8Inlet" |
209
+ "kamstrupE9Outlet" |
210
+ "diffKamstrupE9Outlet" |
211
+ "cntKamstrupE9Outlet" |
212
+
213
+ "operatingTime" |
214
+ "diffOperatingTime" |
215
+ "cntOperatingTime" |
216
+
217
+ "errorOperatingTime" |
218
+ "diffErrorOperatingTime" |
219
+ "cntErrorOperatingTime" |
220
+
221
+ "remainingBatteryTime" |
222
+ "diffRemainingBatteryTime" |
223
+ "cntRemainingBatteryTime" |
224
+
225
+ "deviceDate" |
226
+ "deviceTime" |
227
+ "deviceDateTime" |
228
+
229
+ "timeSinceLastExactOverhearingArrived" |
230
+ "timeAtLastExactOverhearingArrived" |
231
+
232
+ "timeSinceLastPossibleCandidateOverhearingArrived" |
233
+ "timeAtLastPossibleCandidateOverhearingArrived" |
234
+
235
+ "timeSinceLastSampled" |
236
+ "timeAtLastSampled" |
237
+
238
+ "timeSinceLastInstallationMounted" |
239
+ "timeAtLastInstallationMounted" |
240
+
241
+ "basetime" |
242
+ "instantTime" |
243
+ "periodStartTime" |
244
+ "periodEndTime" |
245
+ "instantOrPeriodStartTime" |
246
+ "instantOrPeriodEndTime" |
247
+
248
+ "device" |
249
+ "wMBusDeviceAddresses" |
250
+ "kamdraftDeviceAddresses" |
251
+ "tchlrDeviceAddresses" |
252
+ "kamdaDeviceAddresses" |
253
+ "msisdnDeviceAddresses" |
254
+
255
+ "deviceRegisters" |
256
+
257
+ "consumptionZone" |
258
+
259
+ "mBusFormatStringSignature" |
260
+ "deviceSoftwareVersion" |
261
+
262
+ "kamstrupMulticalInfocodeType1" |
263
+ "kamstrupMulticalInfocodeType2" |
264
+ "kamstrupMulticalInfocodeType3" |
265
+ "kamstrupMulticalInfocodeType4" |
266
+ "kamstrupMulticalInfocode" |
267
+ "kamstrupModuleType" |
268
+
269
+ "diehlInfocodeType1" |
270
+ "diehlInfocode" |
271
+
272
+ "landisGyrMBusStatusType1" |
273
+ "landisGyrMBusStatusType2" |
274
+ "landisGyrMBusStatus" |
275
+ "landisGyrInfocodeType1" |
276
+ "landisGyrInfocodeType2" |
277
+ "landisGyrInfocode" |
278
+
279
+ "infocode";