feat(race-day): start heats with an EFRA/IFMAR count-down and flying start

Race Day Start now runs a count-down (Go, 30 s - 5 min, default per
event) with calls every minute, 30 s and 10 s, grid call and 9..3
count for grid starts, hold/resume/+1 min/to 30 s/to 10 s/Go now, and
starts the heat by itself when it runs out. The transponder check runs
during the count-down, replacing the separate warm-up.

Adds a flying start mode (horn + clock is running, own clock per car)
as the qualifying default, and the latest personal clock start rules
from EFRA 9.3 / IFMAR 4.2.3 for flying and staggered starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
larssandandClaude Opus 5.5 committed 2026-09-30 21:27:20 +02:00
1 parent 1bc75f8ec1
commit 5bfb67ea02
27 files changed
+884 -334

No files matched your search

+29 -9
View File
@@ -10,7 +10,10 @@ export const RACE_AUDIO_EVENT_DEFINITIONS = Object.freeze([
event("start_tone", "start", "high", false, "effects/start_beep.wav"),
event("false_start", "start", "critical", true, "effects/warning.wav", 1000), event("restart_race", "start", "high"),
event("staggered_release", "start", "normal"),
event("warmup_start", "start", "normal"), event("warmup_1_minute", "start", "normal"), event("warmup_end", "start", "high"),
event("prologue_start", "start", "normal"), event("prologue_minutes", "start", "normal"),
event("prologue_grid", "start", "high"), event("prologue_count", "start", "high"),
event("prologue_hold", "start", "high", true, "effects/warning.wav"), event("prologue_resumed", "start", "normal"),
event("prologue_cancelled", "start", "normal"), event("clock_running", "start", "high"),
event("transponder_pass", "race", "pass", false, "effects/transponder_pass.wav"), event("lap_completed", "race", "pass", false),
event("personal_best", "race", "low", true, "effects/personal_best.wav", 1500),
event("fastest_lap", "race", "normal", true, "effects/fastest_lap_trophy.wav", 1500),
@@ -251,16 +254,33 @@ export function createRaceAudioEngine(options = {}) {
return;
}
emitLightState("GRID", { sessionId: session?.id });
if (settings.startCountdownSeconds >= 60) { trigger("race_1_minute", { interrupt: true }); callbacks.onCountdown?.(60); await wait(30000); if (cancelled()) return false; }
if (settings.startCountdownSeconds >= 30) { trigger("race_30_seconds", { interrupt: true }); callbacks.onCountdown?.(30); await wait(20000); if (cancelled()) return false; }
if (settings.startCountdownSeconds >= 10) {
trigger("race_10_seconds", { interrupt: true });
for (let seconds = 10; seconds > 0; seconds -= 1) { callbacks.onCountdown?.(seconds); await wait(1000); if (cancelled()) return false; }
const flying = session?.startMode === "flying";
// Race Day's prologue replaces this count-down (skipCountdown); when the prologue ran all
// the way down it has also called 10..3, so the intro calls are skipped too (skipIntro).
if (!callbacks.skipCountdown) {
if (settings.startCountdownSeconds >= 60) { trigger("race_1_minute", { interrupt: true }); callbacks.onCountdown?.(60); await wait(30000); if (cancelled()) return false; }
if (settings.startCountdownSeconds >= 30) { trigger("race_30_seconds", { interrupt: true }); callbacks.onCountdown?.(30); await wait(20000); if (cancelled()) return false; }
if (settings.startCountdownSeconds >= 10) {
trigger("race_10_seconds", { interrupt: true });
for (let seconds = 10; seconds > 0; seconds -= 1) { callbacks.onCountdown?.(seconds); await wait(1000); if (cancelled()) return false; }
}
}
// A flying start has no start procedure (EFRA 9.2b): the horn and "clock is running" -
// each car's own clock then starts at its own first crossing.
if (flying) {
emitLightState("GO", { sessionId: session?.id });
await playEffect("start_tone", { force: true });
if (cancelled()) return false;
callbacks.onTone?.();
trigger("clock_running", { interrupt: true, logData: { sessionId: session?.id } });
return true;
}
emitLightState("READY", { sessionId: session?.id });
await trigger("drivers_ready", { interrupt: true }).voiceDone; if (cancelled()) return false;
if (session?.type === "qualification") await trigger("qualifying_start").voiceDone; if (cancelled()) return false;
await trigger("start_sequence").voiceDone; if (cancelled()) return false;
if (!callbacks.skipIntro) {
await trigger("drivers_ready", { interrupt: true }).voiceDone; if (cancelled()) return false;
if (session?.type === "qualification") await trigger("qualifying_start").voiceDone; if (cancelled()) return false;
await trigger("start_sequence").voiceDone; if (cancelled()) return false;
}
if (settings.startLights) {
for (let light = 1; light <= 5; light += 1) {
emitLightState(`LIGHT_${light}`, { sessionId: session?.id, lights: light });