WasatchPhotonics / ENLIGHTEN

Open-source spectroscopy application for controlling and taking measurements from Wasatch Photonics spectrometers.
https://wasatchphotonics.com/product-category/software/
MIT License
3 stars 6 forks source link

Kiosk features #290

Closed mzieg closed 11 months ago

mzieg commented 11 months ago

Adding features to simplify deployment in "kiosk" mode with undesired features disabled via plugin.

mzieg commented 11 months ago

I hadn't thought some of this through...we may need the ability for auto-load plugins to wait until a spectrometer has connected, if the plugin wants to do anything "per-spectrometer" during get_configuration (i.e. during connection). Kludging around this in the plugin for now...

samiebee43 commented 11 months ago

we may need the ability for auto-load plugins to wait until a spectrometer has connected, if the plugin wants to do anything "per-spectrometer" during get_configuration

This would be a good opportunity to smarten up our plugin event functions.

What we have:

At some point we had a different init-time event, connect that I wanted to remove. I'm pretty sure that event corresponded to the Connect checkbox in Enlighten. Part of why I wanted to remove it was to reduce the need for multiple checkboxes for plugins, and partially was because Connect was changed to reload plugins, which should happen opaquely to the internal program. Overall it was confusing to have two very similar event functions.

get_configuration and process_request is similar to a synchronous event-driven model used in game design, robotics, computer vision, etc. In those cases the functions tend to be called setup and update, or init and draw, or start and loop, etc.

In order to satisfy situations where spectrometers are plugged or unplugged during plugin time, where there may be multiple spectrometers, etc we can borrow more event-driven mentality. The names of the functions don't matter so much as what event triggers them and what they are used for.

(on_gui_update would have been useful for maintaining the relationship between Count and x_0, x_1, ..., in LocalBaseline for exaple)

These can be added at any time while maintaining backwards compatibility.

samiebee43 commented 11 months ago

This should close #283 ?