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.

showEvent(self, e: QShowEvent)[source]
class qtpyvcp.widgets.input_widgets.file_system.QtpyVCPQFileSystemModel[source]
data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) Any[source]
class qtpyvcp.widgets.input_widgets.file_system.FileSystemTable(parent=None)[source]
showEvent(self, a0: QShowEvent)[source]
openSelectedItem(index=None)[source]

If ngc file, opens in LinuxCNC, if dir displays dir.

editSelectedFile()[source]

Open the selected file in editor.

loadSelectedFile(index=None)[source]

If ngc file, opens in LinuxCNC, if dir displays dir.

selectPrevious()[source]

Select the previous item in the view.

selectNext()[source]

Select the next item in the view.

rename()[source]

renames the selected file or folder

newFile()[source]

Create a new empty file

deleteItem()[source]

Delete the selected item (either a file or folder).

setRootPath(root_path)[source]

Sets the currently displayed path.

viewParentDirectory()[source]

View the parent directory of the current view.

getSelection()[source]

Returns list of selected indexes, or None.

class qtpyvcp.widgets.input_widgets.mdientry_widget.Validator[source]
validate(self, a0: str, a1: int) Tuple[QValidator.State, str, int][source]
class qtpyvcp.widgets.input_widgets.mdientry_widget.MDIEntry(parent=None)[source]

MDI Entry

Input any valid g Code. Enter sends the g Code.

keyPressEvent(self, a0: QKeyEvent)[source]
focusInEvent(self, a0: QFocusEvent)[source]
initialize()[source]

This method is called right before the main application starts.

terminate()[source]

This method is called right before the main application ends.

class qtpyvcp.widgets.input_widgets.action_slider.ActionSlider(parent=None)[source]

docstring for ActionSlider.

mouseDoubleClickEvent(self, a0: QMouseEvent)[source]
mousePressEvent(self, ev: QMouseEvent)[source]
mouseReleaseEvent(self, ev: QMouseEvent)[source]
keyPressEvent(self, ev: QKeyEvent)[source]
keyReleaseEvent(self, a0: QKeyEvent)[source]
class qtpyvcp.widgets.input_widgets.offset_table.ItemDelegate(columns)[source]
displayText(self, value: Any, locale: QLocale) str[source]
createEditor(self, parent: QWidget, option: QStyleOptionViewItem, index: QModelIndex) QWidget[source]
class qtpyvcp.widgets.input_widgets.offset_table.OffsetModel(parent=None)[source]
headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.DisplayRole) Any[source]
columnCount(self, parent: QModelIndex = QModelIndex()) int[source]
rowCount(self, parent: QModelIndex = QModelIndex()) int[source]
flags(self, index: QModelIndex) Qt.ItemFlags[source]
data(self, index: QModelIndex, role: int = Qt.DisplayRole) Any[source]
setData(self, index: QModelIndex, value: Any, role: int = Qt.EditRole) bool[source]
class qtpyvcp.widgets.input_widgets.offset_table.OffsetTable(parent=None)[source]
deleteSelectedOffset()[source]

Delete the currently selected item

clearOffsetTable(confirm=True)[source]

Remove all items from the model

selectedRow()[source]

Returns the row number of the currently selected row, or 0

DROLineEdit

class qtpyvcp.widgets.input_widgets.dro_line_edit.DROLineEdit(parent=None)[source]

DRO that supports typing in desired position to set work coordinate offset.

updateValue(pos=None)[source]

Update the displayed position.

keyPressEvent(self, a0: QKeyEvent)[source]
class qtpyvcp.widgets.input_widgets.action_dial.ActionDial(parent=None)[source]

docstring for ActionDial.

mousePressEvent(self, me: QMouseEvent)[source]
mouseReleaseEvent(self, me: QMouseEvent)[source]
keyPressEvent(self, ev: QKeyEvent)[source]
keyReleaseEvent(self, a0: QKeyEvent)[source]
class qtpyvcp.widgets.input_widgets.recent_file_combobox.RecentFileComboBox(parent=None)[source]
class qtpyvcp.widgets.input_widgets.tool_table.ItemDelegate(columns)[source]
displayText(self, value: Any, locale: QLocale) str[source]
createEditor(self, parent: QWidget, option: QStyleOptionViewItem, index: QModelIndex) QWidget[source]
class qtpyvcp.widgets.input_widgets.tool_table.ToolModel(parent=None)[source]
headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.DisplayRole) Any[source]
columnCount(self, parent: QModelIndex = QModelIndex()) int[source]
rowCount(self, parent: QModelIndex = QModelIndex()) int[source]
flags(self, index: QModelIndex) Qt.ItemFlags[source]
data(self, index: QModelIndex, role: int = Qt.DisplayRole) Any[source]
setData(self, index: QModelIndex, value: Any, role: int = Qt.EditRole) bool[source]
toolDataFromRow(row)[source]

