feat(export): lap times in a heat's print/PDF is a remembered choice, off by default (1.89.53)

This commit is contained in:
larssand committed 2026-11-16 23:27:04 +01:00
1 parent afe884d2fe
commit bfffde86b9
8 files changed
+25 -10

No files matched your search

+4
View File
@@ -8,6 +8,10 @@ The application version is maintained in `package.json` and displayed in the adm
No changes recorded yet.
## 1.89.53 - 2026-11-16
- The lap times table in a heat's print and PDF is now a choice: **Lap times in 🖨/PDF** next to Print / PDF / CSV in the race overview (remembered, off by default). Off, a heat prints on one page with the result and the lap chart, as before.
## 1.89.52 - 2026-11-16
- Heat print and PDF: under the lap chart, every lap time in a table – a row per lap, a column per driver in finish order. Each driver's best lap is bold on green and the fastest lap of the heat bold on purple. Only with a single heat, so the full results stay short.
+1 -1
View File
@@ -116,7 +116,7 @@ The menu follows how a race day works: **Start** (Dashboard, Race Day), **Create
- **▶ Run the day automatically** starts each heat's count-down on its own when the schedule says so, and waits (saying why) while a heat runs, the decoder is offline or a heat is not ready. With several classes on one day, every class's heats run in the same order. Finals are never created automatically: when a class's qualifying is done it says "Waiting: check qualifying and press 🏁 Create finals for …" with the class names, so qualifying can be corrected first. Then the autopilot runs the finals. It runs only in the browser where it was turned on. **■ Stop autopilot** to run heats by hand; turning it on again carries on with the next heat not yet run. **⏸ Pause the day** pauses the heat on track (or holds the count-down) and the autopilot until **Resume the day**.
- **Race overview** (under the heat queue): the whole race of the current event in one place - the podium from the A final, then practice, qualifying and finals that open and close, each with the standings and every heat's result (laps, result, best lap, and the car in sponsor heats). **Print**, **PDF** and **CSV** export the whole race with every heat, 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.
- **📈 Lap chart:** every qualifying heat and final has a fold-out lap chart - each driver's place after every lap as a coloured line, place 1 on top, names at their official finish place. Counted from the passings, nothing extra to set up. It is printed and in the PDF of a single heat, and with the finals in the full results.
- **⏱ Lap times:** the print and PDF of a single heat also list every lap, a column per driver in finish order; each driver's best lap is bold on green and the fastest lap of the heat purple.
- **⏱ Lap times:** tick **Lap times in 🖨/PDF** (next to Print / PDF / CSV in the race overview) and the print and PDF of a single heat also list every lap, a column per driver in finish order; each driver's best lap is bold on green and the fastest lap of the heat purple. Off by default, so a heat prints on one page; the lap chart is always there.
- **Speaker panel** (under the start buttons): track call, track clear, red flag, pause, resume, false start and marshal warning. Under **Sound and calls** are quick switches that save at once: mute all, lap time calls, race leader calls, practice hype and the speaker cues.
- **Preflight** checks the decoder, participants, transponders (missing or duplicated), the lap window, the grid and audio. Blockers come first, each with a shortcut to the right setting. The min/max lap time can be edited right there.
- **An automatic SQLite backup** is taken before every start.
+1 -1
View File
@@ -129,7 +129,7 @@ Gränssnittet finns på svenska och engelska.
- **Heat-kön** visar aktuellt, nästa och därpå följande heat i körordning: träning, kval omgång för omgång (Q1 H1, Q1 H2, Q2 H1 …), sedan finaler från lägsta (C, B, A). När ett heat är klart väljer **▶ Nästa** nästa heat med ett klick. Sessionslistorna i Race Setup och på Race Day följer samma ordning, så ett heat som tagits bort och skapats om hamnar på rätt plats; **▲▼** på en session i Race Setup flyttar den tidigare eller senare.
- **Race-översikt** (under heatkön): hela racet för det aktuella eventet på ett ställe – pallen från A-finalen, sedan träning, kval och finaler som kan fällas ut, var och en med ställning och varje heats resultat (varv, resultat, bästa varv, och bilen i sponsorheat). **Skriv ut**, **PDF** och **CSV** exporterar hela racet med alla heat, 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.
- **📈 Varvdiagram:** varje kvalheat och final har ett utfällbart varvdiagram – varje förares placering efter varje varv som en färgad linje, 1:a överst, namnen vid den officiella placeringen. Räknas från passeringarna, inget att ställa in. Det kommer med i utskrift och PDF av ett enskilt heat, och med finalerna i hela resultatet.
- **⏱ Varvtider:** utskrift och PDF av ett enskilt heat listar också alla varv, en kolumn per förare i placeringsordning; förarens bästa varv är fett på grönt och heatets snabbaste varv lila.
- **⏱ Varvtider:** kryssa i **Varvtider i 🖨/PDF** (bredvid Skriv ut / PDF / CSV i race-översikten) så listar utskrift och PDF av ett enskilt heat också alla varv, en kolumn per förare i placeringsordning; förarens bästa varv är fett på grönt och heatets snabbaste varv lila. Av från början, så ett heat ryms på en sida; varvdiagrammet kommer alltid med.
- **Speakerpanel** (under startknapparna): stopp på banan, banan fri, röd flagg, paus, fortsätt, tjuvstart och banvaktsvarning. Under **Ljud och utrop** finns snabbval som sparas direkt: tysta allt, varvtidsutrop, ledarutrop, pepp under träning och speaker-utropen.
- **Förkontrollen** kontrollerar decoder, deltagare, transpondrar (saknade eller dubbletter), varvtidsgränser, grid och ljud. Blockerare visas först, var och en med en genväg till rätt inställning. Min/max-varvtid kan ändras direkt där.
- **En automatisk SQLite-backup** tas före varje start.
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "rc-racecore",
"version": "1.89.52",
"version": "1.89.53",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "rc-racecore",
"version": "1.89.52",
"version": "1.89.53",
"hasInstallScript": true,
"license": "AGPL-3.0-or-later",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "rc-racecore",
"version": "1.89.52",
"version": "1.89.53",
"private": true,
"license": "AGPL-3.0-or-later",
"description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence",
+11 -3
View File
@@ -182,12 +182,13 @@ const buildRaceResultsHtml = (event) => buildRaceResultsHtmlHelper(event, { t, e
// Race overview (Race Day and the results archive): the whole race, with print, PDF and CSV.
const getRaceOverview = (event) => buildRaceOverview(event, { sessions: getSessionsForEvent(event?.id), cars: state.cars, buildLeaderboard, buildPracticeStandings, buildQualifyingStandings, buildFinalStandings, getCompetitorPassings });
const raceOverviewPhaseLabel = (type) => t(`race_overview.phase_${type}`);
const renderRaceOverviewFor = (event) => (event ? renderRaceOverviewPanel(getRaceOverview(event), { t, escapeHtml, formatLap, renderTable, renderRaceStandingsTableView, phaseLabel: raceOverviewPhaseLabel, getStatusLabel }) : "");
const renderRaceOverviewFor = (event) => (event ? renderRaceOverviewPanel(getRaceOverview(event), { t, escapeHtml, formatLap, renderTable, renderRaceStandingsTableView, phaseLabel: raceOverviewPhaseLabel, getStatusLabel, lapTimes: state.settings.heatPrintLapTimes === true }) : "");
const bindRaceOverviewFor = (root, event) => event && bindRaceOverviewPanel(root, getRaceOverview(event), {
print: () => openPrintWindow(`${event.name} - ${t("events.results_overview")}`, buildRaceResultsHtml(event)),
pdf: () => exportRaceResultsPdf(event),
printHeat: (sessionId) => printHeatResult(event, sessionId),
pdfHeat: (sessionId) => exportHeatResultPdf(event, sessionId),
setLapTimes: (on) => { state.settings.heatPrintLapTimes = on; saveState(); },
csv: (overview) => downloadCsvFile(`${sanitizeFilenameSegment(event.name)}_race_overview.csv`, buildRaceOverviewCsvRows(overview, { t, formatLap, phaseLabel: raceOverviewPhaseLabel })),
});
// Every heat's result, for the printed results overview (or just one heat: onlySessionId).
@@ -215,7 +216,7 @@ const renderRaceOverviewHeatsHtml = (event, onlySessionId = "") => getOverviewHe
${renderTable([t("table.pos"), ...(rows.some((row) => row.qual) ? [t("table.qual")] : []), t("table.driver"), ...(rows.some((row) => row.car) ? [t("race_overview.car")] : []), t("table.laps"), t("table.result"), t("table.best_lap")],
rows.map((row) => `<tr><td>${medal(row.pos)}</td>${rows.some((item) => item.qual) ? qualCell(row.qual, escapeHtml) : ""}<td>${rowFlag(row)}${escapeHtml(row.name)}</td>${rows.some((item) => item.car) ? `<td>${escapeHtml(row.car || "-")}</td>` : ""}<td>${row.laps}</td><td>${escapeHtml(row.result)}</td><td>${row.bestLapMs ? escapeHtml(formatLap(row.bestLapMs)) : "-"}</td></tr>`))}
${lapChart && (onlySessionId || phase.type === "final") ? `<div class="print-lap-chart"><h3>${escapeHtml(t("lap_chart.title"))}</h3>${renderLapChartSvg(lapChart, { escapeHtml, title: t("lap_chart.title"), lapLabel: t("table.lap") })}</div>` : ""}
${lapTable && onlySessionId ? renderPrintLapTable(lapTable) : ""}
${lapTable && onlySessionId && state.settings.heatPrintLapTimes ? renderPrintLapTable(lapTable) : ""}
</section>`).join("");
const buildHeatPdfSection = ({ session, rows, phase, lapChart, lapTable }, { withChart = true } = {}) => {
const withCar = rows.some((row) => row.car);
@@ -229,7 +230,7 @@ const buildHeatPdfSection = ({ session, rows, phase, lapChart, lapTable }, { wit
const withLapChart = lapChart && withChart ? { ...section, chart: { title: t("lap_chart.title"), lapLabel: t("table.lap"), ...lapChart } } : section;
// The lap times (a column per driver, best laps marked) only with a single heat's PDF.
const shortLap = (ms) => (ms ? formatLap(ms).replace(/^0:/, "") : "");
return lapTable && withChart
return lapTable && withChart && state.settings.heatPrintLapTimes
? { ...withLapChart, lapTable: { title: t("lap_table.title"), lapLabel: t("table.lap"), names: lapTable.names, rows: lapTable.rows.map((row) => row.map(shortLap)), best: lapTable.best, fastest: lapTable.fastest, legend: t("lap_table.legend") } }
: withLapChart;
};
@@ -2599,6 +2600,8 @@ const TRANSLATIONS = {
"events.practice_seed_method": "Practice-seedning: metod",
"seed.in_a_row": "{n} i rad",
"lap_table.title": "Varvtider",
"race_overview.lap_times": "Varvtider i 🖨/PDF",
"race_overview.lap_times_hint": "Tar med alla varvtider (en kolumn per förare, bästa varv markerade) när ett enskilt heat skrivs ut eller sparas som PDF. Av = en sida med resultat och varvdiagram.",
"lap_table.legend": "Fet = förarens bästa varv · lila = heatets snabbaste varv",
"seed.average": "snitt {n}",
"seed.best_sum": "{n} bästa",
@@ -5051,6 +5054,8 @@ const TRANSLATIONS = {
"events.practice_seed_method": "Practice seeding: method",
"seed.in_a_row": "{n} in a row",
"lap_table.title": "Lap times",
"race_overview.lap_times": "Lap times in 🖨/PDF",
"race_overview.lap_times_hint": "Adds every lap time (a column per driver, best laps marked) when a single heat is printed or saved as PDF. Off = one page with the result and the lap chart.",
"lap_table.legend": "Bold = the driver's best lap · purple = the fastest lap of the heat",
"seed.average": "avg {n}",
"seed.best_sum": "best {n}",
@@ -6956,6 +6961,7 @@ function loadState() {
: [],
obsOverlay: normalizeObsOverlaySettings(parsed.settings?.obsOverlay),
raceAudio: normalizeRaceAudioSettings(parsed.settings?.raceAudio),
heatPrintLapTimes: parsed.settings?.heatPrintLapTimes === true,
},
decoder: {
connected: false,
@@ -7028,6 +7034,8 @@ function loadState() {
logoDataUrl: "",
racePresets: [],
obsOverlay: normalizeObsOverlaySettings(),
// Lap times table in a single heat's print / PDF (off: the print stays one page).
heatPrintLapTimes: false,
raceAudio: normalizeRaceAudioSettings(),
},
decoder: {
+4 -2
View File
@@ -5,7 +5,7 @@ import { renderLapChartSvg } from "./lap_chart_logic.js";
// and every heat. Logic in race_overview_logic.js; print, PDF and CSV come in as deps.
const openPhases = new Set();
export function renderRaceOverviewPanel(overview, { t, escapeHtml, formatLap, renderTable, renderRaceStandingsTableView, phaseLabel, getStatusLabel }) {
export function renderRaceOverviewPanel(overview, { t, escapeHtml, formatLap, renderTable, renderRaceStandingsTableView, phaseLabel, getStatusLabel, ...options }) {
if (!overview || !overview.phases.length) return "";
const { event, phases, podium } = overview;
const heatTable = (rows) => renderTable(
@@ -20,6 +20,7 @@ export function renderRaceOverviewPanel(overview, { t, escapeHtml, formatLap, re
<button class="btn" type="button" data-race-overview="print">${t("race_overview.print")}</button>
<button class="btn" type="button" data-race-overview="pdf">PDF</button>
<button class="btn" type="button" data-race-overview="csv">CSV</button>
<label class="toggle" title="${escapeHtml(t("race_overview.lap_times_hint"))}"><input type="checkbox" data-race-overview-lap-times ${options.lapTimes ? "checked" : ""} /><span>${t("race_overview.lap_times")}</span></label>
</div>
</div>
<div class="panel-body">
@@ -40,7 +41,8 @@ export function renderRaceOverviewPanel(overview, { t, escapeHtml, formatLap, re
</section>`;
}
export function bindRaceOverviewPanel(root, overview, { print, pdf, csv, printHeat = () => {}, pdfHeat = () => {} }) {
export function bindRaceOverviewPanel(root, overview, { print, pdf, csv, printHeat = () => {}, pdfHeat = () => {}, setLapTimes = () => {} }) {
root.querySelector("[data-race-overview-lap-times]")?.addEventListener("change", (change) => setLapTimes(change.currentTarget.checked));
if (!root || !overview) return;
root.querySelectorAll(".race-overview-phase").forEach((node) => node.addEventListener("toggle", () => {
if (node.open) openPhases.add(node.dataset.phase); else openPhases.delete(node.dataset.phase);
+1
View File
@@ -148,6 +148,7 @@ export function applyPersistedStateHelper(persisted, deps) {
audioEnabled: persisted.settings?.audioEnabled !== false,
passingSoundMode: persisted.settings?.passingSoundMode || state.settings.passingSoundMode || "beep",
finishVoiceEnabled: persisted.settings?.finishVoiceEnabled !== false,
heatPrintLapTimes: persisted.settings?.heatPrintLapTimes === true,
startSoundEnabled: persisted.settings?.startSoundEnabled !== false,
finishSoundEnabled: persisted.settings?.finishSoundEnabled !== false,
speechVoiceUri: String(persisted.settings?.speechVoiceUri || state.settings.speechVoiceUri || ""),