예제 #1
0
import linuxcnc

from qtvcp.widgets.widget_baseclass import _HalWidgetBase
from qtvcp.widgets.simple_widgets import Indicated_PushButton
from qtvcp.core import Status, Action, Info
from qtvcp.lib.aux_program_loader import Aux_program_loader
from qtvcp import logger

# Instantiate the libraries with global reference
# STATUS gives us status messages from linuxcnc
# ACTION gives commands to linuxcnc
# INFO is INI file details
# LOG is for running code logging
STATUS = Status()
ACTION = Action()
INFO = Info()
AUX_PRGM = Aux_program_loader()
LOG = logger.getLogger(__name__)

# Set the log level for this module
# LOG.setLevel(logger.INFO) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL

class ActionButton(Indicated_PushButton, _HalWidgetBase):
    def __init__(self, parent=None):
        super(ActionButton, self).__init__(parent)
        self._block_signal = False
        self.estop = False
        self.machine_on = False
        self.home = False
        self.run = False
        self.abort = False
예제 #2
0
import os
import sys

from PyQt5.QtCore import pyqtSignal, pyqtProperty, QVariant
from PyQt5.QtWidgets import QLabel
from PyQt5.QtGui import QPixmap

from qtvcp.widgets.widget_baseclass import _HalWidgetBase
from qtvcp.core import Status, Info
from qtvcp import logger

# Instantiate the libraries with global reference
# STATUS gives us status messages from linuxcnc
# LOG is for running code logging
STATUS = Status()
INFO = Info()
LOG = logger.getLogger(__name__)

# Set the log level for this module
# LOG.setLevel(logger.INFO) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL

if INFO.IMAGE_PATH is not None:
    DEFAULTIMAGE = (os.path.join(INFO.IMAGE_PATH, 'applet-critical.png')) or ''
else:
    INFO.IMAGE_PATH = ''
    DEFAULTIMAGE = ''


class ImageSwitcher(QLabel, _HalWidgetBase):
    widgetChanged = pyqtSignal(int)