PROC: activate approach/missed/vector-to-final; DCLTR-2 declutters airspace
PROC menu actions were empty stubs. Now: procedures.js tags approach legs with
seg ('approach'|'missed' — everything past the runway threshold = missed,
previously dropped); Proc.jsx flags loaded legs appr/missed (preserved by
flightplan.setPlan) and the ACTIVATE APPROACH / MISSED APPROACH / VECTOR-TO-FINAL
items set the active (magenta) leg to the matching segment, with a hint when
nothing is loaded. Missed legs shown dimmed in the preview.
DCLTR-2 now hides the airspace (SUA) overlay, matching the manual (p.56), in
addition to the existing nav-symbol declutter.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ export function setPlan(next) {
|
||||
const wps = Array.isArray(next?.waypoints)
|
||||
? next.waypoints
|
||||
.filter((w) => isFinite(w.lat) && isFinite(w.lon))
|
||||
.map((w) => ({ id: String(w.id || 'WPT'), lat: +w.lat, lon: +w.lon, type: w.type || 'WPT', alt: w.alt ?? null, ...(w.dsgn != null ? { dsgn: !!w.dsgn } : {}), ...(w.appr ? { appr: true } : {}) }))
|
||||
.map((w) => ({ id: String(w.id || 'WPT'), lat: +w.lat, lon: +w.lon, type: w.type || 'WPT', alt: w.alt ?? null, ...(w.dsgn != null ? { dsgn: !!w.dsgn } : {}), ...(w.appr ? { appr: true } : {}), ...(w.missed ? { missed: true } : {}) }))
|
||||
: [];
|
||||
const wantLeg = Number.isFinite(next?.activeLeg) ? next.activeLeg : 1;
|
||||
plan = { name: next?.name || 'ACTIVE', waypoints: wps, activeLeg: Math.max(1, Math.min(wps.length - 1, wantLeg)) || 1 };
|
||||
|
||||
@@ -121,6 +121,10 @@ export function procedureLegs(icao, type, name, trans) {
|
||||
|
||||
const out = [];
|
||||
const seen = new Set();
|
||||
// For approaches, the runway threshold is the Missed-Approach Point: legs after
|
||||
// it are the missed-approach segment. We tag (rather than drop) them so the
|
||||
// FMS can hold them un-sequenced and "Activate Missed Approach" can fly them.
|
||||
let inMissed = false;
|
||||
for (const leg of seq) {
|
||||
if (!leg.fix) continue; // heading/altitude legs w/o a fix
|
||||
if (seen.has(leg.fix)) continue; // de-dupe repeated fixes
|
||||
@@ -133,9 +137,10 @@ export function procedureLegs(icao, type, name, trans) {
|
||||
}
|
||||
if (!pt) continue; // unresolved fix → skip
|
||||
seen.add(leg.fix);
|
||||
out.push({ id: leg.fix, lat: pt.lat, lon: pt.lon, type: isRwy ? 'APT' : 'WPT', alt: leg.alt });
|
||||
// An approach ends at the runway threshold — drop the missed-approach legs.
|
||||
if (TYPE === 'APPCH' && isRwy) break;
|
||||
const wp = { id: leg.fix, lat: pt.lat, lon: pt.lon, type: isRwy ? 'APT' : 'WPT', alt: leg.alt };
|
||||
if (TYPE === 'APPCH') wp.seg = inMissed ? 'missed' : 'approach';
|
||||
out.push(wp);
|
||||
if (TYPE === 'APPCH' && isRwy) inMissed = true; // everything past the runway = missed
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user