vdat.gui.fplane – The fplane viewer

Panel with the focal plane

The FplaneWidget

class vdat.gui.fplane.FplaneWidget(parent=None)[source]

Bases: PyQt5.QtWidgets.QTabWidget

Widget containing the tabs showing the focal plane.

Custom signals
Name Signature Description
sig_ifuToggled str, bool emitted when an IFU is selected in a widget contained in this one; the id of the IFU and whether is selected (True) or deselected (False) are passed as arguments.
sig_ifuSelected str, bool emitted when an IFU is selected in a widget that contains this one; the id of the IFU and whether is selected (True) or deselected (False) are passed as arguments.
sig_selectAllIFUs   emitted when all the IFUs are selected in a widget that contains this one
sig_deselectAllIFUs   emitted when all the IFUs are deselected in a widget that contains this one
Custom slot
Name Signature Description
change_fplane() str, dict Upon selecting a new directory or task, update the tabs for the directory passed as first argument according to the instruction in the dictionary passed as second argument.
ifuToggled() str, bool Emit the sig_ifuToggled signal
ifuSelected() str, bool Emit the sig_ifuSelected signal
selectAllIFUs   Emit the sig_selectAllIFUs signal
deselectAllIFUs   Emit the sig_deselectAllIFUs signal
Connections between custom signals and/or slots. If the signal or slot belongs to tab, it is connected in change_fplane() and disconnected in empty_fplane()
Signal Slot
tab.sig_ifuToggled ifuToggled()
sig_selectAllIFUs tab.selectAllIFUs
sig_ifuSelected tab.ifuSelected
sig_deselectAllIFUs tab.deselectAllIFUs
Parameters:
parent : PyQt5.QtWidgets.QWidget or derivate

parent object of the tree view model

sig_ifuToggled
sig_ifuSelected
sig_selectAllIFUs
sig_deselectAllIFUs
empty_fplane()[source]

Loop through the current tabs and for each one of them:

  • remove from the FplaneWidget
  • disconnect all the signals connected in change_fplane()
  • if the use_cache property is True, save the widget in the cache
  • if the use_cache property is False, mark the widget for deletion
change_fplane(target, task_dict)[source]

Clear the old tabs and create a set of new ones.

It loops through the list in the tabs section of task_dict, load and call the plugins implementing each tab_type. If the plugin exists and the execution succeed, for each widget returned:

All errors when loading and calling the plugins are collected and shown before return the method. If no tab is found or no tab could be plugged in because of errors, show an overlay to notify the user.

Parameters:
target : string

path of the selected directory

task_dict : dict

dictionary with the configuration for the tabs and buttons to display

show_tab_errors(errors)[source]

Shows the errors into a QErrorMessage window.

Parameters:
errors : list of strings

errors to report

ifuToggled(id_, val)[source]

Emit the sig_ifuToggled signal. The method is also a PyQt slot.

Parameters:
id_ : string

SLOTID of the ifu that is toggled

val : bool

True if selected, False if deselected

ifuSelected(id_, val)[source]

Emit the sig_ifuSelected signal. The method is also a PyQt slot.

Parameters:
id_ : string

SLOTID of the ifu that is toggled

val : bool

True if selected, False if deselected

selectAllIFUs()[source]

Emit the sig_selectAllIFUs signal. The method is also a PyQt slot.

deselectAllIFUs()[source]

Emit the sig_selectAllIFUs signal. The method is also a PyQt slot.

The cache

class vdat.gui.fplane.FplaneCache[source]

Cache of fplane objects.

This object allows to store and retrieve objects in dictionary of lists. Each entry has the type of the object (as provided by the user) as key and a list of object as value.

from_cache(fp_type)[source]

Returns one object stored under the name fp_type.

Parameters:
fp_type : string

name of the type to store

Returns:
An object or ``None`` if the cache is empty.
into_cache(fp_type, fp)[source]

Store the object (a widget) into the cache.

Parameters:
fp_type : string

name of the type to store

fp : object

object to be stored.