feat: Add global reset mode for Toupcam and Hamamatsu cameras#504
Open
hongquanli wants to merge 6 commits intomasterfrom
Open
feat: Add global reset mode for Toupcam and Hamamatsu cameras#504hongquanli wants to merge 6 commits intomasterfrom
hongquanli wants to merge 6 commits intomasterfrom
Conversation
Add use_global_reset_mode config option to CameraConfig that enables global shutter mode on supported cameras. For Toupcam, this sets TOUPCAM_OPTION_GLOBAL_RESET_MODE and returns zero strobe delay. For Hamamatsu, this sets DCAM SHUTTER_MODE to GLOBAL with debug logging for strobe time verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add GUI checkbox in Settings > Advanced > Hardware Configuration to toggle global reset mode. The setting is saved to the INI config and loaded on startup, requiring app restart to take effect. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…vers Extract global reset logic into a public method on both camera drivers so it can be called at runtime without requiring app restart. The init code now delegates to this method. Toupcam recalculates strobe timing after toggling; Hamamatsu recalculates exposure time to pick up new SDK-reported strobe values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add default implementations of supports_global_reset_mode() and set_global_reset_mode() to AbstractCamera. Default returns False / logs warning, so cameras that don't support it need no changes. Toupcam checks the GLOBALSHUTTER hardware flag; Hamamatsu queries the SHUTTER_MODE property from the DCAM SDK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
trigger_delay_us is not necessarily 0 in global reset mode (e.g. Hamamatsu has ~3x row time delay). Only strobe_time_us (rolling readout delay) should be zeroed. The trigger_delay_us calculation is kept but may need refinement after checking Toupcam global reset docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
INTERNAL_LINEINTERVAL is a sensor property that doesn't change with shutter mode. In global reset mode, the rolling readout delay (line_interval * height) doesn't apply since all rows expose simultaneously. Only TRIGGERDELAY is used for strobe timing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
use_global_reset_modeconfig option toCameraConfigfor enabling global shutter modesupports_global_reset_mode()andset_global_reset_mode(enabled)onAbstractCamerawith safe defaults (returnsFalse/ logs warning) so all 5+ camera drivers work without changesTOUPCAM_FLAG_GLOBALSHUTTER, setsTOUPCAM_OPTION_GLOBAL_RESET_MODE, zeroes strobe delay) and Hamamatsu (setsDCAM_IDPROP.SHUTTER_MODE, queries SDK for strobe values)[GENERAL] use_global_reset_mode)Test plan
🤖 Generated with Claude Code