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, QShowEvent)[source]
class qtpyvcp.widgets.input_widgets.file_system.FileSystemTable(parent=None)[source]
showEvent(self, 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()[source]

Loads the selected file into LinuxCNC.

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.

hiddenColumns

String of comma separated column numbers to hide.

class qtpyvcp.widgets.input_widgets.mdientry_widget.Validator[source]
validate(self, str, 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, QKeyEvent)[source]
focusInEvent(self, 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.

actionName

The fully qualified name of the action the slider should trigger.

Returns:The action name.
Return type:str
class qtpyvcp.widgets.input_widgets.offset_table.ItemDelegate(columns)[source]
displayText(self, Any, QLocale) → str[source]
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget[source]
class qtpyvcp.widgets.input_widgets.offset_table.OffsetModel(parent=None)[source]
headerData(self, int, Qt.Orientation, role: int = Qt.DisplayRole) → Any[source]
columnCount(self, parent: QModelIndex = QModelIndex()) → int[source]
rowCount(self, parent: QModelIndex = QModelIndex()) → int[source]
flags(self, QModelIndex) → Qt.ItemFlags[source]
data(self, QModelIndex, role: int = Qt.DisplayRole) → Any[source]
setData(self, QModelIndex, 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, QKeyEvent)[source]
class qtpyvcp.widgets.input_widgets.action_dial.ActionDial(parent=None)[source]

docstring for ActionDial.

actionName

The fully qualified name of the action the dial should trigger.

Returns:The action name.
Return type:str
class qtpyvcp.widgets.input_widgets.recent_file_combobox.RecentFileComboBox(parent=None)[source]
class qtpyvcp.widgets.input_widgets.tool_table.ItemDelegate(columns)[source]
displayText(self, Any, QLocale) → str[source]
createEditor(self, QWidget, QStyleOptionViewItem, QModelIndex) → QWidget[source]
class qtpyvcp.widgets.input_widgets.tool_table.ToolModel(parent=None)[source]
headerData(self, int, Qt.Orientation, role: int = Qt.DisplayRole) → Any[source]
columnCount(self, parent: QModelIndex = QModelIndex()) → int[source]
rowCount(self, parent: QModelIndex = QModelIndex()) → int[source]
flags(self, QModelIndex) → Qt.ItemFlags[source]
data(self, QModelIndex, role: int = Qt.DisplayRole) → Any[source]
setData(self, QModelIndex, 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(parent)[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, QKeyEvent)[source]
changeEvent(self, QEvent)[source]
setPlainText(self, str)[source]
EditorReadOnly(state)[source]

Set to Read Only to disable editing

contextMenuEvent(self, QContextMenuEvent)[source]
resizeEvent(self, QResizeEvent)[source]
class qtpyvcp.widgets.input_widgets.gcode_text_edit.NumberMargin(parent)[source]
paintEvent(self, QPaintEvent)[source]
class qtpyvcp.widgets.input_widgets.gcode_editor.GcodeLexer(parent=None, standalone=False)[source]
description(self, int) → str[source]
defaultColor(self) → QColor[source]

defaultColor(self, int) -> QColor

styleText(self, int, 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]
backgroundcolor

Property to set the background color of the GCodeEditor (str).

sets the background color of the GCodeEditor

marginbackgroundcolor

Property to set the background color of the GCodeEditor margin (str).

sets the background color of the GCodeEditor margin

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
  • be able to select and remove unwanted commands from the history
  • be able to select a row and run commands from that point upwards
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

Return name of entry object to Designer

mdiListOrderNatural

Return if list order is Natural - True/False

toggleQueue(toggle)[source]

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

clearQueue()[source]

Clear queue items yet to be run.

removeSelectedItem()[source]

Remove the selected line

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

actionName

The name of the action the entry should trigger.

Returns:The action name.
Return type:str
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
actionName
The actionName property for setting the action the combobox
should trigger from within QtDesigner.
Returns:The action name.
Return type:str
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
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.