Feat/device power control - #22
Merged
Merged
Conversation
- power_state / standby() / power_on(wait=True): command the Stirling cooler off and on via REG_DEVICE_POWER_STATE_SETPOINT. Standby keeps the GVCP connection open (it is not a reset), so the camera can be quieted and its power cut during idle periods without unplugging; power_on waits for the detector to re-cool. Idempotent; docstrings note the cooler cycle-life cost. - reset(): issue a firmware reset via REG_DEVICE_RESET (0xD340). The camera reboots and the control channel drops, so the call marks the Camera disconnected; reconnect once it has rebooted. - connect(timeout=...): forward the timeout to wait_until_ready so connecting to a freshly powered, still-cooling camera no longer fails at the fixed 120 s. Closes #15.
# Conflicts: # docs/source/changelog.rst
wait_until_ready() now uses two budgets instead of a fixed 120 s: a short timeout (default 10 s) while the camera is unresponsive/stuck, and a long cooling_timeout (default 600 s) while it reports it is actively cooling or initialising (from TDC status). So a from-cold camera is waited out, while a genuinely absent one fails fast. connect() forwards both; power_on()'s timeout now maps to the cooling budget. Refines the #15 fix.
A firmware reset reboots the camera, which can bring it up on a new link-local IP. The Camera object kept the old address, so reset() then connect() on the same object chased a dead IP and never reconnected. reset() now clears _camera_ip so the next connect() auto-discovers the rebooted camera. Verified on hardware: reset -> reconnect on the same object in ~95s. Hardware reset test hardened to retry-connect through the reboot.
…ontrol # Conflicts: # docs/source/changelog.rst # tests/test_camera.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds software power control and makes connect() ride out a cooling camera.
up without unplugging.
camera (it can come up on a new link-local IP).
unresponsive, long one (~600s) while it's actively cooling.
Closes #15