taurus.qt.qtgui.panel

This package contains a collection of taurus Qt widgets representing various panels like forms or panels to be inserted in dialogs

Classes

class DefaultLabelWidget(*args)[source]

The base class used by default for showing the label of a TaurusValue.

Note

It only makes sense to use this class as a part of a TaurusValue, since it assumes that it can get a reference to a TaurusValue via the getTaurusValueBuddy() member

(more info)

class DefaultReadWidgetLabel(*args)[source]

A customised label for the read widget

(more info)

class DefaultTaurusValueCheckBox(*args)[source]

(more info)

class DefaultUnitsWidget(*args)[source]

(more info)

class MacroServerMessageErrorHandler(msgbox)[source]

(more info)

class QConfigEditor(parent=None, designMode=False)[source]

A widget that shows a tree view of the contents of Taurus configuration files saved by TaurusMainWindow and lets the user edit the values of the configuration keys

(more info)

class QDataExportDialog(parent=None, datadict=None, sortedNames=None)[source]

This creates a Qt dialog for showing and exporting x-y Ascii data from one or more curves The data sets are passed (by calling setDataSets() or at instantiation time) as a dictionary:

datadict={name:(x,y),...}

where name is the curve name and x,y are iterable containers (e.g., lists, tuple, arrays…) of data to be exported

(more info)

class QDoubleListDlg(parent=None, designMode=False, winTitle='', mainLabel='', label1='', label2='', list1=None, list2=None)[source]

Generic dialog providing two lists. Items can be moved from one to the other

(more info)

class QRawDataWidget(parent=None)[source]

(more info)

class TangoConfigLineEdit(qt_parent=None, designMode=False)[source]

(more info)

class TangoMessageErrorHandler(msgbox)[source]

This class is designed to handle PyTango.DevFailed error into a TaurusMessagePanel

(more info)

class TaurusArrayEditorButton(parent=None, designMode=False)[source]

A button that launches a TaurusArrayEditor

Note

the TaurusArrayEditor widget was removed (with qwt5). Until a better replacement is implemented, this will use a TaurusValuesTable

(more info)

class TaurusAttrForm(parent=None, designMode=False)[source]

A form that displays the attributes of a Device Server

(more info)

class TaurusCommandsForm(parent=None, designMode=False)[source]

A form that shows commands available for a Device Server

(more info)

class TaurusConfigLineEdit(**kwargs)[source]

(more info)

class TaurusConfigurationPanel(parent=None, designMode=False)[source]

(more info)

class TaurusDevButton(parent=None, designMode=False)[source]

A button that launches a TaurusAttrForm

(more info)

class TaurusDevicePanel(parent=None, model=None, palette=None, bound=True)[source]

TaurusDevPanel is a Taurus Application inspired in Jive and Atk Panel.

It Provides a Device selector and a panel for displaying information from the selected device.

(more info)

class TaurusDevPanel(parent=None, designMode=False)[source]

TaurusDevPanel is a Taurus Application inspired in Jive and Atk Panel.

It Provides a Device selector and several dockWidgets for interacting and displaying information from the selected device.

(more info)

class TaurusForm(parent=None, formWidget=None, buttons=None, withButtons=True, designMode=False)[source]

A form containing specific widgets for interacting with a given list of taurus attributes and/or devices.

Its model is a list of attribute and/or device names to be shown. Each item is represented in a row consisting of a label, a read widget, a write widget, a units widget and an “extra” widget (some of them may not be shown) which are vertically aligned with their counterparts from other items.

By default a TaurusValue object is used for each item, but this can be changed and customizations can be provided by enabling/disabling item factories with setItemFactories().

Item objects can be accessed by index using a list-like notation:

form = TaurusForm()
form.model = ['sys/tg_test/1/'+a for a in ('short_image','float_scalar')]
form[0].labelConfig = 'dev_alias'
form[-1].writeWidgetClass = 'TaurusWheelEdit'
print(len(form))
# --> outputs '2' (the length of the form is the number of items)

By default, the form provides global Apply and Cancel buttons.

You can also see some code that exemplifies the use of TaurusForm in Taurus coding examples

(more info)

class TaurusImageButton(parent=None, designMode=False)[source]

A button that launches an ImageDialog

(more info)

class TaurusInputPanel(input_data, parent=None)[source]

A panel design to get an input from the user.

The input_data is a dictionary which contains information on how to build the input dialog. It must contains the following keys:

  • prompt <str>: message to be displayed

