diff --git a/CHANGELOG.md b/CHANGELOG.md index 66bb72f..3f6a4a5 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,15 @@ # Changelog +- Added `no_guides` to hide guides - Added `flyOver` property to waypoints - Added `finish` property to missions - Added new cloud layers - Improved handling of Garmin `fpl` files -- Prioritizing waypoints in GeoJson +- Prioritizing waypoints in GeoJSON - Improved GeoJSON output - Added stub to import departure, approach and arrival waypoints - Fixed METAR button disabling -- Improved GeoJson symbols +- Improved GeoJSON symbols - Changed airport links to be more clever - Updated mission links - Changed links for airports, changed styling for waypoints diff --git a/dist/Aerofly/Mission.js b/dist/Aerofly/Mission.js index a37303a..5995cc1 100644 --- a/dist/Aerofly/Mission.js +++ b/dist/Aerofly/Mission.js @@ -54,6 +54,10 @@ export class Mission { * How many minutes does it take to make a full circle */ this.turn_time = 2; + /** + * Hide guides in missio + */ + this.no_guides = false; this.warnings = []; this.title = title; this.description = description; @@ -324,7 +328,6 @@ export class Mission { 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; @@ -814,7 +817,7 @@ ${this.conditions + finish}\ <[list_tmmission_checkpoint][checkpoints][] `; this.checkpoints.forEach((c, i) => { - string += c.toString(i); + string += c.toString(i, this.no_guides); }); string += `\ > @@ -824,7 +827,7 @@ ${this.conditions + finish}\ return string; } hydrate(json) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y; + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z; this._title = (_a = json._title) !== null && _a !== void 0 ? _a : this._title; this._description = (_b = json._description) !== null && _b !== void 0 ? _b : this._description; this.flight_setting = (_c = json.flight_setting) !== null && _c !== void 0 ? _c : this.flight_setting; @@ -849,8 +852,9 @@ ${this.conditions + finish}\ this.cruise_speed = (_v = json.cruise_speed) !== null && _v !== void 0 ? _v : this.cruise_speed; this.cruise_altitude = (_w = json.cruise_altitude) !== null && _w !== void 0 ? _w : this.cruise_altitude; this.turn_time = (_x = json.turn_time) !== null && _x !== void 0 ? _x : this.turn_time; + this.no_guides = (_y = json.no_guides) !== null && _y !== void 0 ? _y : this.no_guides; this.conditions.hydrate(json.conditions); - this.finish = (_y = json.finish) !== null && _y !== void 0 ? _y : this.finish; + this.finish = (_z = json.finish) !== null && _z !== void 0 ? _z : this.finish; this.checkpoints = json.checkpoints.map((c) => { const cx = new MissionCheckpoint(); cx.hydrate(c); diff --git a/dist/Aerofly/MissionCheckpoint.js b/dist/Aerofly/MissionCheckpoint.js index 3f5dd4d..dbde59c 100644 --- a/dist/Aerofly/MissionCheckpoint.js +++ b/dist/Aerofly/MissionCheckpoint.js @@ -192,7 +192,7 @@ export class MissionCheckpoint { const altDifference = this.lon_lat.altitude_m - lastLonLat.altitude_m; // m this.slope = altDifference / this.distance_m; } - toString(index) { + toString(index, noGuides = false) { let flyOver = ""; if (this.type === MissionCheckpoint.TYPE_WAYPOINT) { flyOver = `\ @@ -204,7 +204,7 @@ export class MissionCheckpoint { <[string8u][type][${Quote.tmc(this.type)}]> <[string8u][name][${Quote.tmc(this.name)}]> <[vector2_float64][lon_lat][${this.lon_lat}]> - <[float64][altitude][${this.lon_lat.altitude_m}]> + <[float64][altitude][${noGuides ? -100 : this.lon_lat.altitude_m}]> //<[float64][speed][${this.speed}]> <[float64][direction][${this.direction}]> <[float64][slope][${this.slope}]> // ${this.slope_deg.toFixed(1)} deg diff --git a/dist/Export/GeoJson.js b/dist/Export/GeoJson.js index 7ea2738..8962ae6 100644 --- a/dist/Export/GeoJson.js +++ b/dist/Export/GeoJson.js @@ -216,7 +216,6 @@ export class GeoJson { //lineCoordinates.push(this.getGeoJsonPosition(entry)); } else { - console.log("Fly-over"); // Fly-over // @see https://en.wikipedia.org/wiki/Circular_segment turnDegrees *= 2; diff --git a/dist/Web/App.js b/dist/Web/App.js index 5a67b8b..99bcd69 100644 --- a/dist/Web/App.js +++ b/dist/Web/App.js @@ -30,24 +30,25 @@ export class App { cruise_altitude_ft: document.getElementById("cruise_altitude_ft"), cruise_speed: document.getElementById("cruise_speed"), date: document.getElementById("date"), - downloadButtons: document.getElementById("download-buttons"), description: document.getElementById("description"), - outputWeather: document.getElementById("output-weather"), - outputAirports: document.getElementById("output-airports"), - outputCheckpoints: document.getElementById("output-checkpoints"), - main: document.querySelector("main"), + downloadButtons: document.getElementById("download-buttons"), magneticDeclination: document.getElementById("magnetic_declination"), + main: document.querySelector("main"), makeMetarDept: document.getElementById("make-metar-dept"), makeMetarDest: document.getElementById("make-metar-dest"), metar: document.getElementById("metar"), metarApiKey: document.getElementById("metar-api-key"), + no_guides: document.getElementById("no_guides"), origin_dir: document.getElementById("origin_dir"), + outputAirports: document.getElementById("output-airports"), + outputCheckpoints: document.getElementById("output-checkpoints"), + outputWeather: document.getElementById("output-weather"), thermal_strength: document.getElementById("thermal_strength"), time: document.getElementById("time"), title: document.getElementById("title"), turbulence_strength: document.getElementById("turbulence_strength"), - turn_time: document.getElementById("turn_time"), turn_radius: document.getElementById("turn_radius"), + turn_time: document.getElementById("turn_time"), upload: document.getElementById("upload"), visibility_sm: document.getElementById("visibility_sm"), visibility: document.getElementById("visibility"), @@ -105,7 +106,7 @@ export class App { this.handleEventClickReset(target); break; case "reverse-flightplan": - this.handleEventClickRverseFlightplan(target); + this.handleEventClickReverseFlightplan(target); break; case "toggle-expert-mode": this.handleEventClickToggleExpertMode(target); @@ -211,7 +212,7 @@ export class App { this.syncToForm(); this.showFlightplan(show); } - handleEventClickRverseFlightplan(target) { + handleEventClickReverseFlightplan(target) { this.mission.reverseWaypoints(); this.syncToForm(); this.showFlightplan(App.SHOW_ALL); @@ -338,6 +339,9 @@ export class App { this.mission.conditions.wind_speed = target.valueAsNumber; show |= App.SHOW_ALL; break; + case "no_guides": + this.mission.no_guides = target.checked; + break; default: const prop = target.getAttribute("data-cp-prop"); const id = (target.closest("[data-cp-id]") || target).getAttribute("data-cp-id"); @@ -763,6 +767,7 @@ export class App { this.elements.wind_direction.value = this.mission.conditions.wind_direction.toFixed(); this.elements.wind_gusts.value = this.mission.conditions.wind_gusts.toFixed(); this.elements.wind_speed.value = this.mission.conditions.wind_speed.toFixed(); + this.elements.no_guides.checked = this.mission.no_guides; if (this.mission.magnetic_declination !== undefined) { this.elements.magneticDeclination.valueAsNumber = this.mission.magnetic_declination; } diff --git a/dist/index.html b/dist/index.html index d4c1484..77cd665 100644 --- a/dist/index.html +++ b/dist/index.html @@ -289,6 +289,12 @@

