Marker fix
This commit is contained in:
@@ -1132,7 +1132,15 @@ async function initAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IS_HOMING) {
|
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 {
|
} else {
|
||||||
initAll();
|
initAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
* GET /api/robot/board-sets
|
||||||
* Gibt die einzigartigen "set"-Werte aller Marker in links.Board zurück.
|
* Gibt die einzigartigen "set"-Werte aller Marker in links.Board zurück.
|
||||||
|
|||||||
Reference in New Issue
Block a user