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

+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);