vdat.gui.tabs.interface – The interface

Tab class interface and plugin function prototype

vdat.gui.tabs.interface.plugin_interface(target_dir, tab_dict, step_name, cache, parent_widget)[source]

Interface of the functions implementing the plugin.

Each tab type must implement a function with the this signature and can be advertised via the vdat.tab_types entry point.

Parameters:
target_dir : string

directory selected by the user

tab_dict : dictionary

dictionary with the specifications to use to build the tabs

step_name : string

name of the step to which the tab(s) belong

cache : vdat.gui.fplane.FplaneCache instance

cache object

parent_widget : PyQt5.QtWidgets.QWidget or derivate

parent object of the tabs

Returns:
list

instances to be plugged into the FplaneWidget as tabs; they should be derived from FplaneTabTemplate or implement the same interface.

class vdat.gui.tabs.interface.FplaneTabTemplate(tab_type, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Template class representing a tab in the focal plane. All the classes should be either derived from this one or implement the same interface

Custom signals
Name Signature Description
sig_ifuToggled str, bool emitted when a user selects/deselects an IFU; the parameters are the SLOTID of the IFU and whether the IFU has been selected
Custom slot
Name Signature Description
ifuSelected() str, bool selects (second argument True)/deselects (second argument False) an IFU, whose SLOTID is given in the first argument.
selectAllIFUs()   selects all IFUs
deselectAllIFUs()   deselect all IFUs
Parameters:
tab_type : str

a name of the tab as advertised in the entry points. When implementing the plugins, care must be taken to pass the correct tab type to allow caching. The tab_type is passed to plugin_interface()

parent : PyQt5.QtWidgets.QWidget or derivate

parent object of the tree view model

Attributes:
tab_type : str

name of tab type; if required, the instance is cached and should be retrieved under this name. By default is set to the tab_type name passed to FplaneTabTemplate.

use_cache : bool

indicate whether the instance can be cached after popping it from the list of tabs. This must be implemented in all derived classes as an attribute or property.

title : string

title to assign to the tab containing the widget. This must be implemented in all derived classes as an attribute or property.

tool_tip : string, optional

if present, is used as the string for the tooltip associated with the current tab

enabled : bool, optional

whether the table is enabled or not. If not present default to True

sig_ifuToggled
cleanup()[source]

Cleanup method called when a tab is popped. The default implementation hides the widget.

ifuSelected(ifuslot, val)[source]

Select or deselect an IFU. This method is also a PyQt slot.

The current implementation does nothing. Reimplement it to react to the vdat.gui.fplane.FplaneWidget.sig_ifuSelected signal. This slot is automatically connected and disconnected when plugging and popping a tab.

Parameters:
ifuslot : string

SLOTID of the selected IFU

val : bool

If True selected, otherwise deselected

selectAllIFUs()[source]

Select all IFU. This method is also a PyQt slot.

The current implementation does nothing. Reimplement it to react to the vdat.gui.fplane.FplaneWidget.sig_selectAllIFUs signal. This slot is automatically connected and disconnected when plugging and popping a tab.

deselectAllIFUs()[source]

Deselect all IFU. This method is also a PyQt slot.

The current implementation does nothing. Reimplement it to react to the vdat.gui.fplane.FplaneWidget.sig_deselectAllIFUs signal. This slot is automatically connected and disconnected when plugging and popping a tab.