--- a/ptz_tracker_modular/ptz_io.py +++ b/ptz_tracker_modular/ptz_io.py @@ -800,2 +800,4 @@ reason: str, + stop_axes: Optional[tuple[int, int, int]] = None, + stop_command: Optional[MoveTuple] = None, ) -> bool: @@ -830,3 +832,4 @@ st["zoom_step_feedback_pulse_sec"] = full_window - st["zoom_step_feedback_native_cmd"] = int(st.get("zoom_step_physical_native_cmd", 0) or 0) + native_cmd = int(st.get("zoom_step_physical_native_cmd", 0) or 0) + st["zoom_step_feedback_native_cmd"] = native_cmd st["zoom_step_feedback_full_window"] = bool(delivered + 1e-6 >= full_window) @@ -946,4 +949,18 @@ st["acquire_zoom_prev_err"] = None + # Capture the ACKed replacement, since PTZ SEND logs only a pre-send attempt. + effective_axes = stop_axes if stop_axes is not None else (None, None, None) + requested_axes = ( + (stop_command.pan_i, stop_command.tilt_i, stop_command.zoom_i) + if stop_command is not None else effective_axes + ) + stop_source = _cmd_source(stop_command) if stop_command is not None else ( + "priority_stop" if stop_axes is not None else "unknown" + ) + stop_generation = _cmd_generation(stop_command) if stop_command is not None else ( + int(st.get("ptz_generation", 0) or 0) if stop_axes is not None else None + ) logger.info( - "[ZOOM DELIVERY] cam=%s request=%s result=%s duration=%.3fs min=%.3fs optics=%s reason=%s zstep=%s", + "[ZOOM DELIVERY] cam=%s request=%s result=%s duration=%.3fs min=%.3fs optics=%s reason=%s zstep=%s " + "kind=%s native=%s stop_source=%s stop_gen=%s stop_seq=%s " + "stop_requested=(%s,%s,%s) stop_effective=(%s,%s,%s)", cam_idx, @@ -964,2 +981,9 @@ int(st.get("zoom_in_pulse_count", 0) or 0), + kind, + native_cmd, + stop_source, + stop_generation, + _cmd_move_seq(stop_command), + *requested_axes, + *effective_axes, ) @@ -1305,2 +1329,3 @@ reason=f"priority_stop:{reason}", + stop_axes=(pan_i, tilt_i, 0), ) @@ -3530,2 +3555,4 @@ reason="physical_stop", + stop_axes=(pan_i, tilt_i, zoom_i), + stop_command=cmd, )