ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
EnlightenPlugin.EnlightenPluginBase Class Reference

Abstract Base Class (ABC) for all ENLIGHTEN-compatible plug-ins. More...

Inheritance diagram for EnlightenPlugin.EnlightenPluginBase:
[legend]

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 = []
 

Detailed Description

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").

Key Attributes
  • error_message can be set by the plug-in if they wish a user-visible error string or stacktrace to be displayed to the user in a message box (e.g. following a failure in connect)

Constructor & Destructor Documentation

◆ __init__()

EnlightenPlugin.EnlightenPluginBase.__init__ ( self,
ctl )

Member Function Documentation

◆ connect()

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.

Returns
True if initialization is successful, False otherwise

◆ disconnect()

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.

◆ field()

EnlightenPlugin.EnlightenPluginBase.field ( self,
** kwargs )

◆ get_axis()

EnlightenPlugin.EnlightenPluginBase.get_axis ( self,
processed_reading = None )

◆ get_axis_name()

EnlightenPlugin.EnlightenPluginBase.get_axis_name ( self)

◆ get_axis_short_name()

EnlightenPlugin.EnlightenPluginBase.get_axis_short_name ( self)

◆ get_configuration()

◆ get_configuration_obj()

EnlightenPlugin.EnlightenPluginBase.get_configuration_obj ( self)

End functional-plugins backend ####.

Begin backwards compatible object-returning wrappers ###

◆ get_plugin_field()

EnlightenPlugin.EnlightenPluginBase.get_plugin_field ( self,
name )

get the associated enlighten.Plugins.PluginFieldWidget (which IS a QWidget, mind you)

◆ get_widget_from_name()

EnlightenPlugin.EnlightenPluginBase.get_widget_from_name ( self,
name )

get the associated QLabel, QSpinBox, etc

◆ log()

EnlightenPlugin.EnlightenPluginBase.log ( self,
* msgs )

Begin functional-plugins backend ###.

◆ output()

EnlightenPlugin.EnlightenPluginBase.output ( self,
name,
value )

◆ plot()

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.

Parameters
xx values
yy values
titleplot title, shown in legend
colorcolor of plot line
Note
if you rely on the default x-axis, note that it is the full detector axis, and is neither interpolated nor cropped in horizontal ROI. Use ProcessedRequest.get_wavelengths() or get_wavenumbers() for the axis in use for a particular EnlightenPluginRequest.
Todo
add weight

◆ process_request()

◆ process_request_obj()

EnlightenPlugin.EnlightenPluginBase.process_request_obj ( self,
request )

◆ to_graph()

EnlightenPlugin.EnlightenPluginBase.to_graph ( self,
x )

Undo to_pixel conversion, and set point back to currently selected graph X-Axis.

◆ to_pixel()

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

◆ update_visibility()

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.

◆ wavelength_to_pixel()

EnlightenPlugin.EnlightenPluginBase.wavelength_to_pixel ( self,
wavelength )

◆ wavenumber_to_pixel()

EnlightenPlugin.EnlightenPluginBase.wavenumber_to_pixel ( self,
wavenumber )

Member Data Documentation

◆ _config

EnlightenPlugin.EnlightenPluginBase._config = None
protected

◆ _fields

list EnlightenPlugin.EnlightenPluginBase._fields = []
protected

◆ auto_enable

EnlightenPlugin.EnlightenPluginBase.auto_enable = None

◆ block_enlighten

bool EnlightenPlugin.EnlightenPluginBase.block_enlighten = False

◆ ctl

EnlightenPlugin.EnlightenPluginBase.ctl = ctl

◆ error_message

EnlightenPlugin.EnlightenPluginBase.error_message = None

◆ has_other_graph

bool EnlightenPlugin.EnlightenPluginBase.has_other_graph = False

◆ is_blocking

bool EnlightenPlugin.EnlightenPluginBase.is_blocking = False

◆ lock_enable

bool EnlightenPlugin.EnlightenPluginBase.lock_enable = False

◆ logfile

EnlightenPlugin.EnlightenPluginBase.logfile = os.path.join(common.get_default_data_dir(), 'plugin.log')

◆ marquee_message

EnlightenPlugin.EnlightenPluginBase.marquee_message = None

◆ metadata

dict EnlightenPlugin.EnlightenPluginBase.metadata = {}

◆ multi_devices

bool EnlightenPlugin.EnlightenPluginBase.multi_devices = False

◆ name

EnlightenPlugin.EnlightenPluginBase.name = None

◆ outputs

dict EnlightenPlugin.EnlightenPluginBase.outputs = {}

◆ overrides

dict EnlightenPlugin.EnlightenPluginBase.overrides = {}

◆ process_requests

bool EnlightenPlugin.EnlightenPluginBase.process_requests = True

◆ series

dict EnlightenPlugin.EnlightenPluginBase.series = {}

◆ signals

list EnlightenPlugin.EnlightenPluginBase.signals = []

◆ streaming

bool EnlightenPlugin.EnlightenPluginBase.streaming = True

◆ table

EnlightenPlugin.EnlightenPluginBase.table = None

◆ x_axis_label

EnlightenPlugin.EnlightenPluginBase.x_axis_label = None

◆ y_axis_label

EnlightenPlugin.EnlightenPluginBase.y_axis_label = None

The documentation for this class was generated from the following file: