class documentation
A thing for creating timelapses.
| Method | __enter__ |
Open database engine when the Thing context manager is opened. |
| Method | __exit__ |
Close database engine when the Thing context manager is closed. |
| Method | __init__ |
Initialise the thing by creating a save queue. |
| Method | capture |
Capture a timelapse. |
| Method | delete |
Delete all the timelapses on the microscope. |
| Method | delete |
Delete the specified timelapse. |
| Method | download |
Return zip of the files captured in the timelapse. |
| Method | get |
Return the bulk gallery actions for timelapse. |
| Method | tab |
Return the UI specification for the tab in the webapp. |
| Class Variable | autofocus |
Z range in steps over which autofocus is performed. |
| Class Variable | autofocus |
Set to True to autofocus prior to each image. |
| Class Variable | dt |
Time interval between captures in seconds. |
| Class Variable | duration |
Total duration of the timelapse in seconds. |
| Class Variable | tab |
Undocumented |
| Property | gallery |
The database engine. |
| Method | _capture |
Capture a single image in the timelapse and update json data. |
| Method | _completion |
Tidy up and add to gallery after the timelapse. |
| Method | _generate |
Generate a TimelapseGalleryInfo object with the current data. |
| Method | _run |
Run the internal main loop of the timelapse. |
| Method | _save |
Loop and save all queued data. Runs in a separate thread. |
| Class Variable | _autofocus |
Undocumented |
| Class Variable | _cam |
Undocumented |
| Class Variable | _class |
Undocumented |
| Class Variable | _show |
Undocumented |
| Instance Variable | _gallery |
Undocumented |
| Instance Variable | _save |
Undocumented |
Inherited from OFMThing:
| Method | create |
Create a RelativeDataPath object with this Thing set as the saving Thing. |
| Property | data |
The data directory for this thing. |
| Property | show |
Whether to show in the Gallery. |
| Instance Variable | _data |
Undocumented |
def __exit__(self, _exc_type:
type[ BaseException], _exc_value: BaseException | None, _traceback: TracebackType | None):
(source)
¶
Close database engine when the Thing context manager is closed.
Capture a timelapse.
A directory will be created with all timelapse images. These will show in the gallery.
| Parameters | |
name:str | None | The name of the timelapse. The date will be appended to the name. If no name is given the name "Timelapse" is used. |
@lt.endpoint( 'delete', 'timelapse/{name}', responses={ 200: { 'description': 'Successfully deleted timelapse'}, 400: { 'description': 'An error occurred while trying to delete timelapse'}})
def delete_timelapse(self, name: str):
(source)
¶
Delete the specified timelapse.
This endpoint allows timelapses to be deleted from disk.
| Parameters | |
name:str | The name of the timelapse to delete |
@lt.endpoint( 'get', 'tab_ui', responses=ui.WEBAPP_TAB_RESPONSE)
def tab_ui(self) -> ui.UIElementList:
(source)
¶
Return the UI specification for the tab in the webapp.
def _capture(self, dir_name:
str, all_captures: list[ TimelapseCaptureData], start_time: float):
(source)
¶
Capture a single image in the timelapse and update json data.
| Parameters | |
dirstr | Directory to write to |
alllist[ | A list of all captures already captured. When the capture is taken, this will be added to. |
startfloat | The time that the timelapse started. |
Tidy up and add to gallery after the timelapse.
This runs even if there is an error. It is run in a finally block so must never error!
| Parameters | |
name:str | The name of the timelapse directory. |
alllist[ | All captures recorded during the run. |
def _generate_gallery_info(self, all_captures:
list[ TimelapseCaptureData], start_time: float) -> TimelapseGalleryInfo:
(source)
¶
Generate a TimelapseGalleryInfo object with the current data.
| Parameters | |
alllist[ | A list of all captures already captured. |
startfloat | The time that the timelapse started. |
| Returns | |
TimelapseGalleryInfo | Undocumented |
Run the internal main loop of the timelapse.
| Parameters | |
name:str | The name of the timelapse directory. |
alllist[ | An empty list to add each capture object to during the run. |