UI verbessern 2
This commit is contained in:
@@ -890,14 +890,20 @@ function computeAndShowYAxis() {
|
||||
|
||||
// ── Daten laden ───────────────────────────────────────────────────────────────
|
||||
|
||||
/** Haupt-Run laden. Im Homing-Mode: immer neuester Homing-Run, kein Dropdown. */
|
||||
async function loadData() {
|
||||
/**
|
||||
* Haupt-Run laden.
|
||||
* Im Homing-Mode: lädt spezifischen Run per runDir-Parameter (kein Dropdown).
|
||||
* @param {string|null} specificRunDir Timestamp des Runs (nur im Homing-Mode genutzt)
|
||||
*/
|
||||
async function loadData(specificRunDir = null) {
|
||||
const statusEl = document.getElementById('status');
|
||||
statusEl.textContent = 'Laden …';
|
||||
|
||||
let url;
|
||||
if (IS_HOMING) {
|
||||
url = '/api/board/latest?from=homing';
|
||||
url = specificRunDir
|
||||
? `/api/board/latest?from=homing&run=${encodeURIComponent(specificRunDir)}`
|
||||
: '/api/board/latest?from=homing';
|
||||
} else {
|
||||
const selRun = document.getElementById('sel-run-primary')?.value ?? '';
|
||||
url = selRun
|
||||
@@ -1071,7 +1077,11 @@ async function initAll() {
|
||||
await loadPositionC(); // setzt _positionCFremdMarkers + berechnet Y-Achse
|
||||
}
|
||||
|
||||
initAll();
|
||||
if (IS_HOMING) {
|
||||
document.getElementById('status').textContent = '→ Homing-Run starten …';
|
||||
} else {
|
||||
initAll();
|
||||
}
|
||||
document.getElementById('btnReload').addEventListener('click', initAll);
|
||||
document.getElementById('sel-run-primary')?.addEventListener('change', async () => {
|
||||
await loadData();
|
||||
@@ -1084,6 +1094,9 @@ document.getElementById('sel-run-compare')?.addEventListener('change', async ()
|
||||
document.getElementById('sel-run-c')?.addEventListener('change', loadPositionC);
|
||||
window.addEventListener('message', async (e) => {
|
||||
if (e.data?.type === 'reload') await initAll();
|
||||
if (e.data?.type === 'load-homing-run' && IS_HOMING) {
|
||||
await loadData(e.data.runDir);
|
||||
}
|
||||
if (e.data?.type === 'homing-state' && IS_HOMING) {
|
||||
_homingAngles = e.data.state;
|
||||
if (_currentRobot) buildSkeletonFK(_currentRobot, _homingAngles);
|
||||
|
||||
Reference in New Issue
Block a user