Step 2: Set up flight plan

NM +
+ + + Hide guides +
+ diff --git a/dist/styles.css b/dist/styles.css index ec7ba4e..aa772e9 100644 --- a/dist/styles.css +++ b/dist/styles.css @@ -135,6 +135,10 @@ input.has-output { width: calc(100% - 2.5em); } +input[type="checkbox"] { + width: auto; +} + input.has-output + output { width: 2em; border: none; diff --git a/src/Aerofly/Mission.ts b/src/Aerofly/Mission.ts index cafe976..d2636ab 100644 --- a/src/Aerofly/Mission.ts +++ b/src/Aerofly/Mission.ts @@ -59,6 +59,12 @@ export class Mission { * How many minutes does it take to make a full circle */ turn_time: number = 2; + + /** + * Hide guides in missio + */ + no_guides: boolean = false; + protected _magnetic_declination?: number; static FLIGHT_SETTING_LANDING: MissionFlightSetting = "landing"; @@ -369,7 +375,6 @@ export class Mission { 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; @@ -925,7 +930,7 @@ ${this.conditions + finish}\ <[list_tmmission_checkpoint][checkpoints][] `; this.checkpoints.forEach((c, i) => { - string += c.toString(i); + string += c.toString(i, this.no_guides); }); string += `\ > @@ -960,6 +965,7 @@ ${this.conditions + finish}\ this.cruise_speed = json.cruise_speed ?? this.cruise_speed; this.cruise_altitude = json.cruise_altitude ?? this.cruise_altitude; this.turn_time = json.turn_time ?? this.turn_time; + this.no_guides = json.no_guides ?? this.no_guides; this.conditions.hydrate(json.conditions); diff --git a/src/Aerofly/MissionCheckpoint.ts b/src/Aerofly/MissionCheckpoint.ts index 058de48..92ff546 100644 --- a/src/Aerofly/MissionCheckpoint.ts +++ b/src/Aerofly/MissionCheckpoint.ts @@ -237,7 +237,7 @@ export class MissionCheckpoint { this.slope = altDifference / this.distance_m; } - toString(index: number): string { + toString(index: number, noGuides: boolean = false): string { let flyOver = ""; if (this.type === MissionCheckpoint.TYPE_WAYPOINT) { flyOver = `\ @@ -249,7 +249,7 @@ export class MissionCheckpoint { <[string8u][type][${Quote.tmc(this.type)}]> <[string8u][name][${Quote.tmc(this.name)}]> <[vector2_float64][lon_lat][${this.lon_lat}]> - <[float64][altitude][${this.lon_lat.altitude_m}]> + <[float64][altitude][${noGuides ? -100 : this.lon_lat.altitude_m}]> //<[float64][speed][${this.speed}]> <[float64][direction][${this.direction}]> <[float64][slope][${this.slope}]> // ${this.slope_deg.toFixed(1)} deg diff --git a/src/Export/GeoJson.ts b/src/Export/GeoJson.ts index dba2286..7a19589 100644 --- a/src/Export/GeoJson.ts +++ b/src/Export/GeoJson.ts @@ -254,7 +254,6 @@ export class GeoJson implements GeoJSON.FeatureCollection { //entry = c.lon_lat.getRelativeCoordinates(turnAnticipationDistance, nextCheckpoint.direction); //lineCoordinates.push(this.getGeoJsonPosition(entry)); } else { - console.log("Fly-over"); // Fly-over // @see https://en.wikipedia.org/wiki/Circular_segment turnDegrees *= 2; diff --git a/src/Web/App.ts b/src/Web/App.ts index 6b77599..40356a8 100644 --- a/src/Web/App.ts +++ b/src/Web/App.ts @@ -56,24 +56,25 @@ export class App { cruise_altitude_ft: document.getElementById("cruise_altitude_ft"), cruise_speed: document.getElementById("cruise_speed"), date: document.getElementById("date"), - downloadButtons: document.getElementById("download-buttons"), description: document.getElementById("description"), - outputWeather: document.getElementById("output-weather"), - outputAirports: document.getElementById("output-airports"), - outputCheckpoints: document.getElementById("output-checkpoints"), - main: document.querySelector("main"), + downloadButtons: document.getElementById("download-buttons"), magneticDeclination: document.getElementById("magnetic_declination"), + main: document.querySelector("main"), makeMetarDept: document.getElementById("make-metar-dept"), makeMetarDest: document.getElementById("make-metar-dest"), metar: document.getElementById("metar"), metarApiKey: document.getElementById("metar-api-key"), + no_guides: document.getElementById("no_guides"), origin_dir: document.getElementById("origin_dir"), + outputAirports: document.getElementById("output-airports"), + outputCheckpoints: document.getElementById("output-checkpoints"), + outputWeather: document.getElementById("output-weather"), thermal_strength: document.getElementById("thermal_strength"), time: document.getElementById("time"), title: document.getElementById("title"), turbulence_strength: document.getElementById("turbulence_strength"), - turn_time: document.getElementById("turn_time"), turn_radius: document.getElementById("turn_radius"), + turn_time: document.getElementById("turn_time"), upload: document.getElementById("upload"), visibility_sm: document.getElementById("visibility_sm"), visibility: document.getElementById("visibility"), @@ -152,7 +153,7 @@ export class App { this.handleEventClickReset(target); break; case "reverse-flightplan": - this.handleEventClickRverseFlightplan(target); + this.handleEventClickReverseFlightplan(target); break; case "toggle-expert-mode": this.handleEventClickToggleExpertMode(target); @@ -267,7 +268,7 @@ export class App { this.showFlightplan(show); } - handleEventClickRverseFlightplan(target: HTMLButtonElement) { + handleEventClickReverseFlightplan(target: HTMLButtonElement) { this.mission.reverseWaypoints(); this.syncToForm(); this.showFlightplan(App.SHOW_ALL); @@ -399,6 +400,9 @@ export class App { this.mission.conditions.wind_speed = target.valueAsNumber; show |= App.SHOW_ALL; break; + case "no_guides": + this.mission.no_guides = target.checked; + break; default: const prop = target.getAttribute("data-cp-prop"); const id = (target.closest("[data-cp-id]") || target).getAttribute("data-cp-id"); @@ -861,6 +865,7 @@ export class App { this.elements.wind_direction.value = this.mission.conditions.wind_direction.toFixed(); this.elements.wind_gusts.value = this.mission.conditions.wind_gusts.toFixed(); this.elements.wind_speed.value = this.mission.conditions.wind_speed.toFixed(); + this.elements.no_guides.checked = this.mission.no_guides; if (this.mission.magnetic_declination !== undefined) { this.elements.magneticDeclination.valueAsNumber = this.mission.magnetic_declination; } else {