You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2020. It is now read-only.
I'd be interested in working on this issue if no one else has started on it yet. From the brief look I've had at the exisiting code, I would propose a new get_spectrometers() function which returns a dict of spectrometer objects with their serial numbers as keys.
Does anyone have any ideas/comments on the problem of creating multiple instances of a spectrometer object - currently you get a USBError raised if you try to do that (e.g. if you call get_a_random_spectrometer() more than once). Would it be better to cache a list of spectrometer objects somewhere and have subsequent calls to the functions return the same instance each time?
You could do the following:
implement a list_unopened_spectrometers() function in utils.py, which (as you suggested) creates a dict of all available spectrometers, but catches and ignores the USBError if a spectrometer is already opened.
A serial() function would need to be implemented in OceanOpticsUSBComm (and sadly, we need to figure out something for the STS class).
Then you could use the list in OceanOpticsBase to pick the spectrometer depended on the serial provided to the init() method.
This would not require a global variable storing a list of all spectrometers.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This should be implemented for everyone who wants to use several spectrometers at once
The text was updated successfully, but these errors were encountered: