raain-model 2.6.7 → 2.6.10
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/.cursorignore +10 -0
- package/.github/workflows/ci.yml +29 -0
- package/CHANGELOG.md +166 -0
- package/LICENSE +21 -0
- package/README.md +90 -9
- package/RELEASE_PROCESS.md +111 -0
- package/package.json +10 -8
- package/specs/REQUIREMENTS.md +42 -0
- package/specs/TECHNICAL.md +57 -0
- package/specs/cartesian/Cartesian.spec.ts +82 -0
- package/specs/cartesian/CartesianTools.spec.ts +121 -0
- package/specs/gauge/Gauge.spec.ts +39 -0
- package/specs/organization/Organization.spec.ts +38 -0
- package/specs/polar/Polar.spec.ts +267 -0
- package/specs/quality/Position.spec.ts +18 -0
- package/specs/quality/QualityPointEdgeCases.spec.ts +215 -0
- package/specs/quality/QualityTools.spec.ts +67 -0
- package/specs/quality/SpeedMatrix.spec.ts +214 -0
- package/specs/radar/Radar.spec.ts +129 -0
- package/specs/rain/Rain.spec.ts +334 -0
- package/specs/tsconfig.json +12 -0
- package/{cartesian/CartesianMeasureValue.js → src/cartesian/CartesianMeasureValue.ts} +73 -41
- package/{cartesian/CartesianTools.js → src/cartesian/CartesianTools.ts} +130 -69
- package/src/cartesian/CartesianValue.ts +26 -0
- package/src/cartesian/EarthMap.ts +5 -0
- package/src/cartesian/ICartesianMeasureValue.ts +22 -0
- package/src/cartesian/LatLng.ts +43 -0
- package/src/cartesian/RadarCartesianMeasureValue.ts +32 -0
- package/src/cartesian/RainCartesianMeasureValue.ts +32 -0
- package/src/gauge/GaugeMeasure.ts +42 -0
- package/src/gauge/GaugeNode.ts +133 -0
- package/src/gauge/GaugeNodeMap.ts +55 -0
- package/src/organization/EventNode.ts +43 -0
- package/{organization/Link.js → src/organization/Link.ts} +17 -14
- package/src/organization/Measure.ts +61 -0
- package/{organization/PeopleNode.js → src/organization/PeopleNode.ts} +20 -10
- package/src/organization/RaainNode.ts +205 -0
- package/src/organization/TeamNode.ts +91 -0
- package/{polar/AbstractPolarMeasureValue.js → src/polar/AbstractPolarMeasureValue.ts} +58 -32
- package/src/polar/IPolarMeasureValue.ts +21 -0
- package/{polar/MeasureValuePolarContainer.js → src/polar/MeasureValuePolarContainer.ts} +29 -13
- package/src/polar/PolarFilter.ts +46 -0
- package/{polar/PolarMeasureValue.js → src/polar/PolarMeasureValue.ts} +125 -62
- package/{polar/PolarMeasureValueMap.js → src/polar/PolarMeasureValueMap.ts} +165 -88
- package/src/polar/PolarValue.ts +16 -0
- package/{polar/RadarPolarMeasureValue.js → src/polar/RadarPolarMeasureValue.ts} +34 -21
- package/src/polar/RainPolarMeasureValue.ts +57 -0
- package/{quality/QualityPoint.js → src/quality/QualityPoint.ts} +62 -34
- package/{quality/SpeedMatrix.js → src/quality/SpeedMatrix.ts} +117 -76
- package/{quality/SpeedMatrixContainer.js → src/quality/SpeedMatrixContainer.ts} +210 -103
- package/src/quality/history/CartesianGaugeHistory.ts +23 -0
- package/src/quality/history/CartesianRainHistory.ts +15 -0
- package/src/quality/history/PositionHistory.ts +31 -0
- package/{quality/index.d.ts → src/quality/index.ts} +3 -0
- package/src/quality/position/Position.ts +59 -0
- package/src/quality/position/PositionValue.ts +15 -0
- package/{quality/tools/QualityTools.js → src/quality/tools/QualityTools.ts} +18 -17
- package/src/radar/RadarMeasure.ts +41 -0
- package/{radar/RadarNode.js → src/radar/RadarNode.ts} +41 -19
- package/src/radar/RadarNodeMap.ts +61 -0
- package/src/rain/MergeStrategy.ts +15 -0
- package/src/rain/RainComputation.ts +96 -0
- package/{rain/RainComputationAbstract.js → src/rain/RainComputationAbstract.ts} +135 -69
- package/src/rain/RainComputationMap.ts +139 -0
- package/{rain/RainComputationQuality.js → src/rain/RainComputationQuality.ts} +82 -44
- package/src/rain/RainMeasure.ts +25 -0
- package/{rain/RainNode.js → src/rain/RainNode.ts} +117 -72
- package/tsconfig.json +17 -0
- package/tslint.json +79 -0
- package/typedoc.json +31 -0
- package/cartesian/CartesianMeasureValue.d.ts +0 -40
- package/cartesian/CartesianMeasureValue.js.map +0 -1
- package/cartesian/CartesianTools.d.ts +0 -32
- package/cartesian/CartesianTools.js.map +0 -1
- package/cartesian/CartesianValue.d.ts +0 -14
- package/cartesian/CartesianValue.js +0 -17
- package/cartesian/CartesianValue.js.map +0 -1
- package/cartesian/EarthMap.d.ts +0 -5
- package/cartesian/EarthMap.js +0 -3
- package/cartesian/EarthMap.js.map +0 -1
- package/cartesian/ICartesianMeasureValue.d.ts +0 -23
- package/cartesian/ICartesianMeasureValue.js +0 -3
- package/cartesian/ICartesianMeasureValue.js.map +0 -1
- package/cartesian/LatLng.d.ts +0 -16
- package/cartesian/LatLng.js +0 -34
- package/cartesian/LatLng.js.map +0 -1
- package/cartesian/RadarCartesianMeasureValue.d.ts +0 -17
- package/cartesian/RadarCartesianMeasureValue.js +0 -22
- package/cartesian/RadarCartesianMeasureValue.js.map +0 -1
- package/cartesian/RainCartesianMeasureValue.d.ts +0 -17
- package/cartesian/RainCartesianMeasureValue.js +0 -23
- package/cartesian/RainCartesianMeasureValue.js.map +0 -1
- package/cartesian/index.js +0 -25
- package/cartesian/index.js.map +0 -1
- package/gauge/GaugeMeasure.d.ts +0 -20
- package/gauge/GaugeMeasure.js +0 -30
- package/gauge/GaugeMeasure.js.map +0 -1
- package/gauge/GaugeNode.d.ts +0 -28
- package/gauge/GaugeNode.js +0 -54
- package/gauge/GaugeNode.js.map +0 -1
- package/gauge/GaugeNodeMap.d.ts +0 -24
- package/gauge/GaugeNodeMap.js +0 -40
- package/gauge/GaugeNodeMap.js.map +0 -1
- package/gauge/index.js +0 -20
- package/gauge/index.js.map +0 -1
- package/index.js +0 -24
- package/index.js.map +0 -1
- package/organization/EventNode.d.ts +0 -22
- package/organization/EventNode.js +0 -30
- package/organization/EventNode.js.map +0 -1
- package/organization/IVersion.js +0 -3
- package/organization/IVersion.js.map +0 -1
- package/organization/Link.d.ts +0 -16
- package/organization/Link.js.map +0 -1
- package/organization/Measure.d.ts +0 -22
- package/organization/Measure.js +0 -45
- package/organization/Measure.js.map +0 -1
- package/organization/PeopleNode.d.ts +0 -18
- package/organization/PeopleNode.js.map +0 -1
- package/organization/RaainNode.d.ts +0 -24
- package/organization/RaainNode.js +0 -109
- package/organization/RaainNode.js.map +0 -1
- package/organization/TeamNode.d.ts +0 -22
- package/organization/TeamNode.js +0 -32
- package/organization/TeamNode.js.map +0 -1
- package/organization/index.js +0 -24
- package/organization/index.js.map +0 -1
- package/polar/AbstractPolarMeasureValue.d.ts +0 -29
- package/polar/AbstractPolarMeasureValue.js.map +0 -1
- package/polar/IPolarMeasureValue.d.ts +0 -19
- package/polar/IPolarMeasureValue.js +0 -3
- package/polar/IPolarMeasureValue.js.map +0 -1
- package/polar/MeasureValuePolarContainer.d.ts +0 -19
- package/polar/MeasureValuePolarContainer.js.map +0 -1
- package/polar/PolarFilter.d.ts +0 -16
- package/polar/PolarFilter.js +0 -45
- package/polar/PolarFilter.js.map +0 -1
- package/polar/PolarMeasureValue.d.ts +0 -51
- package/polar/PolarMeasureValue.js.map +0 -1
- package/polar/PolarMeasureValueMap.d.ts +0 -45
- package/polar/PolarMeasureValueMap.js.map +0 -1
- package/polar/PolarValue.d.ts +0 -10
- package/polar/PolarValue.js +0 -12
- package/polar/PolarValue.js.map +0 -1
- package/polar/RadarPolarMeasureValue.d.ts +0 -27
- package/polar/RadarPolarMeasureValue.js.map +0 -1
- package/polar/RainPolarMeasureValue.d.ts +0 -20
- package/polar/RainPolarMeasureValue.js +0 -42
- package/polar/RainPolarMeasureValue.js.map +0 -1
- package/polar/index.js +0 -25
- package/polar/index.js.map +0 -1
- package/quality/QualityPoint.d.ts +0 -37
- package/quality/QualityPoint.js.map +0 -1
- package/quality/SpeedMatrix.d.ts +0 -83
- package/quality/SpeedMatrix.js.map +0 -1
- package/quality/SpeedMatrixContainer.d.ts +0 -102
- package/quality/SpeedMatrixContainer.js.map +0 -1
- package/quality/history/CartesianGaugeHistory.d.ts +0 -15
- package/quality/history/CartesianGaugeHistory.js +0 -14
- package/quality/history/CartesianGaugeHistory.js.map +0 -1
- package/quality/history/CartesianRainHistory.d.ts +0 -9
- package/quality/history/CartesianRainHistory.js +0 -11
- package/quality/history/CartesianRainHistory.js.map +0 -1
- package/quality/history/PositionHistory.d.ts +0 -20
- package/quality/history/PositionHistory.js +0 -17
- package/quality/history/PositionHistory.js.map +0 -1
- package/quality/index.js +0 -26
- package/quality/index.js.map +0 -1
- package/quality/position/Position.d.ts +0 -22
- package/quality/position/Position.js +0 -50
- package/quality/position/Position.js.map +0 -1
- package/quality/position/PositionValue.d.ts +0 -9
- package/quality/position/PositionValue.js +0 -12
- package/quality/position/PositionValue.js.map +0 -1
- package/quality/tools/QualityTools.d.ts +0 -9
- package/quality/tools/QualityTools.js.map +0 -1
- package/radar/RadarMeasure.d.ts +0 -19
- package/radar/RadarMeasure.js +0 -30
- package/radar/RadarMeasure.js.map +0 -1
- package/radar/RadarNode.d.ts +0 -30
- package/radar/RadarNode.js.map +0 -1
- package/radar/RadarNodeMap.d.ts +0 -26
- package/radar/RadarNodeMap.js +0 -44
- package/radar/RadarNodeMap.js.map +0 -1
- package/radar/index.js +0 -20
- package/radar/index.js.map +0 -1
- package/rain/MergeStrategy.d.ts +0 -13
- package/rain/MergeStrategy.js +0 -11
- package/rain/MergeStrategy.js.map +0 -1
- package/rain/RainComputation.d.ts +0 -42
- package/rain/RainComputation.js +0 -65
- package/rain/RainComputation.js.map +0 -1
- package/rain/RainComputationAbstract.d.ts +0 -73
- package/rain/RainComputationAbstract.js.map +0 -1
- package/rain/RainComputationMap.d.ts +0 -37
- package/rain/RainComputationMap.js +0 -58
- package/rain/RainComputationMap.js.map +0 -1
- package/rain/RainComputationQuality.d.ts +0 -40
- package/rain/RainComputationQuality.js.map +0 -1
- package/rain/RainMeasure.d.ts +0 -17
- package/rain/RainMeasure.js +0 -18
- package/rain/RainMeasure.js.map +0 -1
- package/rain/RainNode.d.ts +0 -46
- package/rain/RainNode.js.map +0 -1
- package/rain/index.js +0 -23
- package/rain/index.js.map +0 -1
- /package/{cartesian/index.d.ts → src/cartesian/index.ts} +0 -0
- /package/{gauge/index.d.ts → src/gauge/index.ts} +0 -0
- /package/{index.d.ts → src/index.ts} +0 -0
- /package/{organization/IVersion.d.ts → src/organization/IVersion.ts} +0 -0
- /package/{organization/index.d.ts → src/organization/index.ts} +0 -0
- /package/{polar/index.d.ts → src/polar/index.ts} +0 -0
- /package/{radar/index.d.ts → src/radar/index.ts} +0 -0
- /package/{rain/index.d.ts → src/rain/index.ts} +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const PolarFilter_1 = require("./PolarFilter");
|
|
1
|
+
import {MeasureValuePolarContainer} from './MeasureValuePolarContainer';
|
|
2
|
+
import {PolarValue} from './PolarValue';
|
|
3
|
+
import {PolarMeasureValue} from './PolarMeasureValue';
|
|
4
|
+
import {PolarFilter} from './PolarFilter';
|
|
5
|
+
|
|
6
|
+
|
|
8
7
|
/**
|
|
9
8
|
* PolarMeasureValue Map tools to optimize get/set
|
|
10
9
|
*/
|
|
11
|
-
class PolarMeasureValueMap {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
export class PolarMeasureValueMap {
|
|
11
|
+
|
|
12
|
+
protected builtMeasureValuePolarContainers: MeasureValuePolarContainer[] = [];
|
|
13
|
+
|
|
14
|
+
constructor(public polarMeasureValue: PolarMeasureValue,
|
|
15
|
+
protected buildPolarFilter: PolarFilter = new PolarFilter()) {
|
|
16
16
|
this.buildFromPolar();
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
protected static UpdateIndex(arrayLength: number, index: number): number {
|
|
19
20
|
let newIndex = index;
|
|
20
21
|
if (arrayLength <= index) {
|
|
21
22
|
newIndex = index - arrayLength;
|
|
22
|
-
}
|
|
23
|
-
else if (index < 0) {
|
|
23
|
+
} else if (index < 0) {
|
|
24
24
|
newIndex = arrayLength + index;
|
|
25
25
|
}
|
|
26
26
|
if (newIndex < 0) {
|
|
@@ -28,240 +28,319 @@ class PolarMeasureValueMap {
|
|
|
28
28
|
}
|
|
29
29
|
return Math.round(newIndex);
|
|
30
30
|
}
|
|
31
|
+
|
|
31
32
|
applyToPolar() {
|
|
32
|
-
const polarMeasureValue = new
|
|
33
|
+
const polarMeasureValue = new PolarMeasureValue({
|
|
33
34
|
measureValuePolarContainers: this.builtMeasureValuePolarContainers,
|
|
34
35
|
azimuthsCount: this.polarMeasureValue.getAzimuthsCount(),
|
|
35
36
|
polarEdgesCount: this.polarMeasureValue.getPolarEdgesCount()
|
|
36
37
|
});
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
const filteredPolarMeasureValue = polarMeasureValue.getFiltered({nullValues: true, ordered: true});
|
|
40
|
+
|
|
41
|
+
this.polarMeasureValue.setPolarsAsContainer(filteredPolarMeasureValue.getPolars(), {resetCount: false});
|
|
39
42
|
}
|
|
40
|
-
|
|
43
|
+
|
|
44
|
+
duplicate(polarFilter?: PolarFilter): PolarMeasureValueMap {
|
|
41
45
|
const newPolarMeasureValueMap = new PolarMeasureValueMap(null);
|
|
42
46
|
const measureValuePolarContainers = [];
|
|
43
47
|
for (const measureValuePolarContainer of this.builtMeasureValuePolarContainers) {
|
|
44
|
-
const duplicateMeasureValuePolarContainer = measureValuePolarContainer.getFiltered({
|
|
48
|
+
const duplicateMeasureValuePolarContainer = measureValuePolarContainer.getFiltered({nullValues: false});
|
|
45
49
|
measureValuePolarContainers.push(duplicateMeasureValuePolarContainer);
|
|
46
50
|
}
|
|
51
|
+
|
|
47
52
|
newPolarMeasureValueMap.polarMeasureValue = this.polarMeasureValue;
|
|
48
53
|
newPolarMeasureValueMap.builtMeasureValuePolarContainers = measureValuePolarContainers;
|
|
49
54
|
newPolarMeasureValueMap.buildPolarFilter = this.buildPolarFilter.merging();
|
|
50
55
|
const newBuildPolarFilter = this.buildPolarFilter.merging(polarFilter);
|
|
56
|
+
|
|
51
57
|
if (!newPolarMeasureValueMap.buildPolarFilter.equal(newBuildPolarFilter)) {
|
|
52
58
|
newPolarMeasureValueMap.filter(newBuildPolarFilter);
|
|
53
59
|
}
|
|
60
|
+
|
|
54
61
|
return newPolarMeasureValueMap;
|
|
55
62
|
}
|
|
56
|
-
|
|
63
|
+
|
|
64
|
+
getPolarValue(json: { azimuthIndex: number, edgeIndex: number }): PolarValue {
|
|
57
65
|
let edgeValue = 0;
|
|
58
66
|
let distanceInMetersFound = 0;
|
|
59
|
-
const {
|
|
67
|
+
const {azimuthIndex, azimuthInDegrees} = this.updatedAzimuth(json.azimuthIndex);
|
|
60
68
|
if (azimuthIndex >= 0) {
|
|
69
|
+
|
|
61
70
|
if (azimuthIndex >= this.builtMeasureValuePolarContainers.length) {
|
|
62
71
|
// throw new Error('Impossible to getPolarValue azimuth from ' + JSON.stringify(json));
|
|
63
72
|
return null;
|
|
64
73
|
}
|
|
74
|
+
|
|
65
75
|
const measureValuePolarContainer = this.builtMeasureValuePolarContainers[azimuthIndex];
|
|
66
|
-
const {
|
|
76
|
+
const {edgeIndex, distanceInMeters} = this.updatedEdge(json.edgeIndex, measureValuePolarContainer);
|
|
67
77
|
distanceInMetersFound = distanceInMeters;
|
|
78
|
+
|
|
68
79
|
if (edgeIndex >= 0) {
|
|
80
|
+
|
|
69
81
|
if (edgeIndex >= measureValuePolarContainer.polarEdges.length) {
|
|
70
82
|
// throw new Error('Impossible to getPolarValue edge from ' + JSON.stringify(json));
|
|
71
83
|
return null;
|
|
72
84
|
}
|
|
85
|
+
|
|
73
86
|
edgeValue = measureValuePolarContainer.polarEdges[edgeIndex];
|
|
74
87
|
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const { distanceInMeters } = this.updatedEdge(json.edgeIndex);
|
|
88
|
+
} else {
|
|
89
|
+
const {distanceInMeters} = this.updatedEdge(json.edgeIndex);
|
|
78
90
|
distanceInMetersFound = distanceInMeters;
|
|
79
91
|
}
|
|
80
|
-
|
|
92
|
+
|
|
93
|
+
return new PolarValue({
|
|
81
94
|
value: edgeValue,
|
|
82
95
|
polarAzimuthInDegrees: azimuthInDegrees,
|
|
83
96
|
polarDistanceInMeters: distanceInMetersFound
|
|
84
97
|
});
|
|
85
98
|
}
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
|
|
100
|
+
setPolarValue(json: { azimuthIndex: number, edgeIndex: number, value: number }) {
|
|
101
|
+
|
|
102
|
+
const {azimuthIndex, azimuthInDegrees} = this.updatedAzimuth(json.azimuthIndex);
|
|
88
103
|
if (azimuthIndex < 0) {
|
|
89
104
|
throw new Error(`Impossible to set ${JSON.stringify(json)} in this optimized polar structure`);
|
|
90
105
|
}
|
|
106
|
+
|
|
91
107
|
const measureValuePolarContainer = this.builtMeasureValuePolarContainers[azimuthIndex];
|
|
92
|
-
const {
|
|
108
|
+
const {edgeIndex} = this.updatedEdge(json.edgeIndex, measureValuePolarContainer);
|
|
93
109
|
if (edgeIndex < 0) {
|
|
94
110
|
throw new Error(`Impossible to set ${JSON.stringify(json)} in this optimized polar structure`);
|
|
95
111
|
}
|
|
112
|
+
|
|
96
113
|
measureValuePolarContainer.polarEdges[edgeIndex] = json.value;
|
|
97
114
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
115
|
+
|
|
116
|
+
iterate(onEachValue: (
|
|
117
|
+
polarValue: PolarValue,
|
|
118
|
+
azimuthIndex: number,
|
|
119
|
+
edgeIndex: number,
|
|
120
|
+
valueSetter: (newValue: number) => void
|
|
121
|
+
) => void,
|
|
122
|
+
options?: {
|
|
123
|
+
iterateOnEachEdge?: boolean,
|
|
124
|
+
polarFilter?: PolarFilter
|
|
125
|
+
}) {
|
|
126
|
+
|
|
127
|
+
const azimuthMin = typeof options?.polarFilter?.azimuthMin !== 'undefined' ? options?.polarFilter.azimuthMin : 0;
|
|
128
|
+
const azimuthMax = typeof options?.polarFilter?.azimuthMax !== 'undefined' ? options?.polarFilter.azimuthMax
|
|
102
129
|
: this.polarMeasureValue.getAzimuthsCount();
|
|
103
|
-
const edgeMin = typeof
|
|
104
|
-
const edgeMax = typeof
|
|
130
|
+
const edgeMin = typeof options?.polarFilter?.edgeMin !== 'undefined' ? options?.polarFilter.edgeMin : 0;
|
|
131
|
+
const edgeMax = typeof options?.polarFilter?.edgeMax !== 'undefined' ? options?.polarFilter.edgeMax
|
|
105
132
|
: this.polarMeasureValue.getPolarEdgesCount();
|
|
106
|
-
|
|
133
|
+
|
|
134
|
+
if (options?.iterateOnEachEdge) {
|
|
107
135
|
this.iterateOnEachEdge(azimuthMin, azimuthMax, edgeMin, edgeMax, onEachValue);
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
136
|
+
} else {
|
|
110
137
|
this.iterateOnEachAzimuth(azimuthMin, azimuthMax, edgeMin, edgeMax, onEachValue);
|
|
111
138
|
}
|
|
112
139
|
}
|
|
140
|
+
|
|
113
141
|
countPolar() {
|
|
114
142
|
return this.builtMeasureValuePolarContainers
|
|
115
143
|
.reduce((p, c) => p + c.getPolarEdgesCount(), 0);
|
|
116
144
|
}
|
|
117
|
-
|
|
145
|
+
|
|
146
|
+
countPolarWithEdgeFilter(filter: any) {
|
|
118
147
|
return this.builtMeasureValuePolarContainers
|
|
119
148
|
.reduce((p, c) => p + c.polarEdges.filter(filter).length, 0);
|
|
120
149
|
}
|
|
121
|
-
|
|
150
|
+
|
|
151
|
+
filter(polarFilter: PolarFilter) {
|
|
152
|
+
|
|
122
153
|
const azimuthsCount = this.polarMeasureValue.getAzimuthsCount();
|
|
123
154
|
const polarEdgesCount = this.polarMeasureValue.getPolarEdgesCount();
|
|
124
155
|
const defaultDistanceBetweenInEdgeInMeters = this.polarMeasureValue.getDefaultDistance();
|
|
156
|
+
|
|
125
157
|
const azimuthMin = typeof polarFilter.azimuthMin !== 'undefined' ? polarFilter.azimuthMin : 0;
|
|
126
158
|
const azimuthMax = typeof polarFilter.azimuthMax !== 'undefined' ?
|
|
127
159
|
Math.min(polarFilter.azimuthMax, azimuthsCount - 1) : azimuthsCount - 1;
|
|
128
160
|
const edgeMin = typeof polarFilter.edgeMin !== 'undefined' ? polarFilter.edgeMin : 0;
|
|
129
161
|
const edgeMax = typeof polarFilter.edgeMax !== 'undefined' ?
|
|
130
162
|
Math.min(polarFilter.edgeMax, polarEdgesCount - 1) : polarEdgesCount - 1;
|
|
163
|
+
|
|
131
164
|
const newMeasureValuePolarContainers = [];
|
|
132
165
|
for (let azimuthIndex = azimuthMin; azimuthIndex <= azimuthMax; azimuthIndex++) {
|
|
133
166
|
const azimuthInDegrees = azimuthIndex * 360 / azimuthsCount;
|
|
134
167
|
const polarEdges = [];
|
|
135
168
|
for (let edgeIndex = edgeMin; edgeIndex <= edgeMax; edgeIndex++) {
|
|
136
|
-
const polarValue = this.getPolarValue({
|
|
169
|
+
const polarValue = this.getPolarValue({azimuthIndex, edgeIndex});
|
|
137
170
|
polarEdges.push(polarValue.value);
|
|
138
171
|
}
|
|
139
|
-
newMeasureValuePolarContainers.push(new
|
|
172
|
+
newMeasureValuePolarContainers.push(new MeasureValuePolarContainer({
|
|
140
173
|
azimuth: azimuthInDegrees,
|
|
141
174
|
distance: defaultDistanceBetweenInEdgeInMeters,
|
|
142
175
|
polarEdges,
|
|
143
176
|
edgeOffset: edgeMin
|
|
144
|
-
}))
|
|
177
|
+
}))
|
|
145
178
|
}
|
|
179
|
+
|
|
146
180
|
this.buildPolarFilter = polarFilter;
|
|
147
181
|
this.builtMeasureValuePolarContainers = newMeasureValuePolarContainers;
|
|
148
182
|
}
|
|
149
|
-
|
|
183
|
+
|
|
184
|
+
protected buildFromPolar() {
|
|
150
185
|
if (!this.polarMeasureValue) {
|
|
151
186
|
return [];
|
|
152
187
|
}
|
|
153
|
-
|
|
188
|
+
|
|
189
|
+
const builtMeasureValuePolarContainers: MeasureValuePolarContainer[] = [];
|
|
190
|
+
|
|
154
191
|
const azimuthsCount = this.polarMeasureValue.getAzimuthsCount();
|
|
155
192
|
const polarEdgesCount = this.polarMeasureValue.getPolarEdgesCount();
|
|
156
193
|
const defaultDistanceBetweenInEdgeInMeters = this.polarMeasureValue.getDefaultDistance();
|
|
194
|
+
|
|
157
195
|
const azimuthMin = typeof this.buildPolarFilter.azimuthMin !== 'undefined' ? this.buildPolarFilter.azimuthMin : 0;
|
|
158
196
|
const azimuthMax = typeof this.buildPolarFilter.azimuthMax !== 'undefined' ? this.buildPolarFilter.azimuthMax : azimuthsCount - 1;
|
|
159
197
|
const edgeMin = typeof this.buildPolarFilter.edgeMin !== 'undefined' ? this.buildPolarFilter.edgeMin : 0;
|
|
160
198
|
const edgeMax = typeof this.buildPolarFilter.edgeMax !== 'undefined' ? this.buildPolarFilter.edgeMax : polarEdgesCount - 1;
|
|
199
|
+
|
|
161
200
|
for (let azIndex = azimuthMin; azIndex <= azimuthMax; azIndex++) {
|
|
162
201
|
const azimuthInDegrees = azIndex * 360 / azimuthsCount;
|
|
163
202
|
const polarEdges = [];
|
|
164
203
|
for (let edgeIndex = edgeMin; edgeIndex <= edgeMax; edgeIndex++) {
|
|
165
204
|
const distanceInMeters = defaultDistanceBetweenInEdgeInMeters * (edgeIndex + 1);
|
|
166
|
-
const polarValue = this.polarMeasureValue.getPolarValue({
|
|
205
|
+
const polarValue = this.polarMeasureValue.getPolarValue({azimuthInDegrees, distanceInMeters});
|
|
167
206
|
polarEdges.push(polarValue.value);
|
|
168
207
|
}
|
|
169
|
-
builtMeasureValuePolarContainers.push(new
|
|
208
|
+
builtMeasureValuePolarContainers.push(new MeasureValuePolarContainer({
|
|
170
209
|
azimuth: azimuthInDegrees,
|
|
171
210
|
distance: defaultDistanceBetweenInEdgeInMeters,
|
|
172
211
|
polarEdges,
|
|
173
212
|
edgeOffset: edgeMin
|
|
174
|
-
}))
|
|
213
|
+
}))
|
|
175
214
|
}
|
|
215
|
+
|
|
176
216
|
this.builtMeasureValuePolarContainers = builtMeasureValuePolarContainers;
|
|
177
217
|
}
|
|
178
|
-
|
|
179
|
-
|
|
218
|
+
|
|
219
|
+
protected updatedAzimuth(azimuthIndexToUpdate: number) {
|
|
180
220
|
const azimuthsCount = this.polarMeasureValue.getAzimuthsCount();
|
|
181
|
-
const azimuthMin = typeof
|
|
221
|
+
const azimuthMin = typeof this.buildPolarFilter?.azimuthMin !== 'undefined' ? this.buildPolarFilter.azimuthMin : 0;
|
|
222
|
+
|
|
182
223
|
const azimuthIndexAbsolute = azimuthIndexToUpdate - azimuthMin;
|
|
183
224
|
const azimuthIndex1 = PolarMeasureValueMap.UpdateIndex(azimuthsCount, azimuthIndexAbsolute);
|
|
184
225
|
const azimuthIndex2 = PolarMeasureValueMap.UpdateIndex(azimuthsCount, azimuthIndexToUpdate);
|
|
185
226
|
const azimuthInDegrees = (azimuthIndex2) * 360 / azimuthsCount;
|
|
227
|
+
|
|
186
228
|
if (azimuthIndex1 < 0) {
|
|
187
229
|
console.warn('### raain-model > Map strange azimuthIndex:', azimuthIndex1);
|
|
188
230
|
}
|
|
189
231
|
if (azimuthInDegrees < 0 || azimuthInDegrees > 360) {
|
|
190
232
|
console.warn('### raain-model > Map strange azimuthInDegrees:', azimuthInDegrees);
|
|
191
233
|
}
|
|
192
|
-
|
|
234
|
+
|
|
235
|
+
return {azimuthIndex: azimuthIndex1, azimuthInDegrees};
|
|
193
236
|
}
|
|
194
|
-
|
|
195
|
-
|
|
237
|
+
|
|
238
|
+
protected updatedEdge(edgeIndexToUpdate: number,
|
|
239
|
+
measureValuePolarContainer?: MeasureValuePolarContainer,
|
|
240
|
+
options?: {
|
|
241
|
+
reverse: boolean
|
|
242
|
+
}) {
|
|
196
243
|
let distance = this.polarMeasureValue.getDefaultDistance();
|
|
197
244
|
if (measureValuePolarContainer) {
|
|
198
245
|
distance = measureValuePolarContainer.getDistance();
|
|
199
246
|
}
|
|
200
|
-
const edgeMin = typeof
|
|
247
|
+
const edgeMin = typeof this.buildPolarFilter?.edgeMin !== 'undefined' ? this.buildPolarFilter.edgeMin : 0;
|
|
248
|
+
|
|
201
249
|
let edgeIndex = edgeIndexToUpdate - edgeMin;
|
|
202
250
|
let distanceIndex = edgeIndexToUpdate + 1;
|
|
203
|
-
if (options
|
|
251
|
+
if (options?.reverse) {
|
|
204
252
|
edgeIndex = edgeIndexToUpdate + edgeMin;
|
|
205
253
|
distanceIndex = edgeIndex + 1;
|
|
206
254
|
}
|
|
255
|
+
|
|
207
256
|
const distanceInMeters = distance * distanceIndex;
|
|
208
257
|
if (distanceInMeters < 0) {
|
|
209
258
|
console.warn('### raain-model > Map strange edgeIndex:', edgeIndex, distanceInMeters);
|
|
210
259
|
}
|
|
260
|
+
|
|
211
261
|
edgeIndex = Math.round(edgeIndex);
|
|
212
|
-
|
|
262
|
+
|
|
263
|
+
return {edgeIndex, distanceInMeters};
|
|
213
264
|
}
|
|
214
|
-
|
|
265
|
+
|
|
266
|
+
protected iterateOnEachAzimuth(azimuthMin: number, azimuthMax: number,
|
|
267
|
+
edgeMin: number, edgeMax: number,
|
|
268
|
+
onEachValue: (
|
|
269
|
+
polarValue: PolarValue,
|
|
270
|
+
azimuthIndex: number,
|
|
271
|
+
edgeIndex: number,
|
|
272
|
+
valueSetter: (newValue: number) => void
|
|
273
|
+
) => void) {
|
|
274
|
+
|
|
215
275
|
for (const measureValuePolarContainer of this.builtMeasureValuePolarContainers) {
|
|
216
276
|
const azimuthInDegrees = measureValuePolarContainer.azimuth;
|
|
217
277
|
const polarEdges = measureValuePolarContainer.polarEdges;
|
|
218
278
|
const azimuthAbsoluteIndex = Math.round(azimuthInDegrees * this.polarMeasureValue.getAzimuthsCount() / 360);
|
|
219
|
-
if (azimuthAbsoluteIndex < azimuthMin)
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
break;
|
|
279
|
+
if (azimuthAbsoluteIndex < azimuthMin) continue;
|
|
280
|
+
if (azimuthMax < azimuthAbsoluteIndex) break;
|
|
281
|
+
|
|
223
282
|
for (const [edgeIndex, value] of polarEdges.entries()) {
|
|
224
|
-
|
|
283
|
+
|
|
284
|
+
const updated = this.updatedEdge(edgeIndex, measureValuePolarContainer, {reverse: true});
|
|
225
285
|
const edgeAbsoluteIndex = updated.edgeIndex;
|
|
226
286
|
const distanceInMeters = updated.distanceInMeters;
|
|
227
|
-
if (edgeAbsoluteIndex < edgeMin)
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
const valueSetter = (newValue) => {
|
|
287
|
+
if (edgeAbsoluteIndex < edgeMin) continue;
|
|
288
|
+
if (edgeMax < edgeAbsoluteIndex) break;
|
|
289
|
+
|
|
290
|
+
const valueSetter = (newValue: number) => {
|
|
232
291
|
polarEdges[edgeIndex] = newValue;
|
|
233
292
|
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
293
|
+
|
|
294
|
+
onEachValue(
|
|
295
|
+
new PolarValue({
|
|
296
|
+
value,
|
|
297
|
+
polarAzimuthInDegrees: azimuthInDegrees,
|
|
298
|
+
polarDistanceInMeters: distanceInMeters
|
|
299
|
+
}),
|
|
300
|
+
azimuthAbsoluteIndex,
|
|
301
|
+
edgeAbsoluteIndex,
|
|
302
|
+
valueSetter);
|
|
239
303
|
}
|
|
240
304
|
}
|
|
241
305
|
}
|
|
242
|
-
|
|
306
|
+
|
|
307
|
+
protected iterateOnEachEdge(azimuthMin: number, azimuthMax: number,
|
|
308
|
+
edgeMin: number, edgeMax: number,
|
|
309
|
+
onEachValue: (
|
|
310
|
+
polarValue: PolarValue,
|
|
311
|
+
azimuthIndex: number,
|
|
312
|
+
edgeIndex: number,
|
|
313
|
+
valueSetter: (newValue: number) => void
|
|
314
|
+
) => void) {
|
|
315
|
+
|
|
243
316
|
for (let edge = edgeMin; edge <= edgeMax; edge++) {
|
|
244
317
|
for (const measureValuePolarContainer of this.builtMeasureValuePolarContainers) {
|
|
245
318
|
const azimuthInDegrees = measureValuePolarContainer.azimuth;
|
|
246
319
|
const polarEdges = measureValuePolarContainer.polarEdges;
|
|
247
320
|
const azimuthAbsoluteIndex = Math.round(azimuthInDegrees * this.polarMeasureValue.getAzimuthsCount() / 360);
|
|
248
|
-
if (azimuthAbsoluteIndex < azimuthMin)
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
break;
|
|
321
|
+
if (azimuthAbsoluteIndex < azimuthMin) continue;
|
|
322
|
+
if (azimuthMax < azimuthAbsoluteIndex) break;
|
|
323
|
+
|
|
252
324
|
for (const [edgeIndex, value] of polarEdges.entries()) {
|
|
253
|
-
|
|
325
|
+
|
|
326
|
+
const updated = this.updatedEdge(edgeIndex, measureValuePolarContainer, {reverse: true});
|
|
254
327
|
const edgeAbsoluteIndex = updated.edgeIndex;
|
|
255
328
|
const distanceInMeters = updated.distanceInMeters;
|
|
329
|
+
|
|
256
330
|
if (edge === edgeAbsoluteIndex) {
|
|
257
|
-
const valueSetter = (newValue) => {
|
|
331
|
+
const valueSetter = (newValue: number) => {
|
|
258
332
|
polarEdges[edgeIndex] = newValue;
|
|
259
333
|
};
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
334
|
+
|
|
335
|
+
onEachValue(
|
|
336
|
+
new PolarValue({
|
|
337
|
+
value,
|
|
338
|
+
polarAzimuthInDegrees: azimuthInDegrees,
|
|
339
|
+
polarDistanceInMeters: distanceInMeters
|
|
340
|
+
}),
|
|
341
|
+
azimuthAbsoluteIndex,
|
|
342
|
+
edgeAbsoluteIndex,
|
|
343
|
+
valueSetter);
|
|
265
344
|
}
|
|
266
345
|
if (edge < edgeAbsoluteIndex) {
|
|
267
346
|
break;
|
|
@@ -271,5 +350,3 @@ class PolarMeasureValueMap {
|
|
|
271
350
|
}
|
|
272
351
|
}
|
|
273
352
|
}
|
|
274
|
-
exports.PolarMeasureValueMap = PolarMeasureValueMap;
|
|
275
|
-
//# sourceMappingURL=PolarMeasureValueMap.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class PolarValue {
|
|
2
|
+
public value: number;
|
|
3
|
+
public polarAzimuthInDegrees: number;
|
|
4
|
+
public polarDistanceInMeters: number;
|
|
5
|
+
|
|
6
|
+
constructor(json: {
|
|
7
|
+
value: number,
|
|
8
|
+
polarAzimuthInDegrees: number,
|
|
9
|
+
polarDistanceInMeters: number
|
|
10
|
+
}) {
|
|
11
|
+
this.value = json.value;
|
|
12
|
+
this.polarAzimuthInDegrees = json.polarAzimuthInDegrees;
|
|
13
|
+
this.polarDistanceInMeters = json.polarDistanceInMeters;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -1,29 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const MeasureValuePolarContainer_1 = require("./MeasureValuePolarContainer");
|
|
1
|
+
import {IPolarMeasureValue} from './IPolarMeasureValue';
|
|
2
|
+
import {AbstractPolarMeasureValue} from './AbstractPolarMeasureValue';
|
|
3
|
+
import {PolarMeasureValue} from './PolarMeasureValue';
|
|
4
|
+
import {MeasureValuePolarContainer} from './MeasureValuePolarContainer';
|
|
5
|
+
|
|
7
6
|
/**
|
|
8
7
|
* Radar with polar value containers
|
|
9
8
|
*/
|
|
10
|
-
class RadarPolarMeasureValue extends
|
|
11
|
-
|
|
9
|
+
export class RadarPolarMeasureValue extends AbstractPolarMeasureValue implements IPolarMeasureValue {
|
|
10
|
+
|
|
11
|
+
public angle: number; // In degrees. Radar incidence angle, from 0° to 90°, from the ground to the top
|
|
12
|
+
public axis: number; // In degrees. Polarization angle 0° = horizontal, 90°= vertical.
|
|
13
|
+
|
|
14
|
+
constructor(json: {
|
|
15
|
+
polarMeasureValue: RadarPolarMeasureValue | PolarMeasureValue | string,
|
|
16
|
+
angle: number
|
|
17
|
+
axis: number
|
|
18
|
+
}) {
|
|
12
19
|
super(json);
|
|
20
|
+
|
|
13
21
|
if (json.polarMeasureValue instanceof RadarPolarMeasureValue) {
|
|
14
22
|
this.angle = json.polarMeasureValue.angle;
|
|
15
23
|
this.axis = json.polarMeasureValue.axis;
|
|
16
24
|
return;
|
|
17
25
|
}
|
|
26
|
+
|
|
18
27
|
if (typeof json.polarMeasureValue === 'string') {
|
|
19
28
|
const object = JSON.parse(json.polarMeasureValue);
|
|
20
29
|
this.angle = typeof json.angle !== 'undefined' ? json.angle : object.angle;
|
|
21
30
|
this.axis = typeof json.axis !== 'undefined' ? json.axis : object.axis;
|
|
22
31
|
return;
|
|
23
32
|
}
|
|
33
|
+
|
|
24
34
|
this.angle = json.angle;
|
|
25
35
|
this.axis = json.axis;
|
|
26
36
|
}
|
|
37
|
+
|
|
27
38
|
/**
|
|
28
39
|
* A fake image to give an example of format needed, made of:
|
|
29
40
|
* - 2 axis: horizontal + vertical
|
|
@@ -31,9 +42,10 @@ class RadarPolarMeasureValue extends AbstractPolarMeasureValue_1.AbstractPolarMe
|
|
|
31
42
|
* - 720 azimuth with a step of 0.5°
|
|
32
43
|
* - 250 gate with a step of 1KM
|
|
33
44
|
*/
|
|
34
|
-
static BuildFakeRadarPolarMeasureValues(movementFrom0To90 = 0) {
|
|
35
|
-
const radarPolarMeasureValues = [];
|
|
36
|
-
|
|
45
|
+
public static BuildFakeRadarPolarMeasureValues(movementFrom0To90 = 0): RadarPolarMeasureValue[] {
|
|
46
|
+
const radarPolarMeasureValues: RadarPolarMeasureValue[] = [];
|
|
47
|
+
|
|
48
|
+
const getMovementValue = (az: number, dis: number) => {
|
|
37
49
|
const sin = Math.sin(az * (Math.PI / 180));
|
|
38
50
|
const tolerance = 20;
|
|
39
51
|
let val = 0;
|
|
@@ -44,9 +56,10 @@ class RadarPolarMeasureValue extends AbstractPolarMeasureValue_1.AbstractPolarMe
|
|
|
44
56
|
}
|
|
45
57
|
return val;
|
|
46
58
|
};
|
|
59
|
+
|
|
47
60
|
const azimuthsCount = 360 * 2;
|
|
48
61
|
const polarEdgesCount = 250;
|
|
49
|
-
for (let axis = 0; axis <= 90; axis += 90) {
|
|
62
|
+
for (let axis = 0; axis <= 90; axis += 90) { // 2 axis: horizontal + vertical
|
|
50
63
|
for (let angle = 0.4; angle < 3; angle++) { // 3 sites: 0.4°, 1.4°, 2.4°
|
|
51
64
|
const value = {
|
|
52
65
|
polarMeasureValue: null,
|
|
@@ -54,37 +67,37 @@ class RadarPolarMeasureValue extends AbstractPolarMeasureValue_1.AbstractPolarMe
|
|
|
54
67
|
angle
|
|
55
68
|
};
|
|
56
69
|
const measureValuePolarContainers = [];
|
|
57
|
-
for (let azimuth = 0; azimuth < (azimuthsCount / 2); azimuth += 0.5) {
|
|
70
|
+
for (let azimuth = 0; azimuth < (azimuthsCount / 2); azimuth += 0.5) { // 0.5° azimuth
|
|
58
71
|
const data = [];
|
|
59
72
|
for (let distance = 0; distance < polarEdgesCount; distance++) {
|
|
60
73
|
const num = Math.round(angle * getMovementValue(azimuth, distance));
|
|
61
74
|
data.push(num);
|
|
62
75
|
}
|
|
63
|
-
const measureValuePolarContainer = new
|
|
76
|
+
const measureValuePolarContainer = new MeasureValuePolarContainer({
|
|
64
77
|
azimuth,
|
|
65
78
|
distance: 1000, // 1KM gate = 1000 meters
|
|
66
79
|
polarEdges: data,
|
|
67
80
|
});
|
|
68
81
|
measureValuePolarContainers.push(measureValuePolarContainer);
|
|
69
82
|
}
|
|
70
|
-
value.polarMeasureValue = new
|
|
83
|
+
value.polarMeasureValue = new PolarMeasureValue({measureValuePolarContainers, azimuthsCount, polarEdgesCount});
|
|
71
84
|
const radarPolarMeasureValue = new RadarPolarMeasureValue(value);
|
|
72
85
|
radarPolarMeasureValues.push(radarPolarMeasureValue);
|
|
73
86
|
}
|
|
74
87
|
}
|
|
75
88
|
return radarPolarMeasureValues;
|
|
76
89
|
}
|
|
77
|
-
|
|
90
|
+
|
|
91
|
+
public toJSON(options = {
|
|
78
92
|
stringify: false
|
|
79
|
-
}) {
|
|
93
|
+
}): any {
|
|
80
94
|
const json = super.toJSON(options);
|
|
81
95
|
json.angle = this.angle;
|
|
82
96
|
json.axis = this.axis;
|
|
83
97
|
return json;
|
|
84
98
|
}
|
|
85
|
-
|
|
86
|
-
|
|
99
|
+
|
|
100
|
+
public toJSONWithPolarStringified(): any {
|
|
101
|
+
return this.toJSON({stringify: true});
|
|
87
102
|
}
|
|
88
103
|
}
|
|
89
|
-
exports.RadarPolarMeasureValue = RadarPolarMeasureValue;
|
|
90
|
-
//# sourceMappingURL=RadarPolarMeasureValue.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {IPolarMeasureValue} from './IPolarMeasureValue';
|
|
2
|
+
import {IVersion} from '../organization';
|
|
3
|
+
import {AbstractPolarMeasureValue} from './AbstractPolarMeasureValue';
|
|
4
|
+
import {PolarMeasureValue} from './PolarMeasureValue';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Computed Rain with polar value containers
|
|
8
|
+
*/
|
|
9
|
+
export class RainPolarMeasureValue extends AbstractPolarMeasureValue implements IPolarMeasureValue, IVersion {
|
|
10
|
+
|
|
11
|
+
private readonly version: string;
|
|
12
|
+
|
|
13
|
+
constructor(json: {
|
|
14
|
+
polarMeasureValue: RainPolarMeasureValue | PolarMeasureValue | string,
|
|
15
|
+
version?: string
|
|
16
|
+
}) {
|
|
17
|
+
super(json);
|
|
18
|
+
|
|
19
|
+
if (json.polarMeasureValue instanceof RainPolarMeasureValue) {
|
|
20
|
+
this.version = json.polarMeasureValue.version;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
this.version = json.version;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static From(obj: IPolarMeasureValue | any): RainPolarMeasureValue {
|
|
28
|
+
let version: string,
|
|
29
|
+
polarMeasureValue: PolarMeasureValue;
|
|
30
|
+
|
|
31
|
+
if (typeof obj.version === 'string') {
|
|
32
|
+
version = obj.version;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (typeof obj.polarMeasureValue !== 'undefined') {
|
|
36
|
+
polarMeasureValue = obj.polarMeasureValue;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return new RainPolarMeasureValue({polarMeasureValue, version});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public toJSON(options = {
|
|
43
|
+
stringify: false
|
|
44
|
+
}): any {
|
|
45
|
+
const json: any = super.toJSON(options);
|
|
46
|
+
json.version = this.version;
|
|
47
|
+
return json;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public toJSONWithPolarStringified(): any {
|
|
51
|
+
return this.toJSON({stringify: true});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public getVersion(): string {
|
|
55
|
+
return this.version;
|
|
56
|
+
}
|
|
57
|
+
}
|