raain-model 1.11.4 → 1.11.6

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.
Files changed (174) hide show
  1. package/cartesian/CartesianMeasureValue.d.ts +41 -0
  2. package/{src/cartesian/CartesianMeasureValue.ts → cartesian/CartesianMeasureValue.js} +34 -64
  3. package/cartesian/CartesianMeasureValue.js.map +1 -0
  4. package/cartesian/CartesianValue.d.ts +9 -0
  5. package/cartesian/CartesianValue.js +12 -0
  6. package/cartesian/CartesianValue.js.map +1 -0
  7. package/cartesian/ICartesianMeasureValue.d.ts +29 -0
  8. package/cartesian/ICartesianMeasureValue.js +3 -0
  9. package/cartesian/ICartesianMeasureValue.js.map +1 -0
  10. package/cartesian/LatLng.d.ts +12 -0
  11. package/cartesian/LatLng.js +31 -0
  12. package/cartesian/LatLng.js.map +1 -0
  13. package/cartesian/RadarCartesianMeasureValue.d.ts +15 -0
  14. package/cartesian/RadarCartesianMeasureValue.js +22 -0
  15. package/cartesian/RadarCartesianMeasureValue.js.map +1 -0
  16. package/cartesian/RainCartesianMeasureValue.d.ts +17 -0
  17. package/cartesian/RainCartesianMeasureValue.js +25 -0
  18. package/cartesian/RainCartesianMeasureValue.js.map +1 -0
  19. package/gauge/GaugeMeasure.d.ts +20 -0
  20. package/gauge/GaugeMeasure.js +24 -0
  21. package/gauge/GaugeMeasure.js.map +1 -0
  22. package/gauge/GaugeNode.d.ts +24 -0
  23. package/gauge/GaugeNode.js +31 -0
  24. package/gauge/GaugeNode.js.map +1 -0
  25. package/gauge/GaugeNodeMap.d.ts +22 -0
  26. package/gauge/GaugeNodeMap.js +42 -0
  27. package/gauge/GaugeNodeMap.js.map +1 -0
  28. package/{src/index.ts → index.d.ts} +0 -6
  29. package/index.js +56 -0
  30. package/index.js.map +1 -0
  31. package/organization/EventNode.d.ts +22 -0
  32. package/organization/EventNode.js +30 -0
  33. package/organization/EventNode.js.map +1 -0
  34. package/organization/IVersion.js +3 -0
  35. package/organization/IVersion.js.map +1 -0
  36. package/organization/Link.d.ts +16 -0
  37. package/{src/organization/Link.ts → organization/Link.js} +13 -13
  38. package/organization/Link.js.map +1 -0
  39. package/organization/Measure.d.ts +20 -0
  40. package/organization/Measure.js +35 -0
  41. package/organization/Measure.js.map +1 -0
  42. package/organization/PeopleNode.d.ts +18 -0
  43. package/organization/PeopleNode.js +26 -0
  44. package/organization/PeopleNode.js.map +1 -0
  45. package/organization/RaainNode.d.ts +23 -0
  46. package/{src/organization/RaainNode.ts → organization/RaainNode.js} +29 -53
  47. package/organization/RaainNode.js.map +1 -0
  48. package/organization/TeamNode.d.ts +22 -0
  49. package/organization/TeamNode.js +32 -0
  50. package/organization/TeamNode.js.map +1 -0
  51. package/package.json +1 -1
  52. package/polar/AbstractPolarMeasureValue.d.ts +29 -0
  53. package/{src/polar/AbstractPolarMeasureValue.ts → polar/AbstractPolarMeasureValue.js} +29 -53
  54. package/polar/AbstractPolarMeasureValue.js.map +1 -0
  55. package/polar/GaugePolarMeasureValue.d.ts +11 -0
  56. package/polar/GaugePolarMeasureValue.js +14 -0
  57. package/polar/GaugePolarMeasureValue.js.map +1 -0
  58. package/polar/IPolarMeasureValue.d.ts +19 -0
  59. package/polar/IPolarMeasureValue.js +3 -0
  60. package/polar/IPolarMeasureValue.js.map +1 -0
  61. package/polar/MeasureValuePolarContainer.d.ts +11 -0
  62. package/polar/MeasureValuePolarContainer.js +22 -0
  63. package/polar/MeasureValuePolarContainer.js.map +1 -0
  64. package/polar/PolarMeasureValue.d.ts +26 -0
  65. package/{src/polar/PolarMeasureValue.ts → polar/PolarMeasureValue.js} +27 -46
  66. package/polar/PolarMeasureValue.js.map +1 -0
  67. package/polar/PolarValue.d.ts +10 -0
  68. package/polar/PolarValue.js +12 -0
  69. package/polar/PolarValue.js.map +1 -0
  70. package/polar/RadarPolarMeasureValue.d.ts +15 -0
  71. package/polar/RadarPolarMeasureValue.js +34 -0
  72. package/polar/RadarPolarMeasureValue.js.map +1 -0
  73. package/polar/RainPolarMeasureValue.d.ts +18 -0
  74. package/polar/RainPolarMeasureValue.js +42 -0
  75. package/polar/RainPolarMeasureValue.js.map +1 -0
  76. package/quality/QualityPoint.d.ts +35 -0
  77. package/{src/quality/QualityPoint.ts → quality/QualityPoint.js} +23 -48
  78. package/quality/QualityPoint.js.map +1 -0
  79. package/quality/SpeedMatrix.d.ts +83 -0
  80. package/{src/quality/SpeedMatrix.ts → quality/SpeedMatrix.js} +78 -116
  81. package/quality/SpeedMatrix.js.map +1 -0
  82. package/quality/SpeedMatrixContainer.d.ts +80 -0
  83. package/{src/quality/SpeedMatrixContainer.ts → quality/SpeedMatrixContainer.js} +76 -141
  84. package/quality/SpeedMatrixContainer.js.map +1 -0
  85. package/quality/history/CartesianGaugeHistory.d.ts +15 -0
  86. package/quality/history/CartesianGaugeHistory.js +14 -0
  87. package/quality/history/CartesianGaugeHistory.js.map +1 -0
  88. package/quality/history/CartesianRainHistory.d.ts +11 -0
  89. package/quality/history/CartesianRainHistory.js +12 -0
  90. package/quality/history/CartesianRainHistory.js.map +1 -0
  91. package/quality/history/PositionHistory.d.ts +20 -0
  92. package/quality/history/PositionHistory.js +17 -0
  93. package/quality/history/PositionHistory.js.map +1 -0
  94. package/quality/position/Position.d.ts +22 -0
  95. package/quality/position/Position.js +50 -0
  96. package/quality/position/Position.js.map +1 -0
  97. package/quality/position/PositionValue.d.ts +9 -0
  98. package/quality/position/PositionValue.js +12 -0
  99. package/quality/position/PositionValue.js.map +1 -0
  100. package/quality/tools/QualityTools.d.ts +24 -0
  101. package/{src/quality/tools/QualityTools.ts → quality/tools/QualityTools.js} +49 -82
  102. package/quality/tools/QualityTools.js.map +1 -0
  103. package/radar/RadarMeasure.d.ts +17 -0
  104. package/radar/RadarMeasure.js +18 -0
  105. package/radar/RadarMeasure.js.map +1 -0
  106. package/radar/RadarNode.d.ts +24 -0
  107. package/radar/RadarNode.js +31 -0
  108. package/radar/RadarNode.js.map +1 -0
  109. package/radar/RadarNodeMap.d.ts +28 -0
  110. package/radar/RadarNodeMap.js +46 -0
  111. package/radar/RadarNodeMap.js.map +1 -0
  112. package/rain/RainComputation.d.ts +34 -0
  113. package/rain/RainComputation.js +55 -0
  114. package/rain/RainComputation.js.map +1 -0
  115. package/rain/RainComputationAbstract.d.ts +41 -0
  116. package/rain/RainComputationAbstract.js +102 -0
  117. package/rain/RainComputationAbstract.js.map +1 -0
  118. package/rain/RainComputationMap.d.ts +32 -0
  119. package/rain/RainComputationMap.js +45 -0
  120. package/rain/RainComputationMap.js.map +1 -0
  121. package/rain/RainComputationQuality.d.ts +37 -0
  122. package/{src/rain/RainComputationQuality.ts → rain/RainComputationQuality.js} +20 -56
  123. package/rain/RainComputationQuality.js.map +1 -0
  124. package/rain/RainMeasure.d.ts +18 -0
  125. package/rain/RainMeasure.js +19 -0
  126. package/rain/RainMeasure.js.map +1 -0
  127. package/rain/RainNode.d.ts +38 -0
  128. package/{src/rain/RainNode.ts → rain/RainNode.js} +48 -76
  129. package/rain/RainNode.js.map +1 -0
  130. package/.travis.deploy.sh +0 -41
  131. package/.travis.yml +0 -22
  132. package/specs/cartesian/Cartesian.spec.ts +0 -56
  133. package/specs/gauge/Gauge.spec.ts +0 -19
  134. package/specs/organization/Organization.spec.ts +0 -32
  135. package/specs/polar/Polar.spec.ts +0 -25
  136. package/specs/quality/Position.spec.ts +0 -18
  137. package/specs/quality/QualityTools.spec.ts +0 -120
  138. package/specs/quality/SpeedMatrix.spec.ts +0 -125
  139. package/specs/radar/Radar.spec.ts +0 -18
  140. package/specs/rain/Rain.spec.ts +0 -71
  141. package/specs/tsconfig.json +0 -12
  142. package/src/cartesian/CartesianValue.ts +0 -17
  143. package/src/cartesian/ICartesianMeasureValue.ts +0 -27
  144. package/src/cartesian/LatLng.ts +0 -39
  145. package/src/cartesian/RadarCartesianMeasureValue.ts +0 -29
  146. package/src/cartesian/RainCartesianMeasureValue.ts +0 -33
  147. package/src/gauge/GaugeMeasure.ts +0 -36
  148. package/src/gauge/GaugeNode.ts +0 -46
  149. package/src/gauge/GaugeNodeMap.ts +0 -55
  150. package/src/organization/EventNode.ts +0 -44
  151. package/src/organization/Measure.ts +0 -49
  152. package/src/organization/PeopleNode.ts +0 -36
  153. package/src/organization/TeamNode.ts +0 -46
  154. package/src/polar/GaugePolarMeasureValue.ts +0 -15
  155. package/src/polar/IPolarMeasureValue.ts +0 -21
  156. package/src/polar/MeasureValuePolarContainer.ts +0 -28
  157. package/src/polar/PolarValue.ts +0 -16
  158. package/src/polar/RadarPolarMeasureValue.ts +0 -43
  159. package/src/polar/RainPolarMeasureValue.ts +0 -57
  160. package/src/quality/history/CartesianGaugeHistory.ts +0 -23
  161. package/src/quality/history/CartesianRainHistory.ts +0 -18
  162. package/src/quality/history/PositionHistory.ts +0 -31
  163. package/src/quality/position/Position.ts +0 -60
  164. package/src/quality/position/PositionValue.ts +0 -15
  165. package/src/radar/RadarMeasure.ts +0 -27
  166. package/src/radar/RadarNode.ts +0 -46
  167. package/src/radar/RadarNodeMap.ts +0 -65
  168. package/src/rain/RainComputation.ts +0 -82
  169. package/src/rain/RainComputationAbstract.ts +0 -137
  170. package/src/rain/RainComputationMap.ts +0 -68
  171. package/src/rain/RainMeasure.ts +0 -27
  172. package/tsconfig.json +0 -17
  173. package/tslint.json +0 -79
  174. /package/{src/organization/IVersion.ts → organization/IVersion.d.ts} +0 -0
