Skip to content

Commit

Permalink
Added stub to import departure, approcah and arrival waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
fboes committed May 4, 2024
1 parent 3b039b0 commit 48b5c99
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dist/Aerofly/Mission.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,18 +303,28 @@ export class Mission {
break;
}
this.conditions.fromMainMcf(mainMcf);
let lastPosition = null;
this.checkpoints = mainMcf.navigation.Route.Ways.filter((w) => {
// Please not that procedure waypoints cannot be restored as of now
return [
MissionCheckpoint.TYPE_ORIGIN,
MissionCheckpoint.TYPE_DEPARTURE_RUNWAY,
//MissionCheckpoint.TYPE_DEPARTURE,
MissionCheckpoint.TYPE_WAYPOINT,
//MissionCheckpoint.TYPE_ARRIVAL,
//MissionCheckpoint.TYPE_APPROACH,
MissionCheckpoint.TYPE_DESTINATION_RUNWAY,
MissionCheckpoint.TYPE_DESTINATION,
].includes(w.type);
// Filtering departure, approach and arrival - these points have no coordinates
}).map((w) => {
let cp = new MissionCheckpoint();
cp.fromMainMcf(w);
if (lastPosition && (isNaN(cp.lon_lat.lon) || isNaN(cp.lon_lat.lat))) {
cp.lon_lat = lastPosition.getRelativeCoordinates(3, 45);
console.log(cp.lon_lat);
}
lastPosition = cp.lon_lat;
return cp;
});
const flight_category = this.conditions.getFlightCategory(this.origin_country !== "US");
Expand Down
3 changes: 3 additions & 0 deletions dist/Aerofly/MissionCheckpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ export class MissionCheckpoint {
}
MissionCheckpoint.TYPE_ORIGIN = "origin";
MissionCheckpoint.TYPE_DEPARTURE_RUNWAY = "departure_runway";
MissionCheckpoint.TYPE_DEPARTURE = "departure";
MissionCheckpoint.TYPE_WAYPOINT = "waypoint";
MissionCheckpoint.TYPE_ARRIVAL = "arrival";
MissionCheckpoint.TYPE_APPROACH = "approach";
MissionCheckpoint.TYPE_DESTINATION_RUNWAY = "destination_runway";
MissionCheckpoint.TYPE_DESTINATION = "destination";
MissionCheckpoint.TYPE_VOR = "vor";
Expand Down
13 changes: 13 additions & 0 deletions src/Aerofly/Mission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,18 +346,31 @@ export class Mission {
break;
}
this.conditions.fromMainMcf(mainMcf);

let lastPosition: LonLat | null = null;
this.checkpoints = mainMcf.navigation.Route.Ways.filter((w) => {
// Please not that procedure waypoints cannot be restored as of now
return [
MissionCheckpoint.TYPE_ORIGIN,
MissionCheckpoint.TYPE_DEPARTURE_RUNWAY,
//MissionCheckpoint.TYPE_DEPARTURE,
MissionCheckpoint.TYPE_WAYPOINT,
//MissionCheckpoint.TYPE_ARRIVAL,
//MissionCheckpoint.TYPE_APPROACH,
MissionCheckpoint.TYPE_DESTINATION_RUNWAY,
MissionCheckpoint.TYPE_DESTINATION,
].includes(w.type);
// Filtering departure, approach and arrival - these points have no coordinates
}).map((w) => {
let cp = new MissionCheckpoint();
cp.fromMainMcf(w);

if (lastPosition && (isNaN(cp.lon_lat.lon) || isNaN(cp.lon_lat.lat))) {
cp.lon_lat = lastPosition.getRelativeCoordinates(3, 45);
console.log(cp.lon_lat);
}

lastPosition = cp.lon_lat;
return cp;
});

Expand Down
3 changes: 3 additions & 0 deletions src/Aerofly/MissionCheckpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export class MissionCheckpoint {

static TYPE_ORIGIN: MissionCheckpointType = "origin";
static TYPE_DEPARTURE_RUNWAY: MissionCheckpointType = "departure_runway";
static TYPE_DEPARTURE: MissionCheckpointType = "departure";
static TYPE_WAYPOINT: MissionCheckpointType = "waypoint";
static TYPE_ARRIVAL: MissionCheckpointType = "arrival";
static TYPE_APPROACH: MissionCheckpointType = "approach";
static TYPE_DESTINATION_RUNWAY: MissionCheckpointType = "destination_runway";
static TYPE_DESTINATION: MissionCheckpointType = "destination";
static TYPE_VOR: MissionCheckpointTypeExtended = "vor";
Expand Down

0 comments on commit 48b5c99

Please sign in to comment.