Marker fix

This commit is contained in:
chk
2026-06-14 21:31:30 +02:00
parent dbfc915b66
commit 42742485f1
2 changed files with 22 additions and 1 deletions

View File

@@ -1132,7 +1132,15 @@ async function initAll() {
}
if (IS_HOMING) {
document.getElementById('status').textContent = '→ Homing-Run starten …';
// Robot-Modell mit Defaultposition sofort laden (kein Board-Run nötig)
fetch('/api/robot').then(r => r.ok ? r.json() : null).then(robot => {
if (!robot) return;
_currentRobot = robot;
buildSkeletonFK(robot, robot.defaultPosition ?? {});
document.getElementById('status').textContent = '→ Homing-Run starten …';
}).catch(() => {
document.getElementById('status').textContent = '→ Homing-Run starten …';
});
} else {
initAll();
}

View File

@@ -916,6 +916,19 @@ app.post('/api/robot/remove-marker', async (req, res) => {
}
});
/**
* GET /api/robot
* Gibt robot.json zurück (ohne Board-Run-Daten).
*/
app.get('/api/robot', async (req, res) => {
try {
const robot = JSON.parse(await fsPromises.readFile(ROBOT_JSON, 'utf8'));
return res.json(robot);
} catch (err) {
return res.status(500).json({ error: String(err) });
}
});
/**
* GET /api/robot/board-sets
* Gibt die einzigartigen "set"-Werte aller Marker in links.Board zurück.