Update camera module with encoding, configuration, and state handling#6
Merged
jlegrand62 merged 6 commits intodevelopfrom Mar 11, 2026
Merged
Update camera module with encoding, configuration, and state handling#6jlegrand62 merged 6 commits intodevelopfrom
jlegrand62 merged 6 commits intodevelopfrom
Conversation
Collaborator
ArthurLuciani2
commented
Mar 10, 2026
- Introduced `encoding` property with support for `jpeg` and `png` formats in `RPCCamera.py` and `cameraserver.py`. - Added `_encoding` and `_config` attributes to store encoding preference and camera parameters. - Implemented `config` property to set camera parameters from Picamera2 Appendix B, with updates applied via `set_controls`. - Modified image capture logic to support `png` encoding using Pillow for conversion and compression. - Extended RPC signals `encodingChanged` and `configChanged` to notify about encoding and configuration changes. - Updated abstract methods in `cameradevice.py` to define `encoding` and `config` management. - Adjusted example code in `cameraserver.py` to include new functionality for encoding and camera configuration.
- Added `encodingChanged` and `configChanged` signals in `PiCameraComm.py` to notify about encoding and configuration updates. - Introduced `encoding` and `config` properties in `PiCameraComm.py` with corresponding setters to update camera settings asynchronously. - Enhanced `_configure_cameras` method in `scanner.py` to set `encoding` and `config` for individual cameras using provided configurations. - Ensured new properties integrate seamlessly with the camera initialization and configuration flow.
…era modules - Introduced a new `WAITING` state in `CameraBridge.py` and `PiCameraComm.py` to represent when the camera is waiting for a response. - Updated `STATE_TO_CLASS` mapping to include the `WAITING` state. - Added `waitingForResponseChanged` signal in `PiCameraComm.py` to notify changes in the waiting state. - Implemented `waiting_for_response` property in `PiCameraComm.py` to manage asynchronous operations and trigger the signal when the waiting state changes. - Modified camera property getters and setters to handle the `WAITING` state during asynchronous operations. - Refactored `CameraBridge` initialization to connect to the `waitingForResponseChanged` signal and update its status accordingly. - Simplified `nextDisplayMode` method in `CameraBridge.py` by removing redundant `return` statements.
- Introduced `PI3_CAMERASERVER_LAG` environment variable to simulate camera processing lag; added handling in `cameraserver.py`. - Added `warningColor` property in `Style.qml` for consistent styling of warning states. - Enhanced `CameraDelegate.qml` to support `waiting` status with appropriate icons and colors. - Updated integration test `test_scan_integration.py` to include lag simulation setup for testing. - Added delay logic to image generation in `cameraserver.py` based on configured lag.
- Updated comments and references in `RPCCamera.py` and `cameraserver.py` to align with Appendix C of the Picamera2 documentation. - Added `encoding` setting and related comments in `config_scan.toml` for `jpeg` and `png` formats. - Introduced `picamera.config` and `picamera2.config` sections in `config_scan.toml` to reflect configurable properties from Appendix C of the Picamera2 doc.
jlegrand62
approved these changes
Mar 11, 2026
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.