Import LinuxCNC source tree

This commit is contained in:
Wang Dequan
2026-08-20 06:17:39 +08:00
commit 2c814634c3
9429 changed files with 10556013 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Empty package file for widgets provided with Qt Quarterly 26.
# Widgets are provided in a package to avoid problems if modules with
# generic names are installed in Python's site-packages directory.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.bar import HalBar
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# DRO
####################################
class HalBarPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(HalBarPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return HalBar(parent)
def name(self):
return "HalBar"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('halbar_label')))
def toolTip(self):
return "HAL Bar Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="HalBar" name="hal_bar" />\n'
def includeFile(self):
return "qtvcp.widgets.bar"

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.basic_probe import BasicProbe
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# BasicProbe
####################################
class BasicProbePlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(BasicProbePlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return BasicProbe(parent)
def name(self):
return "BasicProbe"
def group(self):
return "Linuxcnc - Widgets"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('basicprobe')))
def toolTip(self):
return "Probe Screen Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="BasicProbe" name="basicprobe" />\n'
def includeFile(self):
return "qtvcp.widgets.basic_probe"

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.camview_widget import CamView
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class CamViewPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(CamViewPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return CamView(parent)
def name(self):
return "CamView"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QIcon(QPixmap(ICON.get_path('camview')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="CamView" name="camview" />\n'
def includeFile(self):
return "qtvcp.widgets.camview_widget"

View File

@@ -0,0 +1,97 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.container_widgets import StateEnableGridLayout
from qtvcp.widgets.container_widgets import JointEnableWidget
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# Linuxcnc State Enable GridLayout
####################################
class StateEnableGridLayoutPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(StateEnableGridLayoutPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return StateEnableGridLayout(parent)
def name(self):
return "StateEnableGridLayout"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('state_enable_gridlayout')))
def toolTip(self):
return "Linuxcnc State enable/disable GridLayout widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="StateEnableGridLayout" name="state_enable_gridLayout" />\n'
def includeFile(self):
return "qtvcp.widgets.container_widgets"
####################################
# Linuxcnc State Enable GridLayout
####################################
class JointEnableWidgetPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(JointEnableWidgetPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return JointEnableWidget(parent)
def name(self):
return "JointEnableWidget"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('jointenablewidget')))
def toolTip(self):
return "Linuxcnc Joint Availability enable/disable widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="JointEnableWidget" name="jointenablewidget" />\n'
def includeFile(self):
return "qtvcp.widgets.container_widgets"

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.detach_tabs import DetachTabWidget
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# Linuxcnc State Enable GridLayout
####################################
class DetachTabWidgetPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(DetachTabWidgetPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return DetachTabWidget(parent)
def name(self):
return "DetachTabWidget"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('detachtabwidget')))
def toolTip(self):
return "Tans can be detached from main widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="DetachTabWidget" name="dtabwidget" />\n'
def includeFile(self):
return "qtvcp.widgets.detach_tabs"

View File

