|
ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
|
This class encapsulates the visual representation of a saved Measurement in the GUI's "saved spectra" column. More...
Public Member Functions | |
| __deepcopy__ (self, memo) | |
| allows deep-copying of Measurements | |
| __init__ (self, ctl, measurement, is_collapsed, graph) | |
| add_curve_to_graph (self) | |
| collapse (self) | |
| color_changed_callback (self, btn) | |
| create_button (self, size=(30, 30), icon_size=(20, 20), icon_name=None, loc=None, callback=None, tooltip=None, is_color=False) | |
| create_label_widget (self) | |
| disable_edit (self, reason=None) | |
| Called by Measurement.save_csv_file_by_row to prevent attempts to rename spectra appended as lines to an existing file. | |
| disable_trash (self, reason) | |
| Called by Measurement.save_csv_file_by_row to prevent attempts to delete spectra appended as lines to an existing file. | |
| display_callback (self) | |
| expand (self) | |
| expand_callback (self) | |
| generate_tooltip (self) | |
| id_callback (self) | |
| id_complete_callback (self) | |
| remove_curve_from_graph (self) | |
| Retain the thumbnail in the session, but remove its graphical trace from the chart. | |
| rename (self, label) | |
| rename_callback (self) | |
| the user clicked the "pencil" icon to edit the Thumbnail's label | |
| rename_complete_callback (self) | |
| The user hit "return" after editting the Thumbnail's name, or otherwise moved focus to a different widget (or re-clicked the edit button), so pass the new label up to the Measurement object. | |
| set_active (self, flag) | |
| set_pixmap (self, pixmap) | |
| Called by MeasurementFactory to set the rendered thumbnail image. | |
| should_add_id_button (self) | |
| toggle_thumbnail_expand_callback (self, thumbnail) | |
| trash_callback (self) | |
| update_kia (self) | |
Public Attributes | |
| body = QtWidgets.QLabel("loading") | |
| "Loading" thumbnail | |
| button_color = self.create_button( icon_size=(28, 28), size=(width, 30), tooltip="Set color", is_color=True) | |
| button_display = self.create_button(callback=self.display_callback, icon_name="chart", icon_size=(28, 28), size=(width, 30), tooltip="Toggle graph trace") | |
| button_edit = self.create_button(callback=self.rename_callback, icon_name="pencil", icon_size=(28, 28), size=(width, 30), tooltip="Rename measurement (ctrl-E for latest)") | |
| button_expand = self.create_button(callback=self.expand_callback, icon_name="down_triangle", icon_size=(10, 10), size=(15, 15), loc=(170, 15)) | |
| button_id = self.create_button(callback=self.id_callback, icon_name="fingerprint", icon_size=(28, 28), size=(width, 30), tooltip=KnowItAll.tooltip) | |
| button_trash = self.create_button(callback=self.trash_callback, icon_name="trash", icon_size=(28, 28), size=(width, 30), tooltip="Delete measurement from disk") | |
| buttons = QtWidgets.QFrame() | |
| Button Bar. | |
| color_changed_callback | |
| ctl = ctl | |
| curve = None | |
| frame = QtWidgets.QFrame() | |
| Sub-frame. | |
| graph = graph | |
| bool | is_collapsed = is_collapsed |
| Tooltip. | |
| bool | is_displayed = False |
| last_editted = None | |
| le_name = self.create_label_widget() | |
| Editable Label. | |
| measurement = measurement | |
| old_name = None | |
| rename_complete_callback | |
| bool | rename_disabled = False |
| selected_color = None | |
Static Public Attributes | |
| int | BUTTON_PADDING = 5 |
| int | BUTTON_Y = 155 |
| int | INNER_WIDTH = 188 |
| int | MAX_WIDTH = 170 |
| int | MIN_WIDTH = 160 |
| int | OUTER_WIDTH = 190 |
This class encapsulates the visual representation of a saved Measurement in the GUI's "saved spectra" column.
It includes a thumbnail pseudo-object (the miniature raster of the spectra), as well as the Qt Widget which displays the Thumbnail and all the buttons and labels and CSS styling around it.
It contains a reference to the main graph both so it can add and remove itself to the graph as a visible trace, and also so it can determine the current x-axis unit.
These objects are created by MeasurementFactory.
Bizarrely, creation of the all-important thumbnail is still in MeasurementFactory?
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.__init__ | ( | self, | |
| ctl, | |||
| measurement, | |||
| is_collapsed, | |||
| graph ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.__deepcopy__ | ( | self, | |
| memo ) |
allows deep-copying of Measurements
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.add_curve_to_graph | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.collapse | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.color_changed_callback | ( | self, | |
| btn ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.create_button | ( | self, | |
| size = (30, 30), | |||
| icon_size = (20, 20), | |||
| icon_name = None, | |||
| loc = None, | |||
| callback = None, | |||
| tooltip = None, | |||
| is_color = False ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.create_label_widget | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.disable_edit | ( | self, | |
| reason = None ) |
Called by Measurement.save_csv_file_by_row to prevent attempts to rename spectra appended as lines to an existing file.
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.disable_trash | ( | self, | |
| reason ) |
Called by Measurement.save_csv_file_by_row to prevent attempts to delete spectra appended as lines to an existing file.
(All they can do is click the eraser icon to remove the whole list, or click the trash icon on the FIRST file to which other spectra were appended.)
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.display_callback | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.expand | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.expand_callback | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.generate_tooltip | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.id_callback | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.id_complete_callback | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.remove_curve_from_graph | ( | self | ) |
Retain the thumbnail in the session, but remove its graphical trace from the chart.
This returns a bool so the clickable "toggle trace" button can simply try to remove an existing trace as means of checking whether the trace is currently shown on the graph or not.
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.rename | ( | self, | |
| label ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.rename_callback | ( | self | ) |
the user clicked the "pencil" icon to edit the Thumbnail's label
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.rename_complete_callback | ( | self | ) |
The user hit "return" after editting the Thumbnail's name, or otherwise moved focus to a different widget (or re-clicked the edit button), so pass the new label up to the Measurement object.
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.set_active | ( | self, | |
| flag ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.set_pixmap | ( | self, | |
| pixmap ) |
Called by MeasurementFactory to set the rendered thumbnail image.
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.should_add_id_button | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.toggle_thumbnail_expand_callback | ( | self, | |
| thumbnail ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.trash_callback | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.update_kia | ( | self | ) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.body = QtWidgets.QLabel("loading") |
"Loading" thumbnail
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.button_color = self.create_button( icon_size=(28, 28), size=(width, 30), tooltip="Set color", is_color=True) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.button_display = self.create_button(callback=self.display_callback, icon_name="chart", icon_size=(28, 28), size=(width, 30), tooltip="Toggle graph trace") |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.button_edit = self.create_button(callback=self.rename_callback, icon_name="pencil", icon_size=(28, 28), size=(width, 30), tooltip="Rename measurement (ctrl-E for latest)") |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.button_expand = self.create_button(callback=self.expand_callback, icon_name="down_triangle", icon_size=(10, 10), size=(15, 15), loc=(170, 15)) |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.button_id = self.create_button(callback=self.id_callback, icon_name="fingerprint", icon_size=(28, 28), size=(width, 30), tooltip=KnowItAll.tooltip) |
|
static |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.button_trash = self.create_button(callback=self.trash_callback, icon_name="trash", icon_size=(28, 28), size=(width, 30), tooltip="Delete measurement from disk") |
|
static |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.buttons = QtWidgets.QFrame() |
Button Bar.
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.color_changed_callback |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.ctl = ctl |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.curve = None |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.frame = QtWidgets.QFrame() |
Sub-frame.
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.graph = graph |
|
static |
| bool enlighten.ui.ThumbnailWidget.ThumbnailWidget.is_collapsed = is_collapsed |
Tooltip.
initial state
| bool enlighten.ui.ThumbnailWidget.ThumbnailWidget.is_displayed = False |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.last_editted = None |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.le_name = self.create_label_widget() |
Editable Label.
|
static |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.measurement = measurement |
|
static |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.old_name = None |
|
static |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.rename_complete_callback |
| bool enlighten.ui.ThumbnailWidget.ThumbnailWidget.rename_disabled = False |
| enlighten.ui.ThumbnailWidget.ThumbnailWidget.selected_color = None |