--- a/ptz_tracker_modular/postprocess.py +++ b/ptz_tracker_modular/postprocess.py @@ -4577,6 +4577,7 @@ pulse_timing: Tuple[float, float] | None = None, optics_observed_now: float | None = None, stop_trace: list[str] | None = None, + continuation_trace: list[tuple[int, int, float, float, float, float, float]] | None = None, ) -> float: """Break continuous zoom-in into short feedback-controlled steps.""" pulse_until = float(st.get("zoom_step_until", 0.0) or 0.0) @@ -4650,6 +4651,12 @@ ): _finish_zoom_step(st, now, stable_key=stable_key) return _reject_zoom_step("pending_native_floor", stop_trace) + if same_native and continuation_trace is not None: + continuation_trace.append(( + st["ptz_generation"], native, float(zoom_cmd), useful_cmd, pulse_until, + float(st.get("zoom_step_pending_pulse_sec", 0.0) or 0.0), + float(st.get("zoom_step_pending_hard_sec", 0.0) or 0.0), + )) zoom_cmd = useful_cmd physical_started = float(st.get("zoom_step_physical_started_at", 0.0) or 0.0) if physical_started > 0.0: @@ -9232,6 +9239,7 @@ st["zoom_useful_pulse_reason"] = "wait_response_framing" zoom_zero_reason = "response_framing" gate_stop = [] if decision_request else None + continuation_trace = [] if decision_request else None zoom_cmd = _gate_zoom_in_pulse( st, # Keep new-request expiry tied to the frame that authorized @@ -9247,6 +9255,7 @@ pulse_timing=response_timing, optics_observed_now=zoom_gate_now, stop_trace=gate_stop, + continuation_trace=continuation_trace, ) if gate_stop: zoom_zero_reason = gate_stop[-1] @@ -9788,6 +9797,15 @@ cam_idx, prepared_fps, visual_only, max(0., time.time()-now)*1000., st.get('control_updates', 0), st.get('control_visual_updates', 0)) ingest_detection(alarm_eligible) + if continuation_trace: + generation, native, proposed, held, until, pulse_sec, hard_sec = continuation_trace[0] + logger.info( + "[ZOOM CONTINUE] cam=%s frame=%s request=%s gen=%s reason=same_native " + "native=%s proposed=%.12g held=%.12g nominal_until=%.6f " + "pulse=%.3fs hard=%.3fs dispatch_zoom=%.12g", + cam_idx, source_seq, decision_request, generation, native, proposed, + held, until, pulse_sec, hard_sec, zoom_cmd, + ) return # =========================