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

Each ENLIGHTEN plug-in will be visualized in the ENLIGHTEN GUI via a dynamically generated widget in the right-hand scrolling control list. More...

Public Member Functions

 __init__ (self, name, datatype="string", direction="output", initial=None, minimum=0, maximum=100, step=1, precision=2, choices=None, callback=None, stylesheet=None, expert=False, width=None, tooltip=None)
 
 __repr__ (self)
 

Public Attributes

 callback = callback
 
 choices = choices
 
 datatype = datatype
 
 direction = direction
 
 expert = expert
 
 initial = initial
 
 maximum = maximum
 
 minimum = minimum
 
 name = name
 
 precision = precision
 
 step = step
 
 stylesheet = stylesheet
 
 tooltip = tooltip
 
 width = width
 

Detailed Description

Each ENLIGHTEN plug-in will be visualized in the ENLIGHTEN GUI via a dynamically generated widget in the right-hand scrolling control list.

That widget will include a vertical stack of these EnlightenPluginFields.

Each field will have a direction, either "input" (from ENLIGHTEN to the plugin) or "output" (from the plugin to ENLIGHTEN).

  • "input" fields are populated by the user via the ENLIGHTEN GUI and passed to the plug-in via an EnlightenPluginRequest (e.g. "matchingThreshold" or "targetPeakCounts")
  • "output" fields are populated by the plug-in and passed via EnlightenPluginResponse back to the ENLIGHTEN GUI for display to the user.

Fields can optionally be given a "tooltip" string for mouseOvers.

Input Fields

Input fields support these datatypes: string, int, float, bool, button.

The plug-in author can determine what QWidget will be used for different "Input" fields by specifying the datatype:

  • string -> QLineEdit
  • int -> QSpinBox
  • float -> QDoubleSpinBox
  • bool -> QCheckBox
  • button -> QPushButton

All fields can be given an "initial" value.

Numeric Input Fields

Int and float input fields support "minimum", "maximum" and "step" (increment) settings. Float fields also support decimal-point "precision".

Button Input Fields

Fields with datatype "button" should include a callback handle to a function, instance method or lambda.

Output Fields

Output fields support these datatypes: string, int, float, bool, pandas.

Regardless of type, all output fields will be rendered on the GUI as a string (QLabel), with the exception of "pandas".

Pandas Output Fields

Any given plugin can only declare ONE "pandas" output field, which is expected to contain all the tabular data output by that plugin.

Pandas fields will be rendered to a QTableView.

Constructor & Destructor Documentation

◆ __init__()

EnlightenPlugin.EnlightenPluginField.__init__ ( self,
name,
datatype = "string",
direction = "output",
initial = None,
minimum = 0,
maximum = 100,
step = 1,
precision = 2,
choices = None,
callback = None,
stylesheet = None,
expert = False,
width = None,
tooltip = None )
Parameters
nameidentifying string
datatypestring (default), int, float, bool, pandas, button
direction"output" (default) or "input" (from plugin's POV)
initialinitial value
minimumlower bound (int/float only)
maximumupper bound (int/float only)
stepincrement (int/float only)
precisiondigits past decimal place (float only)
callbackfunction reference if button clicked (button only)
tooltipmouseover string
stylesheetoptional stylesheet name
expertonly display in Expert mode
widthfield width in pixels

Member Function Documentation

◆ __repr__()

EnlightenPlugin.EnlightenPluginField.__repr__ ( self)

Member Data Documentation

◆ callback

EnlightenPlugin.EnlightenPluginField.callback = callback

◆ choices

EnlightenPlugin.EnlightenPluginField.choices = choices

◆ datatype

EnlightenPlugin.EnlightenPluginField.datatype = datatype

◆ direction

EnlightenPlugin.EnlightenPluginField.direction = direction

◆ expert

EnlightenPlugin.EnlightenPluginField.expert = expert

◆ initial

EnlightenPlugin.EnlightenPluginField.initial = initial

◆ maximum

EnlightenPlugin.EnlightenPluginField.maximum = maximum

◆ minimum

EnlightenPlugin.EnlightenPluginField.minimum = minimum

◆ name

EnlightenPlugin.EnlightenPluginField.name = name

◆ precision

EnlightenPlugin.EnlightenPluginField.precision = precision

◆ step

EnlightenPlugin.EnlightenPluginField.step = step

◆ stylesheet

EnlightenPlugin.EnlightenPluginField.stylesheet = stylesheet

◆ tooltip

EnlightenPlugin.EnlightenPluginField.tooltip = tooltip

◆ width

EnlightenPlugin.EnlightenPluginField.width = width

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