|
ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
|
This class orchestrates ENLIGHTEN's simultaneous connection to multiple spectrometers in parallel. More...
Public Member Functions | |
| __init__ (self, ctl) | |
| add (self, device) | |
| add_color_button (self) | |
| The Qt Designer doesn't let us emplace pyqtgraph objects (I think?), so add this button at runtime. | |
| bool | any_has_excitation (self) |
| change_device_setting (self, setting, value=0, all_=False) | |
| send commands to device thread via (name, value) pickleable tuples | |
| check_callback (self) | |
| None | check_ejected_unplugged (self, list[DeviceID] connected_devices) |
| Goes through the set of ejected spectrometers and checks if they still appear in the list of connected devices. | |
| bool | check_hardware_curve_present (self, name, spec_id) |
| check_hide_others_callback (self) | |
| bool | check_spec_user_ejected (self, DeviceID device_id) |
| choose_color (self, spec, ignore_auto=False) | |
| clear_reset (self, device_id) | |
| color_changed_callback (self, btn) | |
| The user has manually selected a color for the current spectrometer, so save and apply it. | |
| combo_callback (self) | |
| If the selected MultiSpec spectrometer changes, update affected objects. | |
| int | count (self) |
| Spectrometer | current_spectrometer (self) |
| eject_current_spec (self) | |
| found_desired (self) | |
| get_clones (self, device_id) | |
| This function hopefully won't need to be retained, but is being added to analyze a developmental bug in which apparently the same spectrometer connected twice, and both instances continued to function :-(. | |
| DeviceID | get_combo_device_id (self) |
| int | get_combo_index (self, spec) |
| get_hardware_feature_curve (self, name, spec_id) | |
| Spectrometer | get_spectrometer (self, device_id) |
| get_spectrometers (self) | |
| bool | have_any_andor (self) |
| bool | have_any_in_process (self) |
| hide (self, spec) | |
| bool | is_autocolor (self) |
| bool | is_connected (self, device_id) |
| bool | is_current_spectrometer (self, spec) |
| bool | is_disconnecting (self, str device_id) |
| bool | is_gave_up (self, device_id) |
| bool | is_ignore (self, device_id) |
| bool | is_in_process (self, device_id) |
| is_in_reset (self, device_id) | |
| bool | is_selected (self, device_id) |
| lock_callback (self) | |
| make_pen (self, spec) | |
| read_spec_object (self, device_id) | |
| register_hardware_feature_curve (self, name, spec_id, curve) | |
| register_strip_feature (self, feature) | |
| MZ: Whut? | |
| reject_undesireable (self, device) | |
| bool | remove (self, spec=None, silent=False) |
| remove_all (self) | |
| remove_hardware_curve (self, name, spec_id) | |
| remove_in_process (self, device_id) | |
| reset_seen (self) | |
| reset_tries (self, device_id) | |
| select_next_spectrometer (self) | |
| select_prev_spectrometer (self) | |
| set_app_state (self, field, value, all_=False) | |
| Update the given SpectrometerApplicationState field for the current spectrometer, or for all spectrometers if locking is enabled. | |
| None | set_disconnecting (self, str device_id, bool status) |
| Records that we are kicking off a spectrometer so Enlighten doesn't accidentally pick it up. | |
| set_gave_up (self, device_id) | |
| Sets in_process value to None, indicating that we've given up trying to connect to that device_id (it is permanently but inactively "in process"). | |
| set_ignore (self, device_id) | |
| set_in_process (self, device_id, WasatchDeviceWrapper device) | |
| set_in_reset (self, device_id) | |
| set_state (self, field, value) | |
| Update the given SpectrometerState field for the current spectrometer, or for all spectrometers if locking is enabled. | |
| unhide (self, spec) | |
| update_color (self) | |
| update_hide_others (self) | |
| update_spectrometer_colors (self) | |
| update_widget (self) | |
Public Attributes | |
| button_color = self.add_color_button() | |
| button_lock = cfu.pushButton_multiSpec_lock | |
| check_autocolor = cfu.checkBox_multiSpec_autocolor | |
| check_callback | |
| check_hide_others = cfu.checkBox_multiSpec_hide_others | |
| check_hide_others_callback | |
| color_changed_callback | |
| combo_callback | |
| combo_spectrometer = cfu.comboBox_multiSpec | |
| ctl = ctl | |
| device_id = None | |
| dict | disconnecting = {} |
| eject_button = cfu.pushButton_eject | |
| eject_current_spec | |
| dict | ejected = set() |
| frame_widget = cfu.frame_multiSpecWidget | |
| bool | hide_others = False |
| dict | ignore = {} |
| dict | in_process = {} |
| layout_colors = cfu.horizontalLayout_multiSpec_colors | |
| lock_callback | |
| list | lockable_widgets |
| bool | locked = False |
| dict | reset_spec_objs = {} |
| seen_colors = set() | |
| dict | serial_colors = {} |
| dict | spec_detector_temp_curves = {} |
| spec_hardware_feature_curves = defaultdict(dict) | |
| dict | spec_hardware_live_curves = {} |
| spec_in_reset = defaultdict(int) | |
| dict | spec_laser_temp_curves = {} |
| dict | spec_roi_curtains = {} |
| dict | spectrometers = {} |
| list | strip_features = [] |
This class orchestrates ENLIGHTEN's simultaneous connection to multiple spectrometers in parallel.
For the first two years of its life (2016-2018), ENLIGHTEN could only connect to one spectrometer at a time. Everything was hard-coded to assume a single spectrometer, and in many cases state was mastered in GUI widgets themselves, such that there was literally no place to store, for instance, the current integration time or laser enable status of a second spectrometer.
Refactoring such a fundamental aspect of the application was a big deal, so this class was created to encapsulate the 1-to-many relationships.
At some point I might rename this to be just "Spectrometers," in parallel with "Measurements" etc.
It's worth considering whether to give Multispec a shutting_down flag, or a callback to get it, but the tear-down process is sufficiently lightweight to just let it ride.
| enlighten.device.Multispec.Multispec.__init__ | ( | self, | |
| ctl ) |
| enlighten.device.Multispec.Multispec.add | ( | self, | |
| device ) |
| enlighten.device.Multispec.Multispec.add_color_button | ( | self | ) |
The Qt Designer doesn't let us emplace pyqtgraph objects (I think?), so add this button at runtime.
| bool enlighten.device.Multispec.Multispec.any_has_excitation | ( | self | ) |
| enlighten.device.Multispec.Multispec.change_device_setting | ( | self, | |
| setting, | |||
| value = 0, | |||
| all_ = False ) |
send commands to device thread via (name, value) pickleable tuples
| enlighten.device.Multispec.Multispec.check_callback | ( | self | ) |
| None enlighten.device.Multispec.Multispec.check_ejected_unplugged | ( | self, | |
| list[DeviceID] | connected_devices ) |
Goes through the set of ejected spectrometers and checks if they still appear in the list of connected devices.
If they don't, this means a user ejected spec has been physically unplugged and should be removed from the set so the user can plug it back in
| bool enlighten.device.Multispec.Multispec.check_hardware_curve_present | ( | self, | |
| name, | |||
| spec_id ) |
| enlighten.device.Multispec.Multispec.check_hide_others_callback | ( | self | ) |
| bool enlighten.device.Multispec.Multispec.check_spec_user_ejected | ( | self, | |
| DeviceID | device_id ) |
| enlighten.device.Multispec.Multispec.choose_color | ( | self, | |
| spec, | |||
| ignore_auto = False ) |
| enlighten.device.Multispec.Multispec.clear_reset | ( | self, | |
| device_id ) |
| enlighten.device.Multispec.Multispec.color_changed_callback | ( | self, | |
| btn ) |
The user has manually selected a color for the current spectrometer, so save and apply it.
| enlighten.device.Multispec.Multispec.combo_callback | ( | self | ) |
If the selected MultiSpec spectrometer changes, update affected objects.
| int enlighten.device.Multispec.Multispec.count | ( | self | ) |
| Spectrometer enlighten.device.Multispec.Multispec.current_spectrometer | ( | self | ) |
| enlighten.device.Multispec.Multispec.eject_current_spec | ( | self | ) |
| enlighten.device.Multispec.Multispec.found_desired | ( | self | ) |
| enlighten.device.Multispec.Multispec.get_clones | ( | self, | |
| device_id ) |
This function hopefully won't need to be retained, but is being added to analyze a developmental bug in which apparently the same spectrometer connected twice, and both instances continued to function :-(.
| DeviceID enlighten.device.Multispec.Multispec.get_combo_device_id | ( | self | ) |
| int enlighten.device.Multispec.Multispec.get_combo_index | ( | self, | |
| spec ) |
| enlighten.device.Multispec.Multispec.get_hardware_feature_curve | ( | self, | |
| name, | |||
| spec_id ) |
| Spectrometer enlighten.device.Multispec.Multispec.get_spectrometer | ( | self, | |
| device_id ) |
| enlighten.device.Multispec.Multispec.get_spectrometers | ( | self | ) |
| bool enlighten.device.Multispec.Multispec.have_any_andor | ( | self | ) |
| bool enlighten.device.Multispec.Multispec.have_any_in_process | ( | self | ) |
| enlighten.device.Multispec.Multispec.hide | ( | self, | |
| spec ) |
| bool enlighten.device.Multispec.Multispec.is_autocolor | ( | self | ) |
| bool enlighten.device.Multispec.Multispec.is_connected | ( | self, | |
| device_id ) |
| bool enlighten.device.Multispec.Multispec.is_current_spectrometer | ( | self, | |
| spec ) |
| bool enlighten.device.Multispec.Multispec.is_disconnecting | ( | self, | |
| str | device_id ) |
| bool enlighten.device.Multispec.Multispec.is_gave_up | ( | self, | |
| device_id ) |
| bool enlighten.device.Multispec.Multispec.is_ignore | ( | self, | |
| device_id ) |
| bool enlighten.device.Multispec.Multispec.is_in_process | ( | self, | |
| device_id ) |
| enlighten.device.Multispec.Multispec.is_in_reset | ( | self, | |
| device_id ) |
| bool enlighten.device.Multispec.Multispec.is_selected | ( | self, | |
| device_id ) |
| enlighten.device.Multispec.Multispec.lock_callback | ( | self | ) |
| enlighten.device.Multispec.Multispec.make_pen | ( | self, | |
| spec ) |
| enlighten.device.Multispec.Multispec.read_spec_object | ( | self, | |
| device_id ) |
| enlighten.device.Multispec.Multispec.register_hardware_feature_curve | ( | self, | |
| name, | |||
| spec_id, | |||
| curve ) |
| enlighten.device.Multispec.Multispec.register_strip_feature | ( | self, | |
| feature ) |
MZ: Whut?
| enlighten.device.Multispec.Multispec.reject_undesireable | ( | self, | |
| device ) |
| bool enlighten.device.Multispec.Multispec.remove | ( | self, | |
| spec = None, | |||
| silent = False ) |
| enlighten.device.Multispec.Multispec.remove_all | ( | self | ) |
| enlighten.device.Multispec.Multispec.remove_hardware_curve | ( | self, | |
| name, | |||
| spec_id ) |
| enlighten.device.Multispec.Multispec.remove_in_process | ( | self, | |
| device_id ) |
| enlighten.device.Multispec.Multispec.reset_seen | ( | self | ) |
| enlighten.device.Multispec.Multispec.reset_tries | ( | self, | |
| device_id ) |
| enlighten.device.Multispec.Multispec.select_next_spectrometer | ( | self | ) |
| enlighten.device.Multispec.Multispec.select_prev_spectrometer | ( | self | ) |
| enlighten.device.Multispec.Multispec.set_app_state | ( | self, | |
| field, | |||
| value, | |||
| all_ = False ) |
Update the given SpectrometerApplicationState field for the current spectrometer, or for all spectrometers if locking is enabled.
| None enlighten.device.Multispec.Multispec.set_disconnecting | ( | self, | |
| str | device_id, | ||
| bool | status ) |
Records that we are kicking off a spectrometer so Enlighten doesn't accidentally pick it up.
| enlighten.device.Multispec.Multispec.set_gave_up | ( | self, | |
| device_id ) |
Sets in_process value to None, indicating that we've given up trying to connect to that device_id (it is permanently but inactively "in process").
| enlighten.device.Multispec.Multispec.set_ignore | ( | self, | |
| device_id ) |
| enlighten.device.Multispec.Multispec.set_in_process | ( | self, | |
| device_id, | |||
| WasatchDeviceWrapper | device ) |
| enlighten.device.Multispec.Multispec.set_in_reset | ( | self, | |
| device_id ) |
| enlighten.device.Multispec.Multispec.set_state | ( | self, | |
| field, | |||
| value ) |
Update the given SpectrometerState field for the current spectrometer, or for all spectrometers if locking is enabled.
| enlighten.device.Multispec.Multispec.unhide | ( | self, | |
| spec ) |
| enlighten.device.Multispec.Multispec.update_color | ( | self | ) |
| enlighten.device.Multispec.Multispec.update_hide_others | ( | self | ) |
| enlighten.device.Multispec.Multispec.update_spectrometer_colors | ( | self | ) |
| enlighten.device.Multispec.Multispec.update_widget | ( | self | ) |
| enlighten.device.Multispec.Multispec.button_color = self.add_color_button() |
| enlighten.device.Multispec.Multispec.button_lock = cfu.pushButton_multiSpec_lock |
| enlighten.device.Multispec.Multispec.check_autocolor = cfu.checkBox_multiSpec_autocolor |
| enlighten.device.Multispec.Multispec.check_callback |
| enlighten.device.Multispec.Multispec.check_hide_others = cfu.checkBox_multiSpec_hide_others |
| enlighten.device.Multispec.Multispec.check_hide_others_callback |
| enlighten.device.Multispec.Multispec.color_changed_callback |
| enlighten.device.Multispec.Multispec.combo_callback |
| enlighten.device.Multispec.Multispec.combo_spectrometer = cfu.comboBox_multiSpec |
| enlighten.device.Multispec.Multispec.ctl = ctl |
| enlighten.device.Multispec.Multispec.device_id = None |
| dict enlighten.device.Multispec.Multispec.disconnecting = {} |
| enlighten.device.Multispec.Multispec.eject_button = cfu.pushButton_eject |
| enlighten.device.Multispec.Multispec.eject_current_spec |
| enlighten.device.Multispec.Multispec.ejected = set() |
| enlighten.device.Multispec.Multispec.frame_widget = cfu.frame_multiSpecWidget |
| bool enlighten.device.Multispec.Multispec.hide_others = False |
| dict enlighten.device.Multispec.Multispec.ignore = {} |
| dict enlighten.device.Multispec.Multispec.in_process = {} |
| enlighten.device.Multispec.Multispec.layout_colors = cfu.horizontalLayout_multiSpec_colors |
| enlighten.device.Multispec.Multispec.lock_callback |
| list enlighten.device.Multispec.Multispec.lockable_widgets |
| enlighten.device.Multispec.Multispec.locked = False |
| dict enlighten.device.Multispec.Multispec.reset_spec_objs = {} |
| enlighten.device.Multispec.Multispec.seen_colors = set() |
| dict enlighten.device.Multispec.Multispec.serial_colors = {} |
| dict enlighten.device.Multispec.Multispec.spec_detector_temp_curves = {} |
| enlighten.device.Multispec.Multispec.spec_hardware_feature_curves = defaultdict(dict) |
| dict enlighten.device.Multispec.Multispec.spec_hardware_live_curves = {} |
| enlighten.device.Multispec.Multispec.spec_in_reset = defaultdict(int) |
| dict enlighten.device.Multispec.Multispec.spec_laser_temp_curves = {} |
| dict enlighten.device.Multispec.Multispec.spec_roi_curtains = {} |
| enlighten.device.Multispec.Multispec.spectrometers = {} |
| list enlighten.device.Multispec.Multispec.strip_features = [] |