Buttons
- class qtpyvcp.widgets.button_widgets.action_button.ActionButton(parent=None, action=None)[source]
General purpose button for triggering QtPyVCP actions.
- Parameters:
parent (QWidget, optional) – The parent widget of the button, or None.
action (str, optional) – The name of the action the button should trigger.
- actionName = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.button_widgets.action_checkbox.ActionCheckBox(parent=None, action=None)[source]
General purpose checkbox for triggering QtPyVCP actions.
- Parameters:
parent (QWidget, optional) – The parent widget of the checkbox, or None.
action (str, optional) – The name of the action the checkbox should trigger.
- actionName = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.button_widgets.action_spinbox.ActionSpinBox(parent=None, action=None)[source]
Action spinbox for triggering QtPyVCP actions that take a numeric argument.
On spinbox valueChange the action will be triggered with the spinbox value passed as the action argument.
- Parameters:
parent (QWidget, optional) – The parent widget of the spindbox, or None.
action (str, optional) – The name of the action the spindbox should trigger.
- actionName = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.button_widgets.dialog_button.DialogButton(parent=None, dialog_name='')[source]
Dialog Button.
Button for launching dialogs.
- Parameters:
parent (QObject) – The dialog’s parent or None.
dialog_name (str) – The name of the dialog to show then the button is clicked.
- dialogName = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.button_widgets.mdi_button.MDIButton(parent=None, command='')[source]
MDI Button
This widget is intended for calling individual MDI commands. Useful for Go To Home, Tool Change and similar actions.
The MDI command can include variables to be expanded from widgets present in the active window. For example, to make a Change Tool button you could add an MDIButton and a QLineEdit named
tool_number_entry. Then set the the MDICommand property of the button to:T#<tool_number_entry> M6 G43
When the button is pressed
#<tool_number_entry>will be substituted with the current text in the QLineEdit.Button for issuing MDI commands.
- Parameters:
parent (QWidget, optional) – The parent widget of the button, or None.
command (str, optional) – A gcode command string for the button to trigger.
- MDICommand = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.button_widgets.subcall_button.SubCallButton(parent=None, filename='')[source]
Button for calling ngc subroutines.
- Parameters:
parent (QWidget, optional) – The parent widget of the button, or None.
filename (str, optional) – The filename of the NGCGUI style subroutine the button should call, including any extension. The subroutine must be on the subroutine path specified in the INI. The name of the subroutine must match exactly the sub/endsub name. The parameter #<parameter1> if found in the VCP the value from that widget will be used instead of the default value. If you don’t have a default value you must have a widget by the same name. The widget can be a line edit, a spin box or a double spin box.
example.ngc o<example> sub #<parameter1> = #1 #<parameter2> = #2 (=default_value) ;Body of the subroutine o<example> endsub
- filename = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.button_widgets.vcpvar_button.VCPVarPushButton(parent=None)[source]
Var Parameter Push Button
A checkable button that keeps its state in a LinuxCNC numbered parameter, such as
#3014, so the setting is stored in the var file.Toggling the button writes
#<varParameterNumber> = 1when checked or= 0when unchecked, as an MDI command,writeDelayms later. At startup, and whenever the var file changes, the button is set from the parameter: any non-zero value checks it.Setup:
Set
varParameterNumberin Qt Designer. Nothing is read or written while it is 0.The var file is found automatically from
[RS274NGC] PARAMETER_FILEin the INI, through thevar_file_managerplugin, which is loaded by default.outputAsIntmakesvalue()return 0 or 1 instead of False or True. The parameter is written as 0 or 1 either way.
Safety:
With
requireHomedon, the default, the button is disabled unless the machine is on, homed and idle. This is checked at startup and whenever homing changes, and a write is refused unless the machine is in that state.
Widget rules can set
Text,CheckedandValueas well as the standard properties.- getConfigurationInfo()[source]
Get debugging information about the current configuration.
- Returns:
Configuration information including paths and settings
- Return type:
dict
- varParameterNumber = <PySide6.QtCore.Property object>
- autoWriteEnabled = <PySide6.QtCore.Property object>
- writeDelay = <PySide6.QtCore.Property object>
- outputAsInt = <PySide6.QtCore.Property object>
- requireHomed = <PySide6.QtCore.Property object>
- setEnabled(enabled)[source]
Override setEnabled to track original state and respect safety requirements
- value()[source]
Return the current checked state as boolean or integer based on outputAsInt property
- setDisplayChecked(checked)[source]
Set checked state without triggering signals (for loading from var file)