TaurusForm
¶
digraph inheritance65282dc55b {
rankdir=UD;
ratio=compress;
size="8.0, 12.0";
"BaseConfigurableClass" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="A base class defining the API for configurable objects."];
"Logger" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="The taurus logger class. All taurus pertinent classes should inherit"];
"Object" -> "Logger" [arrowsize=0.5,style="setlinewidth(0.5)"];
"Object" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"QObject" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"wrapper" -> "QObject" [arrowsize=0.5,style="setlinewidth(0.5)"];
"QPaintDevice" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"simplewrapper" -> "QPaintDevice" [arrowsize=0.5,style="setlinewidth(0.5)"];
"QWidget" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"QObject" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"];
"QPaintDevice" -> "QWidget" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusBaseComponent" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="A generic Taurus component."];
"TaurusListener" -> "TaurusBaseComponent" [arrowsize=0.5,style="setlinewidth(0.5)"];
"BaseConfigurableClass" -> "TaurusBaseComponent" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusBaseContainer" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="Base class for the Taurus container widgets."];
"TaurusBaseWidget" -> "TaurusBaseContainer" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusBaseWidget" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="The base class for all Qt Taurus widgets."];
"TaurusBaseComponent" -> "TaurusBaseWidget" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusForm" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="A form containing specific widgets for interacting with"];
"TaurusWidget" -> "TaurusForm" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusListener" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="TaurusListener Interface"];
"Logger" -> "TaurusListener" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusWidget" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="This is a Qt.QWidget that additionally accepts a model property."];
"QWidget" -> "TaurusWidget" [arrowsize=0.5,style="setlinewidth(0.5)"];
"TaurusBaseContainer" -> "TaurusWidget" [arrowsize=0.5,style="setlinewidth(0.5)"];
"simplewrapper" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"wrapper" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded];
"simplewrapper" -> "wrapper" [arrowsize=0.5,style="setlinewidth(0.5)"];
}
-
class
TaurusForm
(parent=None, formWidget=None, buttons=None, withButtons=True, designMode=False)[source]¶ Bases:
taurus.qt.qtgui.container.tauruswidget.TaurusWidget
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 specific mappings can be defined using thesetCustomWidgetMap()
method.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','/double_scalar')] form[0].labelConfig = 'dev_alias' form[-1].writeWidgetClass = 'TaurusWheelEdit' print(len(form)) # --> outputs '3' (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
-
addModels
(modelNames)[source]¶ Adds models to the existing ones:
Parameters: modelNames ( sequence
<str
>) – the names of the models to be addedSee also
-
compact
¶
-
getCustomWidgetMap
()[source]¶ Returns the map used to create custom widgets.
Return type: dict
<str
,tuple
>Returns: a dictionary whose keys are device type strings (i.e. see PyTango.DeviceInfo
) and whose values are tuples of classname,args,kwargs
-
getFormWidget
(model=None)[source]¶ Returns a tuple that can be used for creating a widget for a given model.
Parameters: model ( str
) – a taurus model name for which the new item of the form will be createdReturn type: tuple
<type
,list
,dict
>Returns: a tuple containing a class, a list of args and a dict of keyword args. The args and the keyword args can be passed to the class constructor
-
getItemByModel
(model, index=0)[source]¶ returns the child item with given model. If there is more than one item with the same model, the index parameter can be used to distinguish among them Please note that his index is only relative to same-model items!
-
getModel
()[source]¶ Returns the model name for this component.
Return type: str
Returns: the model name.
-
classmethod
getQtDesignerPluginInfo
()[source]¶ Returns pertinent information in order to be able to build a valid QtDesigner widget plugin.
The dictionary returned by this method should contain at least the following keys and values: - ‘module’ : a string representing the full python module name (ex.: ‘taurus.qt.qtgui.base’) - ‘icon’ : a string representing valid resource icon (ex.: ‘designer:combobox.png’) - ‘container’ : a bool telling if this widget is a container widget or not.
This default implementation returns the following dictionary:
{ 'group' : 'Taurus [Unclassified]', 'icon' : 'logos:taurus.png', 'container' : False }
Return type: dict
Returns: a map with pertinent designer information
-
model
¶
-
modifiableByUser
¶ whether the user can change the contents of the widget
Return type: bool
Returns: True if the user is allowed to modify the look&feel
-
parentModelChanged
(parentmodel_name)[source]¶ Invoked when the Taurus parent model changes
Parameters: parentmodel_name ( str
) – the new name of the parent model
-
removeModels
(modelNames)[source]¶ Removes models from those already in the form.
Parameters: modelNames ( sequence
<str
>) – the names of the models to be removedSee also
-
setCustomWidgetMap
(cwmap)[source]¶ Sets a map map for custom widgets.
Parameters: cwmap ( dict
<str
,tuple
>) – a dictionary whose keys are device type strings (i.e. seePyTango.DeviceInfo
) and whose values are tuples of classname,args,kwargs
-
setModelCheck
(model, check=True)[source]¶ Sets the component taurus model. Setting the check argument to True (default) will check if the current model is equal to the given argument. If so then nothing is done. This should be the standard way to call this method since it will avoid recursion.
Parameters: - model (
str
) – the new model name - check (
bool
) – whether or not to check against the actual model name
- model (
-
setModifiableByUser
(modifiable)[source]¶ sets whether the user can change the contents of the form (e.g., via Modify Contents in the context menu) Reimplemented from
TaurusWidget.setModifiableByUser()
Parameters: modifiable ( bool
) –See also
TaurusWidget.setModifiableByUser()
-
useParentModel
¶ Returns whether this component is using the parent model
Return type: bool
Returns: True if using parent model or False otherwise
-
withButtons
¶
-