raain-model 2.4.6 → 2.5.1
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/README.md +2 -6
- package/RELEASE.md +1 -0
- package/cartesian/CartesianMeasureValue.d.ts +11 -2
- package/cartesian/CartesianMeasureValue.js +49 -9
- package/cartesian/CartesianMeasureValue.js.map +1 -1
- package/cartesian/CartesianValue.d.ts +1 -0
- package/cartesian/CartesianValue.js +1 -1
- package/cartesian/CartesianValue.js.map +1 -1
- package/cartesian/ICartesianMeasureValue.d.ts +1 -6
- package/cartesian/RadarCartesianMeasureValue.d.ts +5 -1
- package/cartesian/RadarCartesianMeasureValue.js +3 -6
- package/cartesian/RadarCartesianMeasureValue.js.map +1 -1
- package/cartesian/RainCartesianMeasureValue.d.ts +6 -2
- package/cartesian/RainCartesianMeasureValue.js +3 -5
- package/cartesian/RainCartesianMeasureValue.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/package.json +4 -2
- package/polar/AbstractPolarMeasureValue.d.ts +9 -9
- package/polar/AbstractPolarMeasureValue.js +40 -51
- package/polar/AbstractPolarMeasureValue.js.map +1 -1
- package/polar/IPolarMeasureValue.d.ts +7 -7
- package/polar/MeasureValuePolarContainer.d.ts +8 -0
- package/polar/MeasureValuePolarContainer.js +41 -0
- package/polar/MeasureValuePolarContainer.js.map +1 -1
- package/polar/PolarFilter.d.ts +16 -0
- package/polar/PolarFilter.js +45 -0
- package/polar/PolarFilter.js.map +1 -0
- package/polar/PolarMeasureValue.d.ts +30 -9
- package/polar/PolarMeasureValue.js +156 -33
- package/polar/PolarMeasureValue.js.map +1 -1
- package/polar/PolarMeasureValueMap.d.ts +40 -0
- package/polar/PolarMeasureValueMap.js +233 -0
- package/polar/PolarMeasureValueMap.js.map +1 -0
- package/polar/RadarPolarMeasureValue.d.ts +3 -1
- package/polar/RadarPolarMeasureValue.js +18 -15
- package/polar/RadarPolarMeasureValue.js.map +1 -1
- package/polar/RainPolarMeasureValue.d.ts +4 -2
- package/polar/RainPolarMeasureValue.js +5 -9
- package/polar/RainPolarMeasureValue.js.map +1 -1
- package/quality/SpeedMatrix.d.ts +2 -2
- package/quality/SpeedMatrix.js +3 -6
- package/quality/SpeedMatrix.js.map +1 -1
- package/quality/SpeedMatrixContainer.d.ts +2 -1
- package/quality/SpeedMatrixContainer.js +7 -2
- package/quality/SpeedMatrixContainer.js.map +1 -1
- package/quality/tools/QualityTools.js +2 -2
- package/quality/tools/QualityTools.js.map +1 -1
- package/rain/RainComputation.d.ts +10 -1
- package/rain/RainComputation.js +14 -2
- package/rain/RainComputation.js.map +1 -1
- package/rain/RainComputationAbstract.d.ts +23 -0
- package/rain/RainComputationAbstract.js +83 -0
- package/rain/RainComputationAbstract.js.map +1 -1
- package/rain/RainComputationMap.d.ts +8 -2
- package/rain/RainComputationMap.js +12 -1
- package/rain/RainComputationMap.js.map +1 -1
- package/rain/RainMeasure.d.ts +1 -1
- package/rain/RainMeasure.js +1 -1
- package/rain/RainNode.d.ts +1 -0
- package/rain/RainNode.js +18 -0
- package/rain/RainNode.js.map +1 -1
- package/polar/GaugePolarMeasureValue.d.ts +0 -11
- package/polar/GaugePolarMeasureValue.js +0 -14
- package/polar/GaugePolarMeasureValue.js.map +0 -1
|
@@ -9,14 +9,55 @@ class MeasureValuePolarContainer {
|
|
|
9
9
|
this.azimuth = json.azimuth;
|
|
10
10
|
this.distance = json.distance;
|
|
11
11
|
this.polarEdges = json.polarEdges;
|
|
12
|
+
this.edgeOffset = json.edgeOffset ? json.edgeOffset : 0;
|
|
12
13
|
}
|
|
13
14
|
toJSON() {
|
|
14
15
|
return {
|
|
15
16
|
azimuth: this.azimuth,
|
|
16
17
|
distance: this.distance,
|
|
17
18
|
polarEdges: this.polarEdges,
|
|
19
|
+
edgeOffset: this.edgeOffset,
|
|
18
20
|
};
|
|
19
21
|
}
|
|
22
|
+
getPolarEdgesCount() {
|
|
23
|
+
return this.edgeOffset + this.polarEdges.length;
|
|
24
|
+
}
|
|
25
|
+
getNotNullValuesCount() {
|
|
26
|
+
const edges = this.polarEdges.filter(e => !!e);
|
|
27
|
+
return edges.length;
|
|
28
|
+
}
|
|
29
|
+
getFiltered(options = { nullValues: true }) {
|
|
30
|
+
let polarEdges = this.polarEdges.map(e => 1 - 1 + e);
|
|
31
|
+
let edgeOffset = this.edgeOffset + 1 - 1;
|
|
32
|
+
if (options.nullValues) {
|
|
33
|
+
const firstNonNullValue = polarEdges.findIndex(value => !!value);
|
|
34
|
+
const lastNonNullValue = polarEdges.reduce((lastIndex, value, currentIndex) => {
|
|
35
|
+
if (!!value) {
|
|
36
|
+
return currentIndex;
|
|
37
|
+
}
|
|
38
|
+
return lastIndex;
|
|
39
|
+
}, -1);
|
|
40
|
+
if (firstNonNullValue >= 0 && lastNonNullValue >= 0) {
|
|
41
|
+
polarEdges = polarEdges.slice(firstNonNullValue, lastNonNullValue + 1);
|
|
42
|
+
edgeOffset = edgeOffset + firstNonNullValue;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
polarEdges = [];
|
|
46
|
+
}
|
|
47
|
+
if (polarEdges.length === 0) {
|
|
48
|
+
edgeOffset = 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return new MeasureValuePolarContainer({
|
|
52
|
+
azimuth: this.azimuth,
|
|
53
|
+
distance: this.distance,
|
|
54
|
+
polarEdges,
|
|
55
|
+
edgeOffset,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
getDistance() {
|
|
59
|
+
return this.distance;
|
|
60
|
+
}
|
|
20
61
|
}
|
|
21
62
|
exports.MeasureValuePolarContainer = MeasureValuePolarContainer;
|
|
22
63
|
//# sourceMappingURL=MeasureValuePolarContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeasureValuePolarContainer.js","sourceRoot":"","sources":["../../src/polar/MeasureValuePolarContainer.ts"],"names":[],"mappings":";;;AAAA,MAA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thMin?: number;
|
|
8
|
+
azimuthMax?: number;
|
|
9
|
+
edgeMin?: number;
|
|
10
|
+
edgeMax?: number;
|
|
11
|
+
});
|
|
12
|
+
protected static min(a: number, b: number): number;
|
|
13
|
+
protected static max(a: number, b: number): number;
|
|
14
|
+
merging(polarFilter?: PolarFilter): PolarFilter;
|
|
15
|
+
equal(polarFilter: PolarFilter): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PolarFilter = void 0;
|
|
4
|
+
class PolarFilter {
|
|
5
|
+
constructor(json) {
|
|
6
|
+
if (typeof (json === null || json === void 0 ? void 0 : json.azimuthMin) !== 'undefined')
|
|
7
|
+
this.azimuthMin = json.azimuthMin;
|
|
8
|
+
if (typeof (json === null || json === void 0 ? void 0 : json.azimuthMax) !== 'undefined')
|
|
9
|
+
this.azimuthMax = json.azimuthMax;
|
|
10
|
+
if (typeof (json === null || json === void 0 ? void 0 : json.edgeMin) !== 'undefined')
|
|
11
|
+
this.edgeMin = json.edgeMin;
|
|
12
|
+
if (typeof (json === null || json === void 0 ? void 0 : json.edgeMax) !== 'undefined')
|
|
13
|
+
this.edgeMax = json.edgeMax;
|
|
14
|
+
}
|
|
15
|
+
static min(a, b) {
|
|
16
|
+
if (typeof a === 'undefined')
|
|
17
|
+
return b;
|
|
18
|
+
if (typeof b === 'undefined')
|
|
19
|
+
return a;
|
|
20
|
+
return Math.min(a, b);
|
|
21
|
+
}
|
|
22
|
+
static max(a, b) {
|
|
23
|
+
if (typeof a === 'undefined')
|
|
24
|
+
return b;
|
|
25
|
+
if (typeof b === 'undefined')
|
|
26
|
+
return a;
|
|
27
|
+
return Math.max(a, b);
|
|
28
|
+
}
|
|
29
|
+
merging(polarFilter) {
|
|
30
|
+
return new PolarFilter({
|
|
31
|
+
azimuthMin: PolarFilter.max(polarFilter === null || polarFilter === void 0 ? void 0 : polarFilter.azimuthMin, this.azimuthMin),
|
|
32
|
+
azimuthMax: PolarFilter.min(polarFilter === null || polarFilter === void 0 ? void 0 : polarFilter.azimuthMax, this.azimuthMax),
|
|
33
|
+
edgeMin: PolarFilter.max(polarFilter === null || polarFilter === void 0 ? void 0 : polarFilter.edgeMin, this.edgeMin),
|
|
34
|
+
edgeMax: PolarFilter.min(polarFilter === null || polarFilter === void 0 ? void 0 : polarFilter.edgeMax, this.edgeMax),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
equal(polarFilter) {
|
|
38
|
+
return this.azimuthMin === polarFilter.azimuthMin &&
|
|
39
|
+
this.azimuthMax === polarFilter.azimuthMax &&
|
|
40
|
+
this.edgeMin === polarFilter.edgeMin &&
|
|
41
|
+
this.edgeMax === polarFilter.edgeMax;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.PolarFilter = PolarFilter;
|
|
45
|
+
//# sourceMappingURL=PolarFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PolarFilter.js","sourceRoot":"","sources":["../../src/polar/PolarFilter.ts"],"names":[],"mappings":";;;AAAA,MAAa,WAAW;IAMpB,YAAY,IAKX;QACG,IAAI,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAA,KAAK,WAAW;YAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAC/E,IAAI,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAA,KAAK,WAAW;YAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAC/E,IAAI,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAA,KAAK,WAAW;YAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QACtE,IAAI,OAAO,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CA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AC,UAAU,KAAK,WAAW,CAAC,UAAU;YAC1C,IAAI,CAAC,OAAO,KAAK,WAAW,CAAC,OAAO;YACpC,IAAI,CAAC,OAAO,KAAK,WAAW,CAAC,OAAO,CAAC;IAC7C,CAAC;CACJ;AA7CD,kCA6CC"}
|
|
@@ -2,29 +2,50 @@ import { MeasureValuePolarContainer } from './MeasureValuePolarContainer';
|
|
|
2
2
|
import { IPolarMeasureValue } from './IPolarMeasureValue';
|
|
3
3
|
import { PolarValue } from './PolarValue';
|
|
4
4
|
export declare class PolarMeasureValue implements IPolarMeasureValue {
|
|
5
|
-
|
|
5
|
+
protected measureValuePolarContainers: MeasureValuePolarContainer[];
|
|
6
|
+
protected azimuthsCount: number;
|
|
7
|
+
protected polarEdgesCount: number;
|
|
6
8
|
constructor(json: {
|
|
7
9
|
measureValuePolarContainers: MeasureValuePolarContainer[] | string;
|
|
8
|
-
|
|
10
|
+
azimuthsCount?: number;
|
|
11
|
+
polarEdgesCount?: number;
|
|
12
|
+
} | string);
|
|
13
|
+
getAzimuthsCount(): number;
|
|
14
|
+
getPolarEdgesCount(): number;
|
|
9
15
|
getPolarsStringified(): string;
|
|
10
16
|
getPolars(): MeasureValuePolarContainer[];
|
|
11
17
|
setPolarsAsString(s: string): void;
|
|
12
|
-
setPolarsAsContainer(measureValuePolarContainers: MeasureValuePolarContainer[]
|
|
18
|
+
setPolarsAsContainer(measureValuePolarContainers: MeasureValuePolarContainer[], options?: {
|
|
19
|
+
resetCount: boolean;
|
|
20
|
+
}): void;
|
|
13
21
|
getPolarValue(json: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
strict?: boolean;
|
|
22
|
+
azimuthInDegrees: number;
|
|
23
|
+
distanceInMeters: number;
|
|
17
24
|
}): PolarValue;
|
|
18
25
|
setPolarValue(json: {
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
azimuthInDegrees: number;
|
|
27
|
+
distanceInMeters: number;
|
|
21
28
|
value: number;
|
|
22
29
|
}): void;
|
|
30
|
+
iterate(onEachValue: (polarValue: PolarValue, azimuthIndex: number, edgeIndex: number, valueSetter: (newValue: number) => void) => void): void;
|
|
23
31
|
toJSON(): {
|
|
24
32
|
measureValuePolarContainers: MeasureValuePolarContainer[];
|
|
33
|
+
azimuthsCount: number;
|
|
34
|
+
polarEdgesCount: number;
|
|
25
35
|
};
|
|
26
36
|
toJSONWithPolarStringified(): {
|
|
27
37
|
measureValuePolarContainers: string;
|
|
38
|
+
azimuthsCount: number;
|
|
39
|
+
polarEdgesCount: number;
|
|
28
40
|
};
|
|
29
|
-
|
|
41
|
+
getFiltered(options?: {
|
|
42
|
+
nullValues: boolean;
|
|
43
|
+
ordered: boolean;
|
|
44
|
+
}): PolarMeasureValue;
|
|
45
|
+
getValuesCount(): number;
|
|
46
|
+
getNotNullValuesCount(): number;
|
|
47
|
+
getDefaultDistance(): number;
|
|
48
|
+
getHash(): string;
|
|
49
|
+
protected count(): void;
|
|
50
|
+
protected countUnknown(): void;
|
|
30
51
|
}
|
|
@@ -4,18 +4,42 @@ exports.PolarMeasureValue = void 0;
|
|
|
4
4
|
const MeasureValuePolarContainer_1 = require("./MeasureValuePolarContainer");
|
|
5
5
|
const PolarValue_1 = require("./PolarValue");
|
|
6
6
|
const AbstractPolarMeasureValue_1 = require("./AbstractPolarMeasureValue");
|
|
7
|
+
const hash_it_1 = require("hash-it");
|
|
7
8
|
class PolarMeasureValue {
|
|
8
9
|
constructor(json) {
|
|
10
|
+
if (typeof json === 'string') {
|
|
11
|
+
json = JSON.parse(json);
|
|
12
|
+
}
|
|
9
13
|
if (typeof json.measureValuePolarContainers === 'string') {
|
|
10
14
|
this.setPolarsAsString(json.measureValuePolarContainers);
|
|
11
|
-
return;
|
|
12
15
|
}
|
|
13
|
-
if (json.measureValuePolarContainers instanceof AbstractPolarMeasureValue_1.AbstractPolarMeasureValue
|
|
16
|
+
else if (json.measureValuePolarContainers instanceof AbstractPolarMeasureValue_1.AbstractPolarMeasureValue
|
|
14
17
|
|| json.measureValuePolarContainers instanceof PolarMeasureValue) {
|
|
15
18
|
this.setPolarsAsContainer(json.measureValuePolarContainers.getPolars());
|
|
16
|
-
return;
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
else {
|
|
21
|
+
this.setPolarsAsContainer(json.measureValuePolarContainers);
|
|
22
|
+
}
|
|
23
|
+
if (!((json === null || json === void 0 ? void 0 : json.azimuthsCount) >= 0) || !((json === null || json === void 0 ? void 0 : json.polarEdgesCount) >= 0)) {
|
|
24
|
+
// throw new Error('PolarMeasureValue needs valid azimuthsCount & polarEdgesCount');
|
|
25
|
+
this.countUnknown();
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.azimuthsCount = json.azimuthsCount;
|
|
29
|
+
this.polarEdgesCount = json.polarEdgesCount;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
getAzimuthsCount() {
|
|
33
|
+
if (this.azimuthsCount < 0) {
|
|
34
|
+
this.count();
|
|
35
|
+
}
|
|
36
|
+
return this.azimuthsCount;
|
|
37
|
+
}
|
|
38
|
+
getPolarEdgesCount() {
|
|
39
|
+
if (this.polarEdgesCount < 0) {
|
|
40
|
+
this.count();
|
|
41
|
+
}
|
|
42
|
+
return this.polarEdgesCount;
|
|
19
43
|
}
|
|
20
44
|
getPolarsStringified() {
|
|
21
45
|
return JSON.stringify(this.getPolars());
|
|
@@ -38,64 +62,163 @@ class PolarMeasureValue {
|
|
|
38
62
|
// console.warn('setPolarsAsString pb: ', e, typeof s, s);
|
|
39
63
|
this.measureValuePolarContainers = [];
|
|
40
64
|
}
|
|
65
|
+
this.countUnknown();
|
|
41
66
|
}
|
|
42
|
-
setPolarsAsContainer(measureValuePolarContainers) {
|
|
67
|
+
setPolarsAsContainer(measureValuePolarContainers, options = { resetCount: true }) {
|
|
43
68
|
let parsed = measureValuePolarContainers ? measureValuePolarContainers : [];
|
|
44
69
|
if (!('length' in parsed)) {
|
|
45
70
|
parsed = [];
|
|
46
71
|
}
|
|
47
72
|
this.measureValuePolarContainers = parsed;
|
|
73
|
+
if (options.resetCount) {
|
|
74
|
+
this.countUnknown();
|
|
75
|
+
}
|
|
48
76
|
}
|
|
49
77
|
getPolarValue(json) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
azimuthIndex = this.updateIndex(this.measureValuePolarContainers, json.azimuthIndex);
|
|
53
|
-
}
|
|
54
|
-
const azimuthContainer = this.measureValuePolarContainers[azimuthIndex];
|
|
55
|
-
if (!azimuthContainer) {
|
|
78
|
+
if (json.azimuthInDegrees < 0 || json.azimuthInDegrees > 360) {
|
|
79
|
+
console.warn('### raain-model > getPolarValue : strange azimuth:', json.azimuthInDegrees);
|
|
56
80
|
return null;
|
|
57
81
|
}
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
let edgeValue = 0;
|
|
83
|
+
let distance = this.getDefaultDistance();
|
|
84
|
+
const measureValuePolarContainersFound = this.measureValuePolarContainers
|
|
85
|
+
.filter(c => c.azimuth === json.azimuthInDegrees);
|
|
86
|
+
if (measureValuePolarContainersFound.length === 1) {
|
|
87
|
+
const measureValuePolarContainer = measureValuePolarContainersFound[0];
|
|
88
|
+
distance = measureValuePolarContainer.distance;
|
|
89
|
+
const edgeIndex = (json.distanceInMeters / distance) - 1 - measureValuePolarContainer.edgeOffset;
|
|
90
|
+
if (0 <= edgeIndex && edgeIndex < measureValuePolarContainer.polarEdges.length) {
|
|
91
|
+
edgeValue = measureValuePolarContainer.polarEdges[edgeIndex];
|
|
92
|
+
}
|
|
65
93
|
}
|
|
66
94
|
return new PolarValue_1.PolarValue({
|
|
67
95
|
value: edgeValue,
|
|
68
|
-
polarAzimuthInDegrees:
|
|
69
|
-
polarDistanceInMeters:
|
|
96
|
+
polarAzimuthInDegrees: json.azimuthInDegrees,
|
|
97
|
+
polarDistanceInMeters: json.distanceInMeters
|
|
70
98
|
});
|
|
71
99
|
}
|
|
72
100
|
setPolarValue(json) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (!azimuthContainer) {
|
|
101
|
+
if (json.azimuthInDegrees < 0 || json.azimuthInDegrees > 360) {
|
|
102
|
+
console.warn('### raain-model > setPolarValue : strange azimuth:', json.azimuthInDegrees);
|
|
76
103
|
return null;
|
|
77
104
|
}
|
|
78
|
-
|
|
79
|
-
|
|
105
|
+
let distance = this.getDefaultDistance();
|
|
106
|
+
const azimuth = json.azimuthInDegrees;
|
|
107
|
+
const found = this.measureValuePolarContainers.filter(c => c.azimuth === azimuth);
|
|
108
|
+
if (found.length === 1) {
|
|
109
|
+
const measureValuePolarContainer = found[0];
|
|
110
|
+
distance = measureValuePolarContainer.distance;
|
|
111
|
+
const edgeIndex = (json.distanceInMeters / distance) - 1 - measureValuePolarContainer.edgeOffset;
|
|
112
|
+
if (0 <= edgeIndex && edgeIndex < measureValuePolarContainer.polarEdges.length) {
|
|
113
|
+
measureValuePolarContainer.polarEdges[edgeIndex] = json.value;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
console.warn('### raain-model > setPolarValue : extending polarEdges');
|
|
117
|
+
let diff = edgeIndex - measureValuePolarContainer.polarEdges.length;
|
|
118
|
+
if (edgeIndex < 0) {
|
|
119
|
+
diff = -1 - edgeIndex;
|
|
120
|
+
measureValuePolarContainer.edgeOffset += edgeIndex;
|
|
121
|
+
}
|
|
122
|
+
const arrayWithNullValuesToAdd = new Array(diff).fill(0);
|
|
123
|
+
if (edgeIndex < 0) {
|
|
124
|
+
measureValuePolarContainer.polarEdges = [json.value].concat(arrayWithNullValuesToAdd.concat(measureValuePolarContainer.polarEdges));
|
|
125
|
+
}
|
|
126
|
+
else if (edgeIndex > 0) {
|
|
127
|
+
measureValuePolarContainer.polarEdges = measureValuePolarContainer.polarEdges.concat(arrayWithNullValuesToAdd.concat([json.value]));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else if (found.length === 0) {
|
|
132
|
+
console.warn('### raain-model > setPolarValue : extending measureValuePolarContainers');
|
|
133
|
+
const polarEdges = [json.value];
|
|
134
|
+
const edgeOffset = json.distanceInMeters / distance - 1;
|
|
135
|
+
this.measureValuePolarContainers.push(new MeasureValuePolarContainer_1.MeasureValuePolarContainer({ azimuth, distance, polarEdges, edgeOffset }));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
iterate(onEachValue) {
|
|
139
|
+
for (const measureValuePolarContainer of this.measureValuePolarContainers) {
|
|
140
|
+
const azimuth = measureValuePolarContainer.azimuth;
|
|
141
|
+
const distance = measureValuePolarContainer.distance;
|
|
142
|
+
const polarEdges = measureValuePolarContainer.polarEdges;
|
|
143
|
+
const azimuthIndex = azimuth * this.getAzimuthsCount() / 360;
|
|
144
|
+
for (const [edgeIndex, value] of polarEdges.entries()) {
|
|
145
|
+
const edgeAbsoluteIndex = edgeIndex + measureValuePolarContainer.edgeOffset;
|
|
146
|
+
const valueSetter = (newValue) => {
|
|
147
|
+
polarEdges[edgeIndex] = newValue;
|
|
148
|
+
};
|
|
149
|
+
onEachValue(new PolarValue_1.PolarValue({
|
|
150
|
+
value,
|
|
151
|
+
polarAzimuthInDegrees: azimuth,
|
|
152
|
+
polarDistanceInMeters: distance * (edgeAbsoluteIndex + 1)
|
|
153
|
+
}), azimuthIndex, edgeAbsoluteIndex, valueSetter);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
80
156
|
}
|
|
81
157
|
toJSON() {
|
|
82
158
|
return {
|
|
83
|
-
measureValuePolarContainers: this.
|
|
159
|
+
measureValuePolarContainers: this.getPolars(),
|
|
160
|
+
azimuthsCount: this.getAzimuthsCount(),
|
|
161
|
+
polarEdgesCount: this.getPolarEdgesCount(),
|
|
84
162
|
};
|
|
85
163
|
}
|
|
86
164
|
toJSONWithPolarStringified() {
|
|
87
165
|
return {
|
|
88
|
-
measureValuePolarContainers: this.getPolarsStringified()
|
|
166
|
+
measureValuePolarContainers: this.getPolarsStringified(),
|
|
167
|
+
azimuthsCount: this.getAzimuthsCount(),
|
|
168
|
+
polarEdgesCount: this.getPolarEdgesCount(),
|
|
89
169
|
};
|
|
90
170
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
171
|
+
getFiltered(options = {
|
|
172
|
+
nullValues: true,
|
|
173
|
+
ordered: false
|
|
174
|
+
}) {
|
|
175
|
+
const azimuthsCount = this.getAzimuthsCount();
|
|
176
|
+
const polarEdgesCount = this.getPolarEdgesCount();
|
|
177
|
+
let measureValuePolarContainers = [];
|
|
178
|
+
for (const measureValuePolarContainer of this.measureValuePolarContainers) {
|
|
179
|
+
const filteredMeasureValuePolarContainer = measureValuePolarContainer.getFiltered(options);
|
|
180
|
+
if (options.nullValues && filteredMeasureValuePolarContainer.getNotNullValuesCount()) {
|
|
181
|
+
measureValuePolarContainers.push(filteredMeasureValuePolarContainer);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (options.ordered) {
|
|
185
|
+
measureValuePolarContainers = measureValuePolarContainers.sort((a, b) => a.azimuth - b.azimuth);
|
|
94
186
|
}
|
|
95
|
-
|
|
96
|
-
|
|
187
|
+
return new PolarMeasureValue({ measureValuePolarContainers, azimuthsCount, polarEdgesCount });
|
|
188
|
+
}
|
|
189
|
+
getValuesCount() {
|
|
190
|
+
return this.getAzimuthsCount() * this.getPolarEdgesCount();
|
|
191
|
+
}
|
|
192
|
+
getNotNullValuesCount() {
|
|
193
|
+
let count = 0;
|
|
194
|
+
for (const [a, measureValuePolarContainer] of this.getPolars().entries()) {
|
|
195
|
+
count += measureValuePolarContainer.getNotNullValuesCount();
|
|
97
196
|
}
|
|
98
|
-
return
|
|
197
|
+
return count;
|
|
198
|
+
}
|
|
199
|
+
getDefaultDistance() {
|
|
200
|
+
let distance = 1000;
|
|
201
|
+
if (this.measureValuePolarContainers.length > 0) {
|
|
202
|
+
distance = this.measureValuePolarContainers[0].distance;
|
|
203
|
+
}
|
|
204
|
+
return distance;
|
|
205
|
+
}
|
|
206
|
+
getHash() {
|
|
207
|
+
return '' + (0, hash_it_1.default)(this.getPolars());
|
|
208
|
+
}
|
|
209
|
+
count() {
|
|
210
|
+
const measureValuePolarContainers = this.getPolars();
|
|
211
|
+
this.azimuthsCount = measureValuePolarContainers.length;
|
|
212
|
+
if (this.azimuthsCount > 0) {
|
|
213
|
+
this.polarEdgesCount = measureValuePolarContainers[0].polarEdges.length;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
this.polarEdgesCount = 0;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
countUnknown() {
|
|
220
|
+
this.azimuthsCount = -1;
|
|
221
|
+
this.polarEdgesCount = -1;
|
|
99
222
|
}
|
|
100
223
|
}
|
|
101
224
|
exports.PolarMeasureValue = PolarMeasureValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolarMeasureValue.js","sourceRoot":"","sources":["../../src/polar/PolarMeasureValue.ts"],"names":[],"mappings":";;;AAAA,6EAAwE;AAExE,6CAAwC;AACxC,2EAAsE;
|
|
1
|
+
{"version":3,"file":"PolarMeasureValue.js","sourceRoot":"","sources":["../../src/polar/PolarMeasureValue.ts"],"names":[],"mappings":";;;AAAA,6EAAwE;AAExE,6CAAwC;AACxC,2EAAsE;AACtE,qCAA2B;AAE3B,MAAa,iBAAiB;IAM1B,YAAY,IAIF;QAEN,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC1B,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAIrB,CAAC;SACL;QAED,IAAI,OAAO,IAAI,CAAC,2BAA2B,KAAK,QAAQ,EAAE;YAEtD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;SAE5D;aAAM,IAAI,IAAI,CAAC,2BAA2B,YAAY,qDAAyB;eACzE,IAAI,CAAC,2BAA2B,YAAY,iBAAiB,EAAE;YAElE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,2BAA2B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rB,IAAI,QAAQ,GAAG,IAAI,CAAC;QACpB,IAAI,IAAI,CAAC,2BAA2B,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7C,QAAQ,GAAG,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;SAC3D;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEM,OAAO;QACV,OAAO,EAAE,GAAG,IAAA,iBAAI,EAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACvC,CAAC;IAES,KAAK;QACX,MAAM,2BAA2B,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACrD,IAAI,CAAC,aAAa,GAAG,2BAA2B,CAAC,MAAM,CAAC;QACxD,IAAI,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE;YACxB,IAAI,CAAC,eAAe,GAAG,2BAA2B,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;SAC3E;aAAM;YACH,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;SAC5B;IACL,CAAC;IAES,YAAY;QAClB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;IAC9B,CAAC;CACJ;AA1RD,8CA0RC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MeasureValuePolarContainer } from './MeasureValuePolarContainer';
|
|
2
|
+
import { PolarValue } from './PolarValue';
|
|
3
|
+
import { PolarMeasureValue } from './PolarMeasureValue';
|
|
4
|
+
import { PolarFilter } from './PolarFilter';
|
|
5
|
+
/**
|
|
6
|
+
* PolarMeasureValue Map tools to optimize get/set
|
|
7
|
+
*/
|
|
8
|
+
export declare class PolarMeasureValueMap {
|
|
9
|
+
polarMeasureValue: PolarMeasureValue;
|
|
10
|
+
protected buildPolarFilter: PolarFilter;
|
|
11
|
+
protected builtMeasureValuePolarContainers: MeasureValuePolarContainer[];
|
|
12
|
+
constructor(polarMeasureValue: PolarMeasureValue, buildPolarFilter?: PolarFilter);
|
|
13
|
+
protected static UpdateIndex(arrayLength: number, index: number): number;
|
|
14
|
+
applyToPolar(): void;
|
|
15
|
+
duplicate(polarFilter?: PolarFilter): PolarMeasureValueMap;
|
|
16
|
+
getPolarValue(json: {
|
|
17
|
+
azimuthIndex: number;
|
|
18
|
+
edgeIndex: number;
|
|
19
|
+
}): PolarValue;
|
|
20
|
+
setPolarValue(json: {
|
|
21
|
+
azimuthIndex: number;
|
|
22
|
+
edgeIndex: number;
|
|
23
|
+
value: number;
|
|
24
|
+
}): void;
|
|
25
|
+
iterate(onEachValue: (polarValue: PolarValue, azimuthIndex: number, edgeIndex: number, valueSetter: (newValue: number) => void) => void, polarFilter?: PolarFilter): void;
|
|
26
|
+
countPolar(): number;
|
|
27
|
+
countPolarWithEdgeFilter(filter: any): number;
|
|
28
|
+
filter(polarFilter: PolarFilter): void;
|
|
29
|
+
protected buildFromPolar(): any[];
|
|
30
|
+
protected updatedAzimuth(azimuthIndexToUpdate: number): {
|
|
31
|
+
azimuthIndex: number;
|
|
32
|
+
azimuthInDegrees: number;
|
|
33
|
+
};
|
|
34
|
+
protected updatedEdge(edgeIndexToUpdate: number, measureValuePolarContainer?: MeasureValuePolarContainer, options?: {
|
|
35
|
+
reverse: boolean;
|
|
36
|
+
}): {
|
|
37
|
+
edgeIndex: number;
|
|
38
|
+
distanceInMeters: number;
|
|
39
|
+
};
|
|
40
|
+
}
|