import sys import os import linuxcnc from PyQt5 import QtCore, QtWidgets from qtvcp.widgets.mdi_line import MDILine as MDI_WIDGET from qtvcp.widgets.gcode_editor import GcodeEditor as GCODE from qtvcp.widgets.stylesheeteditor import StyleSheetEditor as SSE from qtvcp.lib.keybindings import Keylookup from qtvcp.core import Status, Action # Set up logging from qtvcp import logger LOG = logger.getLogger(__name__) # Set the log level for this module #LOG.setLevel(logger.INFO) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL ########################################### # **** instantiate libraries section **** # ########################################### KEYBIND = Keylookup() STATUS = Status() ACTION = Action() LOG = logger.getLogger(__name__) # Set the log level for this module #LOG.setLevel(logger.INFO) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL
# 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. # This library is used to play sounds launched from STATUS messages # it has uses OS builtin sounds or can play arbritray files ####################################################################### # Set up logging from qtvcp import logger log = logger.getLogger(__name__) # try to add ability for audio feedback to user. PY_LIB_GOOD = GST_LIB_GOOD = True try: import pygst pygst.require("0.10") import gst except: PY_LIB_GOOD = False import subprocess p = subprocess.Popen('gst-launch-1.0', shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) output, error = p.communicate() if p.returncode > 1:
from PyQt5 import QtCore, QtWidgets from qtvcp.widgets.widget_baseclass import _HalWidgetBase from qtvcp.core import Status, Action from qtvcp import logger # Instantiate the libraries with global reference # STATUS gives us status messages from linuxcnc # ACTION is for linuxcnc commands # LOG is for running code logging STATUS = Status() ACTION = Action() LOG = logger.getLogger(__name__) # Set the log level for this module #LOG.setLevel(logger.DEBUG) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL class RadioAxisSelector(QtWidgets.QRadioButton, _HalWidgetBase): def __init__(self, parent=None): super(RadioAxisSelector, self).__init__(parent) self.toggled.connect(lambda: self.btnstate(self)) self.axis = 'x' self.joint = 0 def _hal_init(self): pass def btnstate(self, b): if b.isChecked() == True: ACTION.SET_SELECTED_JOINT(self.joint)