@@ -1,29 +0,0 @@
1
- import {CartesianValue} from './CartesianValue';
2
- import {CartesianMeasureValue} from './CartesianMeasureValue';
3
-
4
- export class RadarCartesianMeasureValue extends CartesianMeasureValue {
5
-
6
- public angle: number;
7
-
8
- constructor(json: {
9
- cartesianValues: string | CartesianValue[],
10
- cartesianPixelWidth: { lat: number, lng: number },
11
- angle: number,
12
- }) {
13
-
14
- super(json);
15
- this.angle = json.angle;
16
- }
17
-
18
- toJSON(stringify = false): JSON {
19
- const json: any = super.toJSON(stringify);
20
- json.angle = this.angle;
21
- return json;
22
- }
23
-
24
- toJSONWithCartesianValuesStringified(): JSON {
25
- const json: any = super.toJSONWithCartesianValuesStringified();
26
- json.angle = this.angle;
27
- return json;
28
- }
29
- }
@@ -1,33 +0,0 @@
1
- import {IVersion} from '../organization/IVersion';
2
- import {CartesianValue} from './CartesianValue';
3
- import {CartesianMeasureValue} from './CartesianMeasureValue';
4
-
5
- export class RainCartesianMeasureValue extends CartesianMeasureValue implements IVersion {
6
-
7
- private readonly version: string;
8
-
9
- constructor(json: {
10
- cartesianValues: string | CartesianValue[],
11
- cartesianPixelWidth: { lat: number, lng: number },
12
- version?: string,
13
- }) {
14
- super(json);
15
- this.version = json.version;
16
- }
17
-
18
- getVersion(): string {
19
- return this.version;
20
- }
21
-
22
- toJSON(stringify = false): JSON {
23
- const json: any = super.toJSON(stringify);
24
- json.version = this.getVersion();
25
- return json;
26
- }
27
-
28
- toJSONWithCartesianValuesStringified(): JSON {
29
- const json: any = super.toJSONWithCartesianValuesStringified();
30
- json.version = this.getVersion();
31
- return json;
32
- }
33
- }
@@ -1,36 +0,0 @@
1
- import {Measure} from '../organization/Measure';
2
- import {IPolarMeasureValue} from '../polar/IPolarMeasureValue';
3
- import {ICartesianMeasureValue} from '../cartesian/ICartesianMeasureValue';
4
-
5
- /**
6
- * api/gauges/:id/measures/:id
7
- */
8
- export class GaugeMeasure extends Measure {
9
-
10
- public static TYPE = 'gauge-measure';
11
- public timeInSec: number;
12
-
13
- constructor(json: {
14
- id: string,
15
- values: IPolarMeasureValue[] | ICartesianMeasureValue[] | Measure[] | number[],
16
- date?: Date,
17
- validity?: number,
18
- timeInSec?: number,
19
- configurationAsJSON?: string | any,
20
- }
21
- ) {
22
- super(json);
23
- this.timeInSec = json.timeInSec >= 0 ? json.timeInSec : -1;
24
- }
25
-
26
- public toJSON(): JSON {
27
- const json = super.toJSON();
28
- json['timeInSec'] = this.timeInSec;
29
- return json;
30
- }
31
-
32
- protected getLinkType(): string {
33
- return GaugeMeasure.TYPE;
34
- }
35
- }
36
-
@@ -1,46 +0,0 @@
1
- import {RaainNode} from '../organization/RaainNode';
2
- import {Link} from '../organization/Link';
3
- import {TeamNode} from '../organization/TeamNode';
4
-
5
- /**
6
- * api/gauges/:id
7
- */
8
- export class GaugeNode extends RaainNode {
9
-
10
- public static TYPE = 'gauge';
11
-
12
- public name: string;
13
- public latitude: number;
14
- public longitude: number;
15
- public team: TeamNode;
16
-
17
- constructor(json: {
18
- id: string,
19
- latitude: number,
20
- longitude: number,
21
- name?: string,
22
- links?: Link[] | RaainNode[],
23
- team?: TeamNode,
24
- version?: string,
25
- }) {
26
- super(json);
27
- this.latitude = json.latitude;
28
- this.longitude = json.longitude;
29
- this.name = json.name;
30
- this.team = json.team;
31
- }
32
-
33
- public toJSON(): JSON {
34
- const json = super.toJSON();
35
- json['latitude'] = this.latitude;
36
- json['longitude'] = this.longitude;
37
- json['name'] = this.name;
38
- json['team'] = this.team?.id || this.team;
39
- return json;
40
- }
41
-
42
- protected getLinkType(): string {
43
- return GaugeNode.TYPE;
44
- }
45
-
46
- }
@@ -1,55 +0,0 @@
1
- import {Link} from '../organization/Link';
2
- import {GaugeNode} from './GaugeNode';
3
- import {GaugeMeasure} from './GaugeMeasure';
4
- import {RaainNode} from '../organization/RaainNode';
5
-
6
- /**
7
- * api/gauges/:id?format=map&begin=...
8
- */
9
- export class GaugeNodeMap extends GaugeNode {
10
-
11
- private map: string; // GaugeMeasure[]; stringified
12
-
13
- constructor(json: {
14
- id: string,
15
- latitude: number,
16
- longitude: number,
17
- map?: string,
18
- name?: string,
19
- links?: Link[] | RaainNode[],
20
- version?: string,
21
- }) {
22
- super(json);
23
- this.setMapData(json.map);
24
- }
25
-
26
- public toJSON(): JSON {
27
- const json = super.toJSON();
28
- if (this.map) {
29
- json['map'] = this.map;
30
- }
31
- return json;
32
- }
33
-
34
- public setMapData(mapData: GaugeMeasure[] | string) {
35
- if (!mapData) {
36
- return;
37
- }
38
-
39
- let map = mapData;
40
- try {
41
- if (typeof (mapData) !== 'string') {
42
- map = JSON.stringify(mapData);
43
- }
44
- } catch (e) {
45
- }
46
- this.map = map.toString();
47
- }
48
-
49
- public getMapData(): GaugeMeasure[] {
50
- if (!this.map) {
51
- return [];
52
- }
53
- return JSON.parse(this.map);
54
- }
55
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * api/notifications/:id
3
- */
4
- export class EventNode {
5
- public id: string;
6
- public title: string;
7
- public status: number;
8
- public red: boolean;
9
- public description: string;
10
- public created: Date;
11
- public modified: Date;
12
-
13
- constructor(json: {
14
- id: string,
15
- title: string,
16
- status: number,
17
- red: boolean,
18
- description: string,
19
- created: Date,
20
- modified: Date
21
- }
22
- ) {
23
- this.id = json.id;
24
- this.title = json.title;
25
- this.status = json.status;
26
- this.red = json.red;
27
- this.description = json.description;
28
- this.created = json.created;
29
- this.modified = json.modified;
30
- }
31
-
32
- public toJSON(): JSON {
33
- return {
34
- id: this.id,
35
- title: this.title,
36
- status: this.status,
37
- red: this.red,
38
- description: this.description,
39
- created: this.created,
40
- modified: this.modified,
41
- } as any;
42
- }
43
- }
44
-
@@ -1,49 +0,0 @@
1
- import {IPolarMeasureValue} from '../polar/IPolarMeasureValue';
2
- import {RaainNode} from './RaainNode';
3
- import {ICartesianMeasureValue} from '../cartesian/ICartesianMeasureValue';
4
-
5
- export class Measure extends RaainNode {
6
- public date: Date;
7
- public values: IPolarMeasureValue[] | ICartesianMeasureValue[] | Measure[] | number[];
8
- // -> why array ? because you can have potential different angle from the Radar
9
-
10
- public validity: number
11
- private configurationAsJSON: string;
12
-
13
- constructor(json: {
14
- id: string,
15
- values: IPolarMeasureValue[] | ICartesianMeasureValue[] | Measure[] | number[],
16
- date?: Date,
17
- validity?: number,
18
- configurationAsJSON?: string | any,
19
- }
20
- ) {
21
- super(json);
22
- this.values = json.values ? json.values : [];
23
- this.date = json.date ? new Date(json.date) : undefined;
24
- this.validity = json.validity >= 0 ? json.validity : -1;
25
- this.setConfiguration(json.configurationAsJSON);
26
- }
27
-
28
- public setConfiguration(configuration: string | any) {
29
- let conf = configuration;
30
- try {
31
- conf = JSON.parse(configuration);
32
- } catch (ignored) {
33
- }
34
-
35
- this.configurationAsJSON = JSON.stringify(conf);
36
- }
37
-
38
- public toJSON(options: { removeValues?: boolean } = {}): JSON {
39
- const json = super.toJSON();
40
- json['date'] = this.date?.toISOString();
41
- json['validity'] = this.validity;
42
- json['configurationAsJSON'] = this.configurationAsJSON;
43
-
44
- if (!options?.removeValues) {
45
- json['values'] = this.values;
46
- }
47
- return json;
48
- }
49
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * api/teams/:id => contacts
3
- */
4
- export class PeopleNode {
5
-
6
- public id: string;
7
- public role: string;
8
- public email: string;
9
- public name: string;
10
- public comments: string; // potential additional info
11
-
12
- constructor(json: {
13
- id: string,
14
- role: string,
15
- email: string,
16
- name: string,
17
- comments: string
18
- }
19
- ) {
20
- this.id = json.id;
21
- this.role = json.role;
22
- this.email = json.email;
23
- this.name = json.name;
24
- this.comments = json.comments;
25
- }
26
-
27
- public toJSON(): JSON {
28
- return {
29
- id: this.id,
30
- role: this.role,
31
- email: this.email,
32
- name: this.name,
33
- comments: this.comments,
34
- } as any;
35
- }
36
- }
@@ -1,46 +0,0 @@
1
- import {PeopleNode} from './PeopleNode';
2
- import {RaainNode} from './RaainNode';
3
-
4
- /**
5
- * api/teams?name=customerTeam
6
- */
7
- export class TeamNode extends RaainNode {
8
-
9
- public static TYPE = 'team';
10
-
11
- public id: any | string;
12
- public name: string;
13
- public description: string;
14
- public contracts: string[];
15
- public contacts: PeopleNode[];
16
-
17
- constructor(json: {
18
- id: any | string,
19
- name?: string,
20
- description?: string,
21
- contracts?: string[],
22
- contacts?: PeopleNode[]
23
- }) {
24
- super(json);
25
-
26
- this.id = json.id;
27
- this.name = json.name;
28
- this.description = json.description;
29
- this.contracts = json.contracts;
30
- this.contacts = json.contacts;
31
- }
32
-
33
- public toJSON(): JSON {
34
- return {
35
- id: this.id,
36
- name: this.name,
37
- description: this.description,
38
- contracts: this.contracts,
39
- contacts: this.contacts,
40
- } as any;
41
- }
42
-
43
- protected getLinkType(): string {
44
- return TeamNode.TYPE;
45
- }
46
- }
@@ -1,15 +0,0 @@
1
- import {IPolarMeasureValue} from './IPolarMeasureValue';
2
- import {AbstractPolarMeasureValue} from './AbstractPolarMeasureValue';
3
- import {PolarMeasureValue} from './PolarMeasureValue';
4
-
5
- /**
6
- * Gauge with single polar value container
7
- */
8
- export class GaugePolarMeasureValue extends AbstractPolarMeasureValue implements IPolarMeasureValue {
9
-
10
- constructor(json: {
11
- polars: string | PolarMeasureValue | AbstractPolarMeasureValue
12
- }) {
13
- super(json);
14
- }
15
- }
@@ -1,21 +0,0 @@
1
- import {MeasureValuePolarContainer} from './MeasureValuePolarContainer';
2
- import {PolarValue} from './PolarValue';
3
-
4
- export interface IPolarMeasureValue {
5
-
6
- getPolarsStringified(): string;
7
-
8
- getPolars(): MeasureValuePolarContainer[];
9
-
10
- setPolarsAsString(s: string): void;
11
-
12
- setPolarsAsContainer(s: MeasureValuePolarContainer[]): void;
13
-
14
- toJSON(): JSON;
15
-
16
- toJSONWithPolarStringified(): JSON;
17
-
18
- getPolarValue(json: { azimuthIndex: number, edgeIndex: number }): PolarValue;
19
-
20
- setPolarValue(json: { azimuthIndex: number, edgeIndex: number, value: number }): void;
21
- }
@@ -1,28 +0,0 @@
1
- export class MeasureValuePolarContainer {
2
- public azimuth: number;
3
- public distance: number;
4
- public polarEdges: number[];
5
-
6
- constructor(json: {
7
- azimuth: number,
8
- distance: number,
9
- polarEdges: number[]
10
- }) {
11
-
12
- if (typeof json?.azimuth === 'undefined') {
13
- throw new Error('MeasureValuePolarContainer needs a valid Object');
14
- }
15
-
16
- this.azimuth = json.azimuth;
17
- this.distance = json.distance;
18
- this.polarEdges = json.polarEdges;
19
- }
20
-
21
- public toJSON(): JSON {
22
- return {
23
- azimuth: this.azimuth,
24
- distance: this.distance,
25
- polarEdges: this.polarEdges,
26
- } as any;
27
- }
28
- }
@@ -1,16 +0,0 @@
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,43 +0,0 @@
1
- import {IPolarMeasureValue} from './IPolarMeasureValue';
2
- import {AbstractPolarMeasureValue} from './AbstractPolarMeasureValue';
3
- import {PolarMeasureValue} from './PolarMeasureValue';
4
-
5
- /**
6
- * Radar with polar value containers
7
- */
8
- export class RadarPolarMeasureValue extends AbstractPolarMeasureValue implements IPolarMeasureValue {
9
-
10
- public angle: number;
11
-
12
- constructor(json: {
13
- polars: RadarPolarMeasureValue | PolarMeasureValue | string,
14
- angle?: number
15
- }) {
16
- super(json);
17
-
18
- if (json.polars instanceof RadarPolarMeasureValue) {
19
- this.angle = json.polars.angle;
20
- return;
21
- }
22
-
23
- if (typeof json.polars === 'string') {
24
- const object = JSON.parse(json.polars);
25
- this.angle = json.angle ? json.angle : object.angle;
26
- return;
27
- }
28
-
29
- this.angle = json.angle;
30
- }
31
-
32
- public toJSON(stringify = false): JSON {
33
- const json: any = super.toJSON(stringify);
34
- json.angle = this.angle;
35
- return json;
36
- }
37
-
38
- public toJSONWithPolarStringified(): JSON {
39
- const json: any = super.toJSONWithPolarStringified();
40
- json.angle = this.angle;
41
- return json;
42
- }
43
- }
@@ -1,57 +0,0 @@
1
- import {IPolarMeasureValue} from './IPolarMeasureValue';
2
- import {IVersion} from '../organization/IVersion';
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
- polars: RainPolarMeasureValue | PolarMeasureValue | string,
15
- version?: string
16
- }) {
17
- super(json);
18
-
19
- if (json.polars instanceof RainPolarMeasureValue) {
20
- this.version = json.polars.version;
21
- return;
22
- }
23
-
24
- this.version = json.version;
25
- }
26
-
27
- static From(obj: any): RainPolarMeasureValue {
28
- let version: string,
29
- polars: PolarMeasureValue;
30
-
31
- if (typeof obj.version === 'string') {
32
- version = obj.version;
33
- }
34
-
35
- if (typeof obj.polars !== 'undefined') {
36
- polars = obj.polars;
37
- }
38
-
39
- return new RainPolarMeasureValue({polars, version});
40
- }
41
-
42
- public toJSON(stringify = false): JSON {
43
- const json: any = super.toJSON(stringify);
44
- json.version = this.version;
45
- return json;
46
- }
47
-
48
- public toJSONWithPolarStringified(): JSON {
49
- const json: any = super.toJSONWithPolarStringified();
50
- json.version = this.version;
51
- return json;
52
- }
53
-
54
- public getVersion(): string {
55
- return this.version;
56
- }
57
- }
@@ -1,23 +0,0 @@
1
- import {CartesianValue} from '../../cartesian/CartesianValue';
2
-
3
- export class CartesianGaugeHistory {
4
- public gaugeId: string;
5
- public gaugeLabel: string;
6
- public date: Date;
7
- public value: CartesianValue;
8
- public configurationAsJSON: string;
9
-
10
- constructor(json: {
11
- gaugeId: string,
12
- gaugeLabel: string,
13
- date: Date,
14
- value: CartesianValue,
15
- configurationAsJSON: string,
16
- }) {
17
- this.gaugeId = json.gaugeId;
18
- this.gaugeLabel = json.gaugeLabel;
19
- this.date = json.date;
20
- this.value = json.value;
21
- this.configurationAsJSON = json.configurationAsJSON;
22
- }
23
- }
@@ -1,18 +0,0 @@
1
- import {CartesianValue} from '../../cartesian/CartesianValue';
2
-
3
- export class CartesianRainHistory {
4
-
5
- public periodBegin: Date;
6
- public periodEnd: Date;
7
- public computedValue: CartesianValue;
8
-
9
- constructor(json: {
10
- periodBegin: Date,
11
- periodEnd: Date,
12
- computedValue: CartesianValue
13
- }) {
14
- this.periodBegin = json.periodBegin;
15
- this.periodEnd = json.periodEnd;
16
- this.computedValue = json.computedValue;
17
- }
18
- }
@@ -1,31 +0,0 @@
1
- import {PositionValue} from '../position/PositionValue';
2
-
3
- export class PositionHistory extends PositionValue {
4
- public id: string;
5
- public label: string;
6
- public date: Date;
7
- public valueFromGauge: number;
8
- public valueFromRain: number;
9
- public configurationAsJSON: string;
10
-
11
- constructor(json: {
12
- id: string,
13
- label: string,
14
- date: Date,
15
- x: number,
16
- y: number,
17
- value: number,
18
- valueFromGauge?: number,
19
- valueFromRain?: number,
20
- configurationAsJSON?: string,
21
- }) {
22
- super(json);
23
-
24
- this.id = json.id;
25
- this.label = json.label;
26
- this.date = json.date;
27
- this.valueFromGauge = json.valueFromGauge;
28
- this.valueFromRain = json.valueFromRain;
29
- this.configurationAsJSON = json.configurationAsJSON;
30
- }
31
- }