mirror of
https://github.com/OpenSquawk/OpenSquawk
synced 2026-08-11 12:05:33 +08:00
feat(live-atc): optional auto-tune after a frequency handoff
Tuning is manual, so after a handoff nothing the pilot says goes through until they dial the new frequency in. With the setting on, the radio does it for them three seconds after the handoff was accepted, announcing "OpenSquawk changing frequency to …" first so it is never a surprise. Whether a change is due is decided from state rather than from an event, which is what makes the two must-not-tune cases safe without a special case: a frequency readback that was wrong and one not yet given both leave the session on a state that still expects the frequency already dialled in, so nothing is due. A pending change is dropped if the session ends or the pilot reaches for the radio themselves — theirs wins. Off by default: working the radio is part of what is being practised, so handing it to the aircraft has to be a deliberate choice. The decision itself is a pure function and covered by tests; the announcement goes through the same speech and comm-log path as everything else, so the browser sim and the bridge both see the tuned frequency the way they already do for a manual change. Also folds the two copies of normalizedFrequencyValue into one in shared/, so the auto-tune logic can compare frequencies without a composable import.
This commit is contained in:
@@ -141,6 +141,7 @@
|
||||
v-model:prerec-enabled="prerecEnabled"
|
||||
v-model:prerec-seconds="prerecSeconds"
|
||||
v-model:ai-traffic-enabled="aiTrafficEnabled"
|
||||
v-model:auto-tune-enabled="autoTuneEnabled"
|
||||
@set-theme="setPmTheme"
|
||||
/>
|
||||
|
||||
@@ -316,6 +317,10 @@ const readbackEnabled = ref(false)
|
||||
// Simulated background traffic. Off by default: it costs TTS per lively minute,
|
||||
// so it stays an opt-in the user turns on once they want the busier frequency.
|
||||
const aiTrafficEnabled = ref(false)
|
||||
// Dial the new frequency in automatically after a handoff. Off by default:
|
||||
// working the radio is part of what is being practised, so turning it over to
|
||||
// the aircraft has to be a deliberate choice.
|
||||
const autoTuneEnabled = ref(false)
|
||||
|
||||
// ── Bug Report ───────────────────────────────────────────────────────────────
|
||||
// Owned here rather than by the dialog: the HUD button starts the screenshot
|
||||
@@ -593,6 +598,7 @@ const session = useLiveAtcSession(engine, {
|
||||
config,
|
||||
prefetchAtisAudio,
|
||||
isRecording,
|
||||
autoTuneEnabled,
|
||||
bridgeConnected,
|
||||
bridgePosition,
|
||||
bridgeToken,
|
||||
|
||||
Reference in New Issue
Block a user