|
ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
|
Abstract Base Class (ABC) for all ENLIGHTEN-compatible plug-ins. More...
Public Member Functions | |
| __init__ (self, ctl) | |
| connect (self) | |
| Do whatever you have to do to prepare for processing measurements. | |
| disconnect (self) | |
| Called when ENLIGHTEN is shutting down. | |
| field (self, **kwargs) | |
| get_axis (self, processed_reading=None) | |
| get_axis_name (self) | |
| get_axis_short_name (self) | |
| get_configuration (self) | |
| End backwards compatible object-returning wrappers #####. | |
| get_configuration_obj (self) | |
| End functional-plugins backend ####. | |
| get_plugin_field (self, name) | |
| get the associated enlighten.Plugins.PluginFieldWidget (which IS a QWidget, mind you) | |
| get_widget_from_name (self, name) | |
| get the associated QLabel, QSpinBox, etc | |
| log (self, *msgs) | |
| Begin functional-plugins backend ###. | |
| output (self, name, value) | |
| plot (self, y, x=None, title=None, color=None) | |
| When plotting on the main scope graph the (co)domain matches that existing graph. | |
| process_request (self, request) | |
| process_request_obj (self, request) | |
| to_graph (self, x) | |
| Undo to_pixel conversion, and set point back to currently selected graph X-Axis. | |
| to_pixel (self, x, domain=None) | |
| domain is an array where the index corresponds to a detector pixel number. | |
| update_visibility (self) | |
| Something has happened which might cause the plugin to wish to refresh its visible state – perhaps a new spectrometer was connected. | |
| wavelength_to_pixel (self, wavelength) | |
| wavenumber_to_pixel (self, wavenumber) | |
Public Attributes | |
| auto_enable = None | |
| bool | block_enlighten = False |
| ctl = ctl | |
| error_message = None | |
| bool | has_other_graph = False |
| bool | is_blocking = False |
| bool | lock_enable = False |
| logfile = os.path.join(common.get_default_data_dir(), 'plugin.log') | |
| marquee_message = None | |
| dict | metadata = {} |
| bool | multi_devices = False |
| name = None | |
| dict | outputs = {} |
| dict | overrides = {} |
| bool | process_requests = True |
| dict | series = {} |
| list | signals = [] |
| bool | streaming = True |
| table = None | |
| x_axis_label = None | |
| y_axis_label = None | |
Protected Attributes | |
| _config = None | |
| list | _fields = [] |
Abstract Base Class (ABC) for all ENLIGHTEN-compatible plug-ins.
Plug-ins extending this class will be imported and instantiated by the ENLIGHTEN PluginController.
Note that your plugin classname MUST match its module name (e.g. "class Foo(EnlightenPluginBase)" inside "Foo.py").
| EnlightenPlugin.EnlightenPluginBase.__init__ | ( | self, | |
| ctl ) |
| EnlightenPlugin.EnlightenPluginBase.connect | ( | self | ) |
Do whatever you have to do to prepare for processing measurements.
This may be a one-time setup operation taking 15sec, or it may be a no-op.
This will be called each time the "[x] connected" checkbox is ticked on the ENLIGHTEN Plug-In Setup GUI. Neither this method nor stop() will be called when the "[x] Enabled" checkbox is ticked.
| EnlightenPlugin.EnlightenPluginBase.disconnect | ( | self | ) |
Called when ENLIGHTEN is shutting down.
Release any resources you have. The next time you're needed, there will be a new call to connect().
Reimplemented in Analysis.Tail.Tail, EventHooks.EventHooks, IDSPeak.IDSPeak, LibraryMatching.LibraryMatching, LockSettings.LockSettings, Multichannel.Multichannel, and SaveAsAngstrom.SaveAsAngstrom.
| EnlightenPlugin.EnlightenPluginBase.field | ( | self, | |
| ** | kwargs ) |
| EnlightenPlugin.EnlightenPluginBase.get_axis | ( | self, | |
| processed_reading = None ) |
| EnlightenPlugin.EnlightenPluginBase.get_axis_name | ( | self | ) |
| EnlightenPlugin.EnlightenPluginBase.get_axis_short_name | ( | self | ) |
| EnlightenPlugin.EnlightenPluginBase.get_configuration | ( | self | ) |
End backwards compatible object-returning wrappers #####.
Can be called BEFORE or AFTER connect. Should be idempotent. Ideally should return same object on multiple calls, but at least should be "equivalent" objects.
Reimplemented in Analysis.Despiking.Despiking, Analysis.LocalBaseline.LocalBaseline, Analysis.PeakFinding.PeakFinding, Analysis.Stats.Stats, Analysis.StatsBuffer.StatsBuffer, Analysis.StripChart.StripChart, Analysis.Tail.Tail, BurnIn.BurnIn, Buttons.Buttons, ColorMatching.ColorMatching, EmissionLines.EmissionLines, EventHooks.EventHooks, HelloWorld.HelloWorld, HiddenFeatures.HiddenFeatures, IDSPeak.IDSPeak, LibraryMatching.LibraryMatching, LockSettings.LockSettings, MakeOddNegative.MakeOddNegative, Multichannel.Multichannel, MultiWaveCal.MultiWaveCal, PixelNoise.PixelNoise, RamanLines.RamanLines, RscriptInvoke.RscriptInvoke, SaveAsAngstrom.SaveAsAngstrom, SavitzkyGolay.SavitzkyGolay, SegmentSpectrum.SegmentSpectrum, SimpleScaling.SimpleScaling, SineAndScale.SineAndScale, WISP.WISP, and Worek.Worek.
| EnlightenPlugin.EnlightenPluginBase.get_configuration_obj | ( | self | ) |
End functional-plugins backend ####.
Begin backwards compatible object-returning wrappers ###
| EnlightenPlugin.EnlightenPluginBase.get_plugin_field | ( | self, | |
| name ) |
get the associated enlighten.Plugins.PluginFieldWidget (which IS a QWidget, mind you)
| EnlightenPlugin.EnlightenPluginBase.get_widget_from_name | ( | self, | |
| name ) |
get the associated QLabel, QSpinBox, etc
| EnlightenPlugin.EnlightenPluginBase.log | ( | self, | |
| * | msgs ) |
Begin functional-plugins backend ###.
| EnlightenPlugin.EnlightenPluginBase.output | ( | self, | |
| name, | |||
| value ) |
| EnlightenPlugin.EnlightenPluginBase.plot | ( | self, | |
| y, | |||
| x = None, | |||
| title = None, | |||
| color = None ) |
When plotting on the main scope graph the (co)domain matches that existing graph.
Set self.x_axis_label or self.y_axis_label to provide your own axis labels when plotting to a secondary graph.
| x | x values |
| y | y values |
| title | plot title, shown in legend |
| color | color of plot line |
| EnlightenPlugin.EnlightenPluginBase.process_request | ( | self, | |
| request ) |
Reimplemented in Analysis.Despiking.Despiking, Analysis.LocalBaseline.LocalBaseline, Analysis.PeakFinding.PeakFinding, Analysis.Stats.Stats, Analysis.StatsBuffer.StatsBuffer, Analysis.StripChart.StripChart, Analysis.Tail.Tail, BurnIn.BurnIn, Buttons.Buttons, ColorMatching.ColorMatching, EmissionLines.EmissionLines, EventHooks.EventHooks, HelloWorld.HelloWorld, LibraryMatching.LibraryMatching, MakeOddNegative.MakeOddNegative, Multichannel.Multichannel, MultiWaveCal.MultiWaveCal, PixelNoise.PixelNoise, RamanLines.RamanLines, RscriptInvoke.RscriptInvoke, SavitzkyGolay.SavitzkyGolay, SegmentSpectrum.SegmentSpectrum, SimpleScaling.SimpleScaling, SineAndScale.SineAndScale, and Worek.Worek.
| EnlightenPlugin.EnlightenPluginBase.process_request_obj | ( | self, | |
| request ) |
| EnlightenPlugin.EnlightenPluginBase.to_graph | ( | self, | |
| x ) |
Undo to_pixel conversion, and set point back to currently selected graph X-Axis.
| EnlightenPlugin.EnlightenPluginBase.to_pixel | ( | self, | |
| x, | |||
| domain = None ) |
domain is an array where the index corresponds to a detector pixel number.
if x occurs once in domain, this is like domain.index(x) otherwise a most sensible index is selected
if domain is unspecified, the selected axis is used
| EnlightenPlugin.EnlightenPluginBase.update_visibility | ( | self | ) |
Something has happened which might cause the plugin to wish to refresh its visible state – perhaps a new spectrometer was connected.
Reimplemented in IDSPeak.IDSPeak.
| EnlightenPlugin.EnlightenPluginBase.wavelength_to_pixel | ( | self, | |
| wavelength ) |
| EnlightenPlugin.EnlightenPluginBase.wavenumber_to_pixel | ( | self, | |
| wavenumber ) |
|
protected |
|
protected |
| EnlightenPlugin.EnlightenPluginBase.auto_enable = None |
| bool EnlightenPlugin.EnlightenPluginBase.block_enlighten = False |
| EnlightenPlugin.EnlightenPluginBase.ctl = ctl |
| EnlightenPlugin.EnlightenPluginBase.error_message = None |
| bool EnlightenPlugin.EnlightenPluginBase.has_other_graph = False |
| bool EnlightenPlugin.EnlightenPluginBase.is_blocking = False |
| bool EnlightenPlugin.EnlightenPluginBase.lock_enable = False |
| EnlightenPlugin.EnlightenPluginBase.logfile = os.path.join(common.get_default_data_dir(), 'plugin.log') |
| EnlightenPlugin.EnlightenPluginBase.marquee_message = None |
| dict EnlightenPlugin.EnlightenPluginBase.metadata = {} |
| bool EnlightenPlugin.EnlightenPluginBase.multi_devices = False |
| EnlightenPlugin.EnlightenPluginBase.name = None |
| dict EnlightenPlugin.EnlightenPluginBase.outputs = {} |
| dict EnlightenPlugin.EnlightenPluginBase.overrides = {} |
| bool EnlightenPlugin.EnlightenPluginBase.process_requests = True |
| dict EnlightenPlugin.EnlightenPluginBase.series = {} |
| list EnlightenPlugin.EnlightenPluginBase.signals = [] |
| bool EnlightenPlugin.EnlightenPluginBase.streaming = True |
| EnlightenPlugin.EnlightenPluginBase.table = None |
| EnlightenPlugin.EnlightenPluginBase.x_axis_label = None |
| EnlightenPlugin.EnlightenPluginBase.y_axis_label = None |