raain-model 2.6.8 → 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 +5 -3
- package/RELEASE_PROCESS.md +111 -0
- package/package.json +1 -1
- 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/{gauge/GaugeNode.js → src/gauge/GaugeNode.ts} +48 -20
- package/src/gauge/GaugeNodeMap.ts +55 -0
- package/src/organization/EventNode.ts +43 -0
- package/{organization/Link.js → src/organization/Link.ts} +15 -15
- package/src/organization/Measure.ts +61 -0
- package/{organization/PeopleNode.js → src/organization/PeopleNode.ts} +20 -10
- package/{organization/RaainNode.js → src/organization/RaainNode.ts} +91 -58
- package/{organization/TeamNode.js → src/organization/TeamNode.ts} +36 -13
- 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/{rain/RainComputationMap.js → src/rain/RainComputationMap.ts} +55 -22
- 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 -85
- 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 -96
- package/organization/RaainNode.js.map +0 -1
- package/organization/TeamNode.d.ts +0 -63
- 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 -97
- 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,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const RaainNode_1 = require("./RaainNode");
|
|
1
|
+
import {PeopleNode} from './PeopleNode';
|
|
2
|
+
import {RaainNode} from './RaainNode';
|
|
3
|
+
|
|
5
4
|
/**
|
|
6
5
|
* Represents a team in the RAAIN system.
|
|
7
6
|
* This class manages team members and their contracts.
|
|
@@ -20,7 +19,26 @@ const RaainNode_1 = require("./RaainNode");
|
|
|
20
19
|
* });
|
|
21
20
|
* ```
|
|
22
21
|
*/
|
|
23
|
-
class TeamNode extends
|
|
22
|
+
export class TeamNode extends RaainNode {
|
|
23
|
+
|
|
24
|
+
/** Type identifier for team nodes */
|
|
25
|
+
public static TYPE = 'team';
|
|
26
|
+
|
|
27
|
+
/** Unique identifier for the team */
|
|
28
|
+
public id: any | string;
|
|
29
|
+
|
|
30
|
+
/** Name of the team */
|
|
31
|
+
public name: string;
|
|
32
|
+
|
|
33
|
+
/** Description of the team */
|
|
34
|
+
public description: string;
|
|
35
|
+
|
|
36
|
+
/** Array of contract types associated with the team */
|
|
37
|
+
public contracts: string[];
|
|
38
|
+
|
|
39
|
+
/** Array of team members */
|
|
40
|
+
public contacts: PeopleNode[];
|
|
41
|
+
|
|
24
42
|
/**
|
|
25
43
|
* Creates a new TeamNode instance.
|
|
26
44
|
*
|
|
@@ -31,38 +49,43 @@ class TeamNode extends RaainNode_1.RaainNode {
|
|
|
31
49
|
* @param json.contracts - Optional array of contract types
|
|
32
50
|
* @param json.contacts - Optional array of team members
|
|
33
51
|
*/
|
|
34
|
-
constructor(json
|
|
52
|
+
constructor(json: {
|
|
53
|
+
id: any | string,
|
|
54
|
+
name?: string,
|
|
55
|
+
description?: string,
|
|
56
|
+
contracts?: string[],
|
|
57
|
+
contacts?: PeopleNode[]
|
|
58
|
+
}) {
|
|
35
59
|
super(json);
|
|
60
|
+
|
|
36
61
|
this.id = json.id;
|
|
37
62
|
this.name = json.name;
|
|
38
63
|
this.description = json.description;
|
|
39
64
|
this.contracts = json.contracts;
|
|
40
65
|
this.contacts = json.contacts;
|
|
41
66
|
}
|
|
67
|
+
|
|
42
68
|
/**
|
|
43
69
|
* Converts the team node to a JSON object.
|
|
44
70
|
*
|
|
45
71
|
* @returns A JSON object containing the team's data
|
|
46
72
|
*/
|
|
47
|
-
toJSON() {
|
|
73
|
+
public toJSON(): any {
|
|
48
74
|
return {
|
|
49
75
|
id: this.id,
|
|
50
76
|
name: this.name,
|
|
51
77
|
description: this.description,
|
|
52
78
|
contracts: this.contracts,
|
|
53
79
|
contacts: this.contacts,
|
|
54
|
-
};
|
|
80
|
+
} as any;
|
|
55
81
|
}
|
|
82
|
+
|
|
56
83
|
/**
|
|
57
84
|
* Returns the link type for team nodes.
|
|
58
85
|
*
|
|
59
86
|
* @returns The string 'team'
|
|
60
87
|
*/
|
|
61
|
-
getLinkType() {
|
|
88
|
+
protected getLinkType(): string {
|
|
62
89
|
return TeamNode.TYPE;
|
|
63
90
|
}
|
|
64
91
|
}
|
|
65
|
-
exports.TeamNode = TeamNode;
|
|
66
|
-
/** Type identifier for team nodes */
|
|
67
|
-
TeamNode.TYPE = 'team';
|
|
68
|
-
//# sourceMappingURL=TeamNode.js.map
|
|
@@ -1,88 +1,114 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import {MeasureValuePolarContainer} from './MeasureValuePolarContainer';
|
|
2
|
+
import {IPolarMeasureValue} from './IPolarMeasureValue';
|
|
3
|
+
import {PolarMeasureValue} from './PolarMeasureValue';
|
|
4
|
+
import {PolarValue} from './PolarValue';
|
|
5
|
+
|
|
6
|
+
export class AbstractPolarMeasureValue implements IPolarMeasureValue {
|
|
7
|
+
|
|
8
|
+
public polarMeasureValue: PolarMeasureValue;
|
|
9
|
+
|
|
10
|
+
constructor(json: {
|
|
11
|
+
polarMeasureValue: AbstractPolarMeasureValue | PolarMeasureValue | string,
|
|
12
|
+
}) {
|
|
13
|
+
|
|
14
|
+
if (!json?.polarMeasureValue) {
|
|
8
15
|
throw new Error('Needs one polarMeasureValue');
|
|
9
16
|
}
|
|
10
|
-
|
|
17
|
+
|
|
18
|
+
let polarMeasureValue1: any = json.polarMeasureValue;
|
|
11
19
|
if (typeof polarMeasureValue1 === 'string') {
|
|
12
20
|
polarMeasureValue1 = JSON.parse(polarMeasureValue1);
|
|
13
21
|
}
|
|
22
|
+
|
|
14
23
|
if (polarMeasureValue1 instanceof AbstractPolarMeasureValue
|
|
15
|
-
|| polarMeasureValue1 instanceof
|
|
16
|
-
this.setPolarsAsContainer(polarMeasureValue1.getPolars(),
|
|
24
|
+
|| polarMeasureValue1 instanceof PolarMeasureValue) {
|
|
25
|
+
this.setPolarsAsContainer(polarMeasureValue1.getPolars(),
|
|
26
|
+
polarMeasureValue1.getAzimuthsCount(),
|
|
27
|
+
polarMeasureValue1.getPolarEdgesCount());
|
|
17
28
|
return;
|
|
18
29
|
}
|
|
30
|
+
|
|
19
31
|
let polarMeasureValue2 = polarMeasureValue1;
|
|
20
32
|
if (polarMeasureValue1['polarMeasureValue']) {
|
|
21
33
|
if (typeof polarMeasureValue1['polarMeasureValue'] === 'string') {
|
|
22
34
|
polarMeasureValue2 = JSON.parse(polarMeasureValue1['polarMeasureValue']);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
35
|
+
} else {
|
|
25
36
|
polarMeasureValue2 = polarMeasureValue1['polarMeasureValue'];
|
|
26
37
|
}
|
|
27
38
|
}
|
|
28
|
-
|
|
29
|
-
let
|
|
39
|
+
|
|
40
|
+
let azimuthsCount: number;
|
|
41
|
+
let polarEdgesCount: number;
|
|
30
42
|
let measureValuePolarContainers = [];
|
|
31
43
|
if (polarMeasureValue2 && polarMeasureValue2['measureValuePolarContainers']) {
|
|
32
44
|
measureValuePolarContainers = polarMeasureValue2['measureValuePolarContainers'];
|
|
45
|
+
|
|
33
46
|
if (polarMeasureValue2['azimuthsCount'] && polarMeasureValue2['polarEdgesCount']) {
|
|
34
47
|
azimuthsCount = parseInt('' + polarMeasureValue2['azimuthsCount'], 10);
|
|
35
48
|
polarEdgesCount = parseInt('' + polarMeasureValue2['polarEdgesCount'], 10);
|
|
36
49
|
}
|
|
37
50
|
}
|
|
51
|
+
|
|
38
52
|
if (typeof measureValuePolarContainers === 'string') {
|
|
39
53
|
this.setPolarsAsString(measureValuePolarContainers, azimuthsCount, polarEdgesCount);
|
|
40
54
|
return;
|
|
41
55
|
}
|
|
56
|
+
|
|
42
57
|
if (Array.isArray(measureValuePolarContainers)) {
|
|
43
58
|
this.setPolarsAsContainer(measureValuePolarContainers, azimuthsCount, polarEdgesCount);
|
|
44
59
|
return;
|
|
45
60
|
}
|
|
61
|
+
|
|
46
62
|
throw new Error('Needs valid polarMeasureValue');
|
|
47
63
|
}
|
|
48
|
-
|
|
64
|
+
|
|
65
|
+
getPolarsStringified(): string {
|
|
49
66
|
return this.polarMeasureValue.getPolarsStringified();
|
|
50
67
|
}
|
|
51
|
-
|
|
68
|
+
|
|
69
|
+
getPolars(): MeasureValuePolarContainer[] {
|
|
52
70
|
return this.polarMeasureValue.getPolars();
|
|
53
71
|
}
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
|
|
73
|
+
setPolarsAsString(measureValuePolarContainers: string, azimuthsCount: number, polarEdgesCount: number): void {
|
|
74
|
+
this.polarMeasureValue = new PolarMeasureValue({measureValuePolarContainers, azimuthsCount, polarEdgesCount});
|
|
56
75
|
}
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
|
|
77
|
+
setPolarsAsContainer(measureValuePolarContainers: MeasureValuePolarContainer[], azimuthsCount: number, polarEdgesCount: number): void {
|
|
78
|
+
this.polarMeasureValue = new PolarMeasureValue({measureValuePolarContainers, azimuthsCount, polarEdgesCount});
|
|
59
79
|
}
|
|
60
|
-
|
|
80
|
+
|
|
81
|
+
getPolarValue(json: { azimuthInDegrees: number, distanceInMeters: number }): PolarValue {
|
|
61
82
|
return this.polarMeasureValue.getPolarValue(json);
|
|
62
83
|
}
|
|
63
|
-
|
|
84
|
+
|
|
85
|
+
setPolarValue(json: { azimuthInDegrees: number, distanceInMeters: number, value: number }): void {
|
|
64
86
|
return this.polarMeasureValue.setPolarValue(json);
|
|
65
87
|
}
|
|
66
|
-
|
|
88
|
+
|
|
89
|
+
getAzimuthsCount(): number {
|
|
67
90
|
return this.polarMeasureValue.getAzimuthsCount();
|
|
68
91
|
}
|
|
69
|
-
|
|
92
|
+
|
|
93
|
+
getPolarEdgesCount(): number {
|
|
70
94
|
return this.polarMeasureValue.getPolarEdgesCount();
|
|
71
95
|
}
|
|
72
|
-
|
|
96
|
+
|
|
97
|
+
public toJSON(options = {
|
|
73
98
|
stringify: false
|
|
74
|
-
}) {
|
|
75
|
-
|
|
76
|
-
|
|
99
|
+
}): any {
|
|
100
|
+
|
|
101
|
+
let polarMeasureValue: any = this.polarMeasureValue;
|
|
102
|
+
if (options?.stringify) {
|
|
77
103
|
polarMeasureValue = JSON.stringify(this.polarMeasureValue.toJSONWithPolarStringified());
|
|
78
104
|
}
|
|
105
|
+
|
|
79
106
|
return {
|
|
80
107
|
polarMeasureValue,
|
|
81
108
|
};
|
|
82
109
|
}
|
|
83
|
-
|
|
84
|
-
|
|
110
|
+
|
|
111
|
+
public toJSONWithPolarStringified(): any {
|
|
112
|
+
return this.toJSON({stringify: true});
|
|
85
113
|
}
|
|
86
114
|
}
|
|
87
|
-
exports.AbstractPolarMeasureValue = AbstractPolarMeasureValue;
|
|
88
|
-
//# sourceMappingURL=AbstractPolarMeasureValue.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {MeasureValuePolarContainer} from './MeasureValuePolarContainer';
|
|
2
|
+
import {PolarValue} from './PolarValue';
|
|
3
|
+
|
|
4
|
+
export interface IPolarMeasureValue {
|
|
5
|
+
|
|
6
|
+
getAzimuthsCount(): number;
|
|
7
|
+
|
|
8
|
+
getPolarEdgesCount(): number;
|
|
9
|
+
|
|
10
|
+
getPolarsStringified(): string;
|
|
11
|
+
|
|
12
|
+
getPolars(): MeasureValuePolarContainer[];
|
|
13
|
+
|
|
14
|
+
toJSON(options?: any): any;
|
|
15
|
+
|
|
16
|
+
toJSONWithPolarStringified(): any;
|
|
17
|
+
|
|
18
|
+
getPolarValue(json: { azimuthInDegrees: number, distanceInMeters: number }): PolarValue;
|
|
19
|
+
|
|
20
|
+
setPolarValue(json: { azimuthInDegrees: number, distanceInMeters: number, value: number }): void;
|
|
21
|
+
}
|
|
@@ -1,34 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export class MeasureValuePolarContainer {
|
|
2
|
+
|
|
3
|
+
public azimuth: number; // In degrees. 0° = North, 90°= Est, 180° = South, 270°= West.
|
|
4
|
+
public distance: number; // In meters. Edge distance.
|
|
5
|
+
public polarEdges: number[]; // Edge Dbz values.
|
|
6
|
+
public edgeOffset: number; // Edge Offset. Count of edges before the edge values. polarEdges can start from this offset.
|
|
7
|
+
|
|
8
|
+
constructor(json: {
|
|
9
|
+
azimuth: number,
|
|
10
|
+
distance: number,
|
|
11
|
+
polarEdges: number[],
|
|
12
|
+
edgeOffset?: number,
|
|
13
|
+
}) {
|
|
14
|
+
|
|
15
|
+
if (typeof json?.azimuth === 'undefined') {
|
|
7
16
|
throw new Error('MeasureValuePolarContainer needs a valid Object');
|
|
8
17
|
}
|
|
18
|
+
|
|
9
19
|
this.azimuth = json.azimuth;
|
|
10
20
|
this.distance = json.distance;
|
|
11
21
|
this.polarEdges = json.polarEdges;
|
|
12
22
|
this.edgeOffset = json.edgeOffset ? json.edgeOffset : 0;
|
|
13
23
|
}
|
|
14
|
-
|
|
24
|
+
|
|
25
|
+
public toJSON(): any {
|
|
15
26
|
return {
|
|
16
27
|
azimuth: this.azimuth,
|
|
17
28
|
distance: this.distance,
|
|
18
29
|
polarEdges: this.polarEdges,
|
|
19
30
|
edgeOffset: this.edgeOffset,
|
|
20
|
-
};
|
|
31
|
+
} as any;
|
|
21
32
|
}
|
|
33
|
+
|
|
22
34
|
getPolarEdgesCount() {
|
|
23
35
|
return this.edgeOffset + this.polarEdges.length;
|
|
24
36
|
}
|
|
37
|
+
|
|
25
38
|
getNotNullValuesCount() {
|
|
26
39
|
const edges = this.polarEdges.filter(e => !!e);
|
|
27
40
|
return edges.length;
|
|
28
41
|
}
|
|
29
|
-
|
|
42
|
+
|
|
43
|
+
getFiltered(options = {nullValues: true}): MeasureValuePolarContainer {
|
|
30
44
|
let polarEdges = this.polarEdges.map(e => 1 - 1 + e);
|
|
31
45
|
let edgeOffset = this.edgeOffset + 1 - 1;
|
|
46
|
+
|
|
32
47
|
if (options.nullValues) {
|
|
33
48
|
const firstNonNullValue = polarEdges.findIndex(value => !!value);
|
|
34
49
|
const lastNonNullValue = polarEdges.reduce((lastIndex, value, currentIndex) => {
|
|
@@ -37,17 +52,19 @@ class MeasureValuePolarContainer {
|
|
|
37
52
|
}
|
|
38
53
|
return lastIndex;
|
|
39
54
|
}, -1);
|
|
55
|
+
|
|
40
56
|
if (firstNonNullValue >= 0 && lastNonNullValue >= 0) {
|
|
41
57
|
polarEdges = polarEdges.slice(firstNonNullValue, lastNonNullValue + 1);
|
|
42
58
|
edgeOffset = edgeOffset + firstNonNullValue;
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
59
|
+
} else {
|
|
45
60
|
polarEdges = [];
|
|
46
61
|
}
|
|
62
|
+
|
|
47
63
|
if (polarEdges.length === 0) {
|
|
48
64
|
edgeOffset = 0;
|
|
49
65
|
}
|
|
50
66
|
}
|
|
67
|
+
|
|
51
68
|
return new MeasureValuePolarContainer({
|
|
52
69
|
azimuth: this.azimuth,
|
|
53
70
|
distance: this.distance,
|
|
@@ -55,9 +72,8 @@ class MeasureValuePolarContainer {
|
|
|
55
72
|
edgeOffset,
|
|
56
73
|
});
|
|
57
74
|
}
|
|
75
|
+
|
|
58
76
|
getDistance() {
|
|
59
77
|
return this.distance;
|
|
60
78
|
}
|
|
61
79
|
}
|
|
62
|
-
exports.MeasureValuePolarContainer = MeasureValuePolarContainer;
|
|
63
|
-
//# sourceMappingURL=MeasureValuePolarContainer.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export class PolarFilter {
|
|
2
|
+
azimuthMin: number;
|
|
3
|
+
azimuthMax: number;
|
|
4
|
+
edgeMin: number;
|
|
5
|
+
edgeMax: number;
|
|
6
|
+
|
|
7
|
+
constructor(json?: {
|
|
8
|
+
azimuthMin?: number;
|
|
9
|
+
azimuthMax?: number;
|
|
10
|
+
edgeMin?: number;
|
|
11
|
+
edgeMax?: number;
|
|
12
|
+
}) {
|
|
13
|
+
if (typeof json?.azimuthMin !== 'undefined') this.azimuthMin = json.azimuthMin;
|
|
14
|
+
if (typeof json?.azimuthMax !== 'undefined') this.azimuthMax = json.azimuthMax;
|
|
15
|
+
if (typeof json?.edgeMin !== 'undefined') this.edgeMin = json.edgeMin;
|
|
16
|
+
if (typeof json?.edgeMax !== 'undefined') this.edgeMax = json.edgeMax;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
protected static min(a: number, b: number): number {
|
|
20
|
+
if (typeof a === 'undefined') return b;
|
|
21
|
+
if (typeof b === 'undefined') return a;
|
|
22
|
+
return Math.min(a, b);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
protected static max(a: number, b: number): number {
|
|
26
|
+
if (typeof a === 'undefined') return b;
|
|
27
|
+
if (typeof b === 'undefined') return a;
|
|
28
|
+
return Math.max(a, b);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
merging(polarFilter?: PolarFilter): PolarFilter {
|
|
32
|
+
return new PolarFilter({
|
|
33
|
+
azimuthMin: PolarFilter.max(polarFilter?.azimuthMin, this.azimuthMin),
|
|
34
|
+
azimuthMax: PolarFilter.min(polarFilter?.azimuthMax, this.azimuthMax),
|
|
35
|
+
edgeMin: PolarFilter.max(polarFilter?.edgeMin, this.edgeMin),
|
|
36
|
+
edgeMax: PolarFilter.min(polarFilter?.edgeMax, this.edgeMax),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
equal(polarFilter: PolarFilter): boolean {
|
|
41
|
+
return this.azimuthMin === polarFilter.azimuthMin &&
|
|
42
|
+
this.azimuthMax === polarFilter.azimuthMax &&
|
|
43
|
+
this.edgeMin === polarFilter.edgeMin &&
|
|
44
|
+
this.edgeMax === polarFilter.edgeMax;
|
|
45
|
+
}
|
|
46
|
+
}
|