taurus taurus

Previous topic

PanelDescriptionWizard

Next topic

taurus.qt.qtgui.tree

This Page

TaurusGui

Inheritance diagram of TaurusGui

class TaurusGui(parent=None, confname=None, configRecursionDepth=None)

Bases: taurus.qt.qtgui.container.taurusmainwindow.TaurusMainWindow

This is main class for constructing the dynamic GUIs. Specific GUIs are supposed to be created by providing a configuration file which is loaded by this class (instead of subclassing it). TaurusGui is a specialised TaurusMainWindow which is able to handle “panels” and load configuration files.

Note

Please be aware that TaurusGui has only recently being developed and it is still under intense development. The syntax of the configuration files may change at some point and more features and bug fixes are likely to be added in the near future.

IMPLICIT_ASSOCIATION = '__[IMPLICIT]__'
closeEvent(event)
createConfig(*args, **kwargs)

reimplemented from TaurusMainWindow.createConfig

createConsole(kernels)
createCustomPanel(paneldesc=None)

Creates a panel from a Panel Description and sets it as “custom panel”.

Parameters:paneldesc (:class:~`PanelDescription`) – description of the panel to be created

See also

createPanel()

createInstrumentsFromPool(macroservername)

Creates a list of instrument panel descriptions by gathering the info from the Pool. Each panel is a TaurusForm grouping together all those elements that belong to the same instrument according to the Pool info

Return type::class:~`list` <:class:~`PanelDescription`>
Returns:
createMainSynoptic(synopticname)

Creates a synoptic panel and registers it as “SelectedInstrument” reader and writer (allowing selecting instruments from synoptic

createPanel(widget, name, floating=False, registerconfig=True, custom=False, permanent=False, icon=None, instrumentkey=None)

Creates a panel containing the given widget.

Parameters:
  • wiget (:class:~`QWidget`) – the widget to be contained in the panel
  • name (:class:~`str`) – the name of the panel. It will be used in tabs as well as for configuration
  • floating (:class:~`bool`) – whether the panel should be docked or floating. (see note below)
  • registerconfig (:class:~`bool`) – if True, the panel will be registered as a delegate for configuration
  • custom (:class:~`bool`) – if True the panel is to be considered a “custom panel”
  • permanent (:class:~`bool`) – set this to True for panels that need to be recreated when restoring the app
  • icon (:class:~`QIcon`) – icon for the panel
  • instrumentkey (:class:~`str`) – name of an instrument to which this panel is to be associated
Return type:

:class:~`DockWidgetPanel`

Returns:

the created panel

Note

On a previous version, there was a mandatory parameter called area (which accepted a Qt.DockWidgetArea or None as values) this parameter has now been substituted by the keyword argument floating. In order to provide backwards compatibility, the “floating” keyword argument stays at the same position as the old area argument and if a Qt.DockWidgetArea value is given, it will be interpreted as floating=True (while if None is passed, it will be interpreted as floating=False.

findPanelsInArea(area)

returns all panels in the given area

Parameters:
  • area (:class:~`Qt.DockWidgetArea` or :class:~`str`) – . If area==’FLOATING’, the dockwidgets that are floating will be returned.
  • area

Warning

This method is deprecated

getAllInstrumentAssociations()

Returns the dictionary of instrument-panel associations

Return type::class:~`dict` <:class:~`str`, :class:~`str`>
Returns:a dict whose keys are the instruments known to the gui and whose values are the corresponding associated panels (or None).
getCustomWidgetMap()

Returns the default map used to create custom widgets by the TaurusForms belonging to this GUI

Return type::class:~`dict` <:class:~`str`, :class:~`Qt.QWidget`>
Returns:a dictionary whose keys are device type strings (i.e. see PyTango.DeviceInfo) and whose values are widgets to be used
getInstrumentAssociation(instrumentname)

Returns the panel name associated to an instrument name

Parameters:instrumentname (:class:~`str` or :class:~`None`) – The name of the instrument whose associated panel is wanted
Return type::class:~`str` or :class:~`None`
Returns:the associated panel name (or None).
getPanel(name)

get a panel object by name

Return type::class:~`DockWidgetPanel`
Returns:
getPanelNames()

returns the names of existing panels

Return type::class:~`list` <:class:~`str`>
Returns:
classmethod getQtDesignerPluginInfo()

TaurusGui is not to be in designer

hideAllPanels()

hides all current panels

loadConfiguration(confname)

Reads a configuration file

Parameters:confname (:class:~`str`) – the name of module located in the PYTHONPATH or in the conf subdirectory of the directory in which taurusgui.py file is installed. This method will try to import <confname>. If that fails, it will try to import “tgconf_<confname>. Alternatively, confname can be the path to the configuration directory (not necessarily in the python path).
onExportCurrentPanelConfiguration(fname=None)
onSelectedInstrument(instrumentname)

Slot to be called when the selected instrument has changed (e.g. by user clicking in the synoptic)

Parameters:instrumentname (:class:~`str`) – The name that identifies the instrument.
onShortMessage(msg)

Slot to be called when there is a new short message. Currently, the only action taken when there is a new message is to display it in the main window status bar.

Parameters:msg (:class:~`str`) – the short descriptive message to be handled
onShowAssociationDialog()

launches the instrument-panel association dialog (modal)

onShowManual(anchor=None)

reimplemented from TaurusMainWindow to show the manual in a panel (not just a dockwidget)

removePanel(name=None)

remove the given panel from the GUI.

Note

The panel; is actually removed from the current perspective. If the panel is saved in other perspectives, it should be removed from them as well.

Parameters:name (:class:~`str` or :class:~`None`) – the name of the panel to be removed If None given, the user will be prompted
setAllInstrumentAssociations(associationsdict, clearExisting=False)

Sets the dictionary of instrument-panel associations. By default, it keeps any existing association not present in the associationsdict.

Parameters:
  • associationsdict (:class:~`dict` <:class:~`str`, :class:~`str`>) – a dict whose keys are the instruments names and whose values are the corresponding associated panels (or None)
  • clearExisting (:class:~`bool`) – if True, the the existing asociations are cleared. If False (default) existing associations are updated with those in associationsdict
setCustomWidgetMap(map)

Sets the widget map that is used application-wide. This widget map will be used by default in all TaurusForm Panels belonging to this gui.

Parameters:map (:class:~`dict` <:class:~`str`, :class:~`Qt.QWidget`>) – a dictionary whose keys are device type strings (e.g. see PyTango.DeviceInfo) and whose values are widgets to be used

See also

TaurusForm.setCustomWidgetMap(), getCustomWidgetMap()

setFocusToPanel(panelname)

Method that sets a focus for panel passed via an argument

Parameters:panelname (:class:~`str`) – The name that identifies the panel. This name must be unique within the panels in the GUI.
setInstrumentAssociation(instrumentname, panelname)

Sets the panel name associated to an instrument

Parameters:
  • instrumentname (:class:~`str`) – The name of the instrument
  • panelname (:class:~`str` or :class:~`None`) – The name of the associated panel or None to remove the association for this instrument.
setLockView(locked)
setModifiableByUser(modifiable)
showAllPanels()

shows all current panels

showSDMInfo()

pops up a dialog showing the current information from the Shared Data Manager

tabifyArea(area)

tabifies all panels in a given area.

Parameters:area (:class:~`Qt.DockWidgetArea`) –

Warning

This method is deprecated

updatePermanentCustomPanels(showAlways=True)

Shows a dialog for selecting which custom panels should be permanently stored in the configuration.

Parameters:showAlways (:class:~`bool`) – forces showing the dialog even if there are no new custom Panels