@fboes/aerofly-custom-missions 1.8.0 → 1.9.0
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/AGENTS.md +0 -0
- package/CHANGELOG.md +5 -1
- package/dist/dto/AeroflyMission.js +3 -3
- package/dist/dto/AeroflyMissionConditions.js +1 -1
- package/dist/dto/AeroflyMissionConditionsCloud.js +7 -0
- package/dist/dto-flight/AeroflySettingsFlight.js +56 -4
- package/dist/dto-flight/AeroflySettingsFlight.test.js +16 -0
- package/dist/node/Convert.js +2 -0
- package/package.json +2 -2
- package/src/dto/AeroflyMission.ts +3 -3
- package/src/dto/AeroflyMissionConditions.ts +3 -1
- package/src/dto/AeroflyMissionConditionsCloud.ts +9 -0
- package/src/dto-flight/AeroflySettingsFlight.test.ts +22 -0
- package/src/dto-flight/AeroflySettingsFlight.ts +61 -10
- package/src/node/Convert.ts +2 -0
- package/tsconfig.json +2 -2
- package/types/dto/AeroflyMissionConditions.d.ts.map +1 -1
- package/types/dto/AeroflyMissionConditionsCloud.d.ts +1 -0
- package/types/dto/AeroflyMissionConditionsCloud.d.ts.map +1 -1
- package/types/dto-flight/AeroflySettingsFlight.d.ts +15 -2
- package/types/dto-flight/AeroflySettingsFlight.d.ts.map +1 -1
- package/types/node/Convert.d.ts.map +1 -1
- package/dist/dto-flight/AeroflyWaypoint.js +0 -85
- package/dist/node/AeroflyBasicTypes.js +0 -61
- package/dist/node/Convert copy.js +0 -67
- package/types/AeroflyMissionCheckpoint.d.ts +0 -140
- package/types/AeroflyMissionTargetPlane.d.ts +0 -40
- package/types/dto/AeroflyConfigFileSet.d.ts +0 -10
- package/types/dto/AeroflyConfigFileSet.d.ts.map +0 -1
- package/types/dto/AeroflyConfiguration.interface.d.ts +0 -4
- package/types/dto/AeroflyConfiguration.interface.d.ts.map +0 -1
- package/types/dto/basicTypes.d.ts +0 -1
- package/types/dto/index.test.d.ts +0 -2
- package/types/dto/index.test.d.ts.map +0 -1
- package/types/dto-flight/AeroflyWaypoint.d.ts +0 -68
- package/types/dto-flight/AeroflyWaypoint.d.ts.map +0 -1
- package/types/index.test.d.ts +0 -2
- package/types/index.test.d.ts.map +0 -1
- package/types/node/AeroflyBasicTypes.d.ts +0 -13
- package/types/node/AeroflyBasicTypes.d.ts.map +0 -1
- package/types/node/Convert copy.d.ts +0 -15
- package/types/node/Convert copy.d.ts.map +0 -1
package/AGENTS.md
CHANGED
|
File without changes
|
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
This changelog documents all notable changes to the Aerofly Custom Missions project. Each version entry includes a list of changes, with the most recent version at the top.
|
|
4
4
|
|
|
5
|
-
## [1.
|
|
5
|
+
## [1.9.0] - 2026-04-20
|
|
6
|
+
|
|
7
|
+
- Added new convenience method to set aircraft systems from general aircraft configuration state. Please note that this will also be used as fallback on flight setting creation.
|
|
8
|
+
|
|
9
|
+
## [1.8.0] - 2026-04-19
|
|
6
10
|
|
|
7
11
|
- Added new flight configuration strings to `AeroflySettingsFlight`
|
|
8
12
|
|
|
@@ -188,8 +188,8 @@ export class AeroflyMission {
|
|
|
188
188
|
return new AeroflyMission(String(data.title ?? ""), {
|
|
189
189
|
tutorialName: String(data.tutorialName ?? ""),
|
|
190
190
|
description: String(data.description ?? ""),
|
|
191
|
-
localizedTexts: [], // TODO
|
|
192
|
-
tags: []
|
|
191
|
+
localizedTexts: [], // TODO: (Array.isArray(data.localizedTexts) ? data.localizedTexts : []).map((l) => AeroflyMissionCheckpoint.fromJSON(l))
|
|
192
|
+
tags: (Array.isArray(data.tags) ? data.tags : []).map((t) => String(t)),
|
|
193
193
|
isFeatured: data.isFeatured !== undefined ? Boolean(data.isFeatured) : null,
|
|
194
194
|
difficulty: data.difficulty !== undefined ? Number(data.difficulty) : null,
|
|
195
195
|
flightSetting: String(data.flightSetting ?? "taxi"),
|
|
@@ -220,7 +220,7 @@ export class AeroflyMission {
|
|
|
220
220
|
isScheduled: data.isScheduled !== undefined ? Boolean(data.isScheduled) : null,
|
|
221
221
|
finish: null, // TODO
|
|
222
222
|
conditions: AeroflyMissionConditions.fromJSON(data.conditions),
|
|
223
|
-
checkpoints: [], // TODO
|
|
223
|
+
checkpoints: [], // TODO: (Array.isArray(data.checkpoints) ? data.checkpoints : []).map((c) => AeroflyMissionCheckpoint.fromJSON(c))
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
}
|
|
@@ -140,7 +140,7 @@ export class AeroflyMissionConditions {
|
|
|
140
140
|
visibility: Number(data.visibility ?? 25_000),
|
|
141
141
|
visibility_sm: Number(data.visibility_sm ?? 0),
|
|
142
142
|
temperature: Number(data.temperature ?? 0),
|
|
143
|
-
clouds: []
|
|
143
|
+
clouds: (Array.isArray(data.checkpoints) ? data.checkpoints : []).map((c) => AeroflyMissionConditionsCloud.fromJSON(c)),
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -92,4 +92,11 @@ export class AeroflyMissionConditionsCloud {
|
|
|
92
92
|
.map((element) => element.toString(index))
|
|
93
93
|
.join("\n");
|
|
94
94
|
}
|
|
95
|
+
static fromJSON(json) {
|
|
96
|
+
if (typeof json !== "object" || json === null) {
|
|
97
|
+
throw new Error("Invalid mission condition cloud data");
|
|
98
|
+
}
|
|
99
|
+
const data = json;
|
|
100
|
+
return new this(Number(data.cover ?? 0), Number(data.base ?? 0));
|
|
101
|
+
}
|
|
95
102
|
}
|
|
@@ -7,11 +7,34 @@ export class AeroflySettingsFlight {
|
|
|
7
7
|
this.altitude_meter = altitude_meter;
|
|
8
8
|
this.heading_degree = heading_degree;
|
|
9
9
|
this.speed_kts = speed_kts;
|
|
10
|
-
this.gear =
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
this.gear = 1;
|
|
11
|
+
/**
|
|
12
|
+
* Throttle is supposed to be set to
|
|
13
|
+
* - 0 on "ColdAndDark", "BeforeStart", "OnGround" and "Takeoff" configuration
|
|
14
|
+
* - 0.4 on "ShortFinal" and "Final" configuration
|
|
15
|
+
* - 0.6 on "Cruise" configuration
|
|
16
|
+
*/
|
|
17
|
+
this.throttle = 0;
|
|
18
|
+
/**
|
|
19
|
+
* Flaps is supposed to be set to 1 on "ShortFinal" and "Final" configurations
|
|
20
|
+
*/
|
|
21
|
+
this.flaps = 0;
|
|
22
|
+
this.configuration = "OnGround";
|
|
23
|
+
this.onGround = true;
|
|
13
24
|
this.configuration = configuration;
|
|
14
|
-
this.
|
|
25
|
+
this.setConfiguration(configuration);
|
|
26
|
+
if (gear !== undefined) {
|
|
27
|
+
this.gear = gear;
|
|
28
|
+
}
|
|
29
|
+
if (throttle !== undefined) {
|
|
30
|
+
this.throttle = throttle;
|
|
31
|
+
}
|
|
32
|
+
if (flaps !== undefined) {
|
|
33
|
+
this.flaps = flaps;
|
|
34
|
+
}
|
|
35
|
+
if (onGround !== undefined) {
|
|
36
|
+
this.onGround = onGround;
|
|
37
|
+
}
|
|
15
38
|
this.airport = airport;
|
|
16
39
|
this.runway = runway;
|
|
17
40
|
}
|
|
@@ -25,6 +48,35 @@ export class AeroflySettingsFlight {
|
|
|
25
48
|
flight.orientation = orientation;
|
|
26
49
|
return flight;
|
|
27
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* @param {AeroflySettingsFlightConfiguration} configuration which will set other parameters like `gear`, `flaps` and `throttle` consistently
|
|
53
|
+
*/
|
|
54
|
+
setConfiguration(configuration) {
|
|
55
|
+
this.configuration = configuration;
|
|
56
|
+
if (configuration === "Keep") {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.onGround =
|
|
60
|
+
configuration === "ColdAndDark" ||
|
|
61
|
+
configuration === "BeforeStart" ||
|
|
62
|
+
configuration === "OnGround" ||
|
|
63
|
+
configuration === "Takeoff";
|
|
64
|
+
this.gear = configuration === "Cruise" ? 0 : 1;
|
|
65
|
+
this.flaps = configuration === "Final" || configuration === "ShortFinal" ? 1 : 0;
|
|
66
|
+
switch (configuration) {
|
|
67
|
+
case "ShortFinal":
|
|
68
|
+
case "Final":
|
|
69
|
+
this.throttle = 0.4;
|
|
70
|
+
break;
|
|
71
|
+
case "Cruise":
|
|
72
|
+
this.throttle = 0.6;
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
this.throttle = 0;
|
|
76
|
+
this.speed_kts = 0;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
28
80
|
/**
|
|
29
81
|
* @returns {AeroflyVector3Float} position vector to use in Aerofly FS4's `main.mcf`
|
|
30
82
|
*/
|
|
@@ -49,4 +49,20 @@ describe("AeroflySettingsFlight", () => {
|
|
|
49
49
|
console.log("Orientation:", flight.heading_degree); // should be 270, is 331
|
|
50
50
|
assertValidAeroflyStructure(flight.toString());
|
|
51
51
|
});
|
|
52
|
+
it("should create fallbacks for flight configurations", () => {
|
|
53
|
+
const flight = new AeroflySettingsFlight(-122.3088, 47.4502, 1000, 90, 150, {
|
|
54
|
+
configuration: "OnGround",
|
|
55
|
+
});
|
|
56
|
+
assert.strictEqual(flight.gear, 1, "Gear extended");
|
|
57
|
+
assert.strictEqual(flight.flaps, 0, "Flaps retracted");
|
|
58
|
+
assert.strictEqual(flight.onGround, true);
|
|
59
|
+
flight.setConfiguration("Cruise");
|
|
60
|
+
assert.strictEqual(flight.gear, 0, "Gear retracted");
|
|
61
|
+
assert.strictEqual(flight.flaps, 0, "Flaps retracted");
|
|
62
|
+
assert.strictEqual(flight.onGround, false);
|
|
63
|
+
flight.setConfiguration("ShortFinal");
|
|
64
|
+
assert.strictEqual(flight.gear, 1, "Gear extended");
|
|
65
|
+
assert.ok(flight.flaps > 0, "Flaps extended");
|
|
66
|
+
assert.strictEqual(flight.onGround, false);
|
|
67
|
+
});
|
|
52
68
|
});
|
package/dist/node/Convert.js
CHANGED
|
@@ -17,6 +17,7 @@ export class Convert {
|
|
|
17
17
|
return [x, y, z];
|
|
18
18
|
}
|
|
19
19
|
static convertVectorToLonLat(coordinates) {
|
|
20
|
+
// TODO: This implementation is not correct
|
|
20
21
|
const f = 1.0 / 298.257223563; // WGS84
|
|
21
22
|
const e2 = 2 * f - f * f;
|
|
22
23
|
//const lambda = VectorToAngle( coordinates[0], coordinates[1] );
|
|
@@ -50,6 +51,7 @@ export class Convert {
|
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
static convertDegreeToMatrix(heading_degree) {
|
|
54
|
+
// TODO: This implementation is not correct
|
|
53
55
|
const theta = heading_degree * (Math.PI / 180); // heading in radians
|
|
54
56
|
const cosTheta = Math.cos(theta);
|
|
55
57
|
const sinTheta = Math.sin(theta);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fboes/aerofly-custom-missions",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Builder for Aerofly FS4 Custom Missions Files",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"type": "module",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/node": "^20.
|
|
26
|
+
"@types/node": "^20.19.39",
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
|
28
28
|
"@typescript-eslint/parser": "^7.0.1",
|
|
29
29
|
"eslint": "^8.56.0",
|
|
@@ -402,8 +402,8 @@ export class AeroflyMission {
|
|
|
402
402
|
return new AeroflyMission(String(data.title ?? ""), {
|
|
403
403
|
tutorialName: String(data.tutorialName ?? ""),
|
|
404
404
|
description: String(data.description ?? ""),
|
|
405
|
-
localizedTexts: [], // TODO
|
|
406
|
-
tags: []
|
|
405
|
+
localizedTexts: [], // TODO: (Array.isArray(data.localizedTexts) ? data.localizedTexts : []).map((l) => AeroflyMissionCheckpoint.fromJSON(l))
|
|
406
|
+
tags: (Array.isArray(data.tags) ? data.tags : []).map((t) => String(t)),
|
|
407
407
|
isFeatured: data.isFeatured !== undefined ? Boolean(data.isFeatured) : null,
|
|
408
408
|
difficulty: data.difficulty !== undefined ? Number(data.difficulty) : null,
|
|
409
409
|
flightSetting: String(data.flightSetting ?? "taxi") as AeroflyMissionSetting,
|
|
@@ -434,7 +434,7 @@ export class AeroflyMission {
|
|
|
434
434
|
isScheduled: data.isScheduled !== undefined ? Boolean(data.isScheduled) : null,
|
|
435
435
|
finish: null, // TODO
|
|
436
436
|
conditions: AeroflyMissionConditions.fromJSON(data.conditions),
|
|
437
|
-
checkpoints: [], // TODO
|
|
437
|
+
checkpoints: [], // TODO: (Array.isArray(data.checkpoints) ? data.checkpoints : []).map((c) => AeroflyMissionCheckpoint.fromJSON(c))
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
}
|
|
@@ -208,7 +208,9 @@ export class AeroflyMissionConditions {
|
|
|
208
208
|
visibility: Number(data.visibility ?? 25_000),
|
|
209
209
|
visibility_sm: Number(data.visibility_sm ?? 0),
|
|
210
210
|
temperature: Number(data.temperature ?? 0),
|
|
211
|
-
clouds: []
|
|
211
|
+
clouds: (Array.isArray(data.checkpoints) ? data.checkpoints : []).map((c) =>
|
|
212
|
+
AeroflyMissionConditionsCloud.fromJSON(c),
|
|
213
|
+
),
|
|
212
214
|
});
|
|
213
215
|
}
|
|
214
216
|
}
|
|
@@ -123,4 +123,13 @@ export class AeroflyMissionConditionsCloud {
|
|
|
123
123
|
.map((element) => element.toString(index))
|
|
124
124
|
.join("\n");
|
|
125
125
|
}
|
|
126
|
+
|
|
127
|
+
static fromJSON(json: unknown): AeroflyMissionConditionsCloud {
|
|
128
|
+
if (typeof json !== "object" || json === null) {
|
|
129
|
+
throw new Error("Invalid mission condition cloud data");
|
|
130
|
+
}
|
|
131
|
+
const data = json as Record<string, unknown>;
|
|
132
|
+
|
|
133
|
+
return new this(Number(data.cover ?? 0), Number(data.base ?? 0));
|
|
134
|
+
}
|
|
126
135
|
}
|
|
@@ -67,4 +67,26 @@ describe("AeroflySettingsFlight", () => {
|
|
|
67
67
|
|
|
68
68
|
assertValidAeroflyStructure(flight.toString());
|
|
69
69
|
});
|
|
70
|
+
|
|
71
|
+
it("should create fallbacks for flight configurations", () => {
|
|
72
|
+
const flight = new AeroflySettingsFlight(-122.3088, 47.4502, 1000, 90, 150, {
|
|
73
|
+
configuration: "OnGround",
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
assert.strictEqual(flight.gear, 1, "Gear extended");
|
|
77
|
+
assert.strictEqual(flight.flaps, 0, "Flaps retracted");
|
|
78
|
+
assert.strictEqual(flight.onGround, true);
|
|
79
|
+
|
|
80
|
+
flight.setConfiguration("Cruise");
|
|
81
|
+
|
|
82
|
+
assert.strictEqual(flight.gear, 0, "Gear retracted");
|
|
83
|
+
assert.strictEqual(flight.flaps, 0, "Flaps retracted");
|
|
84
|
+
assert.strictEqual(flight.onGround, false);
|
|
85
|
+
|
|
86
|
+
flight.setConfiguration("ShortFinal");
|
|
87
|
+
|
|
88
|
+
assert.strictEqual(flight.gear, 1, "Gear extended");
|
|
89
|
+
assert.ok(flight.flaps > 0, "Flaps extended");
|
|
90
|
+
assert.strictEqual(flight.onGround, false);
|
|
91
|
+
});
|
|
70
92
|
});
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import { AeroflyVector3Float, AeroflyMatrix3Float, Convert } from "../node/Convert.js";
|
|
2
2
|
import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
|
|
3
3
|
|
|
4
|
+
export type AeroflySettingsFlightConfiguration =
|
|
5
|
+
| "Keep"
|
|
6
|
+
| "ColdAndDark"
|
|
7
|
+
| "BeforeStart" // TODO
|
|
8
|
+
| "OnGround"
|
|
9
|
+
| "Takeoff"
|
|
10
|
+
| "Cruise"
|
|
11
|
+
| "ShortFinal"
|
|
12
|
+
| "Final";
|
|
13
|
+
|
|
4
14
|
export class AeroflySettingsFlight {
|
|
5
|
-
gear: number;
|
|
15
|
+
gear: number = 1;
|
|
6
16
|
|
|
7
17
|
/**
|
|
8
18
|
* Throttle is supposed to be set to
|
|
9
|
-
* - 0 on "ColdAndDark", "OnGround" and "Takeoff" configuration
|
|
19
|
+
* - 0 on "ColdAndDark", "BeforeStart", "OnGround" and "Takeoff" configuration
|
|
10
20
|
* - 0.4 on "ShortFinal" and "Final" configuration
|
|
11
21
|
* - 0.6 on "Cruise" configuration
|
|
12
22
|
*/
|
|
13
|
-
throttle: number;
|
|
23
|
+
throttle: number = 0;
|
|
14
24
|
|
|
15
25
|
/**
|
|
16
26
|
* Flaps is supposed to be set to 1 on "ShortFinal" and "Final" configurations
|
|
17
27
|
*/
|
|
18
|
-
flaps: number;
|
|
19
|
-
configuration:
|
|
20
|
-
onGround: boolean;
|
|
28
|
+
flaps: number = 0;
|
|
29
|
+
configuration: AeroflySettingsFlightConfiguration = "OnGround";
|
|
30
|
+
onGround: boolean = true;
|
|
21
31
|
|
|
22
32
|
/**
|
|
23
33
|
* Airport is supposed to be set on any configurations but "Cruise" and "Keep"
|
|
@@ -45,11 +55,21 @@ export class AeroflySettingsFlight {
|
|
|
45
55
|
runway = "",
|
|
46
56
|
}: Partial<AeroflySettingsFlight> = {},
|
|
47
57
|
) {
|
|
48
|
-
this.gear = gear;
|
|
49
|
-
this.throttle = throttle;
|
|
50
|
-
this.flaps = flaps;
|
|
51
58
|
this.configuration = configuration;
|
|
52
|
-
this.
|
|
59
|
+
this.setConfiguration(configuration);
|
|
60
|
+
|
|
61
|
+
if (gear !== undefined) {
|
|
62
|
+
this.gear = gear;
|
|
63
|
+
}
|
|
64
|
+
if (throttle !== undefined) {
|
|
65
|
+
this.throttle = throttle;
|
|
66
|
+
}
|
|
67
|
+
if (flaps !== undefined) {
|
|
68
|
+
this.flaps = flaps;
|
|
69
|
+
}
|
|
70
|
+
if (onGround !== undefined) {
|
|
71
|
+
this.onGround = onGround;
|
|
72
|
+
}
|
|
53
73
|
this.airport = airport;
|
|
54
74
|
this.runway = runway;
|
|
55
75
|
}
|
|
@@ -85,6 +105,37 @@ export class AeroflySettingsFlight {
|
|
|
85
105
|
return flight;
|
|
86
106
|
}
|
|
87
107
|
|
|
108
|
+
/**
|
|
109
|
+
* @param {AeroflySettingsFlightConfiguration} configuration which will set other parameters like `gear`, `flaps` and `throttle` consistently
|
|
110
|
+
*/
|
|
111
|
+
setConfiguration(configuration: AeroflySettingsFlightConfiguration) {
|
|
112
|
+
this.configuration = configuration;
|
|
113
|
+
if (configuration === "Keep") {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
this.onGround =
|
|
118
|
+
configuration === "ColdAndDark" ||
|
|
119
|
+
configuration === "BeforeStart" ||
|
|
120
|
+
configuration === "OnGround" ||
|
|
121
|
+
configuration === "Takeoff";
|
|
122
|
+
this.gear = configuration === "Cruise" ? 0 : 1;
|
|
123
|
+
this.flaps = configuration === "Final" || configuration === "ShortFinal" ? 1 : 0;
|
|
124
|
+
switch (configuration) {
|
|
125
|
+
case "ShortFinal":
|
|
126
|
+
case "Final":
|
|
127
|
+
this.throttle = 0.4;
|
|
128
|
+
break;
|
|
129
|
+
case "Cruise":
|
|
130
|
+
this.throttle = 0.6;
|
|
131
|
+
break;
|
|
132
|
+
default:
|
|
133
|
+
this.throttle = 0;
|
|
134
|
+
this.speed_kts = 0;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
88
139
|
/**
|
|
89
140
|
* @returns {AeroflyVector3Float} position vector to use in Aerofly FS4's `main.mcf`
|
|
90
141
|
*/
|
package/src/node/Convert.ts
CHANGED
|
@@ -30,6 +30,7 @@ export class Convert {
|
|
|
30
30
|
latitude: number;
|
|
31
31
|
altitude_meter: number;
|
|
32
32
|
} {
|
|
33
|
+
// TODO: This implementation is not correct
|
|
33
34
|
const f = 1.0 / 298.257223563; // WGS84
|
|
34
35
|
const e2 = 2 * f - f * f;
|
|
35
36
|
|
|
@@ -64,6 +65,7 @@ export class Convert {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
static convertDegreeToMatrix(heading_degree: number): AeroflyMatrix3Float {
|
|
68
|
+
// TODO: This implementation is not correct
|
|
67
69
|
const theta = heading_degree * (Math.PI / 180); // heading in radians
|
|
68
70
|
|
|
69
71
|
const cosTheta = Math.cos(theta);
|
package/tsconfig.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
4
|
"target": "es2021",
|
|
5
|
-
"module": "
|
|
5
|
+
"module": "nodenext",
|
|
6
6
|
"rootDir": "./src",
|
|
7
7
|
"outDir": "./dist",
|
|
8
|
-
"moduleResolution": "
|
|
8
|
+
"moduleResolution": "nodenext",
|
|
9
9
|
"strict": true,
|
|
10
10
|
"esModuleInterop": true,
|
|
11
11
|
"sourceMap": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AeroflyMissionConditions.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionConditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,wBAAwB;IACjC;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,4BAA4B,CAAC;IAEnC;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,6BAA6B,EAAE,CAAM;IAE7C;;;;;;;;;;;OAWG;gBACS,EACR,IAAiB,EACjB,IAIC,EACD,kBAAsB,EACtB,eAAmB,EACnB,UAAmB,EACnB,aAAiB,EACjB,WAAe,EACf,MAAW,GACd,GAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,CAAC;KACnB;IAgBN;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAMhC;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,aAAa,EAAE,MAAM,EAEtC;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;;OAGG;IACH,IAAI,WAAW,CAAC,WAAW,EAAE,MAAM,EAGlC;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,gBAAgB,IAAI,wBAAwB,EAAE;IAI9C;;OAEG;IACH,UAAU,IAAI,wBAAwB;IAsBtC;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,wBAAwB;
|
|
1
|
+
{"version":3,"file":"AeroflyMissionConditions.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionConditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,wBAAwB;IACjC;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,4BAA4B,CAAC;IAEnC;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,6BAA6B,EAAE,CAAM;IAE7C;;;;;;;;;;;OAWG;gBACS,EACR,IAAiB,EACjB,IAIC,EACD,kBAAsB,EACtB,eAAmB,EACnB,UAAmB,EACnB,aAAiB,EACjB,WAAe,EACf,MAAW,GACd,GAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG;QACnC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,CAAC;KACnB;IAgBN;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAMhC;IAED;;OAEG;IACH,IAAI,aAAa,CAAC,aAAa,EAAE,MAAM,EAEtC;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED;;;OAGG;IACH,IAAI,WAAW,CAAC,WAAW,EAAE,MAAM,EAGlC;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,gBAAgB,IAAI,wBAAwB,EAAE;IAI9C;;OAEG;IACH,UAAU,IAAI,wBAAwB;IAsBtC;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,wBAAwB;CA4B3D"}
|
|
@@ -53,5 +53,6 @@ export declare class AeroflyMissionConditionsCloud {
|
|
|
53
53
|
* @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
|
|
54
54
|
*/
|
|
55
55
|
toString(index?: number): string;
|
|
56
|
+
static fromJSON(json: unknown): AeroflyMissionConditionsCloud;
|
|
56
57
|
}
|
|
57
58
|
//# sourceMappingURL=AeroflyMissionConditionsCloud.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AeroflyMissionConditionsCloud.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionConditionsCloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAmC,MAAM,qCAAqC,CAAC;AAGhH;;GAEG;AACH,MAAM,MAAM,sCAAsC,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3F;;;;;;;GAOG;AACH,qBAAa,6BAA6B;IACtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;gBACS,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAKvC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,6BAA6B;IAIpF;;OAEG;IACH,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,EAE9B;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,sCAAsC,CAWvD;IAED;;;OAGG;IACH,WAAW,CAAC,KAAK,GAAE,MAAU,GAAG,wBAAwB,EAAE;IAqC1D;;;OAGG;IACH,QAAQ,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"AeroflyMissionConditionsCloud.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyMissionConditionsCloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAmC,MAAM,qCAAqC,CAAC;AAGhH;;GAEG;AACH,MAAM,MAAM,sCAAsC,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3F;;;;;;;GAOG;AACH,qBAAa,6BAA6B;IACtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;gBACS,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAKvC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,6BAA6B;IAIpF;;OAEG;IACH,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,EAE9B;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,sCAAsC,CAWvD;IAED;;;OAGG;IACH,WAAW,CAAC,KAAK,GAAE,MAAU,GAAG,wBAAwB,EAAE;IAqC1D;;;OAGG;IACH,QAAQ,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM;IAMnC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,6BAA6B;CAQhE"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { AeroflyVector3Float, AeroflyMatrix3Float } from "../node/Convert.js";
|
|
2
2
|
import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
|
|
3
|
+
export type AeroflySettingsFlightConfiguration =
|
|
4
|
+
| "Keep"
|
|
5
|
+
| "ColdAndDark"
|
|
6
|
+
| "BeforeStart"
|
|
7
|
+
| "OnGround"
|
|
8
|
+
| "Takeoff"
|
|
9
|
+
| "Cruise"
|
|
10
|
+
| "ShortFinal"
|
|
11
|
+
| "Final";
|
|
3
12
|
export declare class AeroflySettingsFlight {
|
|
4
13
|
longitude: number;
|
|
5
14
|
latitude: number;
|
|
@@ -9,7 +18,7 @@ export declare class AeroflySettingsFlight {
|
|
|
9
18
|
gear: number;
|
|
10
19
|
/**
|
|
11
20
|
* Throttle is supposed to be set to
|
|
12
|
-
* - 0 on "ColdAndDark", "OnGround" and "Takeoff" configuration
|
|
21
|
+
* - 0 on "ColdAndDark", "BeforeStart", "OnGround" and "Takeoff" configuration
|
|
13
22
|
* - 0.4 on "ShortFinal" and "Final" configuration
|
|
14
23
|
* - 0.6 on "Cruise" configuration
|
|
15
24
|
*/
|
|
@@ -18,7 +27,7 @@ export declare class AeroflySettingsFlight {
|
|
|
18
27
|
* Flaps is supposed to be set to 1 on "ShortFinal" and "Final" configurations
|
|
19
28
|
*/
|
|
20
29
|
flaps: number;
|
|
21
|
-
configuration:
|
|
30
|
+
configuration: AeroflySettingsFlightConfiguration;
|
|
22
31
|
onGround: boolean;
|
|
23
32
|
/**
|
|
24
33
|
* Airport is supposed to be set on any configurations but "Cruise" and "Keep"
|
|
@@ -50,6 +59,10 @@ export declare class AeroflySettingsFlight {
|
|
|
50
59
|
orientation: AeroflyMatrix3Float,
|
|
51
60
|
additionalAttributes?: Partial<AeroflySettingsFlight>,
|
|
52
61
|
): AeroflySettingsFlight;
|
|
62
|
+
/**
|
|
63
|
+
* @param {AeroflySettingsFlightConfiguration} configuration which will set other parameters like `gear`, `flaps` and `throttle` consistently
|
|
64
|
+
*/
|
|
65
|
+
setConfiguration(configuration: AeroflySettingsFlightConfiguration): void;
|
|
53
66
|
/**
|
|
54
67
|
* @returns {AeroflyVector3Float} position vector to use in Aerofly FS4's `main.mcf`
|
|
55
68
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AeroflySettingsFlight.d.ts","sourceRoot":"","sources":["../../src/dto-flight/AeroflySettingsFlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAW,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,qBAAa,qBAAqB;IA6BnB,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,MAAM;IAChB,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,MAAM;IACtB,SAAS,EAAE,MAAM;IAhC5B,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AeroflySettingsFlight.d.ts","sourceRoot":"","sources":["../../src/dto-flight/AeroflySettingsFlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAW,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,MAAM,MAAM,kCAAkC,GACxC,MAAM,GACN,aAAa,GACb,aAAa,GACb,UAAU,GACV,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC;AAEd,qBAAa,qBAAqB;IA6BnB,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,MAAM;IAChB,cAAc,EAAE,MAAM;IACtB,cAAc,EAAE,MAAM;IACtB,SAAS,EAAE,MAAM;IAhC5B,IAAI,EAAE,MAAM,CAAK;IAEjB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAK;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAK;IAClB,aAAa,EAAE,kCAAkC,CAAc;IAC/D,QAAQ,EAAE,OAAO,CAAQ;IAEzB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;gBAGJ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,EACtB,SAAS,GAAE,MAAU,EAC5B,EACI,IAAQ,EACR,QAAY,EACZ,KAAS,EACT,aAA0B,EAC1B,QAAe,EACf,OAAY,EACZ,MAAW,GACd,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAqB1C,MAAM,CAAC,YAAY,CACf,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,GAAE,MAAU,EACrB,oBAAoB,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAC1D,qBAAqB;IAWxB,MAAM,CAAC,iBAAiB,CACpB,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,mBAAmB,EAC7B,WAAW,EAAE,mBAAmB,EAChC,oBAAoB,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAC1D,qBAAqB;IAQxB;;OAEG;IACH,gBAAgB,CAAC,aAAa,EAAE,kCAAkC;IA4BlE;;OAEG;IACH,IAAI,QAAQ,IAAI,mBAAmB,CAElC;IAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,EAKzC;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,mBAAmB,CAIlC;IAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,EAGzC;IAED,IAAI,WAAW,IAAI,mBAAmB,CAErC;IAED,IAAI,WAAW,CAAC,WAAW,EAAE,mBAAmB,EAE/C;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,WAAW,CAAC,WAAW,EAAE,MAAM,EAElC;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAE5B;IAED,UAAU,IAAI,wBAAwB;IAwBtC,MAAM;IAQN;;OAEG;IACH,QAAQ,IAAI,MAAM;CAGrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Convert.d.ts","sourceRoot":"","sources":["../../src/node/Convert.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3G,qBAAa,OAAO;IAChB,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,mBAAmB;IAsB9G,MAAM,CAAC,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,GAAG;QAC5D,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;KAC1B;
|
|
1
|
+
{"version":3,"file":"Convert.d.ts","sourceRoot":"","sources":["../../src/node/Convert.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3G,qBAAa,OAAO;IAChB,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,mBAAmB;IAsB9G,MAAM,CAAC,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,GAAG;QAC5D,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;KAC1B;IAmCD,MAAM,CAAC,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,mBAAmB;IAUzE,MAAM,CAAC,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,GAAG,MAAM;IAQtE,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIhD,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI/C,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,MAAM;IAI/B,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,MAAM;CAGlC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { AeroflyBasicTypes } from "../node/AeroflyBasicTypes.js";
|
|
2
|
-
import { AeroflyConfigurationNode, AeroflyConfigurationNodeComment } from "../node/AeroflyConfigurationNode.js";
|
|
3
|
-
export class AeroflyWaypoint {
|
|
4
|
-
/**
|
|
5
|
-
* @param {AeroflyWaypointType} type like "origin", "departure_runway", "departure", "waypoint", "arrival", "approach", "destination_runway" or "destination"
|
|
6
|
-
* @param {string} identifier alphanumeric identifier, e.g. "SEA", "PDX", "RWY16L", "FIX1"
|
|
7
|
-
* @param {number} longitude WGS84
|
|
8
|
-
* @param {number} latitude WGS84
|
|
9
|
-
* @param {object} [options] additional options for the waypoint
|
|
10
|
-
* @param {boolean} [options.flyOver] if true, the waypoint is meant to be flown over, otherwise it can be used as a fly-by waypoint
|
|
11
|
-
* @param {?number} [options.navaidFrequency] if the waypoint is a navaid, its frequency in Hz
|
|
12
|
-
* @param {number} [options.altitude] in meter
|
|
13
|
-
* @param {?number} [options.altitude_ft] altitude in feet, will override altitude in meter if provided
|
|
14
|
-
* @param {?number} [options.elevation] elevation of the waypoint in meter, only used for origin, departure and destination waypoints
|
|
15
|
-
* @param {?number} [options.elevation_ft] elevation of the waypoint in feet, will override elevation in meter if provided
|
|
16
|
-
* @param {?bigint} [options.uid] unique identifier for the waypoint, will be generated automatically if not provided
|
|
17
|
-
*/
|
|
18
|
-
constructor(type, identifier, longitude, latitude, { flyOver: flyOver = false, navaidFrequency = null, altitude = null, altitude_ft = null, elevation = null, elevation_ft = null, uid = null, } = {}) {
|
|
19
|
-
this.type = type;
|
|
20
|
-
this.identifier = identifier;
|
|
21
|
-
this.longitude = longitude;
|
|
22
|
-
this.latitude = latitude;
|
|
23
|
-
this.navaidFrequency = navaidFrequency;
|
|
24
|
-
this.elevation = elevation;
|
|
25
|
-
this.uid = uid;
|
|
26
|
-
this.flyOver = flyOver;
|
|
27
|
-
this.altitude = altitude;
|
|
28
|
-
if (altitude_ft !== null) {
|
|
29
|
-
this.altitude_ft = altitude_ft;
|
|
30
|
-
}
|
|
31
|
-
if (elevation_ft !== null) {
|
|
32
|
-
this.elevation_ft = elevation_ft;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
static createFromCartesian(type, identifier, position, options = {}) {
|
|
36
|
-
const { longitude, latitude, altitude_meter } = AeroflyBasicTypes.convertVectorToLonLat(position);
|
|
37
|
-
return new AeroflyWaypoint(type, identifier, longitude, latitude, { ...options, altitude: altitude_meter });
|
|
38
|
-
}
|
|
39
|
-
get altitude_ft() {
|
|
40
|
-
return this.altitude !== null ? this.altitude * 3.28084 : null;
|
|
41
|
-
}
|
|
42
|
-
set altitude_ft(altitude_ft) {
|
|
43
|
-
this.altitude = altitude_ft !== null ? altitude_ft * 0.3048 : null;
|
|
44
|
-
}
|
|
45
|
-
get elevation_ft() {
|
|
46
|
-
return this.elevation !== null ? this.elevation * 3.28084 : null;
|
|
47
|
-
}
|
|
48
|
-
set elevation_ft(elevation_ft) {
|
|
49
|
-
this.elevation = elevation_ft !== null ? elevation_ft * 0.3048 : null;
|
|
50
|
-
}
|
|
51
|
-
get position() {
|
|
52
|
-
return AeroflyBasicTypes.convertLonLatToVector(this.longitude, this.latitude, this.altitude || 0);
|
|
53
|
-
}
|
|
54
|
-
getElement(index = 0) {
|
|
55
|
-
const element = new AeroflyConfigurationNode("tmnav_route_" + this.type, this.identifier, String(index))
|
|
56
|
-
.appendChild("string8u", "Identifier", this.identifier)
|
|
57
|
-
.appendChild("vector3_float64", "Position", this.position, `Lon ${this.longitude.toPrecision(6)}, Lat ${this.latitude.toPrecision(6)}, ${Math.ceil(this.altitude_ft ?? 0)} ft`)
|
|
58
|
-
.append(this.uid
|
|
59
|
-
? new AeroflyConfigurationNode("uint64", "Uid", this.uid)
|
|
60
|
-
: new AeroflyConfigurationNodeComment("uint64", "Uid", ""));
|
|
61
|
-
if (this.type === "origin" ||
|
|
62
|
-
this.type === "departure_runway" ||
|
|
63
|
-
this.type === "departure" ||
|
|
64
|
-
this.type === "destination_runway" ||
|
|
65
|
-
this.type === "destination") {
|
|
66
|
-
element.append(this.elevation !== null
|
|
67
|
-
? new AeroflyConfigurationNode("float64", "Elevation", this.elevation, `${Math.ceil(this.elevation_ft ?? 0)} ft`)
|
|
68
|
-
: new AeroflyConfigurationNodeComment("float64", "Elevation", ""));
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
element.appendChild("bool", "FlyOver", this.flyOver);
|
|
72
|
-
element.appendChild("vector2_float64", "Altitude", this.altitude !== null && this.altitude > 0 ? [this.altitude, this.altitude] : [-1001, 100001], `${this.altitude_ft !== null && this.altitude_ft > 0 ? Math.ceil(this.altitude_ft) + " ft" : "unrestricted"}`);
|
|
73
|
-
}
|
|
74
|
-
if (this.navaidFrequency) {
|
|
75
|
-
element.appendChild("float64", "NavaidFrequency", this.navaidFrequency);
|
|
76
|
-
}
|
|
77
|
-
return element;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* @returns {string} to use in Aerofly FS4's `main.mcf`
|
|
81
|
-
*/
|
|
82
|
-
toString() {
|
|
83
|
-
return this.getElement().toString();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export class AeroflyBasicTypes {
|
|
2
|
-
static convertLonLatToVector(longitude, latitude, altitude_meter) {
|
|
3
|
-
const a = 6378137.0;
|
|
4
|
-
const f = 1.0 / 298.257223563;
|
|
5
|
-
const e2 = f * (2 - f);
|
|
6
|
-
const lon = longitude * (Math.PI / 180); // in radians
|
|
7
|
-
const lat = latitude * (Math.PI / 180); // in radians
|
|
8
|
-
const h = altitude_meter;
|
|
9
|
-
const sinLat = Math.sin(lat);
|
|
10
|
-
const cosLat = Math.cos(lat);
|
|
11
|
-
const cosLon = Math.cos(lon);
|
|
12
|
-
const sinLon = Math.sin(lon);
|
|
13
|
-
const N = a / Math.sqrt(1 - e2 * sinLat * sinLat);
|
|
14
|
-
const x = (N + h) * cosLat * cosLon;
|
|
15
|
-
const y = (N + h) * cosLat * sinLon;
|
|
16
|
-
const z = (N * (1 - e2) + h) * sinLat;
|
|
17
|
-
return [x, y, z];
|
|
18
|
-
}
|
|
19
|
-
static convertVectorToLonLat(coordinates) {
|
|
20
|
-
const f = 1.0 / 298.257223563; // WGS84
|
|
21
|
-
const e2 = 2 * f - f * f;
|
|
22
|
-
//const lambda = VectorToAngle( coordinates[0], coordinates[1] );
|
|
23
|
-
let lambda = 0;
|
|
24
|
-
if (coordinates[0] > 0) {
|
|
25
|
-
if (coordinates[1] < 0) {
|
|
26
|
-
lambda = 2 * Math.PI + Math.atan(coordinates[1] / coordinates[0]);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
lambda = Math.atan(coordinates[1] / coordinates[0]);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
else if (coordinates[0] < 0) {
|
|
33
|
-
lambda = Math.PI + Math.atan(coordinates[1] / coordinates[0]);
|
|
34
|
-
}
|
|
35
|
-
else if (coordinates[1] > 0) {
|
|
36
|
-
lambda = 0.5 * Math.PI;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
lambda = 1.5 * Math.PI;
|
|
40
|
-
}
|
|
41
|
-
const rho = Math.sqrt(coordinates[0] * coordinates[0] + coordinates[1] * coordinates[1]);
|
|
42
|
-
const phi = Math.atan(coordinates[2] / ((1.0 - e2) * rho));
|
|
43
|
-
const longitude = (lambda * 180) / Math.PI;
|
|
44
|
-
const latitude = (phi * 180) / Math.PI;
|
|
45
|
-
const altitude_meter = rho / Math.cos(phi) - 6378137.0 / Math.sqrt(1 - e2 * Math.sin(phi) * Math.sin(phi));
|
|
46
|
-
return {
|
|
47
|
-
longitude: longitude > 180 ? longitude - 360 : longitude,
|
|
48
|
-
latitude: latitude > 90 ? latitude - 180 : latitude < -90 ? latitude + 180 : latitude,
|
|
49
|
-
altitude_meter,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
static convertDegreeToMatrix(heading_degree) {
|
|
53
|
-
const theta = heading_degree * (Math.PI / 180); // heading in radians
|
|
54
|
-
const cosTheta = Math.cos(theta);
|
|
55
|
-
const sinTheta = Math.sin(theta);
|
|
56
|
-
return [cosTheta, -sinTheta, 0, sinTheta, cosTheta, 0, 0, 0, 1];
|
|
57
|
-
}
|
|
58
|
-
static convertMatrixToDegree(orientation) {
|
|
59
|
-
return ((Math.atan2(orientation[1], orientation[0]) - 1) * (180 / Math.PI) + 26 + 360) % 360;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export class Convert {
|
|
2
|
-
static convertLonLatToVector(longitude, latitude, altitude_meter) {
|
|
3
|
-
const a = 6378137.0;
|
|
4
|
-
const f = 1.0 / 298.257223563;
|
|
5
|
-
const e2 = f * (2 - f);
|
|
6
|
-
const lon = longitude * (Math.PI / 180); // in radians
|
|
7
|
-
const lat = latitude * (Math.PI / 180); // in radians
|
|
8
|
-
const h = altitude_meter;
|
|
9
|
-
const sinLat = Math.sin(lat);
|
|
10
|
-
const cosLat = Math.cos(lat);
|
|
11
|
-
const cosLon = Math.cos(lon);
|
|
12
|
-
const sinLon = Math.sin(lon);
|
|
13
|
-
const N = a / Math.sqrt(1 - e2 * sinLat * sinLat);
|
|
14
|
-
const x = (N + h) * cosLat * cosLon;
|
|
15
|
-
const y = (N + h) * cosLat * sinLon;
|
|
16
|
-
const z = (N * (1 - e2) + h) * sinLat;
|
|
17
|
-
return [x, y, z];
|
|
18
|
-
}
|
|
19
|
-
static convertVectorToLonLat(coordinates) {
|
|
20
|
-
const f = 1.0 / 298.257223563; // WGS84
|
|
21
|
-
const e2 = 2 * f - f * f;
|
|
22
|
-
//const lambda = VectorToAngle( coordinates[0], coordinates[1] );
|
|
23
|
-
let lambda = 0;
|
|
24
|
-
if (coordinates[0] > 0) {
|
|
25
|
-
if (coordinates[1] < 0) {
|
|
26
|
-
lambda = 2 * Math.PI + Math.atan(coordinates[1] / coordinates[0]);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
lambda = Math.atan(coordinates[1] / coordinates[0]);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
else if (coordinates[0] < 0) {
|
|
33
|
-
lambda = Math.PI + Math.atan(coordinates[1] / coordinates[0]);
|
|
34
|
-
}
|
|
35
|
-
else if (coordinates[1] > 0) {
|
|
36
|
-
lambda = 0.5 * Math.PI;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
lambda = 1.5 * Math.PI;
|
|
40
|
-
}
|
|
41
|
-
const rho = Math.sqrt(coordinates[0] * coordinates[0] + coordinates[1] * coordinates[1]);
|
|
42
|
-
const phi = Math.atan(coordinates[2] / ((1.0 - e2) * rho));
|
|
43
|
-
const longitude = (lambda * 180) / Math.PI;
|
|
44
|
-
const latitude = (phi * 180) / Math.PI;
|
|
45
|
-
const altitude_meter = rho / Math.cos(phi) - 6378137.0 / Math.sqrt(1 - e2 * Math.sin(phi) * Math.sin(phi));
|
|
46
|
-
return {
|
|
47
|
-
longitude: longitude > 180 ? longitude - 360 : longitude,
|
|
48
|
-
latitude: latitude > 90 ? latitude - 180 : latitude < -90 ? latitude + 180 : latitude,
|
|
49
|
-
altitude_meter,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
static convertDegreeToMatrix(heading_degree) {
|
|
53
|
-
const theta = heading_degree * (Math.PI / 180); // heading in radians
|
|
54
|
-
const cosTheta = Math.cos(theta);
|
|
55
|
-
const sinTheta = Math.sin(theta);
|
|
56
|
-
return [cosTheta, -sinTheta, 0, sinTheta, cosTheta, 0, 0, 0, 1];
|
|
57
|
-
}
|
|
58
|
-
static convertMatrixToDegree(orientation) {
|
|
59
|
-
return ((Math.atan2(orientation[1], orientation[0]) - 1) * (180 / Math.PI) + 26 + 360) % 360;
|
|
60
|
-
}
|
|
61
|
-
static convertMeterToFeet(meter) {
|
|
62
|
-
return meter * 3.28084;
|
|
63
|
-
}
|
|
64
|
-
static convertFeetToMeter(feet) {
|
|
65
|
-
return feet / 3.28084;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @class
|
|
3
|
-
* A single way point for the given flight plan
|
|
4
|
-
*
|
|
5
|
-
* The purpose of this class is to collect data needed for Aerofly FS4's
|
|
6
|
-
* `custom_missions_user.tmc` flight plan file format, and export the structure
|
|
7
|
-
* for this file via the `toString()` method.
|
|
8
|
-
*/
|
|
9
|
-
export declare class AeroflyMissionCheckpoint {
|
|
10
|
-
/**
|
|
11
|
-
* @property {"origin"|"departure_runway"|"departure"|"waypoint"|"arrival"|"approach"|"destination_runway"|"destination"} type of checkpoint, like "departure_runway"
|
|
12
|
-
*/
|
|
13
|
-
type: AeroflyMissionCheckpointType;
|
|
14
|
-
/**
|
|
15
|
-
* @property {string} name ICAO code for airport, runway designator, navaid
|
|
16
|
-
* designator, fix name, or custom name
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
/**
|
|
20
|
-
* @property {number} longitude easting, using the World Geodetic
|
|
21
|
-
* System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
|
|
22
|
-
* of decimal degrees; -180..180
|
|
23
|
-
*/
|
|
24
|
-
longitude: number;
|
|
25
|
-
/**
|
|
26
|
-
* @property {number} latitude northing, using the World Geodetic
|
|
27
|
-
* System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
|
|
28
|
-
* of decimal degrees; -90..90
|
|
29
|
-
*/
|
|
30
|
-
latitude: number;
|
|
31
|
-
/**
|
|
32
|
-
* @property {number} altitude The height in meters above or below the WGS
|
|
33
|
-
* 84 reference ellipsoid
|
|
34
|
-
*/
|
|
35
|
-
altitude: number;
|
|
36
|
-
/**
|
|
37
|
-
* @property {?boolean} altitudeConstraint The altitude given in `altitude`
|
|
38
|
-
* will be interpreted as mandatory flight plan altitude instead of
|
|
39
|
-
* suggestion.
|
|
40
|
-
*/
|
|
41
|
-
altitudeConstraint: boolean | null;
|
|
42
|
-
/**
|
|
43
|
-
* @property {?number} direction of runway, in degree
|
|
44
|
-
*/
|
|
45
|
-
direction: number | null;
|
|
46
|
-
/**
|
|
47
|
-
* @property {?number} slope of runway
|
|
48
|
-
*/
|
|
49
|
-
slope: number | null;
|
|
50
|
-
/**
|
|
51
|
-
* @property {?number} length of runway, in meters
|
|
52
|
-
*/
|
|
53
|
-
length: number | null;
|
|
54
|
-
/**
|
|
55
|
-
* @property {?number} frequency of runways or navigational aids, in Hz; multiply by 1000 for kHz, 1_000_000 for MHz
|
|
56
|
-
*/
|
|
57
|
-
frequency: number | null;
|
|
58
|
-
/**
|
|
59
|
-
* @property {?boolean} flyOver if waypoint is meant to be flown over
|
|
60
|
-
*/
|
|
61
|
-
flyOver: boolean | null;
|
|
62
|
-
/**
|
|
63
|
-
* @param {string} name ICAO code for airport, runway designator, navaid
|
|
64
|
-
* designator, fix name, or custom name
|
|
65
|
-
* @param {"origin"|"departure_runway"|"departure"|"waypoint"|"arrival"|"approach"|"destination_runway"|"destination"} type Type of checkpoint, like "departure_runway"
|
|
66
|
-
* @param {number} longitude easting, using the World Geodetic
|
|
67
|
-
* System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
|
|
68
|
-
* of decimal degrees; -180..180
|
|
69
|
-
* @param {number} latitude northing, using the World Geodetic
|
|
70
|
-
* System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
|
|
71
|
-
* of decimal degrees; -90..90
|
|
72
|
-
* @param {object} additionalAttributes allows to set additional attributes on creation
|
|
73
|
-
* @param {number} [additionalAttributes.altitude] The height in meters above or below the WGS
|
|
74
|
-
* 84 reference ellipsoid
|
|
75
|
-
* @param {?number} [additionalAttributes.altitude_feet] The height in feet above or below the WGS
|
|
76
|
-
* 84 reference ellipsoid. Will overwrite altitude
|
|
77
|
-
* @param {number} [additionalAttributes.altitudeConstraint] The altitude given in `altitude`
|
|
78
|
-
* will be interpreted as mandatory flight plan altitude instead of
|
|
79
|
-
* suggestion.
|
|
80
|
-
* @param {boolean} [additionalAttributes.direction] of runway, in degree
|
|
81
|
-
* @param {?number} [additionalAttributes.slope] of runway
|
|
82
|
-
* @param {?number} [additionalAttributes.length] of runway, in meters
|
|
83
|
-
* @param {?number} [additionalAttributes.length_feet] of runway, in feet. Will overwrite length
|
|
84
|
-
* @param {?number} [additionalAttributes.frequency] of runways or navigational aids, in Hz; multiply by 1000 for kHz, 1_000_000 for MHz
|
|
85
|
-
* @param {?boolean} [additionalAttributes.flyOver] if waypoint is meant to be flown over
|
|
86
|
-
*/
|
|
87
|
-
constructor(
|
|
88
|
-
name: string,
|
|
89
|
-
type: AeroflyMissionCheckpointType,
|
|
90
|
-
longitude: number,
|
|
91
|
-
latitude: number,
|
|
92
|
-
{
|
|
93
|
-
altitude,
|
|
94
|
-
altitude_feet,
|
|
95
|
-
altitudeConstraint,
|
|
96
|
-
direction,
|
|
97
|
-
slope,
|
|
98
|
-
length,
|
|
99
|
-
length_feet,
|
|
100
|
-
frequency,
|
|
101
|
-
flyOver,
|
|
102
|
-
}?: {
|
|
103
|
-
altitude?: number;
|
|
104
|
-
altitude_feet?: number | null;
|
|
105
|
-
altitudeConstraint?: boolean | null;
|
|
106
|
-
direction?: number | null;
|
|
107
|
-
slope?: number | null;
|
|
108
|
-
length?: number | null;
|
|
109
|
-
length_feet?: number | null;
|
|
110
|
-
frequency?: number | null;
|
|
111
|
-
flyOver?: boolean | null;
|
|
112
|
-
},
|
|
113
|
-
);
|
|
114
|
-
/**
|
|
115
|
-
* @param {number} altitude_feet
|
|
116
|
-
*/
|
|
117
|
-
set altitude_feet(altitude_feet: number);
|
|
118
|
-
/**
|
|
119
|
-
* @returns {number} altitude_feet
|
|
120
|
-
*/
|
|
121
|
-
get altitude_feet(): number;
|
|
122
|
-
/**
|
|
123
|
-
* @param {number} length_feet
|
|
124
|
-
*/
|
|
125
|
-
set length_feet(length_feet: number);
|
|
126
|
-
/**
|
|
127
|
-
* @returns {number} length_feet
|
|
128
|
-
*/
|
|
129
|
-
get length_feet(): number;
|
|
130
|
-
/**
|
|
131
|
-
* @returns {string}
|
|
132
|
-
*/
|
|
133
|
-
get frequency_string(): string;
|
|
134
|
-
/**
|
|
135
|
-
* @param {number} index if used in an array will se the array index
|
|
136
|
-
* @returns {string} to use in Aerofly FS4's `custom_missions_user.tmc`
|
|
137
|
-
*/
|
|
138
|
-
toString(index?: number): string;
|
|
139
|
-
}
|
|
140
|
-
//# sourceMappingURL=AeroflyMissionCheckpoint.d.ts.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @class
|
|
3
|
-
* A target plane which the aircraft needs to cross.
|
|
4
|
-
*/
|
|
5
|
-
export declare class AeroflyMissionTargetPlane {
|
|
6
|
-
/**
|
|
7
|
-
* @property {number} longitude easting, using the World Geodetic
|
|
8
|
-
* System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
|
|
9
|
-
* of decimal degrees; -180..180
|
|
10
|
-
*/
|
|
11
|
-
longitude: number;
|
|
12
|
-
/**
|
|
13
|
-
* @property {number} latitude northing, using the World Geodetic
|
|
14
|
-
* System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
|
|
15
|
-
* of decimal degrees; -90..90
|
|
16
|
-
*/
|
|
17
|
-
latitude: number;
|
|
18
|
-
/**
|
|
19
|
-
* @property {number} dir in degree
|
|
20
|
-
*/
|
|
21
|
-
dir: number;
|
|
22
|
-
/**
|
|
23
|
-
* @property {string} name of property
|
|
24
|
-
*/
|
|
25
|
-
name: string;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @param {number} longitude easting, using the World Geodetic
|
|
29
|
-
* System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
|
|
30
|
-
* of decimal degrees; -180..180
|
|
31
|
-
* @param {number}latitude northing, using the World Geodetic
|
|
32
|
-
* System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units
|
|
33
|
-
* of decimal degrees; -90..90
|
|
34
|
-
* @param {number} dir in degree
|
|
35
|
-
* @param {string} name of property
|
|
36
|
-
*/
|
|
37
|
-
constructor(longitude: number, latitude: number, dir: number, name?: string);
|
|
38
|
-
toString(): string;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=AeroflyMissionTargetPlane.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare class AeroflyConfigFileSet {
|
|
2
|
-
#private;
|
|
3
|
-
elements: string[];
|
|
4
|
-
constructor(indent: number, type: string, name: string, value?: string);
|
|
5
|
-
get indent(): string;
|
|
6
|
-
push(type: string, name: string, value: string | number | string[] | number[] | boolean, comment?: string): this;
|
|
7
|
-
pushRaw(s: string): this;
|
|
8
|
-
toString(): string;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=AeroflyConfigFileSet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AeroflyConfigFileSet.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyConfigFileSet.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;;IAE7B,QAAQ,EAAE,MAAM,EAAE,CAAC;gBAEP,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW;IAK1E,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,OAAO,GAAE,MAAW;IAa7G,OAAO,CAAC,CAAC,EAAE,MAAM;IAKjB,QAAQ;CAGX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AeroflyConfiguration.interface.d.ts","sourceRoot":"","sources":["../../src/dto/AeroflyConfiguration.interface.ts"],"names":[],"mappings":"AAAA,UAAU,6BAA6B;IACnC,IAAI,OAAO,IAAI,wBAAwB,CAAC;CAC3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=basicTypes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/dto/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { AeroflyVector3Float } from "../node/AeroflyBasicTypes.js";
|
|
2
|
-
import { AeroflyConfigurationNode } from "../node/AeroflyConfigurationNode.js";
|
|
3
|
-
export type AeroflyWaypointType =
|
|
4
|
-
| "origin"
|
|
5
|
-
| "departure_runway"
|
|
6
|
-
| "departure"
|
|
7
|
-
| "waypoint"
|
|
8
|
-
| "arrival"
|
|
9
|
-
| "approach"
|
|
10
|
-
| "destination_runway"
|
|
11
|
-
| "destination";
|
|
12
|
-
export declare class AeroflyWaypoint {
|
|
13
|
-
type: AeroflyWaypointType;
|
|
14
|
-
identifier: string;
|
|
15
|
-
longitude: number;
|
|
16
|
-
latitude: number;
|
|
17
|
-
navaidFrequency: number | null;
|
|
18
|
-
altitude: number | null;
|
|
19
|
-
elevation: number | null;
|
|
20
|
-
uid: bigint | null;
|
|
21
|
-
flyOver: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* @param {AeroflyWaypointType} type like "origin", "departure_runway", "departure", "waypoint", "arrival", "approach", "destination_runway" or "destination"
|
|
24
|
-
* @param {string} identifier alphanumeric identifier, e.g. "SEA", "PDX", "RWY16L", "FIX1"
|
|
25
|
-
* @param {number} longitude WGS84
|
|
26
|
-
* @param {number} latitude WGS84
|
|
27
|
-
* @param {object} [options] additional options for the waypoint
|
|
28
|
-
* @param {boolean} [options.flyOver] if true, the waypoint is meant to be flown over, otherwise it can be used as a fly-by waypoint
|
|
29
|
-
* @param {?number} [options.navaidFrequency] if the waypoint is a navaid, its frequency in Hz
|
|
30
|
-
* @param {number} [options.altitude] in meter
|
|
31
|
-
* @param {?number} [options.altitude_ft] altitude in feet, will override altitude in meter if provided
|
|
32
|
-
* @param {?number} [options.elevation] elevation of the waypoint in meter, only used for origin, departure and destination waypoints
|
|
33
|
-
* @param {?number} [options.elevation_ft] elevation of the waypoint in feet, will override elevation in meter if provided
|
|
34
|
-
* @param {?bigint} [options.uid] unique identifier for the waypoint, will be generated automatically if not provided
|
|
35
|
-
*/
|
|
36
|
-
constructor(
|
|
37
|
-
type: AeroflyWaypointType,
|
|
38
|
-
identifier: string,
|
|
39
|
-
longitude: number,
|
|
40
|
-
latitude: number,
|
|
41
|
-
{
|
|
42
|
-
flyOver: flyOver,
|
|
43
|
-
navaidFrequency,
|
|
44
|
-
altitude,
|
|
45
|
-
altitude_ft,
|
|
46
|
-
elevation,
|
|
47
|
-
elevation_ft,
|
|
48
|
-
uid,
|
|
49
|
-
}?: Partial<AeroflyWaypoint>,
|
|
50
|
-
);
|
|
51
|
-
static createFromCartesian(
|
|
52
|
-
type: AeroflyWaypointType,
|
|
53
|
-
identifier: string,
|
|
54
|
-
position: AeroflyVector3Float,
|
|
55
|
-
options?: Partial<AeroflyWaypoint>,
|
|
56
|
-
): AeroflyWaypoint;
|
|
57
|
-
get altitude_ft(): number | null;
|
|
58
|
-
set altitude_ft(altitude_ft: number | null);
|
|
59
|
-
get elevation_ft(): number | null;
|
|
60
|
-
set elevation_ft(elevation_ft: number | null);
|
|
61
|
-
get position(): AeroflyVector3Float;
|
|
62
|
-
getElement(index?: number): AeroflyConfigurationNode;
|
|
63
|
-
/**
|
|
64
|
-
* @returns {string} to use in Aerofly FS4's `main.mcf`
|
|
65
|
-
*/
|
|
66
|
-
toString(): string;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=AeroflyWaypoint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AeroflyWaypoint.d.ts","sourceRoot":"","sources":["../../src/dto-flight/AeroflyWaypoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAmC,MAAM,qCAAqC,CAAC;AAEhH,MAAM,MAAM,mBAAmB,GACzB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,UAAU,GACV,SAAS,GACT,UAAU,GACV,oBAAoB,GACpB,aAAa,CAAC;AAEpB,qBAAa,eAAe;IAsBb,IAAI,EAAE,mBAAmB;IACzB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,MAAM;IAxBpB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IAExB;;;;;;;;;;;;;OAaG;gBAEQ,IAAI,EAAE,mBAAmB,EACzB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EACvB,EACI,OAAO,EAAE,OAAe,EACxB,eAAsB,EACtB,QAAe,EACf,WAAkB,EAClB,SAAgB,EAChB,YAAmB,EACnB,GAAU,GACb,GAAE,OAAO,CAAC,eAAe,CAAM;IAgBpC,MAAM,CAAC,mBAAmB,CACtB,IAAI,EAAE,mBAAmB,EACzB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,GAAE,OAAO,CAAC,eAAe,CAAM,GACvC,eAAe;IAKlB,IAAI,WAAW,IAAI,MAAM,GAAG,IAAI,CAE/B;IAED,IAAI,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAEzC;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,IAAI,CAEhC;IAED,IAAI,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,EAE3C;IAED,IAAI,QAAQ,IAAI,mBAAmB,CAElC;IAED,UAAU,CAAC,KAAK,GAAE,MAAU,GAAG,wBAAwB;IA4CvD;;OAEG;IACH,QAAQ,IAAI,MAAM;CAGrB"}
|
package/types/index.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type AeroflyVector3Float = [number, number, number];
|
|
2
|
-
export type AeroflyMatrix3Float = [number, number, number, number, number, number, number, number, number];
|
|
3
|
-
export declare class AeroflyBasicTypes {
|
|
4
|
-
static convertLonLatToVector(longitude: number, latitude: number, altitude_meter: number): AeroflyVector3Float;
|
|
5
|
-
static convertVectorToLonLat(coordinates: AeroflyVector3Float): {
|
|
6
|
-
longitude: number;
|
|
7
|
-
latitude: number;
|
|
8
|
-
altitude_meter: number;
|
|
9
|
-
};
|
|
10
|
-
static convertDegreeToMatrix(heading_degree: number): AeroflyMatrix3Float;
|
|
11
|
-
static convertMatrixToDegree(orientation: AeroflyMatrix3Float): number;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=AeroflyBasicTypes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AeroflyBasicTypes.d.ts","sourceRoot":"","sources":["../../src/node/AeroflyBasicTypes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3G,qBAAa,iBAAiB;IAC1B,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,mBAAmB;IAsB9G,MAAM,CAAC,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,GAAG;QAC5D,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;KAC1B;IAkCD,MAAM,CAAC,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,mBAAmB;IASzE,MAAM,CAAC,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,GAAG,MAAM;CAGzE"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type AeroflyVector3Float = [number, number, number];
|
|
2
|
-
export type AeroflyMatrix3Float = [number, number, number, number, number, number, number, number, number];
|
|
3
|
-
export declare class Convert {
|
|
4
|
-
static convertLonLatToVector(longitude: number, latitude: number, altitude_meter: number): AeroflyVector3Float;
|
|
5
|
-
static convertVectorToLonLat(coordinates: AeroflyVector3Float): {
|
|
6
|
-
longitude: number;
|
|
7
|
-
latitude: number;
|
|
8
|
-
altitude_meter: number;
|
|
9
|
-
};
|
|
10
|
-
static convertDegreeToMatrix(heading_degree: number): AeroflyMatrix3Float;
|
|
11
|
-
static convertMatrixToDegree(orientation: AeroflyMatrix3Float): number;
|
|
12
|
-
static convertMeterToFeet(meter: number): number;
|
|
13
|
-
static convertFeetToMeter(feet: number): number;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=Convert%20copy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Convert copy.d.ts","sourceRoot":"","sources":["../../src/node/Convert copy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3G,qBAAa,OAAO;IAChB,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,mBAAmB;IAsB9G,MAAM,CAAC,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,GAAG;QAC5D,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;KAC1B;IAkCD,MAAM,CAAC,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,mBAAmB;IASzE,MAAM,CAAC,qBAAqB,CAAC,WAAW,EAAE,mBAAmB,GAAG,MAAM;IAItE,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIhD,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGlD"}
|