From fdc8bbd02dfde0c27ceec51538ddf5a07f673884 Mon Sep 17 00:00:00 2001 From: leubeem Date: Wed, 17 Jun 2026 15:24:26 +0200 Subject: [PATCH] fix(pm): tune radio to the starting position's frequency on session start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The initial active frequency was only set via a hardcoded EDDF special-case (121.900); every other airport — and any arrival that begins on Center/Approach rather than Delivery — kept a stale/default active frequency. That triggered an immediate "check frequency" on the pilot's very first call (e.g. IFR enroute start: on 121.900 but Center expects 121.800). Now the radio is tuned to expectedFrequencyForState() for the start position when the session begins, so the first call is always on the right frequency and subsequent handoffs change to the correct next-position frequency. Co-Authored-By: Claude Opus 4.8 --- app/pages/pm.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/pages/pm.vue b/app/pages/pm.vue index b8f3864..1d49081 100644 --- a/app/pages/pm.vue +++ b/app/pages/pm.vue @@ -3059,9 +3059,17 @@ const startMonitoring = async (flightPlan: any, scenario: Scenario) => { currentScreen.value = 'monitor' persistSelectedPlan(flightPlan) - if (scenarioIcao === 'EDDF') { - frequencies.value.active = '121.900' - frequencies.value.standby = '121.700' + // Tune the radio to the starting position's actual frequency so the pilot's + // first call is on the right frequency instead of being rejected with a + // "check frequency" (the active freq otherwise carries over from a prior run + // or a hardcoded default, which breaks every non-EDDF start and any arrival + // that begins on Center/Approach rather than Delivery). + const startFreq = expectedFrequencyForState() + if (startFreq) { + if (frequencies.value.active && frequencies.value.active !== startFreq) { + frequencies.value.standby = frequencies.value.active + } + frequencies.value.active = startFreq } // 4. Walk the initial ATC/system states locally (deterministic, no LLM).