The following are optional keys (and their corresponding default values):

  • title <str> (doesn’t have default value)

  • key <str> (doesn’t have default value): a label to be presented left to the input box represeting the label

  • unit <str> (doesn’t have default value): a label to be presented right to the input box representing the units

  • data_type <str or sequence> (‘String’): type of data to be requested. Standard accepted data types are ‘String’, ‘Integer’, ‘Float’, ‘Boolean’, ‘Text’. A list of elements will be interpreted as a selection. Default TaurusInputPanel class will interpret any custom data types as ‘String’ and will display input widget accordingly. Custom data types can be handled differently by supplying a different input_panel_klass.

  • minimum <int/float>: minimum value (makes sense when data_type is ‘Integer’ or ‘Float’)

  • maximum <int/float>: maximum value (makes sense when data_type is ‘Integer’ or ‘Float’)

  • step <int/float> (1): step size value (makes sense when data_type is ‘Integer’ or ‘Float’)

  • decimals <int> (1): number of decimal places to show (makes sense when data_type is ‘Float’)

  • default_value <obj> (doesn’t have default value): default value

  • allow_multiple <bool> (False): allow more than one value to be selected (makes sense when data_type is a sequence of possibilities)

Example:

app = Qt.QApplication([])

class Listener(object):
    def on_accept(self):
        print("user selected", self.panel.value())

d = dict(
    prompt="What's your favourite car brand?",
    data_type=["Mazda", "Skoda", "Citroen", "Mercedes", "Audi"],
    default_value="Mercedes"
)
w = TaurusInputPanel(d)
l = Listener()
l.panel = w
w.connect(w.buttonBox(), Qt.SIGNAL("accepted()"), l.on_accept)
w.show()
app.exec_()

(more info)

class TaurusMessageErrorHandler(msgbox)[source]

This class is designed to handle a generic error into a TaurusMessagePanel

(more info)

class TaurusMessagePanel(err_type=None, err_value=None, err_traceback=None, parent=None, designMode=False)[source]

A panel intended to display a taurus error. Example:

dev = taurus.Device("sys/tg_test/1")
try:
    print(dev.read_attribute("throw_exception"))
except PyTango.DevFailed, df:
    msgbox = TaurusMessagePanel()
    msgbox.show()

You can show the error outside the exception handling code. If you do this, you should keep a record of the exception information as given by sys.exc_info():

dev = taurus.Device("sys/tg_test/1")
exc_info = None
try:
    print(dev.read_attribute("throw_exception"))
except PyTango.DevFailed, df:
    exc_info = sys.exc_info()

if exc_info:
    msgbox = TaurusMessagePanel(*exc_info)
    msgbox.show()

(more info)

class TaurusModelChooser(parent=None, selectables=None, host=None, designMode=None, singleModel=False)[source]

A widget that allows the user to select a list of models from a tree representing devices and attributes from a Tango server.

The user selects models and adds them to a list. Then the user should click on the update button to notify that the selection is ready.

signals::
  • “updateModels” emitted when the user clicks on the update button. It passes a list<str> of models that have been selected.

(more info)

class TaurusModelItem(src=None, display=None)[source]

An item object for TaurusModelModel. Exposes display icon and ok attributes which are calculated and kept in synch with the property src

(more info)

class TaurusModelList(parent=None, items=None, designMode=False)[source]

A list view widget to display and manage a list of models

Tries to identify the type of model and show the state of the device/attr associated with it. It also allows drag and drop of models and sorting.

(more info)

class TaurusModelModel(items=None)[source]

A Qt data model for describing taurus models

(more info)

class TaurusModelSelector(parent=None)[source]

TaurusModelSelector is a QTabWidget container for TaurusModelSelectorItem.

(more info)

class TaurusModelSelectorItem(parent=None, **kwargs)[source]

Base class for ModelSelectorItem. It defines the minimal API to be defined in the specialization

(more info)

class TaurusModelSelectorTree(parent=None, selectables=None, buttonsPos=None, designMode=None)[source]

(more info)

class TaurusPlotButton(parent=None, designMode=False)[source]

A button that launches a TaurusPlot

(more info)

class TaurusValue(parent=None, designMode=False, customWidgetMap=None)[source]

Internal TaurusValue class

Warning

TaurusValue (and any derived class from it) should never be instantiated directly. It is designed to be instantiated by a TaurusForm class, since it breaks some conventions on the way it manages layouts of its parent model.

(more info)

class TaurusValuesFrame(parent=None, designMode=False)[source]

This is a container specialized into containing TaurusValue widgets. It should be used Only for TaurusValues

(more info)

class TaurusValuesTableButton(parent=None, designMode=False)[source]

A button that launches a TaurusValuesTable

(more info)

class TaurusValuesTableButton_W(parent=None, designMode=False)[source]

A button that launches a TaurusValuesTable

(more info)