mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-01 06:06:05 +08:00
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:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user