Просмотр исходного кода

Remove timeout from motion thread 'ok' response waiting

The motion thread now waits indefinitely for hardware 'ok' response,
only aborting on stop_requested. Use force stop if hardware becomes
unresponsive. Exception-based retries still in place for connection errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 3 недель назад
Родитель
Сommit
a6cae17e10
1 измененных файлов с 2 добавлено и 8 удалено
  1. 2 8
      modules/core/pattern_manager.py

+ 2 - 8
modules/core/pattern_manager.py

@@ -392,10 +392,10 @@ class MotionControlThread:
         state.machine_x = new_x_abs
         state.machine_y = new_y_abs
 
-    def _send_grbl_coordinates_sync(self, x: float, y: float, speed: int = 600, timeout: int = 2, home: bool = False):
+    def _send_grbl_coordinates_sync(self, x: float, y: float, speed: int = 600, home: bool = False):
         """Synchronous version of send_grbl_coordinates for motion thread.
 
-        Retries indefinitely until success or stop_requested is set.
+        Waits indefinitely for 'ok' response until success or stop_requested is set.
         Use force stop to abort if the hardware is unresponsive.
         """
         logger.debug(f"Motion thread sending G-code: X{x} Y{y} at F{speed}")
@@ -411,7 +411,6 @@ class MotionControlThread:
                 state.conn.send(gcode + "\n")
                 logger.debug(f"Motion thread sent command: {gcode}")
 
-                start_time = time.time()
                 while True:
                     # Check for stop request while waiting for response
                     if state.stop_requested:
@@ -424,11 +423,6 @@ class MotionControlThread:
                         logger.debug("Motion thread: Command execution confirmed.")
                         return True
 
-                    # Timeout waiting for response
-                    if time.time() - start_time > timeout:
-                        logger.warning("Motion thread: Timeout waiting for 'ok' response")
-                        break
-
             except Exception as e:
                 error_str = str(e)
                 logger.warning(f"Motion thread error sending command: {error_str}")