fixed state lock

This commit is contained in:
2ManyProjects 2026-01-10 01:27:32 -06:00
parent 96422fe0d2
commit 2108ce78fc

View file

@ -639,6 +639,7 @@ class StitchingScanner:
self._displacement_since_append_x += dx
self._displacement_since_append_y += dy
total_x += dx
with self._state_lock:
self.state.current_x += dx
with self._state_lock:
@ -717,6 +718,7 @@ class StitchingScanner:
self._displacement_since_append_y += dy
total_y += dy
with self._state_lock:
self.state.current_y += dy
with self._state_lock:
@ -742,6 +744,7 @@ class StitchingScanner:
# Done when we've moved enough
if abs(total_y) >= target_displacement:
self.log(f"Row transition complete: {abs(total_y):.1f}px")
with self._state_lock:
self.state.current_y = 0
self.motion.send_command('s')
time.sleep(self.config.settle_time)