Draft
Conversation
…ntralize scanning functionality: - Introduced `Scan` class to manage scanning operations, including path execution, image capture, and metadata handling. - Added `DataUploader` to handle asynchronous upload of scan data to `PlantDB` with queuing and threading support. - Integrated `TimeLapse` class to schedule and coordinate multiple scans with configurable modes and timings. - Implemented `PowerManager` to manage power control for CNC and lights. - Enhanced `grbl.py` and `dummy_cnc.py` to support standby state (`_standby`) for CNC operations. - Updated `pyproject.toml` to include the `gpio` dependency. - Improved `hal.py` to define `ready` and `standby` properties for abstract CNC interfaces.
- Added callback-based `activity_monitor` to `PowerManager` for watching CNC activity and handling timeouts. - Introduced GPIO pin configurations for CNC, lights, and growth lights in `PowerManager`. - Implemented structured power-on/off methods for CNC, lights, and growth lights with GPIO control. - Improved GRBL configuration in `grbl.py` to skip sending unchanged settings for efficiency. - Added `parse_duration` utility to handle and convert duration strings into `datetime.timedelta`. - Updated `TimeLapse` to support dynamic path imports, improved scan scheduling, and metadata initialization. - Refactored `TimeLapse` to better manage scan intervals, fixed timings, and number of scans.
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.
Adding timelapse scan functionality following the plan:
Plant-Imager3: Time-Lapse
Objectives
Here are the various objectives expected for the Plant-Imager to perform a time-lapse reconstruction:
Auxillary objectives:
Plan
1. time-lapse
New Scan and TimeLapse class
A
TimeLapserepresents the process of capturing the subject and consists of one or multipleScan. TheScannereffectuate the scan of the plant through theTimeLapseclass and can only have oneTimeLapseat a time (3.).A
Scanis a 3D capture of the plant at a given time, moving through the path once and captures by the cameras at each point.The current status (no time-lapse) is one
TimeLapsewhich does oneScan.Each
Scanis time-coded for the start time, finish time then recorded.The
Scannerwakes up the machine (5.) before aScanis due and starts it on time (1.).When a
Scanis finished theScannerevaluates if the nextScan(if there is one) is scheduled to take place less than a set ammount of time later. If True the scanner remains on standby. If False, theScannerpowers down theCNCand turn down the lights or switch to growth lights depending on the time and the parameters of theTimeLapse(5.)Current Scan recovery
The current Scan configuration is stored in a JSON file on the disk in a non-temporary folder. On startup, the plantimager-app checks this file to see if a scan was already in progress. If it is the case the scan is loaded back and resumed. (4.)
Interface
When a Scan is configured a new interface is created where its configuration can be reviewed. The information displayed include the path configured and the various time-points planned. The time-points already executed are marked as completed.
On the main interface in the scanner area (bottom left), the current (planned) timestamp is displayed during a capture, otherwise the next timestamp and the time to said timestamp.
A secondary progress-bar is displayed to represent the progression of the number of
ScansWebui
New sections in the configuration toml (2.):
optionaly: create a configuration wizard
2. hardware
The main changes in hardware are done to allow the plant-imager controller (RasPi) to turn on and off various part of the scanner (cnc, lights, growth lights). This is done to allow coordination and power-savings (5.).
The power supply of the different parts must be seperated.
For switching the different parts a two stage design is used. The first stage is a low-voltage relay board that is controlled by the plant-imager controller through the GPIO pins. This first stage then controls the second stage, each relay controlling a high(er)-voltage power relay.
Additionnal change of the led bands possible.