@@ -0,0 +1,499 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.dialog_widget import *
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class DialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(DialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return LcncDialog(parent)
def name(self):
return "LcncDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('lcncdialog')))
def toolTip(self):
return "Basic Message Dialog"
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="LcncDialog" name="lcncdialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"
###############################################################################
# manual Tool Change Dialog
###############################################################################
class ToolDialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(ToolDialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return ToolDialog(parent)
def name(self):
return "ToolDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('tooldialog')))
def toolTip(self):
return "Manual Tool Change Prompt Widgets"
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="ToolDialog" name="tooldialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"
###############################################################################
# File Dialog
###############################################################################
class FileDialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(FileDialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return FileDialog(parent)
def name(self):
return "FileDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('iledialog')))
def toolTip(self):
return "Gcode File Selection Dialog"
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="FileDialog" name="filedialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"
###############################################################################
# Cam Dialog
###############################################################################
class CamViewDialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(CamViewDialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return CamViewDialog(parent)
def name(self):
return "CamViewDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('camviewdialog')))
def toolTip(self):
return "Web Cam View alignment Dialog"
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="CamViewDialog" name="camviewdialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"
###############################################################################
# MacroTab Dialog
###############################################################################
class MacroTabDialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(MacroTabDialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return MacroTabDialog(parent)
def name(self):
return "MacroTabDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('macrotabdialog')))
def toolTip(self):
return "Macro program Selection Dialog"
def whatsThis(self):
return "Uses it to select short convenience subroutines"
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="MacroTabDialog" name="_macrotabdialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"
###############################################################################
# OriginOffset Dialog
###############################################################################
class OriginOffsetDialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(OriginOffsetDialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return OriginOffsetDialog(parent)
def name(self):
return "OriginOffsetDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('originoffsetdialog')))
def toolTip(self):
return "Origin Offset Editing Dialog"
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="OriginOffsetDialog" name="originoffsetdialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"
###############################################################################
# ToolChooser Dialog
###############################################################################
class ToolChooserDialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(ToolChooserDialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return ToolChooserDialog(parent)
def name(self):
return "ToolChooserDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('Toolchooserdialog')))
def toolTip(self):
return "Tool Chooser Dialog"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="ToolChooserDialog" name="toolchooserdialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"
###############################################################################
# ToolOffset Dialog
###############################################################################
class ToolOffsetDialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(ToolOffsetDialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return ToolOffsetDialog(parent)
def name(self):
return "ToolOffsetDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('Tooloffsetdialog')))
def toolTip(self):
return "Tool Offset Editing Dialog"
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="ToolOffsetDialog" name="tooloffsetdialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"
###############################################################################
# VersaProbe Dialog
###############################################################################
class VersaProbeDialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(VersaProbeDialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return VersaProbeDialog(parent)
def name(self):
return "VersaProbeDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('versaprobedialog')))
def toolTip(self):
return "Probe Dialog Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="VersaProbeDialog" name="versaprobedialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"
###############################################################################
# Entry Dialog
###############################################################################
class EntryDialogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(EntryDialogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return EntryDialog(parent)
def name(self):
return "EntryDialog"
def group(self):
return "Linuxcnc - Dialogs"
def icon(self):
return QIcon(QPixmap(ICON.get_path('entrydialog')))
def toolTip(self):
return "Basic Entry Dialog"
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="EntryDialog" name="entrydialog" />\n'
def includeFile(self):
return "qtvcp.widgets.dialog_widget"

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.gcode_graphics import GCodeGraphics
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# GCodeGraphics
####################################
class GCodeGraphicsPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(GCodeGraphicsPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return GCodeGraphics(parent)
def name(self):
return "GCodeGraphics"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('gcodegraphics')))
def toolTip(self):
return "Graphics5 widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="GCodeGraphics" name="gcodegraphics" />\n'
def includeFile(self):
return "qtvcp.widgets.gcode_graphics"

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.hal_label import HALLabel
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# Label Display
####################################
class HALLabelPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(HALLabelPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return HALLabel(parent)
def name(self):
return "HALLabel"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QIcon(QPixmap(ICON.get_path('hallabel')))
def toolTip(self):
return "HAL Pin Display widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="HALLabel" name="hallabel" />\n'
def includeFile(self):
return "qtvcp.widgets.hal_label"

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.jog_increments import JogIncrements
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class JogIncrementsPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(JogIncrementsPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return JogIncrements(parent)
def name(self):
return "JogIncrements"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QIcon(QPixmap(ICON.get_path('jogincrements')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="JogIncrements" name="jogincrements" />\n'
def includeFile(self):
return "qtvcp.widgets.jog_increments"

View File

@@ -0,0 +1,94 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.joypad import JoyPad, HALPad
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# HAL Joypad widget
####################################
class JoyPadPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(JoyPadPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return JoyPad(parent)
def name(self):
return "JoyPad"
def group(self):
return "Linuxcnc - Widgets"
def icon(self):
return QIcon(QPixmap(ICON.get_path('JoyPad')))
def toolTip(self):
return "JoyPad Selection Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="JoyPad" name="joypad" />\n'
def includeFile(self):
return "qtvcp.widgets.joypad"
####################################
# HAL Joypad widget
####################################
class HALPadPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(HALPadPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return HALPad(parent)
def name(self):
return "HALPad"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QIcon(QPixmap(ICON.get_path('HALPad')))
def toolTip(self):
return "HAL JoyPad Selection Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="HALPad" name="halpad" />\n'
def includeFile(self):
return "qtvcp.widgets.joypad"

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.led_widget import LED
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class LEDPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(LEDPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return LED(parent)
def name(self):
return "LED"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QIcon(QPixmap(ICON.get_path('led')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="LED" name="led" />\n'
def includeFile(self):
return "qtvcp.widgets.led_widget"

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.nurbs_editor import NurbsEditor
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# HAL NurbsEditor widget
####################################
class NurbsEditorPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(NurbsEditorPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return NurbsEditor(parent)
def name(self):
return "NurbsEditor"
def group(self):
return "Linuxcnc - Widgets"
def icon(self):
return QIcon(QPixmap(ICON.get_path('NurbsEditor')))
def toolTip(self):
return "Nurbs Gcode Editor Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="NurbsEditor" name="nurbseditor" />\n'
def includeFile(self):
return "qtvcp.widgets.nurbseditor"

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.overlay_widget import FocusOverlay
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class FocusOverlayPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(FocusOverlayPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return FocusOverlay(parent)
def name(self):
return "FocusOverlay"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QIcon(QPixmap(ICON.get_path('focusoverlay')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return True
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="FocusOverlay" name="focusoverlay" />\n'
def includeFile(self):
return "qtvcp.widgets.overlay_widget"

View File

@@ -0,0 +1,62 @@
#!/usr/bin/env python3
# QT Designer custom widget plugin imports for linuxcnc
#
# Chris Morley copyright 2012
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# helps confirm designer is set up with right paths
print('Qtvcp python plugin found:',__file__)
from qtvcp.core import Info
i = Info()
i.update()
# HAL only widgets
from qtvcp.plugins.simplewidgets_plugin import *
from qtvcp.plugins.led_plugin import LEDPlugin
from qtvcp.plugins.hal_label_plugin import HALLabelPlugin
from qtvcp.plugins.detach_tabs_plugin import DetachTabWidgetPlugin
from qtvcp.plugins.round_progress_bar_plugin import RoundProgressBarPlugin
from qtvcp.plugins.joypad_plugin import *
# plain widgets
from qtvcp.plugins.nurbs_editor_plugin import NurbsEditorPlugin
from qtvcp.plugins.web_widget_plugin import WebWidgetPlugin
# Linuxcnc widgets
from qtvcp.plugins.container_plugin import StateEnableGridLayoutPlugin
from qtvcp.plugins.container_plugin import JointEnableWidgetPlugin
from qtvcp.plugins.graphics_plugin import GCodeGraphicsPlugin
from qtvcp.plugins.widgets_plugin import *
from qtvcp.plugins.state_led_plugin import StateLEDPlugin
from qtvcp.plugins.status_label_plugin import StatusLabelPlugin
from qtvcp.plugins.state_label_plugin import StateLabelPlugin
from qtvcp.plugins.actionbutton_plugin import *
from qtvcp.plugins.dialog_plugin import *
from qtvcp.plugins.overlay_plugin import FocusOverlayPlugin
from qtvcp.plugins.status_slider_plugin import StatusSliderPlugin
from qtvcp.plugins.status_adjustment_bar_plugin import StatusAdjustmentBarPlugin
from qtvcp.plugins.screenoptions_plugin import LcncScreenOptionsPlugin
from qtvcp.plugins.jogincrements_plugin import JogIncrementsPlugin
from qtvcp.plugins.camview_plugin import CamViewPlugin
from qtvcp.plugins.toolbutton_plugin import *
from qtvcp.plugins.versa_probe_plugin import VersaProbePlugin
from qtvcp.plugins.basic_probe_plugin import BasicProbePlugin
from qtvcp.plugins.tab_widget_plugin import TabWidgetPlugin
from qtvcp.plugins.virtualkeyboard_plugin import VirtualKeyboardPlugin
from qtvcp.plugins.round_gauge_plugin import GaugePlugin
from qtvcp.plugins.bar_plugin import HalBarPlugin

View File

@@ -0,0 +1,53 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.round_gauge import Gauge
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class GaugePlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(GaugePlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return Gauge(parent)
def name(self):
return "Gauge"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QIcon(QPixmap(ICON.get_path('gauge')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="Gauge" name="gauge" />\n'
def includeFile(self):
return "qtvcp.widgets.round_gauge"

View File

@@ -0,0 +1,59 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.round_progress import RoundProgressBar
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class RoundProgressBarPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(RoundProgressBarPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
w = RoundProgressBar(parent)
w.setFormat('%v')
w.setValue(70)
w.valueFormatChanged()
return w
def name(self):
return "RoundProgressBar"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QIcon(QPixmap(ICON.get_path('roundprogressbar')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="RoundProgressBar" name="RoundProgressBar" />\n'
def includeFile(self):
return "qtvcp.widgets.round_progress"

View File

@@ -0,0 +1,170 @@
#!/usr/bin/env python3
from qtpy import QtCore, QtGui, QtWidgets
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin, \
QPyDesignerTaskMenuExtension, QExtensionFactory, \
QDesignerFormWindowInterface
from qtvcp.widgets.screen_options import ScreenOptions
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# ScreenOptions
####################################
class LcncScreenOptionsPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(LcncScreenOptionsPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
manager = formEditor.extensionManager()
if manager:
self.factory = \
screenOptionsTaskMenuFactory(manager)
manager.registerExtensions(
self.factory,
"org.qt-project.Qt.Designer.TaskMenu")
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return ScreenOptions(parent)
def name(self):
return "ScreenOptions"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('screenoptions')))
def toolTip(self):
return "ScreenOptions widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="ScreenOptions" name="screen_options" />\n'
def includeFile(self):
return "qtvcp.widgets.screen_options"
class screenOptionsDialog(QtWidgets.QDialog):
def __init__(self, widget, parent=None):
QtWidgets.QDialog.__init__(self, parent)
self.widget = widget
self.previewWidget = ScreenOptions()
self.previewWidget.notify_option = widget.notify_option
buttonBox = QtWidgets.QDialogButtonBox()
okButton = buttonBox.addButton(buttonBox.Ok)
cancelButton = \
buttonBox.addButton(buttonBox.Cancel)
okButton.clicked.connect(self.updateWidget)
cancelButton.clicked.connect(self.reject)
layout = QtWidgets.QGridLayout()
self.c_notify = QtWidgets.QCheckBox("Desktop Notify Errors")
self.c_notify.setChecked(widget.desktop_notify)
self.c_notify_max_msgs = QtWidgets.QSpinBox()
self.c_notify_max_msgs.setValue(widget.notify_max_messages)
self.c_notify_max_msgs.setRange(1, 10)
self.c_notify_max_msgs_label = QtWidgets.QLabel('Max Errors Shown')
self.c_errors = QtWidgets.QCheckBox("Catch Errors")
self.c_errors.setChecked(widget.catch_errors)
self.c_close = QtWidgets.QCheckBox("Catch close Event")
self.c_close.setChecked(widget.close_event)
self.c_play_sounds = QtWidgets.QCheckBox("Play Sounds")
self.c_play_sounds.setChecked(widget.play_sounds)
self.c_use_pref_file = QtWidgets.QCheckBox("Set up a Preference File")
self.c_use_pref_file.setChecked(widget.use_pref_file)
self.e_hal_base_name = QtWidgets.QLineEdit()
self.e_hal_base_name.setText(widget._halBaseName)
layout.addWidget(self.c_notify)
layout.addWidget(self.c_notify_max_msgs)
layout.addWidget(self.c_notify_max_msgs_label,1,1,1,1)
layout.addWidget(self.c_errors,2,0,1,1)
layout.addWidget(self.c_close,3,0,1,1)
layout.addWidget(self.c_play_sounds,4,0,1,1)
layout.addWidget(self.c_use_pref_file,5,0,1,1)
layout.addWidget(QtWidgets.QLabel('HAL Component Base Name:'),6,0,1,1)
layout.addWidget(self.e_hal_base_name,6,1,1,1)
layout.addWidget(buttonBox, 7, 0, 1, 2)
self.setLayout(layout)
self.setWindowTitle(self.tr("Set Options"))
def updateWidget(self):
formWindow = \
QDesignerFormWindowInterface.findFormWindow(
self.widget)
if formWindow:
formWindow.cursor().setProperty("notify_option",
self.c_notify.isChecked())
formWindow.cursor().setProperty("notify_max_messages",
self.c_notify_max_msgs.value())
formWindow.cursor().setProperty("catch_errors_option",
self.c_errors.isChecked())
formWindow.cursor().setProperty("catch_close_option",
self.c_close.isChecked())
formWindow.cursor().setProperty("play_sounds_option",
self.c_play_sounds.isChecked())
formWindow.cursor().setProperty("use_pref_file_option",
self.c_use_pref_file.isChecked())
formWindow.cursor().setProperty("halCompBaseName",
self.e_hal_base_name.text())
self.accept()
class screenOptionsMenuEntry(QPyDesignerTaskMenuExtension):
def __init__(self, widget, parent):
QPyDesignerTaskMenuExtension.__init__(self, parent)
self.widget = widget
self.editStateAction = QtWidgets.QAction(
self.tr("Set Options..."), self)
self.editStateAction.triggered.connect(self.updateLocation)
def preferredEditAction(self):
return self.editStateAction
def taskActions(self):
return [self.editStateAction]
def updateLocation(self):
dialog = screenOptionsDialog(self.widget)
dialog.exec()
class screenOptionsTaskMenuFactory(QExtensionFactory):
def __init__(self, parent=None):
QExtensionFactory.__init__(self, parent)
def createExtension(self, obj, iid, parent):
if iid != "org.qt-project.Qt.Designer.TaskMenu":
return None
if isinstance(obj, ScreenOptions):
return screenOptionsMenuEntry(obj, parent)
return None

View File

@@ -0,0 +1,920 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.simple_widgets import IndicatedPushButton
from qtvcp.widgets.simple_widgets import PushButton
from qtvcp.widgets.simple_widgets import CheckBox
from qtvcp.widgets.simple_widgets import RadioButton
from qtvcp.widgets.simple_widgets import LCDNumber
from qtvcp.widgets.simple_widgets import Slider
from qtvcp.widgets.simple_widgets import GridLayout
from qtvcp.widgets.simple_widgets import Dial
from qtvcp.widgets.simple_widgets import DoubleScale
from qtvcp.widgets.general_hal_output import GeneralHALOutput
from qtvcp.widgets.general_hal_input import GeneralHALInput
from qtvcp.widgets.xembed import XEmbed
from qtvcp.widgets.radio_axis_selector import RadioAxisSelector
from qtvcp.widgets.axis_tool_button import AxisToolButton
from qtvcp.widgets.offset_tool_button import OffsetToolButton
from qtvcp.widgets.file_manager import FileManager
from qtvcp.widgets.image_switcher import ImageSwitcher
from qtvcp.widgets.image_switcher import StatusImageSwitcher
from qtvcp.widgets.machine_log import MachineLog
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# IndicatedPushBUTTON
####################################
class IndicatedPushButtonPlugin(QPyDesignerCustomWidgetPlugin):
# The __init__() method is only used to set up the plugin and define its
# initialized variable.
def __init__(self, parent=None):
super(IndicatedPushButtonPlugin, self).__init__(parent)
self.initialized = False
# The initialize() and isInitialized() methods allow the plugin to set up
# any required resources, ensuring that this can only happen once for each
# plugin.
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
# This factory method creates new instances of our custom widget
def createWidget(self, parent):
return IndicatedPushButton(parent)
# This method returns the name of the custom widget class
def name(self):
return "IndicatedPushButton"
# Returns the name of the group in Qt Designer's widget box
def group(self):
return "Linuxcnc - Widgets"
# Returns the icon
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('IndicatedPushButton')))
# Returns a tool tip short description
def toolTip(self):
return "Push button widget with indicator LED"
# Returns a short description of the custom widget for use in a "What's
# This?" help message for the widget.
def whatsThis(self):
return ""
# Returns True if the custom widget acts as a container for other widgets;
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties.
def domXml(self):
return '<widget class="IndicatedPushButton" name="indicatedPushButton" />\n'
# Returns the module containing the custom widget class. It may include
# a module path.
def includeFile(self):
return "qtvcp.widgets.simple_widgets"
####################################
# PUSHBUTTON
####################################
class PushButtonPlugin(QPyDesignerCustomWidgetPlugin):
# The __init__() method is only used to set up the plugin and define its
# initialized variable.
def __init__(self, parent=None):
super(PushButtonPlugin, self).__init__(parent)
self.initialized = False
# The initialize() and isInitialized() methods allow the plugin to set up
# any required resources, ensuring that this can only happen once for each
# plugin.
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
# This factory method creates new instances of our custom widget
def createWidget(self, parent):
return PushButton(parent)
# This method returns the name of the custom widget class
def name(self):
return "PushButton"
# Returns the name of the group in Qt Designer's widget box
def group(self):
return "Linuxcnc - HAL"
# Returns the icon
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('pushbutton')))
# Returns a tool tip short description
def toolTip(self):
return "Push button widget"
# Returns a short description of the custom widget for use in a "What's
# This?" help message for the widget.
def whatsThis(self):
return ""
# Returns True if the custom widget acts as a container for other widgets;
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties.
def domXml(self):
return '<widget class="PushButton" name="pushbutton" />\n'
# Returns the module containing the custom widget class. It may include
# a module path.
def includeFile(self):
return "qtvcp.widgets.simple_widgets"
####################################
# CHECKBUTTON
####################################
class CheckBoxPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(CheckBoxPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return CheckBox(parent)
def name(self):
return "CheckBox"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('checkbox')))
def toolTip(self):
return "HAL Checkbox widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="CheckBox" name="checkbox" />\n'
def includeFile(self):
return "qtvcp.widgets.simple_widgets"
####################################
# RADIOBUTTON
####################################
class RadioButtonPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(RadioButtonPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return RadioButton(parent)
def name(self):
return "RadioButton"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('radiobutton')))
def toolTip(self):
return "HAL Radiobutton widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="RadioButton" name="radiobutton" />\n'
def includeFile(self):
return "qtvcp.widgets.simple_widgets"
####################################
# LCD Display
####################################
class LCDNumberPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(LCDNumberPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return LCDNumber(parent)
def name(self):
return "LCDNumber"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('lcdnumber')))
def toolTip(self):
return "HAL LCD Display widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="LCDNumber" name="lcdnumber" />\n'
def includeFile(self):
return "qtvcp.widgets.simple_widgets"
####################################
# Slider
####################################
class SliderPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(SliderPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return Slider(parent)
def name(self):
return "Slider"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('slider')))
def toolTip(self):
return "HAL Slider widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return ("""
<widget class="Slider" name="slider">
<property name=\"maximum\">
<number>100</number>
</property>
<property name=\"orientation\">
<enum>Qt::Horizontal</enum>
</property>
</widget>
""")
def includeFile(self):
return "qtvcp.widgets.simple_widgets"
####################################
# GridLayout
####################################
class LcncGridLayoutPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(LcncGridLayoutPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return GridLayout(parent)
def name(self):
return "GridLayout"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('gridlayout')))
def toolTip(self):
return "HAL enable/disable GridLayout widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="GridLayout" name="gridlayout" />\n'
def includeFile(self):
return "qtvcp.widgets.simple_widgets"
####################################
# GeneralHALOutput
####################################
class GeneralHALOutputPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(GeneralHALOutputPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return GeneralHALOutput(parent)
def name(self):
return "GeneralHALOutput"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('generalhaloutput')))
def toolTip(self):
return "Generalized HAL Output Pin Widget"
def whatsThis(self):
return "Used to add HAl Pins to Arbitrary widgets"
def isContainer(self):
return True
def domXml(self):
return '<widget class="GeneralHALOutput" name="generalhaloutput" />\n'
def includeFile(self):
return "qtvcp.widgets.general_hal_output"
####################################
# GeneralHALInput
####################################
class GeneralHALInputPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(GeneralHALInputPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return GeneralHALInput(parent)
def name(self):
return "GeneralHALInput"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('generalhalinput')))
def toolTip(self):
return "Generalized HAL Input Pin Widget"
def whatsThis(self):
return "Used to add HAl Pins to Arbitrary widgets"
def isContainer(self):
return True
def domXml(self):
return '<widget class="GeneralHALInput" name="generalhalinput" />\n'
def includeFile(self):
return "qtvcp.widgets.general_hal_input"
####################################
# XEmbed
####################################
class XEmbedPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(XEmbedPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return XEmbed(parent)
def name(self):
return "XEmbed"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('xembed')))
def toolTip(self):
return "Widget for embedding thirdparty programs"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="XEmbed" name="xembed" />\n'
def includeFile(self):
return "qtvcp.widgets.xembed"
####################################
# RadioAxisSelector
####################################
class RadioAxisSelectorPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(RadioAxisSelectorPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return RadioAxisSelector(parent)
def name(self):
return "RadioAxisSelector"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('radioaxisselector')))
def toolTip(self):
return "RadioAxisSelector widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="RadioAxisSelector" name="radioaxisselector" />\n'
def includeFile(self):
return "qtvcp.widgets.radio_axis_selector"
####################################
# AxisToolButton
####################################
class AxisToolButtonPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(AxisToolButtonPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return AxisToolButton(parent)
def name(self):
return "AxisToolButton"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('axistoolbutton')))
def toolTip(self):
return "Button for selecting an Axis and setting the Origin"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="AxisToolButton" name="axistoolbutton" />\n'
def includeFile(self):
return "qtvcp.widgets.axis_tool_button"
####################################
# OffsetToolButton
####################################
class OffsetToolButtonPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(OffsetToolButtonPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return OffsetToolButton(parent)
def name(self):
return "OffsetToolButton"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('offsettoolbutton')))
def toolTip(self):
return "Button for selecting an Axis and setting the Origin"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="OffsetToolButton" name="offsettoolbutton" />\n'
def includeFile(self):
return "qtvcp.widgets.offset_tool_button"
####################################
# FileManager
####################################
class FileManagerPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(FileManagerPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return FileManager(parent)
def name(self):
return "FileManager"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('filemanager')))
def toolTip(self):
return "Button for selecting an Axis and setting the Origin"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="FileManager" name="filemanager" />\n'
def includeFile(self):
return "qtvcp.widgets.file_manager"
####################################
# ImageSwitcher
####################################
class ImageSwitcherPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(ImageSwitcherPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
w = ImageSwitcher(parent)
w._designerInit()
return w
def name(self):
return "ImageSwitcher"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('imageswitcher')))
def toolTip(self):
return "Label that switches between different images"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '''<widget class="ImageSwitcher" name="imageswitcher">
<property name="geometry">
<rect>
<x>10</x>
<y>0</y>
<width>50</width>
<height>50</height>
</rect>
</property>
</widget>'''
def includeFile(self):
return "qtvcp.widgets.image_switcher"
####################################
# StatusImageSwitcher
####################################
class StatusImageSwitcherPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(StatusImageSwitcherPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
w = StatusImageSwitcher(parent)
w._designerInit()
return w
def name(self):
return "StatusImageSwitcher"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('statusimageswitcher')))
def toolTip(self):
return "Label that switches between different Images based on status"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '''<widget class="StatusImageSwitcher" name="statusimageswitcher"></widget>'''
def includeFile(self):
return "qtvcp.widgets.image_switcher"
####################################
# Dial
####################################
class DialPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(DialPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return Dial(parent)
def name(self):
return "Dial"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('dial')))
def toolTip(self):
return "Handwheel Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '''<widget class="Dial" name="dial"></widget>'''
def includeFile(self):
return "qtvcp.widgets.simple_widgets"
####################################
# DoubleScale
####################################
class DoubleScalePlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(DoubleScalePlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return DoubleScale(parent)
def name(self):
return "DoubleScale"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('doublescale')))
def toolTip(self):
return "Scaling Hal Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '''<widget class="DoubleScale" name="doublescale"></widget>'''
def includeFile(self):
return "qtvcp.widgets.simple_widgets"
####################################
# MachineLog
####################################
class MachineLogPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(MachineLogPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return MachineLog(parent)
def name(self):
return "MachineLog"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('machinelog')))
def toolTip(self):
return "Machine Log Display Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '''<widget class="MachineLog" name="machinelog"></widget>'''
def includeFile(self):
return "qtvcp.widgets.machine_log"

View File

@@ -0,0 +1,54 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.state_label import StateLabel
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class StateLabelPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(StateLabelPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return StateLabel(parent)
def name(self):
return "StateLabel"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QIcon(QPixmap(ICON.get_path('statelabel')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="StateLabel" name="statelabel" />\n'
def includeFile(self):
return "qtvcp.widgets.state_label"

View File

@@ -0,0 +1,55 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.state_led import StateLED
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class StateLEDPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(StateLEDPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, core):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return StateLED(parent)
def name(self):
return "StateLED"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QIcon(QPixmap(ICON.get_path('led')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="StateLED" name="stateled" />\n'
def includeFile(self):
return "qtvcp.widgets.state_led"

View File

@@ -0,0 +1,56 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.adjustment_bar import StatusAdjustmentBar
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class StatusAdjustmentBarPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(StatusAdjustmentBarPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
widget = StatusAdjustmentBar(parent)
widget.buildWidget()
return widget
def name(self):
return "StatusAdjustmentBar"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QIcon(QPixmap(ICON.get_path('statusadjustmentbar')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="StatusAdjustmentBar" name="statusadjustmentbar" />\n'
def includeFile(self):
return "qtvcp.widgets.adjustment_bar"

View File

@@ -0,0 +1,545 @@
#!/usr/bin/env python3
from qtpy import QtCore, QtGui, QtWidgets
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin, QExtensionFactory, QPyDesignerTaskMenuExtension, \
QPyDesignerPropertySheetExtension, QDesignerFormWindowInterface
from qtvcp.widgets.richtext_selector import RichTextEditorDialog
from qtvcp.widgets.status_label import StatusLabel
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
Q_TYPEID = {
'QDesignerContainerExtension': 'org.qt-project.Qt.Designer.Container',
'QDesignerPropertySheetExtension': 'org.qt-project.Qt.Designer.PropertySheet',
'QDesignerTaskMenuExtension': 'org.qt-project.Qt.Designer.TaskMenu',
'QDesignerMemberSheetExtension': 'org.qt-project.Qt.Designer.MemberSheet'
}
class StatusLabelPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(StatusLabelPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
manager = formEditor.extensionManager()
if manager:
self.factory = StatusLabelTaskMenuFactory(manager)
manager.registerExtensions(self.factory, Q_TYPEID['QDesignerTaskMenuExtension'])
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return StatusLabel(parent)
def name(self):
return "StatusLabel"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QIcon(QPixmap(ICON.get_path('statuslabel')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="StatusLabel" name="statuslabel" />\n'
def includeFile(self):
return "qtvcp.widgets.status_label"
# *************************************************************************
class GstatLabelPropertySheetExtension(QExtensionFactory):
def __init__(self, parent=None):
QExtensionFactory.__init__(self, parent)
# print 'extension',parent
def createExtension(self, obj, iid, parent):
if iid != "com.trolltech.Qt.Designer.PropertySheet":
return None
if isinstance(obj, StatusLabel):
return GstatLabelPropertySheet(obj, parent)
return None
class GstatLabelPropertySheet(QPyDesignerPropertySheetExtension):
def __init__(self, widget, parent):
QPyDesignerPropertySheetExtension.__init__(self, parent)
self.widget = widget
self.formWindow = QDesignerFormWindowInterface.findFormWindow(self.widget)
print(self.formWindow)
self.propertylist = ['objectName', 'geometry', 'text']
self.temp_flag = True
# print dir(self.widget.pyqtConfigure.__sizeof__)
# print self.widget.pyqtConfigure.__sizeof__()
try:
from qtpy.QtCore import Property as _QtProperty
except Exception:
from PyQt5.QtCore import pyqtProperty as _QtProperty
for i in StatusLabel.__dict__:
# print i
if isinstance(StatusLabel.__dict__[i], _QtProperty):
self.propertylist.append(i)
print(i)
# print dir(self.widget)
def count(self):
return len(self.propertylist)
def property(self, index):
name = self.propertyName(index)
print('property index:', index, name)
if 'object' in name:
return 'default'
if 'orient' in name:
return False
if 'text' == name or 'alt' in name:
return self.widget.text
return self.widget[str(name)]
def indexOf(self, name):
# print 'NAME:',name
for num, i in enumerate(self.propertylist):
if i == name: return num
self.propertylist.append(name)
print('not found:', name, num + 1)
return num + 1
def setChanged(self, index, value):
return
def isChanged(self, index):
return False
def hasReset(self, index):
return True
def isAttribute(self, index):
return False
def propertyGroup(self, index):
name = self.propertyName(index)
if 'geometry' in name:
return 'QObject'
if 'objectName' in name:
return 'QWidget'
if 'text' in name:
return 'Text'
return 'Bool'
def setProperty(self, index, vvalue):
prop = self.propertyName(index)
value = vvalue.toPyObject()
print('SET property', prop, index, value)
if 'objectName' in prop:
self.widget.setObjectName(value)
if 'geometry' in prop:
self.widget.setGeometry(value)
if prop == 'text':
self.widget.setText(value)
if 'Status' in prop:
self.do_alt_text_test(prop, index, value)
self.widget[prop] = value
return
if self.formWindow:
self.formWindow.cursor().setProperty(self.propertyName(index), value)
return
def getVisible(self, index, data):
pass
def isVisible(self, index):
prop = self.propertyName(index)
if 'alt_text' in prop:
return self.temp_flag
return True
def propertyName(self, index):
return self.propertylist[index]
def do_alt_text_test(self, prop, indexm, value):
if 'jograte' in prop:
print('flag:', value)
self.temp_flag = value
class StatusLabelMenuEntry(QPyDesignerTaskMenuExtension):
def __init__(self, widget, parent):
super(QPyDesignerTaskMenuExtension, self).__init__(parent)
self.widget = widget
self.editStateAction = QtWidgets.QAction(
self.tr("Set Actions"), self)
self.editStateAction.triggered.connect(self.updateOptions)
def preferredEditAction(self):
return self.editStateAction
def taskActions(self):
return [self.editStateAction]
def updateOptions(self):
dialog = StatusLabelDialog(self.widget)
dialog.exec()
class StatusLabelTaskMenuFactory(QExtensionFactory):
def __init__(self, parent=None):
QExtensionFactory.__init__(self, parent)
def createExtension(self, obj, iid, parent):
if not isinstance(obj, StatusLabel):
return None
if iid == Q_TYPEID['QDesignerTaskMenuExtension']:
return StatusLabelMenuEntry(obj, parent)
return None
class TreeComboBox(QtWidgets.QComboBox):
def __init__(self, parent=None):
super(TreeComboBox, self).__init__(parent)
self.__skip_next_hide = False
tree_view = QtWidgets.QTreeView(self)
tree_view.setFrameShape(QtWidgets.QFrame.NoFrame)
tree_view.setEditTriggers(tree_view.NoEditTriggers)
tree_view.setAlternatingRowColors(True)
tree_view.setSelectionBehavior(tree_view.SelectRows)
tree_view.setWordWrap(True)
tree_view.setAllColumnsShowFocus(True)
self.setView(tree_view)
self.view().viewport().installEventFilter(self)
def showPopup(self):
self.setRootModelIndex(QtCore.QModelIndex())
super(TreeComboBox, self).showPopup()
def hidePopup(self):
self.setRootModelIndex(self.view().currentIndex().parent())
self.setCurrentIndex(self.view().currentIndex().row())
if self.__skip_next_hide:
self.__skip_next_hide = False
else:
super(TreeComboBox, self).hidePopup()
def selectIndex(self, index):
self.setRootModelIndex(index.parent())
self.setCurrentIndex(index.row())
def eventFilter(self, object, event):
if event.type() == QtCore.QEvent.MouseButtonPress and object is self.view().viewport():
index = self.view().indexAt(event.pos())
# print index.parent(),index.row(),index.column(),index.data(),index.data(QtCore.Qt.UserRole + 1)
# print self.view().isExpanded(self.view().currentIndex())
# if self.itemAt(event.pos()) is None
self.__skip_next_hide = not self.view().visualRect(index).contains(event.pos())
return False
def addItems(self, parent, elements):
for text, value, children in elements:
item = QtGui.QStandardItem(text)
item.setData(value[0], role=QtCore.Qt.UserRole + 1)
item.setData(value[1], role=QtCore.Qt.UserRole + 2)
parent.appendRow(item)
if children:
self.addItems(item, children)
def select(self, nodeNum, row):
# print 'select:', nodeNum, row
# select last row
newIndex = self.model().index(nodeNum, 0)
self.setRootModelIndex(newIndex)
self.setCurrentIndex(row)
class StatusLabelDialog(QtWidgets.QDialog):
def __init__(self, widget, parent=None):
QtWidgets.QDialog.__init__(self, parent)
self.setWindowTitle(self.tr("Set Options"))
self.setGeometry(300, 300, 200, 200)
self.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.widget = widget
self.previewWidget = StatusLabel()
tab = QtWidgets.QTabWidget()
self.tab1 = QtWidgets.QWidget()
self.tab2 = QtWidgets.QWidget()
tab.addTab(self.tab1, 'Actions')
self.buildtab1()
vbox = QtWidgets.QVBoxLayout()
vbox.addWidget(tab)
wid = QtWidgets.QWidget()
vbox2 = QtWidgets.QVBoxLayout(wid)
label = QtWidgets.QLabel('Default Designer Text')
self.defaultTextTemplateEditBox = QtWidgets.QLineEdit()
self.defaultTextTemplateEditBox.setText(self.widget.text())
vbox2.addWidget(label)
vbox2.addWidget(self.defaultTextTemplateEditBox)
vbox.addWidget(wid)
# Dialog control buttons
buttonBox = QtWidgets.QDialogButtonBox()
okButton = buttonBox.addButton(buttonBox.Ok)
cancelButton = buttonBox.addButton(buttonBox.Cancel)
okButton.clicked.connect(self.updateWidget)
cancelButton.clicked.connect(self.reject)
vbox.addWidget(buttonBox, 1)
self.setLayout(vbox)
def buildtab1(self):
self.combo = TreeComboBox()
model = QtGui.QStandardItemModel()
model.setHeaderData(0, QtCore.Qt.Horizontal, 'Name', QtCore.Qt.DisplayRole)
# (('Displayed name',['widget property name', code to show related data],[])
node_1 = (('Set Feed Override', ['feed_override', 2], []),
('Rapid Override', ['rapid_override', 2], []),
('Spindle Override', ['spindle_override', 2], []),
('Max Velocity Override', ['max_velocity_override', 2], []))
node_2 = (('Jog Rate', ['jograte', 6], []),
('Jog Rate Angular', ['jograte_angular', 2], []),
('Jog Increment', ['jogincr', 6], []),
('Jog Increment Angular', ['jogincr_angular', 2], []))
node_3 = (('Spindle Rate Requested', ['requested_spindle_speed', 6], []),
('Spindle Rate Actual', ['actual_spindle_speed', 6], []))
node_4 = (('Current Feed Rate', ['current_feedrate', 6], []),
('Current Feed Unit', ['current_feedunit', 6], []))
node_5 = (('Tool Number', ['tool_number', 2], []),
('Tool Diameter', ['tool_diameter', 6], []),
('Tool Offset', ['tool_offset', 3], []),
('Tool Comment', ['tool_comment', 2], []))
node_6 = (('Active G-Codes', ['gcodes', 2], []),
('Active M-Codes', ['mcodes', 2], []),
('Active G5X System', ['user_system', 2], []))
node_7 = (('File Name', ['filename', 2], []),
('File Path', ['filepath', 2], []))
node_8 = (('Machine State', ['machine_state', 8], []),)
node_9 = (('Time', ['time_stamp', 2], []),
('HAL Pin Status', ['halpin', 22], []))
node_none = (('Unused', ['unused', 2], []),)
parent_node = [('Unset', [None, None], node_none),
('OVERRIDES', [None, None], node_1),
('JOGGING', [None, None], node_2),
('SPINDLE', [None, None], node_3),
('FEED', [None, None], node_4),
('TOOL', [None, None], node_5),
('ACTIVE CODE', [None, None], node_6),
('FILE', [None, None], node_7),
('MACHINE STATE', [None, None], node_8),
('MISC', [None, None], node_9)]
self.combo.addItems(model, parent_node)
self.combo.setModel(model)
# self.combo.view().hideColumn (1)
# self.combo.resize(300, 30)
self.combo.currentIndexChanged.connect(self.selectionChanged)
layout = QtWidgets.QVBoxLayout()
layout.addWidget(self.combo)
# related data selection - note the name 'self.ud' uses a number
# that doubles each time - binary coded. this is so we can specify
# multiple selectors code 1 give ud1, code 2 gives ud2, code 3 gives
# ud1 and ud2 etc
# Tool offset Index number selection
self.ud1 = QtWidgets.QWidget()
hbox = QtWidgets.QHBoxLayout()
hbox.setContentsMargins(0, 0, 0, 0)
label = QtWidgets.QLabel('Index number')
self.JNumSpinBox = QtWidgets.QSpinBox()
self.JNumSpinBox.setRange(-1, 8)
self.JNumSpinBox.setValue(self.widget._index)
hbox.addWidget(label)
hbox.addStretch(1)
hbox.addWidget(self.JNumSpinBox)
self.ud1.setLayout(hbox)
layout.addWidget(self.ud1)
self.ud1.hide()
# text template
self.ud2 = QtWidgets.QWidget()
vbox2 = QtWidgets.QVBoxLayout(self.ud2)
label = QtWidgets.QLabel('Imperial/Angular Text Template')
vbox2.addWidget(label)
hbox = QtWidgets.QHBoxLayout()
self.textTemplateEditBox = QtWidgets.QLineEdit()
self.textTemplateEditBox.setText(self.widget._textTemplate)
hbox.addWidget(self.textTemplateEditBox)
dialogButton = QtWidgets.QPushButton('Edit')
dialogButton.clicked.connect(lambda: self.launchDialog(self.textTemplateEditBox))
hbox.addWidget(dialogButton)
vbox2.addLayout(hbox)
layout.addWidget(self.ud2)
# metric text template
self.ud4 = QtWidgets.QWidget()
vbox4 = QtWidgets.QVBoxLayout(self.ud4)
label = QtWidgets.QLabel('Metric Text Template')
vbox4.addWidget(label)
hbox = QtWidgets.QHBoxLayout()
self.altTextTemplateEditBox = QtWidgets.QLineEdit()
self.altTextTemplateEditBox.setText(self.widget._alt_textTemplate)
hbox.addWidget(self.altTextTemplateEditBox)
dialogButton = QtWidgets.QPushButton('Edit')
dialogButton.clicked.connect(lambda: self.launchDialog(self.altTextTemplateEditBox))
hbox.addWidget(dialogButton)
vbox4.addLayout(hbox)
layout.addWidget(self.ud4)
self.ud4.hide()
self.ud8 = QtWidgets.QWidget()
vbox8 = QtWidgets.QVBoxLayout(self.ud8)
label = QtWidgets.QLabel('Please edit state_label_list \nproperty directly')
vbox8.addWidget(label)
layout.addWidget(self.ud8)
self.ud8.hide()
self.ud16 = QtWidgets.QWidget()
vbox2 = QtWidgets.QVBoxLayout(self.ud16)
label = QtWidgets.QLabel('HalPin Name')
vbox2.addWidget(label)
hbox = QtWidgets.QHBoxLayout()
self.halpinEditBox = QtWidgets.QLineEdit()
self.halpinEditBox.setText(self.widget._halpin_name)
hbox.addWidget(self.halpinEditBox)
vbox2.addLayout(hbox)
layout.addWidget(self.ud16)
self.tab1.setLayout(layout)
# set combo to currently set property
# widget[cdata[1][0]] will tell us the widgets property state
# eg widget.feed_override etc
flag = False
# print parent_node
for pnum, pdata in enumerate(parent_node):
# print pnum,pdata[0]
if pnum == 0: continue
if pdata[0]:
for cnum, cdata in enumerate(pdata[2]):
# print 'child,state:',cdata[1][0],self.widget[cdata[1][0]]
if self.widget[cdata[1][0]]:
flag = True
# print 'found index:',pnum,cnum
break
if flag:
break
if flag:
self.combo.select(pnum, cnum)
else:
self.combo.select(0, 0)
def launchDialog(self, widget):
d = RichTextEditorDialog()
style = d.showDialog(pretext=widget.text())
if style:
self.defaultTextTemplateEditBox.setText(style)
widget.setText(style)
def selectionChanged(self, i):
winPropertyName = self.combo.itemData(i, role=QtCore.Qt.UserRole + 1)
userDataCode = self.combo.itemData(i, role=QtCore.Qt.UserRole + 2)
# print 'selected property,related data code:',winPropertyName,userDataCode,i
if winPropertyName is None:
# collapsed = self.combo.view().isExpanded(self.combo.view().currentIndex())
# if collapsed: return True
# self.combo.select(0,0)
return True
# hide/show user data widgets
if not userDataCode is None:
for i in (1, 2, 4, 8, 16):
widg = self['ud%s' % i]
if userDataCode & i:
widg.show()
else:
widg.hide()
self.adjustSize()
def updateWidget(self):
i = self.combo.currentIndex()
winProperty = self.combo.itemData(i, role=QtCore.Qt.UserRole + 1)
if winProperty is None:
self.combo.select(0, 0)
return
formWindow = QDesignerFormWindowInterface.findFormWindow(self.widget)
if formWindow and winProperty == 'unused':
formWindow.cursor().setProperty('feed_override_status',
True)
formWindow.cursor().setProperty('feed_override_status',
False)
elif formWindow:
# set widget option
formWindow.cursor().setProperty(winProperty + '_status',
True)
# set related data
formWindow.cursor().setProperty('index_number',
self.JNumSpinBox.value())
# block signal so button text doesn't change when selecting action
self.widget._designer_block_signal = True
formWindow.cursor().setProperty('textTemplate',
self.textTemplateEditBox.text())
formWindow.cursor().setProperty('alt_textTemplate',
self.altTextTemplateEditBox.text())
formWindow.cursor().setProperty('text',
self.defaultTextTemplateEditBox.text())
formWindow.cursor().setProperty('halpin_name',
self.halpinEditBox.text())
self.widget._designer_block_signal = False
self.accept()
##############################
# required class boiler code #
##############################
def __getitem__(self, item):
return getattr(self, item)
def __setitem__(self, item, value):
return setattr(self, item, value)

View File

@@ -0,0 +1,54 @@
#!/usr/bin/env python3
from qtpy.QtGui import QIcon, QPixmap
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.status_slider import StatusSlider
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class StatusSliderPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(StatusSliderPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return StatusSlider(parent)
def name(self):
return "StatusSlider"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QIcon(QPixmap(ICON.get_path('statusslider')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return False
# Returns an XML description of a custom widget instance that describes
# default values for its properties. Each custom widget created by this
# plugin will be configured using this description.
def domXml(self):
return '<widget class="StatusSlider" name="statusslider" />\n'
def includeFile(self):
return "qtvcp.widgets.status_slider"

View File

@@ -0,0 +1,66 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.tab_widget import TabWidget
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# Tab Widget
####################################
class TabWidgetPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(TabWidgetPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return TabWidget(parent)
def name(self):
return "TabWidget"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('tabwidget')))
def toolTip(self):
return "TabWidget with adjustable Tab Height"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return ("""
<widget class="TabWidget" name="tabwidget">
' <widget class="QWidget" name="tab" />'
' <widget class="QWidget" name="tab_2" />'
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>139</width>
<height>100</height>
</rect>
</property>
</widget>
""")
def includeFile(self):
return "qtvcp.widgets.tab_widget"

View File

@@ -0,0 +1,140 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.system_tool_button import SystemToolButton
from qtvcp.widgets.action_tool_button import ActionToolButton
from qtvcp.widgets.axisPickTool_button import AxisPickToolButton
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# SystemToolButton
####################################
class SystemToolButtonPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(SystemToolButtonPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return SystemToolButton(parent)
def name(self):
return "SystemToolButton"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('systemtoolbutton')))
def toolTip(self):
return "Button for selecting a User Coordinate System"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="SystemToolButton" name="systemtoolbutton" />\n'
def includeFile(self):
return "qtvcp.widgets.system_tool_button"
####################################
# ActionToolButton
####################################
class ActionToolButtonPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(ActionToolButtonPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return ActionToolButton(parent)
def name(self):
return "ActionToolButton"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('actiontoolbutton')))
def toolTip(self):
return "Tool Button for selecting selectable Actions"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="ActionToolButton" name="actiontoolbutton" />\n'
def includeFile(self):
return "qtvcp.widgets.action_tool_button"
####################################
# AxisPickToolButton
####################################
class AxisPickToolButtonPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(AxisPickToolButtonPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return AxisPickToolButton(parent)
def name(self):
return "AxisPickToolButton"
def group(self):
return "Linuxcnc - Widgets"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('AxisPicktoolbutton')))
def toolTip(self):
return "Tool Button for selecting an available Axis"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="AxisPickToolButton" name="axispicktoolbutton" />\n'
def includeFile(self):
return "qtvcp.widgets.axisPickTool_button"

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.versa_probe import VersaProbe
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# VersaProbe
####################################
class VersaProbePlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(VersaProbePlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return VersaProbe(parent)
def name(self):
return "VersaProbe"
def group(self):
return "Linuxcnc - Widgets"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('versaprobe')))
def toolTip(self):
return "Probe Screen Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="VersaProbe" name="versaprobe" />\n'
def includeFile(self):
return "qtvcp.widgets.versa_probe"

View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.virtualkeyboard import VirtualKeyboard
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# VirtualKeyboard
####################################
class VirtualKeyboardPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(VirtualKeyboardPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return VirtualKeyboard(parent)
def name(self):
return "VirtualKeyboard"
def group(self):
return "Linuxcnc - Widgets"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('virtualkeyboard')))
def toolTip(self):
return "On Screen Virtual Keyboard Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="VirtualKeyboard" name="virtualkeyboard" />\n'
def includeFile(self):
return "qtvcp.widgets.virtualkeyboard"

View File

@@ -0,0 +1,49 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.web_widget import WebWidget
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
class WebWidgetPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(WebWidgetPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return WebWidget(parent)
def name(self):
return "WebWidget"
def group(self):
return "Linuxcnc - Widgets"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('webwidget')))
def toolTip(self):
return "HAL web viewing widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="WebWidget" name="webwidget" />\n'
def includeFile(self):
return "qtvcp.widgets.web_widget"

View File

@@ -0,0 +1,683 @@
#!/usr/bin/env python3
from qtpy import QtGui
from qtpy.QtDesigner import QPyDesignerCustomWidgetPlugin
from qtvcp.widgets.dro_widget import DROLabel
from qtvcp.widgets.user_dro_label import UserDROLabel
from qtvcp.widgets.mdi_line import MDILine
from qtvcp.widgets.operator_value_line import OperatorValueLine
from qtvcp.widgets.tool_chooser import ToolChooser
from qtvcp.widgets.mdi_history import MDIHistory
from qtvcp.widgets.mdi_touchy import MDITouchy
from qtvcp.widgets.gcode_editor import GcodeEditor, GcodeDisplay
from qtvcp.widgets.geditor import GEditor
from qtvcp.widgets.status_stacked import StatusStacked
from qtvcp.widgets.widget_switcher import WidgetSwitcher
from qtvcp.widgets.origin_offsetview import OriginOffsetView
from qtvcp.widgets.tool_offsetview import ToolOffsetView
from qtvcp.widgets.macro_widget import MacroTab
from qtvcp.widgets.qtvcp_icons import Icon
ICON = Icon()
####################################
# DRO
####################################
class LcncDROLabelPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(LcncDROLabelPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return DROLabel(parent)
def name(self):
return "DROLabel"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('dro_label')))
def toolTip(self):
return "DRO Display Widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="DROLabel" name="dro_label" />\n'
def includeFile(self):
return "qtvcp.widgets.dro_widget"
####################################
# Axis Position UserDROLabel
####################################
class UserDROLabelPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(UserDROLabelPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return UserDROLabel(parent)
def name(self):
return "UserDROLabel"
def group(self):
return "Linuxcnc - Widgets"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('UserDROLabel')))
def toolTip(self):
return "User Referenced Axis Position Display Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="UserDROLabel" name="userdro" />\n'
def includeFile(self):
return "qtvcp.widgets.user_dro_label"
####################################
# MDI edit line
####################################
class MDILinePlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(MDILinePlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return MDILine(parent)
def name(self):
return "MDILine"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('mdiline')))
def toolTip(self):
return "MDI edit line Widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="MDILine" name="mdiline" />\n'
def includeFile(self):
return "qtvcp.widgets.mdi_line"
####################################
# Tool Chooser
####################################
class ToolChooserPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(ToolChooserPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return ToolChooser(parent)
def name(self):
return "ToolChooser"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('toolchooser')))
def toolTip(self):
return "Tool chooser Widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="ToolChooser" name="toolchooser" />\n'
def includeFile(self):
return "qtvcp.widgets.tool_chooser"
####################################
# Operator Value edit line
####################################
class OperatorValueLinePlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(OperatorValueLinePlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return OperatorValueLine(parent)
def name(self):
return "OperatorValueLine"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('operatorvalueline')))
def toolTip(self):
return "Operator value edit line Widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="OperatorValueLine" name="operatorvalueline" />\n'
def includeFile(self):
return "qtvcp.widgets.operator_value_line"
####################################
# MDI History widget
####################################
class MDIHistoryPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(MDIHistoryPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return MDIHistory(parent)
def name(self):
return "MDIHistory"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('mdihistory')))
def toolTip(self):
return "MDI History Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="MDIHistory" name="mdihistory" />\n'
def includeFile(self):
return "qtvcp.widgets.mdi_history"
####################################
# MDI Touchy widget
####################################
class MDITouchyPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(MDITouchyPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return MDITouchy(parent)
def name(self):
return "MDITouchy"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('MDITouchy')))
def toolTip(self):
return "MDI Touchy Widget"
def whatsThis(self):
return ""
def isContainer(self):
return False
def domXml(self):
return '<widget class="MDITouchy" name="mditouchy" />\n'
def includeFile(self):
return "qtvcp.widgets.mdi_touchy"
####################################
# Gcode editor
####################################
class GcodeEditorPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(GcodeEditorPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return GcodeEditor(parent)
def name(self):
return "GcodeEditor"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('gcodeeditor')))
def toolTip(self):
return "Gcode display / editor Widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="GcodeEditor" name="gcodeeditor" />\n'
def includeFile(self):
return "qtvcp.widgets.gcode_editor"
####################################
# Gcode display (read only)
####################################
class GcodeDisplayPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(GcodeDisplayPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return GcodeDisplay(parent)
def name(self):
return "GcodeDisplay"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('gcodedisplay')))
def toolTip(self):
return "Gcode display Widget (read-only)"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="GcodeDisplay" name="gcode_display" />\n'
def includeFile(self):
return "qtvcp.widgets.gcode_editor"
####################################
# GEditor
####################################
class GEditorPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(GEditorPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return GEditor(parent, designer=True)
def name(self):
return "GEditor"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('GEditor')))
def toolTip(self):
return "Gcode display / editor Widget using ToolBars"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="GEditor" name="geditor" />\n'
def includeFile(self):
return "qtvcp.widgets.geditor"
####################################
# StatusStacked
####################################
class StatusStackedPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(StatusStackedPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return StatusStacked(parent)
def name(self):
return "StatusStacked"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('statusstacked')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="StatusStacked" name="statusstacked" />\n'
def includeFile(self):
return "qtvcp.widgets.status_stacked"
####################################
# WidgetSwitcher
####################################
class WidgetSwitcherPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(WidgetSwitcherPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return WidgetSwitcher(parent)
def name(self):
return "WidgetSwitcher"
def group(self):
return "Linuxcnc - HAL"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('widgetswitcher')))
def toolTip(self):
return ""
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '''<widget class="WidgetSwitcher" name="widgetswitcher">
<property name="widget_list" stdset="0">
<stringlist>
</stringlist>
</property>
</widget>'''
def includeFile(self):
return "qtvcp.widgets.widget_switcher"
####################################
# OriginOffsetView Widget
####################################
class OriginOffsetViewPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(OriginOffsetViewPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return OriginOffsetView(parent)
def name(self):
return "OriginOffsetView"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('originoffsetview')))
def toolTip(self):
return "User Origin Offset Editor Widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="OriginOffsetView" name="originoffsetview" />\n'
def includeFile(self):
return "qtvcp.widgets.origin_offsetview"
####################################
# ToolOffsetView Widget
####################################
class ToolOffsetViewPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(ToolOffsetViewPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return ToolOffsetView(parent)
def name(self):
return "ToolOffsetView"
def group(self):
return "Linuxcnc - Controller"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('tooloffsetview')))
def toolTip(self):
return "Tool Offset Editor Widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="ToolOffsetView" name="tooloffsetview" />\n'
def includeFile(self):
return "qtvcp.widgets.tool_offsetview"
####################################
# MacroTab Widget
####################################
class MacroTabPlugin(QPyDesignerCustomWidgetPlugin):
def __init__(self, parent=None):
super(MacroTabPlugin, self).__init__(parent)
self.initialized = False
def initialize(self, formEditor):
if self.initialized:
return
self.initialized = True
def isInitialized(self):
return self.initialized
def createWidget(self, parent):
return MacroTab(parent)
def name(self):
return "MacroTab"
def group(self):
return "Linuxcnc - Widgets"
def icon(self):
return QtGui.QIcon(QtGui.QPixmap(ICON.get_path('macrotab')))
def toolTip(self):
return "Macro Subroutine Selection Widget"
def whatsThis(self):
return ""
def isContainer(self):
return True
def domXml(self):
return '<widget class="MacroTab" name="macrotab" />\n'
def includeFile(self):
return "qtvcp.widgets.macro_widget"