Files
csaxs_bec/tests
menzelandClaude Opus 5 5d6f2374ff
CI for csaxs_bec / test (push) Failing after 25s
fix(canon): make stop() actually stop -- it was a silent no-op on hardware
Verified against the camera on 2026-08-18: `control.cgi?stop=<axis>` does
nothing. The suspicion recorded yesterday was right -- no bare `stop` field
exists on this camera, it expresses actions as `<namespace>.action`, and
because the server answers HTTP 200 for unimplemented commands the failure
was completely silent. stop_all(), the device's on_stop() abort hook and the
motion tool's own cleanup were all quietly doing nothing.

stop() no longer sends a stop command. It halts each axis by **commanding a
move to where that axis currently is**, which is built on the one motion
primitive proven to work on this hardware. Properties worth knowing:

* protocol-independent -- any camera accepting absolute moves stops this way,
  whatever it calls its stop command, so this survives firmware differences;
* positions are sampled **once** for all axes rather than once per axis,
  because this is the panic path and must not be slow;
* the axis decelerates on its normal ramp rather than dead-stopping, and may
  drift slightly past the sampled position before settling. It is a halt, not
  a freeze, and the docstring says so.

_PARAM["stop"] is gone rather than left as a misleading dead entry.

Also adds `motion_check.py --find-stop`, which hunts for a *native*
one-request stop by interrupting a series of moves with each candidate
(`c.1.pan.action=stop`, `c.1.action=stop`, `p.action=stop`, ...). Worth having
because the re-target must read ~32 kB of info.cgi before it can act, and at
100 deg/s that round-trip is real extra travel on the path taken when
something is already wrong. If a candidate halts the axis it becomes the fast
path -- with the re-target kept as the fallback, since a silent no-op is
precisely what the fallback protects against.

Tests: 104. Coverage for re-targeting the sampled position, sampling info.cgi
once for stop_all rather than four times, requiring control privilege,
raising rather than silently skipping an axis it cannot read (the original
bug's failure mode), and the candidate hunt's mechanics.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 08:44:12 +02:00
..