LaboratoireMecaniqueLille / crappy

Command and Real-time Acquisition Parallelized in Python
https://crappy.readthedocs.io/en/stable/
GNU General Public License v2.0
78 stars 16 forks source link

Send signal when recording images with Camera Block #107

Closed WeisLeDocto closed 6 months ago

WeisLeDocto commented 6 months ago

Since Crappy 2.0.0, the Camera Block never outputs messages to downstream Blocks. That is because the acquisition, display, and recording of the images are all managed from within the Camera Block. However, as pointed out in #98, there is currently no way for other Blocks to know when an image is saved. This feature could be useful when performing image analysis in post-processing, in case actions need to be performed during the test, to synchronize with the timestamps of the saved images.

With this PR, the Camera Block now sends messages containing the timestamp and metadata of each recorded image. It does so in case all these conditions are true:

The timestamp and metadata are respectively sent over the labels 't(s)' and 'meta'. A new example was added to demonstrate the new behavior, and the documentation was updated.