diff --git a/CHANGELOG.md b/CHANGELOG.md index 47f27a9..bab733c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The application version is maintained in `package.json` and displayed in the adm No changes recorded yet. +## 1.68.0 + +- Open Practice settings: the Open Practice row in Events has "Settings" (it was "Edit", with only name and date) with the lap window (shortest and longest lap) and the ranking: best lap (as before), best N laps in a row (e.g. 3), or best X minutes (most laps inside X minutes, then the shorter time - e.g. 5 min). The timing list, the overlay, Race Day and the results show the chosen result ("3 laps 52.341", "17 laps / 5:00.3"), the best lap stays in its own column. Laps only count as "in a row" within one run: a stop in the pits starts a new one. + ## 1.67.2 - Events → Manage: the easy setup comes first (sponsor setup, or the race steps and tabs), then the list of heats. Adding a heat by hand (type, start, seeding method ...) is folded away under "Add a heat by hand (advanced)", and branding is folded at the bottom. diff --git a/package-lock.json b/package-lock.json index 07bc979..c417d0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rc-racecore", - "version": "1.67.2", + "version": "1.68.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rc-racecore", - "version": "1.67.2", + "version": "1.68.0", "hasInstallScript": true, "dependencies": { "better-sqlite3": "^12.11.1", diff --git a/package.json b/package.json index bae3ec8..3f234bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-racecore", - "version": "1.67.2", + "version": "1.68.0", "private": true, "description": "RC RaceCore live timing and race control with AMMC ingest and SQLite persistence", "engines": { diff --git a/src/app.js b/src/app.js index e1d6d46..788b9b1 100644 --- a/src/app.js +++ b/src/app.js @@ -2848,6 +2848,17 @@ const TRANSLATIONS = { "race_overview.phase_practice": "Träning", "race_overview.phase_qualification": "Kval", "race_overview.phase_final": "Finaler", + "practice_rank.settings": "Inställningar", + "practice_rank.min_lap": "Kortaste varv (s)", + "practice_rank.max_lap": "Längsta varv (s)", + "practice_rank.ranking": "Rankning", + "practice_rank.ranking_hint": "Hur listan sorteras – i tidtagningen, overlayn och resultaten.", + "practice_rank.mode_best_lap": "Bästa varv", + "practice_rank.mode_consecutive": "Bästa N varv i följd", + "practice_rank.mode_window": "Bästa X minuter (flest varv)", + "practice_rank.laps": "N varv i följd", + "practice_rank.minutes": "X minuter", + "practice_rank.laps_n": "{n} varv", "team_setup.title": "Lagrace", "team_setup.intro": "Dela in förarna i lag, välj lagets bil (eller förarnas egna transpondrar) och racets längd. Start, paus och stopp sköts från Race Day.", "team_setup.step_teams": "1. Lag och förare", @@ -4923,6 +4934,17 @@ const TRANSLATIONS = { "race_overview.phase_practice": "Practice", "race_overview.phase_qualification": "Qualifying", "race_overview.phase_final": "Finals", + "practice_rank.settings": "Settings", + "practice_rank.min_lap": "Shortest lap (s)", + "practice_rank.max_lap": "Longest lap (s)", + "practice_rank.ranking": "Ranking", + "practice_rank.ranking_hint": "How the list is sorted – in timing, the overlay and the results.", + "practice_rank.mode_best_lap": "Best lap", + "practice_rank.mode_consecutive": "Best N laps in a row", + "practice_rank.mode_window": "Best X minutes (most laps)", + "practice_rank.laps": "N laps in a row", + "practice_rank.minutes": "X minutes", + "practice_rank.laps_n": "{n} laps", "team_setup.title": "Team race", "team_setup.intro": "Split the drivers into teams, pick each team's car (or the drivers' own transponders) and the race length. Start, pause and stop from Race Day.", "team_setup.step_teams": "1. Teams and drivers", @@ -5413,6 +5435,10 @@ function normalizeSession(session = {}) { startMode: normalizeStartMode(session?.startMode || "mass"), seedBestLapCount: Math.max(0, Number(session?.seedBestLapCount || 0) || 0), seedMethod, + // Open / free practice ranking (timing_logic getPracticeRankMetric): best lap, N in a row, best X min. + practiceRanking: ["consecutive", "window"].includes(String(session?.practiceRanking || "")) ? String(session.practiceRanking) : "best_lap", + practiceRankLaps: Math.max(2, Math.min(50, Math.round(Number(session?.practiceRankLaps) || 3))), + practiceRankMin: Math.max(1, Math.min(120, Math.round(Number(session?.practiceRankMin) || 5))), staggerGapSec: Math.max(0, Number(session?.staggerGapSec || 0) || 0), maxCars: session?.maxCars ? Math.max(1, Number(session.maxCars) || 1) : null, mode: session?.mode === "track" ? "track" : "race", diff --git a/src/event_views.js b/src/event_views.js index e6f97e0..d428262 100644 --- a/src/event_views.js +++ b/src/event_views.js @@ -41,6 +41,23 @@ export function renderEventWorkspaceMarkup(mode, deps) { : `${escapeHtml(t("events.progress_next", { name: next }))}`; return `${status} ${escapeHtml(t("events.progress_count", { done, total }))}`; }; + // Open practice settings (in the edit window): lap window and how the list is ranked. + const renderPracticeSettingsFields = (practiceEvent) => { + const session = state.sessions.find((item) => item.eventId === practiceEvent.id && ["open_practice", "free_practice"].includes(item.type)) || {}; + const ranking = session.practiceRanking || "best_lap"; + const sec = (ms) => (Number(ms) > 0 ? String(Math.round(Number(ms) / 100) / 10) : ""); + return ` + + + + + `; + }; const renderEventRow = ({ event: e, progress }) => `
@@ -52,7 +69,7 @@ export function renderEventWorkspaceMarkup(mode, deps) { ${e.raceConfig?.practiceOnly ? `` : ``} - +
`; @@ -187,7 +204,7 @@ export function renderEventWorkspaceMarkup(mode, deps) { ${ editingEvent.raceConfig?.practiceOnly - ? `` + ? `${renderPracticeSettingsFields(editingEvent)}` : `