feat(race): autopilot waits for qualifying from practice; qualifying start time per class (1.89.51)

This commit is contained in:
larssand committed 2026-11-16 23:01:49 +01:00
1 parent 57e081e291
commit fbc4246a60
12 files changed
+114 -10

No files matched your search

+5
View File
@@ -8,6 +8,11 @@ The application version is maintained in `package.json` and displayed in the adm
No changes recorded yet.
## 1.89.51 - 2026-11-16
- Run the day automatically no longer starts the preliminary qualifiers once practice is done: it waits, like before the finals, with "Waiting: practice is done – press Generate qualifying from practice".
- Manage → Race actions: new "Qualifying starts at" time per class (shown while the qualifying has not started). No qualifier of the class starts before it; with the autopilot on, the count-down starts by itself so the first qualifier goes at that time. That gives a break after seeding to print and put up the heats. Empty = follow the day schedule.
## 1.89.50 - 2026-11-16
- Manage → Format: how qualifying is ranked (most laps in the time, or the best N laps in a row / best / average) is now in the basic view, not only under Advanced, and is called "Qualifying ranked on" instead of "Qualifying best laps / seed method".
+1
View File
@@ -175,6 +175,7 @@ After creation the race is managed in four tabs (Race Setup → Manage):
- presets: short technical track, club race, ÖRC Winter, endurance, and whole race days in federation style - **EFRA 1/10 Off-road**, **EFRA 1/10 Touring / On-road**, **EFRA/SBF 1/8 Nitro** (bump-up, long final), **IFMAR worlds**, **ROAR** (timed qualifying, bump-up, single A main), **Quick club day**, **Rookie / Junior** and **Points race without finals** - or your own saved club presets. A federation preset also sets the practice rounds (with seeding on the best 3 laps in a row), and its description is shown under the choice. The values follow the handbooks in spirit; rules change between editions, so everything stays editable;
- **Race actions** at the bottom of the tab:
- create qualifying from practice (or the entry list); heats are split as evenly as possible, e.g. 9 drivers with max 8 per heat gives 5 + 4;
- after practice, **Generate qualifying from practice** and optionally **Qualifying starts at** (a time) for a break to print and put up the heats; the autopilot waits for both;
- practice is split into heats the same way, and ranked by **Practice seeding** at the top of Format (0 = best single lap; EFRA presets: 3 fastest laps in a row). Lists and overlay show the seeding time, and a better seeding time is called out ("new seeding time, 0.40 quicker"). Open Practice is not affected;
- changing cars per heat or the number of qualifying rounds under Format rebuilds the practice and qualifying heats that have not run yet;
- Manage → Race actions shows the buttons in the order of the day: 1. after practice, **Generate qualifying from practice**; 2. between qualifying rounds (optional), **Regroup qualifying heats not run yet**; 3. after qualifying, **Generate finals from qualifying** and bump-ups. Until qualifying is built from practice, the heat list says the qualifying heats are preliminary; locked manual grids are respected;
+1
View File
@@ -188,6 +188,7 @@ Efter det hanteras racet i fyra flikar (Race Setup → Hantera):
- förval: kort teknisk bana, klubbrace, ÖRC Winter, endurance, och hela racedagar i förbundsstil – **EFRA 1/10 Off-road**, **EFRA 1/10 Touring / On-road**, **EFRA/SBF 1/8 Nitro** (bump-up, lång final), **IFMAR VM**, **ROAR** (tidskval, bump-up, en A-final), **Klubbdag snabb**, **Rookie / Junior** och **Poängrace utan finaler** – eller egna sparade klubbförval. Ett förbundsförval sätter även antal träningar (med seeding på bästa 3 varv i följd), och beskrivningen visas under valet. Värdena följer handböckerna i stil; reglerna ändras mellan årgångar, så allt går att justera;
- **Race actions** längst ner i fliken:
- skapa kval från träningen (eller deltagarlistan); heaten delas så jämnt som möjligt, till exempel 9 förare och max 8 per heat → 5 + 4;
- efter practice: **Skapa kval från practice** och vid behov **Kvalet startar kl** (en tid) för en paus att skriva ut och sätta upp heaten; automatiken väntar in båda;
- träningen (practice) delas i heat på samma sätt och rankas enligt **Practice-seedning** överst i Format (0 = bästa enskilda varv; EFRA-förvalen: 3 snabbaste varv i rad). Listor och overlay visar seedningstiden, och en bättre seedningstid ropas ut ("ny seedningstid, 0,40 snabbare"). Open Practice påverkas inte;
- ändrar du bilar per heat eller antal kvalomgångar under Format byggs de practice- och kvalheat som inte har körts om;
- Hantera → Race actions visar knapparna i dagens ordning: 1. efter practice, **Skapa kval från practice**; 2. mellan kvalomgångarna (valfritt), **Dela om kvalheat som inte körts**; 3. efter kvalet, **Skapa finaler från kval** och bump-up. Tills kvalet är skapat från practice står det i heatlistan att kvalheaten är preliminära; låsta manuella grid respekteras;
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "rc-racecore",
"version": "1.89.50",
"version": "1.89.51",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "rc-racecore",
"version": "1.89.50",
"version": "1.89.51",
"hasInstallScript": true,
"license": "AGPL-3.0-or-later",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "rc-racecore",
"version": "1.89.50",
"version": "1.89.51",
"private": true,
"license": "AGPL-3.0-or-later",
"description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence",
+23 -6
View File
@@ -33,7 +33,7 @@ import { RACE_AUDIO_EVENT_DEFINITIONS, createRaceAudioEngine, normalizeRaceAudio
import { renderRaceFormatField, renderRaceFormatContextCard, getRaceSummaryItems, getRaceSummaryWarnings, renderManageStatusBadge, renderRaceWizardSteps, renderRaceWizardContent, renderRaceStandingsTable } from "./race_setup_ui.js";
import { normalizeRaceTeam as normalizeRaceTeamLogic, normalizeStoredRacePreset as normalizeStoredRacePresetLogic, getRaceFormatPresets as getRaceFormatPresetsLogic, applyRaceFormatPreset as applyRaceFormatPresetLogic, buildRaceFormatConfigFromForm as buildRaceFormatConfigFromFormLogic, normalizeEvent as normalizeEventLogic, normalizeBrandingConfig as normalizeBrandingConfigLogic, resolveEventBranding as resolveEventBrandingLogic, getRaceManageStatuses as getRaceManageStatusesLogic, buildDefaultRaceWizardDraft as buildDefaultRaceWizardDraftLogic, getRaceWizardPreset as getRaceWizardPresetLogic, applyRaceWizardPresetDefaults as applyRaceWizardPresetDefaultsLogic, ensureRaceParticipantsConfigured as ensureRaceParticipantsConfiguredLogic, buildRaceSession as buildRaceSessionLogic, buildOpenPracticeBundle as buildOpenPracticeBundleLogic, buildTrackSession as buildTrackSessionLogic, createSponsorRounds as createSponsorRoundsLogic, buildRaceSessionsFromWizard as buildRaceSessionsFromWizardLogic, getRaceWizardSessionPlan as getRaceWizardSessionPlanLogic, getEventDrivers as getEventDriversLogic, getEventTeams as getEventTeamsLogic, getTeamDriverPool as getTeamDriverPoolLogic, reassignTeamMembers as reassignTeamMembersLogic, findEventTeamForPassing as findEventTeamForPassingLogic, generateQualifyingForRace as generateQualifyingForRaceLogic, rebuildPracticeHeats as rebuildPracticeHeatsLogic, reseedUpcomingQualifying as reseedUpcomingQualifyingLogic, moveDriversIntoQualifyingHeat as moveDriversIntoQualifyingHeatLogic, parseQualifyingHeatName as parseQualifyingHeatNameLogic, generateFinalsForRace as generateFinalsForRaceLogic, getRunGeneratedSessions, applyBumpsForRace as applyBumpsForRaceLogic, orderSessionsForRunning, buildEventSchedule as buildEventScheduleLogic, normalizeHeatOrder, planSeedingGroups } from "./event_race_logic.js";
import { normalizeRaceTeam as normalizeRaceTeamLogic, normalizeStoredRacePreset as normalizeStoredRacePresetLogic, getRaceFormatPresets as getRaceFormatPresetsLogic, applyRaceFormatPreset as applyRaceFormatPresetLogic, buildRaceFormatConfigFromForm as buildRaceFormatConfigFromFormLogic, normalizeEvent as normalizeEventLogic, normalizeBrandingConfig as normalizeBrandingConfigLogic, resolveEventBranding as resolveEventBrandingLogic, getRaceManageStatuses as getRaceManageStatusesLogic, buildDefaultRaceWizardDraft as buildDefaultRaceWizardDraftLogic, getRaceWizardPreset as getRaceWizardPresetLogic, applyRaceWizardPresetDefaults as applyRaceWizardPresetDefaultsLogic, ensureRaceParticipantsConfigured as ensureRaceParticipantsConfiguredLogic, buildRaceSession as buildRaceSessionLogic, buildOpenPracticeBundle as buildOpenPracticeBundleLogic, buildTrackSession as buildTrackSessionLogic, createSponsorRounds as createSponsorRoundsLogic, buildRaceSessionsFromWizard as buildRaceSessionsFromWizardLogic, getRaceWizardSessionPlan as getRaceWizardSessionPlanLogic, getEventDrivers as getEventDriversLogic, getEventTeams as getEventTeamsLogic, getTeamDriverPool as getTeamDriverPoolLogic, reassignTeamMembers as reassignTeamMembersLogic, findEventTeamForPassing as findEventTeamForPassingLogic, generateQualifyingForRace as generateQualifyingForRaceLogic, getQualifyingSeedNotice, rebuildPracticeHeats as rebuildPracticeHeatsLogic, reseedUpcomingQualifying as reseedUpcomingQualifyingLogic, moveDriversIntoQualifyingHeat as moveDriversIntoQualifyingHeatLogic, parseQualifyingHeatName as parseQualifyingHeatNameLogic, generateFinalsForRace as generateFinalsForRaceLogic, getRunGeneratedSessions, applyBumpsForRace as applyBumpsForRaceLogic, orderSessionsForRunning, buildEventSchedule as buildEventScheduleLogic, normalizeHeatOrder, planSeedingGroups } from "./event_race_logic.js";
import { getFinishWait as getFinishWaitLogic, getSessionTypeLabel as getSessionTypeLabelLogic, getStatusLabel as getStatusLabelLogic, isUntimedSession as isUntimedSessionLogic, getActiveSession as getActiveSessionLogic, getLiveSession as getLiveSessionLogic, getSessionTargetMs as getSessionTargetMsLogic, getSessionLapWindow as getSessionLapWindowLogic, isCountedPassing as isCountedPassingLogic, getVisiblePassings as getVisiblePassingsLogic, getPassingValidationLabel as getPassingValidationLabelLogic, getSessionTiming as getSessionTimingLogic, ensureSessionResult as ensureSessionResultLogic, buildLeaderboard as buildLeaderboardLogic, formatLapDelta as formatLapDeltaLogic, formatLeaderboardGap as formatLeaderboardGapLogic, getCompetitorElapsedMs as getCompetitorElapsedMsLogic, getCompetitorPassings as getCompetitorPassingsLogic, getCompetitorSeedMetric as getCompetitorSeedMetricLogic, getSessionEntrants as getSessionEntrantsLogic, buildPracticeStandings as buildPracticeStandingsLogic, getQualifyingPointsValue as getQualifyingPointsValueLogic, isHighPointsTable as isHighPointsTableLogic, compareNumberSet as compareNumberSetLogic, buildQualifyingTieBreakNote as buildQualifyingTieBreakNoteLogic, hasQualifyingPrimaryTie as hasQualifyingPrimaryTieLogic, buildQualifyingStandings as buildQualifyingStandingsLogic, formatTeamActiveMemberLabel as formatTeamActiveMemberLabelLogic, buildTeamRaceStandings as buildTeamRaceStandingsLogic, buildSessionChannelStats as buildSessionChannelStatsLogic, buildTeamStintLog as buildTeamStintLogLogic, getSessionGridEntries as getSessionGridEntriesLogic, getSessionGridOrder as getSessionGridOrderLogic, ensureSessionDriverOrder as ensureSessionDriverOrderLogic, buildFinalStandings as buildFinalStandingsLogic, getTrackRecordMs as getTrackRecordMsLogic } from "./timing_logic.js";
import { normalizeTrackLayouts, getTrackLayoutIdAt, getTrackLayoutLabel, nextTrackLayoutLabel, findRaceSessionBlockingLayoutChange, isPracticeSessionType, isTrackLayoutInUse } from "./track_layouts_logic.js";
@@ -553,6 +553,7 @@ function setAutopilot(date, on) {
function describeAutopilot(action) {
const name = action.row ? `${getDayClassLabel(action.row.session)} ${action.row.session.name}`.trim() : "";
if (action.reason === "finals") return t("day.auto_finals", { classes: action.classes.join(", ") });
if (action.reason === "seed") return t("day.auto_seed", { classes: action.classes.join(", ") || name });
if (action.reason === "until") return t("day.auto_until", { name, time: formatDayClock(action.row.start), min: Math.max(0, Math.ceil((action.launchAt - Date.now()) / 60000)) });
return t(`day.auto_${action.reason}`, { name });
}
@@ -565,7 +566,11 @@ function tickAutopilot() {
const finalsPending = [...new Set(state.events
.filter((event) => event.date === autopilotDate && shouldOfferFinals(state, event.id))
.map((event) => (event.classId ? getClassName(event.classId) : event.name || "")).filter(Boolean))];
let action = getAutopilotAction(rows, { day, busy, finalsPending, prologueMs: (session) => (usesCountDown(session) ? getDefaultPrologueSec(session) * 1000 : 0) });
// Practice done but qualifying still the preliminary heats: wait for "Generate qualifying from practice".
const seedPending = Object.fromEntries(state.events
.filter((event) => event.date === autopilotDate && event.mode === "race" && getQualifyingSeedNotice(event, getSessionsForEvent(event.id)) === "ready")
.map((event) => [event.id, event.classId ? getClassName(event.classId) : event.name || ""]));
let action = getAutopilotAction(rows, { day, busy, finalsPending, seedPending, prologueMs: (session) => (usesCountDown(session) ? getDefaultPrologueSec(session) * 1000 : 0) });
if (action.type === "start") {
const session = action.row.session;
if (!state.decoder?.connected) action = { type: "wait", reason: "decoder", row: action.row };
@@ -2244,6 +2249,11 @@ const TRANSLATIONS = {
"events.race_actions_title": "Race actions",
"events.race_actions_hint": "Knapparna i den ordning de används under dagen.",
"events.actions_after_practice": "1. Efter practice",
"events.qual_start_label": "Kvalet startar kl",
"events.qual_start_save": "Spara tid",
"events.qual_start_clear": "Enligt schemat",
"events.qual_start_hint": "Tomt = kvalet följer dagens schema. Sätt en tid för en paus efter seedningen, så hinner heaten skrivas ut och sättas upp (🖨 och 📺 under Dagens schema). Med Kör dagen automatiskt startar nedräkningen till första kvalet själv vid tiden.",
"events.qual_start_set": "Inget kvalheat i klassen startar före {time}. Med Kör dagen automatiskt startar nedräkningen så att första kvalet går {time}.",
"events.actions_after_practice_hint": "Delar in kvalheaten efter practice-resultatet, så att de som är lika snabba kör ihop, och ersätter de preliminära heaten. Utan practice används deltagarlistan.",
"events.actions_between_quals": "2. Mellan kvalomgångarna (valfritt)",
"events.actions_between_quals_hint": "Efter till exempel Q1: delar om de kvalheat som inte har körts efter kvalrankingen hittills. Körda heat och låsta grid rörs inte.",
@@ -2665,7 +2675,7 @@ const TRANSLATIONS = {
"events.practice_standings": "Practice-ranking",
"events.qualifying_standings": "Kval-ranking",
"events.final_standings": "Final-ranking",
"events.generated_qualifying": "Kvalheat skapade från ranking.",
"events.generated_qualifying": "Kvalheat skapade från ranking. Välj under knappen när kvalet ska starta (Kvalet startar kl), eller låt det följa schemat.",
"events.format_practice_not_rebuilt": "Practice-heaten görs inte om eftersom practice redan har börjat köras – då skulle varv och resultat raderas.",
"events.format_heats_not_rebuilt": "Formatet är sparat, men kvalheaten görs inte om eftersom kvalet redan har börjat köras ({names}) – då skulle varv och resultat raderas. Vill ni ändå göra om dem: tryck först \"Rensa genererade kval\" och sedan \"Skapa kval från practice\".",
"events.finals_generated": "Finaler skapade från ranking.",
@@ -3543,7 +3553,7 @@ const TRANSLATIONS = {
"guide.race_day_8": "8. Redan när du registrerar eller ändrar en förare under Förare varnar systemet om transpondern redan används av en annan förare (t.ex. i fel klass) och namnger vem - ett komplement till förkontrollens kontroll av dubbla transpondrar inom samma heat. Samma person som kör flera klasser med sin egen transponder flaggas aldrig.",
"guide.race_day_9": "9. Kör ni på ett nät där fler har åtkomst (t.ex. arenans WiFi)? Slå på Admin-PIN under Inställningar -> System & backup. Då kräver alla ändringar PIN - resultat, inställningar och uppdatering - medan visning och publika overlay-/träningslänkar fungerar som vanligt. Varje webbläsare loggar in en gång och kommer ihåg det i 30 dagar.",
"guide.race_day_10": "10. Start med nedräkning (som EFRA/IFMAR): välj längd (Go, 30 s, 1, 1:30, 2, 3 eller 5 min - standard per tävling under Race Setup) och tryck Starta. Banan är öppen, speakern ropar ut tiden (varje minut, 30 s, 10 s; vid gridstart även \"bilarna till startplatsen\" vid 30 s och 10, 9 … 3). Pausa medan bilarna ställs upp, +1 min, Till 30 s (omstart av gridet), Till 10 s, Go nu eller Avbryt. När tiden går ut startar heatet av sig själv: gridstart får tystnad efter \"3\", startljus och tutan 1-3 s senare, flygande start ger signalen och \"Klockan går\". Transponderkontrollen visar grön bock för alla som passerat sedan nedräkningen började - saknas någon, byt transponder direkt i panelen eller välj en okänd transponder som passerat. Go nu varnar om någon inte setts.",
"guide.race_day_11": "11. Dagens schema (längst ned på Race Day) visar alla klasser den dagen i en körordning med tider. Ange första start, paus mellan heaten, paus mellan omgångar (träning → kval, omgång → omgång) och paus före finaler (t.ex. lunch, räknas från att kvalet tog slut). ☕ på ett heat lägger in en extra paus före just det. Fasta pauser med klockslag (t.ex. Lunch 12:00–13:00 och Prisutdelning 16:00–16:30, + Lägg till paus för fler): inget heat startar eller körs inom dem, och de syns i utskriften och på förartavlan. ▲▼ ändrar ordningen. Ett heat som startar sent eller pausas flyttar resten av dagen. 🖨 Skriv ut körordning ger en lista med tider och förare att sätta upp på tavlan, och 📺 Förarvy (/public-overlay/schedule) visar förarna nästa heat och vilka som kör. Upprop: när ett heat har 10 minuter kvar (ändras under Upprop) frågar Race Day om du vill ropa upp det – 📢 Ropa ut läser upp heatet och förarna i högtalarna och markerar det Uppropad i förarvyn; Senare frågar igen om 2 minuter. ▶ Kör dagen automatiskt startar varje heats nedräkning själv när det är dags och ropar då upp heaten själv (den här webbläsaren måste vara öppen). Alla klasser samma dag körs i samma ordning: träning, kvalomgång för kvalomgång, sist finalerna. När kvalet är klart i en klass väntar den tills du har tryckt 🏁 Skapa finaler; ■ Stoppa automatiken låter dig köra för hand och sedan slå på den igen; ⏸ Pausa dagen pausar heatet på banan och automatiken tills du fortsätter.",
"guide.race_day_11": "11. Dagens schema (längst ned på Race Day) visar alla klasser den dagen i en körordning med tider. Ange första start, paus mellan heaten, paus mellan omgångar (träning → kval, omgång → omgång) och paus före finaler (t.ex. lunch, räknas från att kvalet tog slut). ☕ på ett heat lägger in en extra paus före just det. Fasta pauser med klockslag (t.ex. Lunch 12:00–13:00 och Prisutdelning 16:00–16:30, + Lägg till paus för fler): inget heat startar eller körs inom dem, och de syns i utskriften och på förartavlan. ▲▼ ändrar ordningen. Ett heat som startar sent eller pausas flyttar resten av dagen. 🖨 Skriv ut körordning ger en lista med tider och förare att sätta upp på tavlan, och 📺 Förarvy (/public-overlay/schedule) visar förarna nästa heat och vilka som kör. Upprop: när ett heat har 10 minuter kvar (ändras under Upprop) frågar Race Day om du vill ropa upp det – 📢 Ropa ut läser upp heatet och förarna i högtalarna och markerar det Uppropad i förarvyn; Senare frågar igen om 2 minuter. ▶ Kör dagen automatiskt startar varje heats nedräkning själv när det är dags och ropar då upp heaten själv (den här webbläsaren måste vara öppen). Alla klasser samma dag körs i samma ordning: träning, kvalomgång för kvalomgång, sist finalerna. När practice är körd i en klass väntar den tills du har tryckt Skapa kval från practice, och har du satt Kvalet startar kl (Hantera → Race actions) startar första kvalet då. När kvalet är klart i en klass väntar den tills du har tryckt 🏁 Skapa finaler; ■ Stoppa automatiken låter dig köra för hand och sedan slå på den igen; ⏸ Pausa dagen pausar heatet på banan och automatiken tills du fortsätter.",
"guide.race_day_12": "12. Race-översikt (under heatkön): hela racet på ett ställe – pallen från A-finalen, sedan träning, kval och finaler med ställning och varje heats resultat (i sponsorheat även bilen). Skriv ut, PDF och CSV exporterar hela racet med finalerna överst (A-finalen först), sedan kval och sist träning. Ett avslutat heat eller en final har egna knappar 🖨 och PDF för bara det heatet, t.ex. till tavlan i depån. Samma översikt finns i Resultatarkivet.",
"guide.dashboard_title": "Schemaavvikelse på Översikt",
"guide.dashboard_1": "Översikt visar nu skillnaden mellan planerad tid och faktisk körtid för alla startade sessioner.",
@@ -3677,6 +3687,7 @@ const TRANSLATIONS = {
"day.auto_paused": "Dagen är pausad",
"day.auto_done": "Alla heat i schemat är körda",
"day.auto_finals": "Väntar: kontrollera kvalet och tryck 🏁 Skapa finaler för {classes}",
"day.auto_seed": "Väntar: practice är körd – tryck Skapa kval från practice för {classes} (Hantera → Race actions)",
"day.auto_decoder": "Väntar: decodern är inte ansluten ({name} står på tur)",
"day.auto_preflight": "Väntar: {name} är inte redo – se kontrollerna",
"day.print_title": "Körordning {date}",
@@ -4688,6 +4699,11 @@ const TRANSLATIONS = {
"events.race_actions_title": "Race actions",
"events.race_actions_hint": "The buttons in the order they are used during the day.",
"events.actions_after_practice": "1. After practice",
"events.qual_start_label": "Qualifying starts at",
"events.qual_start_save": "Save time",
"events.qual_start_clear": "Follow the schedule",
"events.qual_start_hint": "Empty = qualifying follows the day schedule. Set a time for a break after seeding, so the heats can be printed and put up (🖨 and 📺 under Today's schedule). With Run the day automatically the count-down to the first qualifier starts by itself at that time.",
"events.qual_start_set": "No qualifying heat of the class starts before {time}. With Run the day automatically the count-down starts so the first qualifier goes at {time}.",
"events.actions_after_practice_hint": "Splits the qualifying heats by the practice result, so drivers of the same pace race together, and replaces the preliminary heats. Without practice the entry list is used.",
"events.actions_between_quals": "2. Between qualifying rounds (optional)",
"events.actions_between_quals_hint": "After for example Q1: regroups the qualifying heats not run yet by the qualifying ranking so far. Heats that ran and locked grids are left alone.",
@@ -5109,7 +5125,7 @@ const TRANSLATIONS = {
"events.practice_standings": "Practice standings",
"events.qualifying_standings": "Qualifying standings",
"events.final_standings": "Final standings",
"events.generated_qualifying": "Qualifying heats generated from standings.",
"events.generated_qualifying": "Qualifying heats generated from standings. Choose below the button when qualifying starts (Qualifying starts at), or let it follow the schedule.",
"events.format_practice_not_rebuilt": "The practice heats are not made again because practice has already started running - that would delete laps and results.",
"events.format_heats_not_rebuilt": "The format is saved, but the qualifying heats are not made again because qualifying has already started running ({names}) - that would delete laps and results. To redo them anyway, press \"Clear generated qualifying\" first and then \"Generate qualifying from practice\".",
"events.finals_generated": "Finals generated from standings.",
@@ -5987,7 +6003,7 @@ const TRANSLATIONS = {
"guide.race_day_8": "8. Already when you register or edit a driver under Drivers, the system warns if the transponder is already used by a different driver (e.g. in the wrong class) and names who - a complement to the preflight's duplicate-transponder check within a single heat. The same person racing multiple classes on their own transponder is never flagged.",
"guide.race_day_9": "9. Running on a network others can reach (e.g. the venue WiFi)? Turn on the Admin PIN under Settings -> System & backup. Every change then needs the PIN - results, settings and updates - while viewing and public overlay/training links work as usual. Each browser logs in once and is remembered for 30 days.",
"guide.race_day_10": "10. Start with a count-down (as EFRA/IFMAR): pick a length (Go, 30 s, 1, 1:30, 2, 3 or 5 min - the default per event is set in Race Setup) and press Start. The track is open and the announcer calls the time (every minute, 30 s, 10 s; for a grid start also \"cars to the grid\" at 30 s and 10, 9 … 3). Hold while cars are placed on the grid, +1 min, To 30 s (grid restart), To 10 s, Go now or Cancel. When the time runs out the heat starts by itself: a grid start gets quiet after \"3\", the start lights and the horn 1-3 s later, a flying start gets the signal and \"Clock is running\". The transponder check shows a green tick for everyone who has crossed since the count-down began - if someone is missing, change their transponder right in the panel or pick an unknown transponder that crossed. Go now warns if someone wasn't seen.",
"guide.race_day_11": "11. Today's schedule (at the bottom of Race Day) shows every class that day in one running order with times. Set the first start, the break between heats, the break between rounds (practice → qualifying, round → round) and the break before the finals (e.g. lunch, counted from the end of qualifying). ☕ on a heat adds an extra break before just that heat. Fixed breaks at clock times (e.g. Lunch 12:00–13:00 and Prize-giving 16:00–16:30, + Add break for more): no heat starts or runs inside them, and they show in the printout and on the drivers' board. ▲▼ change the order. A heat that starts late or is paused moves the rest of the day. 🖨 Print running order gives a list with times and drivers for the board in the pits, and 📺 Drivers' board (/public-overlay/schedule) shows drivers the next heats and who drives them. Calls: when a heat is 10 minutes away (set under Call), Race Day asks whether to call it – 📢 Call now reads the heat and its drivers over the speakers and marks it Called on the drivers' board; Later asks again in 2 minutes. ▶ Run the day automatically starts each heat's count-down on its own when it is due and then calls the heats itself (keep this browser open). Every class on the day runs in the same order: practice, qualifying round by round, finals last. When a class's qualifying is done it waits until you press 🏁 Create finals; ■ Stop autopilot lets you run heats by hand and turn it back on later; ⏸ Pause the day pauses the heat on track and the autopilot until you resume.",
"guide.race_day_11": "11. Today's schedule (at the bottom of Race Day) shows every class that day in one running order with times. Set the first start, the break between heats, the break between rounds (practice → qualifying, round → round) and the break before the finals (e.g. lunch, counted from the end of qualifying). ☕ on a heat adds an extra break before just that heat. Fixed breaks at clock times (e.g. Lunch 12:00–13:00 and Prize-giving 16:00–16:30, + Add break for more): no heat starts or runs inside them, and they show in the printout and on the drivers' board. ▲▼ change the order. A heat that starts late or is paused moves the rest of the day. 🖨 Print running order gives a list with times and drivers for the board in the pits, and 📺 Drivers' board (/public-overlay/schedule) shows drivers the next heats and who drives them. Calls: when a heat is 10 minutes away (set under Call), Race Day asks whether to call it – 📢 Call now reads the heat and its drivers over the speakers and marks it Called on the drivers' board; Later asks again in 2 minutes. ▶ Run the day automatically starts each heat's count-down on its own when it is due and then calls the heats itself (keep this browser open). Every class on the day runs in the same order: practice, qualifying round by round, finals last. When a class's practice is done it waits until you press Generate qualifying from practice, and if you set Qualifying starts at (Manage → Race actions) the first qualifier goes then. When a class's qualifying is done it waits until you press 🏁 Create finals; ■ Stop autopilot lets you run heats by hand and turn it back on later; ⏸ Pause the day pauses the heat on track and the autopilot until you resume.",
"guide.race_day_12": "12. Race overview (under the heat queue): the whole race in one place - the podium from the A final, then practice, qualifying and finals with the standings and every heat's result (with the car in sponsor heats). Print, PDF and CSV export the whole race with the finals on top (A final first), then qualifying, then practice. A finished heat or final has its own 🖨 and PDF buttons for just that heat, e.g. for the board in the pits. The same overview is in the Results archive.",
"guide.dashboard_title": "Schedule drift on overview",
"guide.dashboard_1": "Overview now shows the difference between planned time and actual elapsed time for all started sessions.",
@@ -6121,6 +6137,7 @@ const TRANSLATIONS = {
"day.auto_paused": "The day is paused",
"day.auto_done": "Every heat in the schedule has been run",
"day.auto_finals": "Waiting: check qualifying and press 🏁 Create finals for {classes}",
"day.auto_seed": "Waiting: practice is done – press Generate qualifying from practice for {classes} (Manage → Race actions)",
"day.auto_decoder": "Waiting: the decoder is not connected ({name} is next)",
"day.auto_preflight": "Waiting: {name} is not ready – see the checks",
"day.print_title": "Running order {date}",
+15 -1
View File
@@ -56,6 +56,10 @@ export function normalizeRaceDay(day = {}) {
marshalRule: ["previous", "next"].includes(day.marshalRule) ? day.marshalRule : "off",
sessionOrder: [...new Set((Array.isArray(day.sessionOrder) ? day.sessionOrder : []).map(String).filter(Boolean))],
autopilot: day.autopilot === true,
// { eventId: timestamp }: a class's qualifying starts no earlier than this (set when the
// qualifying is built from practice, so the heats can be printed and put up first).
qualStartAt: Object.fromEntries(Object.entries(day.qualStartAt && typeof day.qualStartAt === "object" ? day.qualStartAt : {})
.map(([id, at]) => [String(id), Number(at) || 0]).filter(([id, at]) => id && at > 0)),
pausedAt: Number(day.pausedAt) > 0 ? Number(day.pausedAt) : null,
};
}
@@ -168,6 +172,7 @@ export function buildDaySchedule(ordered, day, now = Date.now()) {
let upcomingIndex = 0;
let previous = null;
const fixed = fixedBreakWindows(day);
const qualStartAt = normalizeRaceDay(day || {}).qualStartAt;
// A start that would begin or run into a fixed break moves to its end (again for a later break).
const pastBreaks = (start, durationMs) => {
let breakHit = null;
@@ -196,6 +201,9 @@ export function buildDaySchedule(ordered, day, now = Date.now()) {
const pausedMs = Number(session.totalPausedMs || 0) + (session.status === "paused" && session.pausedAt ? Math.max(0, now - Number(session.pausedAt)) : 0);
end = Math.max(now, actualStart + durationMs + pausedMs);
} else {
// The class's qualifying start time ("Kvalet startar kl"): no qualifier of it before then.
const notBefore = session.type === "qualification" ? Number(qualStartAt[session.eventId] || 0) : 0;
if (notBefore > planned) planned = notBefore;
// A heat that would start or run into the fixed break (lunch) waits until it is over.
const plannedMove = pastBreaks(planned, durationMs);
planned = plannedMove.start;
@@ -229,11 +237,17 @@ export function buildDaySchedule(ordered, day, now = Date.now()) {
// prologueMs(session) = how long before the planned start its count-down begins.
// finalsPending = the classes whose qualifying is done but whose finals are not created yet:
// the autopilot never creates finals (qualifying may need corrections first), it waits for them.
export function getAutopilotAction(rows, { day, now = Date.now(), busy = false, prologueMs = () => 0, finalsPending = [] }) {
// seedPending = { eventId: class label } of classes whose practice is done but whose qualifying is
// still the preliminary one: the autopilot never runs those qualifiers, it waits for
// "Generate qualifying from practice".
export function getAutopilotAction(rows, { day, now = Date.now(), busy = false, prologueMs = () => 0, finalsPending = [], seedPending = {} }) {
if (day?.pausedAt) return { type: "wait", reason: "paused" };
if (busy || rows.some((row) => row.state === "live")) return { type: "wait", reason: "running" };
const row = rows.find((item) => item.state === "upcoming");
if (!row) return finalsPending.length ? { type: "wait", reason: "finals", classes: finalsPending } : { type: "wait", reason: "done" };
if (row.session.type === "qualification" && seedPending[row.session.eventId] !== undefined) {
return { type: "wait", reason: "seed", row, classes: [seedPending[row.session.eventId]].filter(Boolean) };
}
const launchAt = row.start - Math.max(0, Number(prologueMs(row.session) || 0));
return now >= launchAt ? { type: "start", row, launchAt } : { type: "wait", reason: "until", row, launchAt };
}
+18
View File
@@ -842,6 +842,24 @@ export function renderEventManagerView(context) {
}
});
// "Qualifying starts at": stored per class on the day plan (qualStartAt); the day schedule and
// the autopilot hold every qualifier of the class until then.
document.getElementById("qualStartForm")?.addEventListener("submit", (e) => {
e.preventDefault();
const time = String(new FormData(e.currentTarget).get("qualStart") || "").trim();
const at = /^\d{2}:\d{2}$/.test(time) ? new Date(`${event.date}T${time}:00`).getTime() : NaN;
const qualStartAt = { ...(dayPlan?.qualStartAt || {}) };
if (Number.isFinite(at)) qualStartAt[event.id] = at; else delete qualStartAt[event.id];
saveDayPlan({ date: event.date, qualStartAt });
refreshManager();
});
document.getElementById("qualStartClear")?.addEventListener("click", () => {
const qualStartAt = { ...(dayPlan?.qualStartAt || {}) };
delete qualStartAt[event.id];
saveDayPlan({ date: event.date, qualStartAt });
refreshManager();
});
document.getElementById("clearGeneratedQualifying")?.addEventListener("click", () => {
if (!confirmClearRunHeats("qualification")) return;
clearGeneratedQualifying(event.id);
+14
View File
@@ -517,6 +517,20 @@ export function renderEventManagerMarkup(context) {
<h4>${t("events.actions_after_practice")}</h4>
<p class="hint">${t("events.actions_after_practice_hint")}</p>
<div class="actions"><button id="generateQualifying" class="btn btn-primary" type="button">${t("events.generate_qualifying")}</button></div>
${(() => {
// When the class's qualifying starts: a pause after seeding so the heats can be
// printed and put up; the autopilot starts the first count-down by itself then.
const quals = sessions.filter((item) => item.type === "qualification" && item.generated);
if (!dayPlan || !quals.length || quals.some((item) => item.status !== "ready" || item.startedAt)) return "";
const at = Number(dayPlan.qualStartAt?.[event.id] || 0);
const value = at ? new Date(at).toTimeString().slice(0, 5) : "";
return `<form id="qualStartForm" class="qual-start-form">
<label><span>${t("events.qual_start_label")}</span><input type="time" name="qualStart" value="${value}" /></label>
<button class="btn" type="submit">${t("events.qual_start_save")}</button>
${at ? `<button class="btn" type="button" id="qualStartClear">${t("events.qual_start_clear")}</button>` : ""}
</form>
<p class="hint">${at ? t("events.qual_start_set", { time: value }) : t("events.qual_start_hint")}</p>`;
})()}
</div>
<div class="race-action-step">
<h4>${t("events.actions_between_quals")}</h4>
+3
View File
@@ -5156,3 +5156,6 @@ tr.is-selected td { background: color-mix(in srgb, var(--danger) 12%, transparen
.race-action-redo { padding: 0 16px; }
.race-action-redo summary { cursor: pointer; font-weight: 600; }
.tip-banner { border: 1px solid rgba(14, 165, 233, 0.45); background: rgba(14, 165, 233, 0.10); border-radius: 10px; padding: 10px 14px; margin-bottom: 0; }
.qual-start-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 8px; }
.qual-start-form label { display: grid; gap: 4px; font-size: 0.85rem; }
.qual-start-form input[type="time"] { width: auto; }
+10
View File
@@ -109,6 +109,16 @@ export async function runRaceSetupSmoke({ evaluate, navigate, fill, savedState,
const practiceHeats = (await savedState()).sessions.filter((session) => session.eventId === club.id && session.type === "practice");
assert.ok(practiceHeats.every((session) => session.driverIds.length <= 2), `practice heats rebuilt with max 2 cars: ${practiceHeats.map((session) => session.name + ":" + session.driverIds.length)}`);
console.log("PASS format change rebuilds the practice and qualifying heats (cars per heat, rounds)");
// "Qualifying starts at": saved per class on the day plan, and cleared again.
await waitFor(async () => Boolean(await evaluate('Boolean(document.getElementById("qualStartForm"))')), "qualifying start form");
await fill("qualStartForm", { qualStart: "13:30" });
await submit("qualStartForm");
const expectedAt = new Date("2026-09-08T13:30:00").getTime();
await waitFor(async () => ((await savedState()).raceDays || []).some((day) => day.date === "2026-09-08" && day.qualStartAt?.[club.id] === expectedAt), "qualifying start saved");
await waitFor(async () => Boolean(await evaluate('Boolean(document.getElementById("qualStartClear"))')), "clear button");
await click("qualStartClear");
await waitFor(async () => !((await savedState()).raceDays || []).some((day) => day.date === "2026-09-08" && day.qualStartAt?.[club.id]), "qualifying start cleared");
console.log("PASS qualifying start time is saved per class and cleared");
}
await navigate("race_setup", "raceWizardStepForm");
await editEvent(race, "race_setup", "raceWizardStepForm");
+21
View File
@@ -222,3 +222,24 @@ test("marshals: the drivers of the heat before (or after), never someone driving
assert.deepEqual(names(assignMarshals(rows, "off", of)), ["", "", ""]);
assert.equal(normalizeRaceDays([{ date: "2026-11-08", marshalRule: "bogus" }])[0].marshalRule, "off");
});
test("a class's qualifying start time holds its qualifiers until then; practice and other days are not moved", () => {
const now = new Date("2026-11-08T10:00:00").getTime();
const qualAt = new Date("2026-11-08T11:30:00").getTime();
const day = { date: "2026-11-08", gapMin: 2, qualStartAt: { e2: qualAt } };
const daySessions = [s("p", "e2", "practice", "practice 1"), s("q1", "e2", "qualification", "Q1 H1"), s("q2", "e2", "qualification", "Q1 H2")];
const rows = buildDaySchedule(daySessions, day, now);
assert.equal(rows[0].start, now, "practice now");
assert.equal(rows[1].start, qualAt, "first qualifier at the chosen time");
assert.equal(rows[2].start, qualAt + 5 * 60000 + 2 * 60000, "the next one after it as usual");
assert.equal(normalizeRaceDays([day])[0].qualStartAt.e2, qualAt);
});
test("autopilot waits for 'Generate qualifying from practice' when the next heat is a preliminary qualifier", () => {
const rows = [{ state: "done", session: s("p", "e2", "practice", "practice 1") }, { state: "upcoming", start: 0, session: s("q1", "e2", "qualification", "Q1 H1") }];
const waiting = getAutopilotAction(rows, { day: {}, now: 10, seedPending: { e2: "2WD" } });
assert.equal(waiting.type, "wait");
assert.equal(waiting.reason, "seed");
assert.deepEqual(waiting.classes, ["2WD"]);
assert.equal(getAutopilotAction(rows, { day: {}, now: 10, seedPending: {} }).type, "start", "built from practice: starts as before");
});