simulation

This commit is contained in:
2026-05-06 23:35:31 +02:00
parent 22ec82c895
commit 1bc7e5eb9e
13 changed files with 232 additions and 105 deletions
@@ -23,6 +23,7 @@ class ScannerManager {
this.area_px = options.area_px;
this.frame_count = options.frame_count;
this.scan_state = options.scan_state;
this.sim_bt = options.simulate;
}
init_controls() {
@@ -30,6 +31,7 @@ class ScannerManager {
this.crop.addEventListener('click', (e) => { this._send({ type: 'calibrate', topic: "crop" }); });
this.scan_bt.addEventListener('click', (e) => { this.scan(); });
this.halt_bt.addEventListener('click', (e) => { this.halt(); });
this.sim_bt.addEventListener('click', (e) => { this.simulate(); });
}
registerSocket(socket) {
@@ -58,6 +60,7 @@ class ScannerManager {
init() { this.axes = 0; this.cropping = 1; this._send({ type: 'scanner', topic: "init", }); }
scan() { this._send({ type: 'scanner', topic: "scan", session: this.session.value ? this.session.value: "0" }); }
simulate() { this._send({ type: 'scanner', topic: "simulate", session: this.session.value ? this.session.value: "0" }); }
halt() { this._send({ type: 'calibrate', topic: "halt" }); }
_send(message) { this.socket.send(message); }