PFD CDI softkey cycles nav source; demo reflects dataref writes

The CDI softkey was in the PFD root row but had no handler — it never cycled the
HSI/CDI source (GPS↔VLOC1↔VLOC2). Wire it to write cdiSrc
(HSI_source_select_pilot, now writable), cycling GPS→NAV1→NAV2.

Also fix a latent demo bug: the 'needs a live sim socket' guard sat above the
setDataref/command handlers, so in DEMO (no sim socket) every dataref write
(transponder code, baro, AP bugs, CDI) was silently dropped. Reflect writes
locally before that guard so cockpit controls respond without a sim.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 20:34:20 +02:00
parent cd7197f06e
commit fb6f0182cc
3 changed files with 18 additions and 2 deletions
+4
View File
@@ -93,6 +93,10 @@ export default function Bezel({ variant = 'pfd', xp, svt3d, onToggleSvt, inset,
else if (label === 'NRST') onToggleNrst && onToggleNrst();
else if (label === 'TMR/REF') onToggleTmr && onToggleTmr();
else if (label === 'DME') onToggleDme && onToggleDme();
else if (label === 'CDI' && xp) { // cycle the HSI/CDI nav source: GPS → NAV1 → NAV2
const cur = Math.round(num(xp.values?.cdiSrc, 2));
xp.setDataref('cdiSrc', (cur + 1) % 3); // 2→0→1→2 = GPS→NAV1(VLOC1)→NAV2(VLOC2)
}
else if (label === 'OBS') onObs && onObs(); // suspend / OBS mode (also fires the sim softkey above)
else if (label === 'CAUTION') onToggleAlerts && onToggleAlerts();
else if (label === 'XPDR') setPage('xpdr');