-
Notifications
You must be signed in to change notification settings - Fork 47
feat: Add multi-camera support with LiveController camera switching #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hongquanli
wants to merge
30
commits into
master
Choose a base branch
from
refactor/laser-port-naming
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
e13b323
refactor: Rename laser constants from wavelength-based to port-based …
hongquanli 8cb1b1c
fix: Correct D3/D4 port-to-source-code mapping
hongquanli 340c6b0
docs: Fix misleading comments in firmware constants
hongquanli 9868e1d
docs: Rename "Laser Ports" to "Illumination Control TTL Ports"
hongquanli 3fe45ef
refactor: Rename firmware pin constants to port-based names
hongquanli fc7280d
fix: Address PR review issues - consistent naming and accurate comments
hongquanli c866822
fix: Update YAML config to match corrected D3/D4 port mapping
hongquanli 5cfc3c4
feat(firmware): Add multi-port illumination control
hongquanli b4d5b04
feat(firmware): Add illumination utility headers
hongquanli aa53069
test(firmware): Add comprehensive illumination control tests
hongquanli 1da03a5
feat(python): Add multi-port illumination control
hongquanli fdbca36
test(python): Add comprehensive multi-port illumination tests
hongquanli 554a772
refactor: Use centralized source code mapping in core.py
hongquanli 7f1aa68
fix: Detect firmware version early during Microcontroller init
hongquanli 117c04c
fix: Add port validation and consistent wait behavior
hongquanli 4dd66e2
test: Add round-trip tests for D3/D4 legacy↔new mapping
hongquanli 7e74579
docs: Document illumination_intensity_factor scaling behavior
hongquanli a91c5ec
docs: Add non-blocking notes to Microcontroller multi-port methods
hongquanli 1d4f483
fix: Address PR review comments for multi-port illumination
hongquanli f25d454
docs: Add class docstring explaining legacy vs multi-port illuminatio…
hongquanli 5a7b3de
docs: Add illumination control documentation
hongquanli 769265a
docs: Add port index column to hardware ports table
hongquanli f37b88c
fix: Handle D3/D5 ports in ImageDisplayWindow.display_image()
hongquanli c31ad9c
refactor: Remove dead code ImageArrayDisplayWindow
hongquanli 5273dd9
Revert "refactor: Remove dead code ImageArrayDisplayWindow"
hongquanli d570053
Merge branch 'master' into refactor/laser-port-naming
hongquanli d8c9d6f
Update illumination control documentation
hongquanli c67b382
fix: Add multi-port illumination commands to firmware validator
hongquanli 6b04a55
Merge branch 'master' into refactor/laser-port-naming
hongquanli c0c14c3
feat: Add multi-camera support with LiveController camera switching
hongquanli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /** | ||
| * Illumination port mapping utilities. | ||
| * | ||
| * Pure C++ utility functions for mapping between legacy illumination source | ||
| * codes and port indices. No Arduino/hardware dependencies. | ||
| */ | ||
|
|
||
| #ifndef ILLUMINATION_MAPPING_H | ||
| #define ILLUMINATION_MAPPING_H | ||
|
|
||
| #include "../constants_protocol.h" | ||
|
|
||
| // Number of illumination ports supported | ||
| #define NUM_ILLUMINATION_PORTS 16 | ||
|
|
||
| /** | ||
| * Map legacy illumination source code to port index. | ||
| * | ||
| * Legacy source codes are non-sequential for historical API compatibility: | ||
| * D1 = 11, D2 = 12, D3 = 14, D4 = 13, D5 = 15 | ||
| * | ||
| * Port indices are sequential: 0=D1, 1=D2, 2=D3, 3=D4, 4=D5 | ||
| * | ||
| * @param source Legacy illumination source code (11-15) | ||
| * @return Port index (0-4), or -1 for unknown source codes | ||
| */ | ||
| inline int illumination_source_to_port_index(int source) | ||
| { | ||
| switch (source) | ||
| { | ||
| case ILLUMINATION_D1: return 0; // 11 -> 0 | ||
| case ILLUMINATION_D2: return 1; // 12 -> 1 | ||
| case ILLUMINATION_D3: return 2; // 14 -> 2 (non-sequential!) | ||
| case ILLUMINATION_D4: return 3; // 13 -> 3 (non-sequential!) | ||
| case ILLUMINATION_D5: return 4; // 15 -> 4 | ||
| default: return -1; // Unknown source | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Map port index to legacy illumination source code. | ||
| * | ||
| * @param port_index Port index (0-4) | ||
| * @return Legacy source code (11-15), or -1 for invalid port index | ||
| */ | ||
| inline int port_index_to_illumination_source(int port_index) | ||
| { | ||
| switch (port_index) | ||
| { | ||
| case 0: return ILLUMINATION_D1; // 0 -> 11 | ||
| case 1: return ILLUMINATION_D2; // 1 -> 12 | ||
| case 2: return ILLUMINATION_D3; // 2 -> 14 | ||
| case 3: return ILLUMINATION_D4; // 3 -> 13 | ||
| case 4: return ILLUMINATION_D5; // 4 -> 15 | ||
| default: return -1; // Invalid port | ||
| } | ||
| } | ||
|
|
||
| #endif // ILLUMINATION_MAPPING_H |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firmware legacy
turn_off_illumination()only turns off the currently selected legacy source pin, but with multi-port illumination it’s now possible for other ports to remain ON (e.g., after SET_MULTI_PORT_MASK / TURN_ON_PORT). This conflicts with the Python SimSerial/tests which assume TURN_OFF_ILLUMINATION is a global shutdown. Consider making legacy TURN_OFF_ILLUMINATION callturn_off_all_ports()(or otherwise guarantee all ports are OFF) to avoid leaving illumination outputs active unintentionally and to keep firmware/simulation behavior consistent.