Returns dictionary of tool data

class qtpyvcp.widgets.input_widgets.tool_table.ToolTable(parent=None)[source]
deleteSelectedTool()[source]

Delete the currently selected item

selectPrevious()[source]

Select the previous item in the view.

selectNext()[source]

Select the next item in the view.

clearToolTable(confirm=True)[source]

Remove all items from the model

addTool()[source]

Appends a new item to the model

loadSelectedTool()[source]

Loads the currently selected tool

selectedRow()[source]

Returns the row number of the currently selected row, or 0

GcodeTextEdit

QPlainTextEdit based G-code editor with syntax highlighting.

class qtpyvcp.widgets.input_widgets.gcode_text_edit.GcodeSyntaxHighlighter(document, font)[source]
highlightBlock(text)[source]

Apply syntax highlighting to the given block of text.

class qtpyvcp.widgets.input_widgets.gcode_text_edit.GcodeTextEdit(parent=None)[source]

G-code Text Edit

QPlainTextEdit based G-code editor with syntax heightening.

keyPressEvent(self, e: QKeyEvent)[source]
changeEvent(self, e: QEvent)[source]
syntaxHighlightingOnOff(state)[source]

Toggle syntax highlighting on/off

setPlainText(self, text: str)[source]
EditorReadOnly(state)[source]

Set to Read Only to disable editing

EditorReadWrite(state)[source]

Set to Read Only to disable editing

contextMenuEvent(self, e: QContextMenuEvent)[source]
resizeEvent(self, e: QResizeEvent)[source]
class qtpyvcp.widgets.input_widgets.gcode_text_edit.NumberMargin(parent)[source]
paintEvent(self, a0: QPaintEvent)[source]
class qtpyvcp.widgets.input_widgets.gcode_editor.GcodeLexer(parent=None, standalone=False)[source]
description(self, style: int) str[source]
defaultColor(self) QColor[source]
defaultColor(self, style: int) QColor
styleText(self, start: int, end: int)[source]
class qtpyvcp.widgets.input_widgets.gcode_editor.EditorBase(parent=None)[source]
find_text_occurences(text)[source]

Return byte positions of start and end of all ‘text’ occurences in the document

class qtpyvcp.widgets.input_widgets.gcode_editor.GcodeEditor(parent=None)[source]
class qtpyvcp.widgets.input_widgets.gcode_editor.FindReplaceDialog(parent)[source]

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.

Todo

  • add/test for styling based on the class queue codes

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.

toggleQueue(toggle)[source]

Toggle queue pause. Starting point is the queue is active.

clearQueue()[source]

Clear queue items pending run state for items yet to be run.

removeSelectedItem()[source]

Remove the selected lines

removeAll()[source]

Remove all items from list and from history

runFromSelection()[source]

Start running MDI from the selected row back to correct end.

runSelection()[source]

Run the selected row only.

submit()[source]

Put a new command on the queue for later execution.

rowClicked()[source]

Item row clicked.

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.

heartBeat()[source]

Supports heart beat on the MDI History execution queue. Issue the next command from the queue. Double check machine is in ok state to accept next command. Issue the command and if success mark command as being active. Mark last command as done.

initialize()[source]

Load up starting data and set signal connections.

terminate()[source]

Teardown processing.

Line Edit

class qtpyvcp.widgets.input_widgets.line_edit.VCPLineEdit(parent=None)[source]

VCP Entry Widget

initialize()[source]

This method is called right before the main application starts.

terminate()[source]

This method is called right before the main application ends.

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

mousePressEvent(self, e: QMouseEvent)[source]
mouseReleaseEvent(self, e: QMouseEvent)[source]
keyPressEvent(self, e: QKeyEvent)[source]
keyReleaseEvent(self, e: QKeyEvent)[source]
class qtpyvcp.widgets.input_widgets.setting_slider.VCPAbstractSettingsWidget[source]
class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsLineEdit(parent)[source]

Settings LineEdit

initialize()[source]

This method is called right before the main application starts.

class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsSlider(parent)[source]

Settings Slider

Set action options like:

machine.jog.linear-speed
mouseDoubleClickEvent(self, a0: QMouseEvent)[source]
initialize()[source]

This method is called right before the main application starts.

class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsSpinBox(parent)[source]

Settings SpinBox

initialize()[source]

This method is called right before the main application starts.

class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsDoubleSpinBox(parent)[source]

Settings DoubleSpinBox

initialize()[source]

This method is called right before the main application starts.

class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsCheckBox(parent)[source]

Settings CheckBox

initialize()[source]

This method is called right before the main application starts.

class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsPushButton(parent)[source]

Settings PushButton

initialize()[source]

This method is called right before the main application starts.

class qtpyvcp.widgets.input_widgets.setting_slider.VCPSettingsComboBox(parent)[source]

Settings ComboBox

initialize()[source]

This method is called right before the main application starts.