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.

class qtpyvcp.widgets.button_widgets.mdi_button.MDIButton(parent=None, command='')[source]

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

Sets the MDI command property (str).

A valid RS274 gcode command string. It can include variables to be expanded from UI widgets present in the active window.

Example

Assuming there is a QLineEdit in the active window with the objectName tool_number_entry, the #<tool_number_entry> variable would be substituted with the current text in the QLineEdit:

T#<tool_number_entry> M6 G43