Input Widgets
- class qtpyvcp.widgets.input_widgets.jog_increment.JogIncrementWidget(parent=None, standalone=False)[source]
- class qtpyvcp.widgets.input_widgets.file_system.RemovableDeviceComboBox(parent=None)[source]
ComboBox for choosing from a list of removable devices.
- class qtpyvcp.widgets.input_widgets.file_system.FileSystemTable(parent=None)[source]
-
- fixedNameColumn = <PySide6.QtCore.Property object>
- nameColumnsWidth = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.input_widgets.mdientry_widget.MDIEntry(parent=None)[source]
MDI Entry
Input any valid g Code. Enter sends the g Code.
- class qtpyvcp.widgets.input_widgets.action_slider.ActionSlider(parent=None)[source]
docstring for ActionSlider.
- actionName = <PySide6.QtCore.Property object>
DROLineEdit
- class qtpyvcp.widgets.input_widgets.dro_line_edit.DROLineEdit[source]
DRO that supports typing in desired position to set work coordinate offset.
- class qtpyvcp.widgets.input_widgets.action_dial.ActionDial(parent=None)[source]
docstring for ActionDial.
- actionName = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.input_widgets.tool_table_editor.ToolTableEditor(parent=None)[source]
Tool Table Editor
Edits the tool table: the standard LinuxCNC columns, plus your own custom columns when the tool database is used. For a lathe or a mill use
LatheToolTableorMillToolTable, which add that machine’s columns.Works with either
tooltabledata plugin:qtpyvcp.plugins.tool_table:ToolTable– the classic.tblfile, standard columns only.qtpyvcp.plugins.db_tool_table:DBToolTable– the tool database, which adds the machine columns and custom columns.
Connect buttons to these slots in Qt Designer. The first seven are the same slots as the
ToolTablewidget, so either widget can be used with the same connections.Slot
What it does
addTool()Adds a tool numbered after the highest one
deleteSelectedTool()Deletes the selected tool
saveToolTable()Saves all changes and loads the table into LinuxCNC
loadToolTable()Reloads the table, discarding unsaved changes
clearToolTable()Deletes every tool
loadSelectedTool()Loads the selected tool with
T<n> M6selectPrevious()Selects the tool above
selectNext()Selects the tool below
renumberSelectedTool()Changes the selected tool’s number
duplicateSelectedTool()Copies the selected tool to the first free number
showAddColumnDialog()Adds a custom column, tool database only
Set
confirmActionsto ask before saving, reloading, deleting and clearing. The signaltoolSelected(int)gives the tool number when a row is clicked, anddirtyChanged(bool)reports whether there are unsaved changes.In the table:
Right-click a column header to show or hide columns, show them all, or go back to the default set. With the tool database the choice is remembered, and custom columns can be added and removed there too.
Right-click a cell to duplicate the tool, or to copy the names that read that value from G-code or a widget rule.
Double-click a tool number, in the T column or the row header, to renumber the tool.
The tool in the spindle is marked with
currentToolColorandcurrentToolBackground.Every column is locked while a program is running.
- class qtpyvcp.widgets.input_widgets.lathe_tool_table.LatheToolTable(parent=None)[source]
Lathe Tool Table
The tool table editor,
ToolTableEditor, with the lathe columns of the tool database: tool type, insert shape and size, holder, hand, threading values, spindle direction and more.It needs the
DBToolTableplugin serving the lathe columns, which is its default. In the VCP’s YAML config:data_plugins: tooltable: provider: qtpyvcp.plugins.db_tool_table:DBToolTable kwargs: extras: lathe
If the plugin serves another machine’s columns instead, the lathe columns are hidden and an error is logged. The standard and custom columns still work.
Type, Hand, Tip Type and Spindle Dir are pick-lists of the values the database accepts.
Insert Shape and Holder offer the choices that fit the tool’s type, and accept other values too.
Size Mode is filled in from Type and Insert Shape.
On grooving and parting tools, Insert Size shows the groove width.
Columns nothing reads back, such as Notes and Holder OAL, are hidden by default. Show them from the column header menu.
- class qtpyvcp.widgets.input_widgets.mill_tool_table.MillToolTable(parent=None)[source]
Mill Tool Table
The tool table editor,
ToolTableEditor, with the mill column of the tool database, ATC: whether the tool fits in the automatic tool changer. Every tool starts ticked. Untick oversize tools, so a tool change macro can use it to ask for a manual change instead.It needs the
DBToolTableplugin serving the mill columns. In the VCP’s YAML config:data_plugins: tooltable: provider: qtpyvcp.plugins.db_tool_table:DBToolTable kwargs: extras: mill
The Remark column is shown last, after ATC.
GcodeTextEdit
QTextEdit based G-code editor with syntax highlighting.
- class qtpyvcp.widgets.input_widgets.gcode_text_edit.ColumnFormatterDelegate(parent=None, alignment=None, margin=None, padding=None, formatter=None, text_padding=None)[source]
Flexible delegate for column formatting with configurable alignment, padding, and text formatting.
- qtpyvcp.widgets.input_widgets.gcode_text_edit.format_date(value, locale)[source]
Format dates as MM/DD/YY HH:MM AM/PM
- qtpyvcp.widgets.input_widgets.gcode_text_edit.format_size(value, locale)[source]
Format file sizes with two-letter abbreviations.
- class qtpyvcp.widgets.input_widgets.gcode_text_edit.GcodeTextEdit(parent=None)[source]
G-code Text Edit
QTextEdit based G-code editor with syntax heightening.
- findNext(text, case_sensitive=False, whole_words=False, use_regex=False, wrap=True)[source]
Find next occurrence of text. Returns True if found, False otherwise.
- findPrevious(text, case_sensitive=False, whole_words=False, use_regex=False, wrap=True)[source]
Find previous occurrence of text. Returns True if found, False otherwise.
- replaceCurrent(search_text, replace_text, case_sensitive=False, whole_words=False, use_regex=False)[source]
Replace the currently selected text if it matches the search text. Returns True if replaced, False otherwise.
- replaceCurrentWithUndo(search_text, replace_text, case_sensitive=False, whole_words=False, use_regex=False)[source]
Replace the current selection and return undo data for that replacement. Returns a dict with position and text info, or None if no replacement.
- replaceAllWithUndo(search_text, replace_text, case_sensitive=False, whole_words=False, use_regex=False)[source]
Replace all occurrences and return undo data for those replacements. Returns a list of dicts with position and text info.
- getMatchCount(text, case_sensitive=False, whole_words=False, use_regex=False)[source]
Count the total number of matches in the document.
- getCurrentMatchIndex(text, case_sensitive=False, whole_words=False, use_regex=False)[source]
Get the index of the current match (1-based). Returns 0 if no current selection or selection doesn’t match.
- class qtpyvcp.widgets.input_widgets.gcode_editor.GcodeEditor(parent=None)[source]
- backgroundcolor = <PySide6.QtCore.Property object>
- marginbackgroundcolor = <PySide6.QtCore.Property object>
QtPyVCP MDI History Widget
This widget implements the following key elements: [1] A history display of MDI commands issued with the latest command at the top of the list and the oldest at the bottom of the list.
[2] A queue system of commands that have been entered but have not yet been executed. This allows the rapid entry of MDI commands to be executed without having to wait for any running commands to complete.
- class qtpyvcp.widgets.input_widgets.mdihistory_widget.MDIHistory(parent=None)[source]
MDI History and Queuing Widget.
This widget implements a visual view of the MDI command history. It also implements a command queuing startegy so that commands can be entered and queued up for execution. Visual style is used to identify items that have been completed, are running and are yet to run.
- mdiEntrylineName = <PySide6.QtCore.Property object>
- mdiListOrderNatural = <PySide6.QtCore.Property object>
- keyPressEvent(event)[source]
Key movement processing. Arrow keys move the selected list item up/down Return key generates a submit situation by making the item as the next available command to processes.
- setHistory(items_list)[source]
Clear and reset the history in the list. item_list is a list of strings.
Line Edit
- class qtpyvcp.widgets.input_widgets.line_edit.VCPLineEdit(parent=None)[source]
VCP Entry Widget
- highPrecisionStorage = <PySide6.QtCore.Property object>
- displayDecimals = <PySide6.QtCore.Property object>
- actionName = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.input_widgets.var_line_edit.VCPVarLineEdit(parent=None)[source]
Var Parameter Line Edit
A number entry that reads and writes a LinuxCNC numbered parameter, such as
#3014, so the value is stored in the var file.A value typed in is written when editing finishes, on Enter, Tab or leaving the field, as the MDI command
#<varParameterNumber> = <value>to 6 decimal places, the precision the var file stores. Text set any other way, for example by a widget rule, is writtenwriteDelayms later.At startup, and whenever the var file changes, the field shows the parameter’s value. It is not overwritten while the field has focus, or when a widget rule sets its
Text.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.displayDecimalssets how many decimals are shown, 4 by default and 6 at most. The value is always stored to 6.
Safety:
With
requireHomedon, the default, the field 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.
- 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>
- displayDecimals = <PySide6.QtCore.Property object>
- requireHomed = <PySide6.QtCore.Property object>
- setEnabled(enabled)[source]
Override setEnabled to track original state and respect safety requirements
- onEditingFinished()[source]
Handle user editing with 6-decimal precision storage and display formatting
- writeToLinuxCNC(force=False)[source]
Public method to manually trigger writing to LinuxCNC parameters.
- Parameters:
force (bool) – If True, write immediately without delay
- readParameterFromVarFile(parameter_number=None)[source]
Read a parameter value directly from the var file.
- Parameters:
parameter_number (int) – Parameter number to read. If None, uses self._var_parameter_number
- Returns:
The parameter value with 6-decimal precision, or None if not found
- Return type:
float or None
- class qtpyvcp.widgets.input_widgets.action_combobox.ActionComboBox(parent=None)[source]
General purpose combobox for triggering QtPyVCP actions.
- Parameters:
parent (QWidget) – The parent widget of the combobox, or None.
- _action_name
The fully qualified name of the action the combobox triggers when the selection is changed.
- Type:
str
- actionName = <PySide6.QtCore.Property object>
- class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsLineEdit(parent)[source]
Settings LineEdit
- settingTypeMode = <PySide6.QtCore.Property object>
- highPrecisionStorage = <PySide6.QtCore.Property object>
- displayDecimals = <PySide6.QtCore.Property object>
- clearValue()[source]
Clear field while committing the new value through setting channels.
This is intended for Qt Designer signal-slot connections that need a no-argument slot. For numeric settings, it writes zero (instead of an empty string) so downstream consumers do not keep stale values.
- onSettingChanged(value)[source]
Apply an external setting change to the widget.
Refreshes the high-precision internal cache BEFORE updating the display – setSetting()-driven restores (e.g. loading a stored operation back into a page) must be reflected by value(), not just by the visible text, otherwise value() keeps returning whatever was last typed into the field even though the field displays the restored number. normalizeValue() is lossless for in-range floats, so the setting’s value is safe to adopt as the new full-precision cache.
- class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsSlider(parent)[source]
Settings Slider
Set action options like:
machine.jog.linear-speed
- class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsSpinBox(parent)[source]
Settings SpinBox
- class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsDoubleSpinBox(parent)[source]
Settings DoubleSpinBox
- class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsCheckBox(parent)[source]
Settings CheckBox
- class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsPushButton(parent)[source]
Settings PushButton with configurable output type and fail-fast validation
- outputAsInt = <PySide6.QtCore.Property object>
- value()[source]
Return the current checked state as boolean or integer based on outputAsInt property