TaurusCommandButton¶
Bases:
PyQt4.QtGui.QPushButton,taurus.qt.qtgui.base.taurusbase.TaurusBaseWidgetThis class provides a button that executes a tango command on its device.
Code examples:
# a button that executes the "status" command for the 'a/b/c' device server button = TaurusCommandButton(command = 'Status', icon='logos:taurus.png') button.setModel('a/b/c') # a button that executes the "exec" command for the 'a/b/c' device server with one parameter button = TaurusCommandButton(command = 'Status', parameters=['2+2'],icon='logos:taurus.png') button.setModel('a/b/c')
See also
TaurusCommandsFormprovides a good example of use of TaurusCommandButton (including managing the return value)returns the command name to be executed when the button is clicked
Return type: strorNoneReturns: the command name
Returns the custom text of the buttom, or None if no custom text is used
see
TaurusBaseComponent.displayValue()
returns the parameters to be used on command execution
Parameters: parameters ( sequence) –
Returns the number of seconds to wait for the result of the command (or -1 if timeout is disabled)
equivalent to self.setCommand(None)
Equivalent to setCustomText(None)
Equivalent to setParameters([])
Equivalent to setTimeout(None)
sets the command to be executed when the button is clicked
Parameters: commandName ( strorNone) – the command name
Sets a custom text for the button (by default it is the command name)
Parameters: customText ( strorNone) – the custom text. If None passed, it will use the command name
Sets the parameters to be used on command execution.
Parameters: parameters ( sequence) – a sequence of parameters. If the elements of the sequence are not of the right type required for the parameter, an automatic conversion will be attempted on execution time. As a special case, if parameters is a string not starting and ending in quote characters, it will be splitted on whitespace to obtain a sequence of parameters. If it is a string starting and ending with quotes, the quotes will be removed and the quoted text will not be splitted.