fixed state lock

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

View file

@ -639,7 +639,8 @@ class StitchingScanner:
self._displacement_since_append_x += dx
self._displacement_since_append_y += dy
total_x += dx
self.state.current_x += dx
with self._state_lock:
self.state.current_x += dx
with self._state_lock:
self.state.cumulative_x = self._displacement_since_append_x
@ -717,7 +718,8 @@ class StitchingScanner:
self._displacement_since_append_y += dy
total_y += dy
self.state.current_y += dy
with self._state_lock:
self.state.current_y += dy
with self._state_lock:
self.state.cumulative_y = total_y
@ -742,7 +744,8 @@ 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")
self.state.current_y = 0
with self._state_lock:
self.state.current_y = 0
self.motion.send_command('s')
time.sleep(self.config.settle_time)