x-axis justierung: lines 4

This commit is contained in:
chk
2026-06-10 20:55:58 +02:00
parent 74a3cfada2
commit 88a9125a16
3 changed files with 11 additions and 9 deletions

View File

@@ -801,15 +801,18 @@ async function initRunSelectors() {
runs5.map(r => `<option value="${r}"${r === cur ? ' selected' : ''}>${r}</option>`).join('');
}
if (selC) {
// Default: zweiten neuesten Run vorwählen (falls vorhanden und noch kein Wert gesetzt)
// URL-Param ?compare=none → kein Default-Vergleich (Board-Tab)
// Ohne den Param → zweiten neuesten Run vorwählen (X-Achsen-Tab)
const noCompare = new URLSearchParams(window.location.search).get('compare') === 'none';
const prevCompare = selC.value;
selC.innerHTML = '<option value=""> keiner </option>' +
runs10.map(r => `<option value="${r}">${r}</option>`).join('');
if (prevCompare) {
selC.value = prevCompare; // bisher gewählten behalten
} else if (runs10.length >= 2) {
selC.value = runs10[1]; // zweiter neuester als Default
} else if (!noCompare && runs10.length >= 2) {
selC.value = runs10[1]; // zweiter neuester als Default (X-Achse)
}
// Andernfalls bleibt " keiner " aktiv (Board-Tab mit ?compare=none)
}
} catch { /* offline oder noch keine Runs */ }
}

View File

@@ -140,7 +140,7 @@
</p>
<iframe
id="board-viewer-frame"
src="/boardViewer.html"
src="/boardViewer.html?compare=none"
style="width: 100%; height: 740px; border: 1px solid #334155; border-radius: 6px; background: #0d0f13; display: block;"
title="Board-Viewer"
></iframe>

View File

@@ -45,14 +45,13 @@
Rechts ➡
</button>
</div>
<div style="margin-top:16px;display:flex;align-items:center;gap:14px;flex-wrap:wrap">
<div class="controls" style="margin-top:16px">
<button id="btn-xaxis-adopt" disabled
style="padding:5px 18px;opacity:.45;cursor:not-allowed;border:1px solid #4a9eff;border-radius:3px;background:#1e293b;color:#c8cdd8;font:inherit;font-size:12px"
title="Gemessene X-Achsen-Richtung in robot.json übernehmen folgt">
title="Gemessene X-Achsen-Richtung in robot.json übernehmen erst nach einer Messung aktiv">
X-Achse übernehmen
</button>
<span style="font-size:11px;color:var(--muted)">
Übernimmt die gemessene Richtung (aus Basis- und Vergleichs-Run) als X-Achse in robot.json
Wird aktiv sobald der Viewer eine Bewegungsrichtung berechnet hat.
</span>
</div>
</div>