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

Add Preset to metadata #389

Open mzieg opened 3 months ago

mzieg commented 3 months ago

To ensure the Preset is current and not just "last selected," we need to ensure Presets change to Select One when a registered supplier changes.

mzieg commented 3 months ago

I don't want to litter the code with with countless classes calling ctl.presets.reset() along every path to a change in acquisition parameters.

What would be slicker would be an AcquisitionParameter class (or superclass?) which could trigger resets in PresetFeature, DarkFeature, ReferenceFeature etc. As an ABC, each could just call self.notify_changed(old=None, new=None). Notifications should include the class name, so ('IntegrationTimeFeature', old=100, new=200). Plugins would be able to subscribe to notifications as well (and issue them?)