fix(pm): tune radio to the starting position's frequency on session start

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 <noreply@anthropic.com>
This commit is contained in:
leubeem
2026-06-17 15:24:26 +02:00
parent 64ecb564a9
commit fdc8bbd02d

View File

@@ -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).