Convert every remaining °C reference to the temp-unit toggle

The Machine Plan chart's axis ticks and first-crack band caption, the
print worksheet's axis title, and its "Your logged band" reference
column were all still hardcoded in °C. They're now data-driven
(data-tempc / data-band-lo / data-band-hi) and update alongside every
other temperature field when the unit is switched.
This commit is contained in:
2026-07-30 16:57:30 -04:00
parent 306d256832
commit 5a780cefa8
2 changed files with 46 additions and 16 deletions
+14
View File
@@ -638,6 +638,20 @@ function updateTempUnitUI() {
if (printHeader) printHeader.textContent = label;
for (const input of document.querySelectorAll('#temp-unit-toggle input[name="tempUnit"]'))
input.checked = input.value === tempUnit;
// Static reference numbers that live outside the plan (chart axes, band captions, the
// print worksheet's "Your logged band" column) — these are fixed constants, not plan
// data, so they're driven off data-tempc/data-band-lo/hi rather than valueForName().
const conv = (c) => Math.round(tempUnit === "F" ? cToF(c) : c);
for (const el of document.querySelectorAll("[data-tempc]"))
el.textContent = String(conv(Number(el.dataset.tempc)));
for (const el of document.querySelectorAll("[data-band-lo]")) {
const lo = conv(Number(el.dataset.bandLo));
const hi = conv(Number(el.dataset.bandHi));
el.textContent = `${el.dataset.bandPrefix ?? ""}${lo}${hi} ${label}${el.dataset.bandSuffix ?? ""}`;
}
const axisTitle = document.getElementById("print-curve-axis-title");
if (axisTitle) axisTitle.textContent = `BEAN TEMP ${label}`;
}
function setTempUnit(unit) {