Merge branch '2.8'
This commit is contained in:
commit
ae6e7e00a4
14 changed files with 238 additions and 62 deletions
|
|
@ -11,8 +11,8 @@ under the 'def initialized__(self):' function add:
|
|||
----
|
||||
if self.w.PREFS_:
|
||||
# variable name (entry name, default value, type, section name)
|
||||
self.int_value = self.PREFS_.getpref('Integer_value', 75, int, 'CUSTOM_FORM_ENTRIES')
|
||||
self.string_value = self.PREFS_.getpref('String_value', 'on', str, 'CUSTOM_FORM_ENTRIES')
|
||||
self.int_value = self.w.PREFS_.getpref('Integer_value', 75, int, 'CUSTOM_FORM_ENTRIES')
|
||||
self.string_value = self.w.PREFS_.getpref('String_value', 'on', str, 'CUSTOM_FORM_ENTRIES')
|
||||
----
|
||||
|
||||
under the 'def closing_cleanup__(self):' function add:
|
||||
|
|
@ -20,8 +20,8 @@ under the 'def closing_cleanup__(self):' function add:
|
|||
----
|
||||
if self.w.PREFS_:
|
||||
# entry name, variable name, type, section name)
|
||||
self.PREFS_.putpref('Integer_value', self.integer_value, int, 'CUSTOM_FORM_ENTRIES')
|
||||
self.PREFS_.putpref('String_value', self.string_value, int, 'CUSTOM_FORM_ENTRIES')
|
||||
self.w.PREFS_.putpref('Integer_value', self.integer_value, int, 'CUSTOM_FORM_ENTRIES')
|
||||
self.w.PREFS_.putpref('String_value', self.string_value, str, 'CUSTOM_FORM_ENTRIES')
|
||||
|
||||
----
|
||||
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@ class _GStat(gobject.GObject):
|
|||
gobject.GObject.__init__(self)
|
||||
self.stat = stat or linuxcnc.stat()
|
||||
self.cmd = linuxcnc.command()
|
||||
self._status_active = False
|
||||
self.old = {}
|
||||
self.old['tool-prep-number'] = 0
|
||||
try:
|
||||
|
|
@ -331,10 +332,12 @@ class _GStat(gobject.GObject):
|
|||
try:
|
||||
self.stat.poll()
|
||||
except:
|
||||
self._status_active = False
|
||||
# some things might not need linuxcnc status but do need periodic
|
||||
self.emit('periodic')
|
||||
# Reschedule
|
||||
return True
|
||||
self._status_active = True
|
||||
old = dict(self.old)
|
||||
self.merge()
|
||||
|
||||
|
|
@ -854,6 +857,9 @@ class _GStat(gobject.GObject):
|
|||
return None
|
||||
return bool(self.stat.motion_mode == linuxcnc.TRAJ_MODE_FREE)
|
||||
|
||||
def is_status_valid(self):
|
||||
return self._status_active
|
||||
|
||||
def set_tool_touchoff(self,tool,axis,value):
|
||||
premode = None
|
||||
m = "G10 L10 P%d %s%f"%(tool,axis,value)
|
||||
|
|
|
|||
|
|
@ -193,8 +193,8 @@ class _Keycalls:
|
|||
self.Key_F2 = 'on_keycall_POWER'
|
||||
self.Key_Home = 'on_keycall_HOME'
|
||||
self.Key_Escape = 'on_keycall_ABORT'
|
||||
self.Key_Left = 'on_keycall_XPOS'
|
||||
self.Key_Right = 'on_keycall_XNEG'
|
||||
self.Key_Left = 'on_keycall_XNEG'
|
||||
self.Key_Right = 'on_keycall_XPOS'
|
||||
self.Key_Up = 'on_keycall_YPOS'
|
||||
self.Key_Down = 'on_keycall_YNEG'
|
||||
self.Key_PageUp = 'on_keycall_ZPOS'
|
||||
|
|
|
|||
|
|
@ -161,8 +161,11 @@ class ActionButtonDialog(QtWidgets.QDialog):
|
|||
('Run',['run', 0], []),
|
||||
('Abort',['abort', 0], []),
|
||||
('Pause',['pause', 0], []),
|
||||
('Step',['step', 0], []),
|
||||
('Override Limits',['limits_override', 0], []),
|
||||
('Zero Axis',['zero_axis', 1], []),
|
||||
('Zero G5x',['zero_g5x', 0], []),
|
||||
('Zero G92',['zero_g92', 0], []),
|
||||
('Block Delete',['block_delete', 0], []),
|
||||
('Optional Stop',['optional_stop', 0], []),
|
||||
('Food Coolant',['flood', 0], []),
|
||||
|
|
|
|||
|
|
@ -175,11 +175,21 @@ class _Lcnc_Action(object):
|
|||
self.RELOAD_DISPLAY()
|
||||
|
||||
def RUN(self, line=0):
|
||||
self.ensure_mode(linuxcnc.MODE_AUTO)
|
||||
if STATUS.is_auto_paused() and line ==0:
|
||||
if not STATUS.is_auto_mode():
|
||||
self.ensure_mode(linuxcnc.MODE_AUTO)
|
||||
if STATUS.is_auto_paused() and line == 0:
|
||||
self.cmd.auto(linuxcnc.AUTO_STEP)
|
||||
return
|
||||
elif not STATUS.is_auto_running():
|
||||
self.cmd.auto(linuxcnc.AUTO_RUN,line)
|
||||
|
||||
def STEP(self):
|
||||
if STATUS.is_auto_running() and not STATUS.is_auto_paused():
|
||||
self.cmd.auto(linuxcnc.AUTO_PAUSE)
|
||||
return
|
||||
if STATUS.is_auto_paused():
|
||||
self.cmd.auto(linuxcnc.AUTO_STEP)
|
||||
return
|
||||
self.cmd.auto(linuxcnc.AUTO_RUN,line)
|
||||
|
||||
def ABORT(self):
|
||||
self.ensure_mode(linuxcnc.MODE_AUTO)
|
||||
|
|
@ -382,7 +392,7 @@ class _Lcnc_Action(object):
|
|||
return (truth, premode)
|
||||
|
||||
def open_filter_program(self,fname, flt):
|
||||
log.debug('Openning filtering program yellow<{}> for {}'.format(flt,fname))
|
||||
log.debug('Opening filtering program yellow<{}> for {}'.format(flt,fname))
|
||||
if not self.tmp:
|
||||
self._mktemp()
|
||||
tmp = os.path.join(self.tmp, os.path.basename(fname))
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ class _IStat(object):
|
|||
if self.TAB_NAMES is not None and len(self.TAB_NAMES) != len(self.TAB_CMDS):
|
||||
log.critical('Embeded tab configuration -invalaid number of TAB_NAMES vrs TAB_CMDs')
|
||||
if self.TAB_NAMES is not None and len(self.TAB_LOCATIONS) != len(self.TAB_NAMES):
|
||||
log.warning('Embeded tab configuration -invalaid number of TAB_NAMES vrs TAB_LOCACTION - guessng default.')
|
||||
log.warning('Embeded tab configuration -invalaid number of TAB_NAMES vrs TAB_LOCATION - guessng default.')
|
||||
for num,i in enumerate(self.TAB_NAMES):
|
||||
try:
|
||||
if self.TAB_LOCATIONS[num]:
|
||||
|
|
@ -218,7 +218,7 @@ class _IStat(object):
|
|||
if result:
|
||||
return result
|
||||
else:
|
||||
log.warning('INI Parcing Error, No {} Entry in {}, Using: {}'.format(detail, heading, default))
|
||||
log.warning('INI Parsing Error, No {} Entry in {}, Using: {}'.format(detail, heading, default))
|
||||
return default
|
||||
|
||||
def convert_machine_to_metric(self, data):
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@
|
|||
###############################################################################
|
||||
|
||||
import os
|
||||
import linuxcnc
|
||||
import hashlib
|
||||
|
||||
from qtvcp.core import Info
|
||||
from qtvcp.core import Info, Action
|
||||
# Set up logging
|
||||
import logger
|
||||
|
||||
INFO = Info()
|
||||
ACTION = Action()
|
||||
LOG = logger.getLogger(__name__)
|
||||
# Set the log level for this module
|
||||
LOG.setLevel(logger.DEBUG) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL
|
||||
|
|
@ -75,8 +75,9 @@ class _TStat(object):
|
|||
def SAVE_TOOLFILE(self, array):
|
||||
self._save(array)
|
||||
|
||||
def ADD_TOOL(self, tool_array = [0,0,'0','0','0','0','0','0','0','0','0','0','0','0','0','No Tool']):
|
||||
pass
|
||||
def ADD_TOOL(self, model, blanktool = [-99,0,'0','0','0','0','0','0','0','0','0','0','0','0','0','New Tool']):
|
||||
model.insert(0, blanktool)
|
||||
self._save(model)
|
||||
|
||||
# [0] = tool number
|
||||
# [1] = pocket number
|
||||
|
|
@ -263,7 +264,7 @@ class _TStat(object):
|
|||
os.fsync(file.fileno())
|
||||
# tell linuxcnc we changed the tool table entries
|
||||
try:
|
||||
linuxcnc.command().load_tool_table()
|
||||
ACTION.RELOAD_TOOLTABLE()
|
||||
except:
|
||||
LOG.error("reloading of tool table into linuxcnc: {}".format(self.toolfile))
|
||||
|
||||
|
|
@ -279,9 +280,11 @@ class _TStat(object):
|
|||
|
||||
# check the hash code on the toolfile against
|
||||
# the saved hash code when last reloaded.
|
||||
def file_current_check(self):
|
||||
def IS_HASH_CURRENT(self):
|
||||
m = self.hash_code
|
||||
m1 = self.md5sum(self.toolfile)
|
||||
if m1 and m != m1:
|
||||
self._reload()
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
self.run = False
|
||||
self.abort = False
|
||||
self.pause = False
|
||||
self.step = False
|
||||
self.load_dialog = False
|
||||
self.macro_dialog = False
|
||||
self.origin_offset_dialog = False
|
||||
|
|
@ -63,6 +64,8 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
self.jog_selected_pos = False
|
||||
self.jog_selected_neg = False
|
||||
self.zero_axis = False
|
||||
self.zero_g5x = False
|
||||
self.zero_g92 = False
|
||||
self.launch_halmeter = False
|
||||
self.launch_status = False
|
||||
self.launch_halshow = False
|
||||
|
|
@ -214,7 +217,7 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
# leave early to aviod the standard 'clicked' signal
|
||||
return
|
||||
|
||||
elif self.zero_axis or self.run:
|
||||
elif True in(self.zero_axis, self.zero_g5x,self.zero_g92, self.run):
|
||||
STATUS.connect('state-off', lambda w: self.setEnabled(False))
|
||||
STATUS.connect('state-estop', lambda w: self.setEnabled(False))
|
||||
STATUS.connect('interp-idle', lambda w: self.setEnabled(homed_on_test()))
|
||||
|
|
@ -225,7 +228,7 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
if self.run:
|
||||
STATUS.connect('file-loaded', lambda w, f: self.setEnabled(True))
|
||||
|
||||
elif self.abort or self.pause:
|
||||
elif True in(self.abort, self.pause, self.step):
|
||||
self.setEnabled(False)
|
||||
if self.pause:
|
||||
STATUS.connect('program-pause-changed', lambda w, state: _safecheck(state))
|
||||
|
|
@ -356,6 +359,8 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
ACTION.ABORT()
|
||||
elif self.pause:
|
||||
ACTION.PAUSE()
|
||||
elif self.step:
|
||||
ACTION.STEP()
|
||||
elif self.load_dialog:
|
||||
STATUS.emit('dialog-request',{'NAME':'LOAD'})
|
||||
elif self.camview_dialog:
|
||||
|
|
@ -371,6 +376,10 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
except IndexError:
|
||||
LOG.error("can't zero origin for specified joint {}".format(self.joint))
|
||||
ACTION.SET_AXIS_ORIGIN(axis, 0)
|
||||
elif self.zero_g5x:
|
||||
ACTION.ZERO_G5X_OFFSET(0)
|
||||
elif self.zero_g92:
|
||||
ACTION.ZERO_G92_OFFSET()
|
||||
elif self.launch_halmeter:
|
||||
AUX_PRGM.load_halmeter()
|
||||
elif self.launch_status:
|
||||
|
|
@ -595,7 +604,7 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
########################################################################
|
||||
|
||||
def _toggle_properties(self, picked):
|
||||
data = ('estop', 'machine_on', 'home', 'run', 'abort', 'pause',
|
||||
data = ('estop', 'machine_on', 'home', 'run', 'abort', 'pause', 'step'
|
||||
'load_dialog', 'jog_joint_pos', 'jog_joint_neg',
|
||||
'jog_selected_pos', 'jog_selected_neg', 'zero_axis',
|
||||
'launch_halmeter', 'launch_status', 'launch_halshow',
|
||||
|
|
@ -606,7 +615,7 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
'limits_override', 'flood', 'mist', 'optional_stop', 'mdi_command',
|
||||
'ini_mdi_command', 'command_text', 'block_delete', 'dro_absolute',
|
||||
'dro_relative', 'dro_dtg','max_velocity_over', 'launch_halscope',
|
||||
'exit')
|
||||
'exit', 'zero_g5x', 'zero_g92')
|
||||
|
||||
for i in data:
|
||||
if not i == picked:
|
||||
|
|
@ -649,6 +658,24 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
def reset_zero_axis(self):
|
||||
self.zero_axis = False
|
||||
|
||||
def set_zero_g5x(self, data):
|
||||
self.zero_g5x = data
|
||||
if data:
|
||||
self._toggle_properties('zero_g5x')
|
||||
def get_zero_g5x(self):
|
||||
return self.zero_g5x
|
||||
def reset_zero_g5x(self):
|
||||
self.zero_g5x = False
|
||||
|
||||
def set_zero_g92(self, data):
|
||||
self.zero_g92 = data
|
||||
if data:
|
||||
self._toggle_properties('zero_g92')
|
||||
def get_zero_g92(self):
|
||||
return self.zero_g92
|
||||
def reset_zero_g92(self):
|
||||
self.zero_g92 = False
|
||||
|
||||
def set_load_dialog(self, data):
|
||||
self.load_dialog = data
|
||||
if data:
|
||||
|
|
@ -748,6 +775,15 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
def reset_pause(self):
|
||||
self.pause = False
|
||||
|
||||
def set_step(self, data):
|
||||
self.step = data
|
||||
if data:
|
||||
self._toggle_properties('step')
|
||||
def get_step(self):
|
||||
return self.step
|
||||
def reset_step(self):
|
||||
self.step = False
|
||||
|
||||
def set_launch_halmeter(self, data):
|
||||
self.launch_halmeter = data
|
||||
if data:
|
||||
|
|
@ -1112,6 +1148,7 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
run_action = QtCore.pyqtProperty(bool, get_run, set_run, reset_run)
|
||||
abort_action = QtCore.pyqtProperty(bool, get_abort, set_abort, reset_abort)
|
||||
pause_action = QtCore.pyqtProperty(bool, get_pause, set_pause, reset_pause)
|
||||
step_action = QtCore.pyqtProperty(bool, get_step, set_step, reset_step)
|
||||
load_dialog_action = QtCore.pyqtProperty(bool, get_load_dialog, set_load_dialog, reset_load_dialog)
|
||||
camview_dialog_action = QtCore.pyqtProperty(bool,
|
||||
get_camview_dialog, set_camview_dialog, reset_camview_dialog)
|
||||
|
|
@ -1125,6 +1162,8 @@ class ActionButton(Indicated_PushButton, _HalWidgetBase):
|
|||
launch_halscope_action = QtCore.pyqtProperty(bool, get_launch_halscope, set_launch_halscope, reset_launch_halscope)
|
||||
home_action = QtCore.pyqtProperty(bool, get_home, set_home, reset_home)
|
||||
zero_axis_action = QtCore.pyqtProperty(bool, get_zero_axis, set_zero_axis, reset_zero_axis)
|
||||
zero_g5x_action = QtCore.pyqtProperty(bool, get_zero_g5x, set_zero_g5x, reset_zero_g5x)
|
||||
zero_g92_action = QtCore.pyqtProperty(bool, get_zero_g92, set_zero_g92, reset_zero_g92)
|
||||
jog_joint_pos_action = QtCore.pyqtProperty(bool, get_jog_joint_pos, set_jog_joint_pos, reset_jog_joint_pos)
|
||||
jog_joint_neg_action = QtCore.pyqtProperty(bool, get_jog_joint_neg, set_jog_joint_neg, reset_jog_joint_neg)
|
||||
jog_selected_pos_action = QtCore.pyqtProperty(bool, get_jog_selected_pos, set_jog_selected_pos, reset_jog_selected_pos)
|
||||
|
|
|
|||
|
|
@ -528,7 +528,10 @@ class OriginOffsetDialog(QDialog, _HalWidgetBase):
|
|||
STATUS.connect('all-homed', lambda w: buttonBox.setEnabled(True))
|
||||
STATUS.connect('state-estop', lambda w: buttonBox.setEnabled(False))
|
||||
STATUS.connect('state-estop-reset', lambda w: buttonBox.setEnabled(STATUS.machine_is_on()
|
||||
and STATUS.is_all_homed()))
|
||||
and STATUS.is_all_homed()))
|
||||
STATUS.connect('interp-idle', lambda w: buttonBox.setEnabled(STATUS.machine_is_on()
|
||||
and STATUS.is_all_homed()))
|
||||
STATUS.connect('interp-run', lambda w: buttonBox.setEnabled(False))
|
||||
for i in('X', 'Y', 'Z'):
|
||||
b = 'button_%s' % i
|
||||
self[b] = QPushButton('Zero %s' % i)
|
||||
|
|
@ -646,13 +649,23 @@ class ToolOffsetDialog(QDialog, _HalWidgetBase):
|
|||
Qt.Dialog |
|
||||
Qt.WindowStaysOnTopHint | Qt.WindowSystemMenuHint)
|
||||
self.setMinimumSize(200, 200)
|
||||
|
||||
self._o = TOOLVIEW_WIDGET()
|
||||
self._o._hal_init()
|
||||
|
||||
buttonBox = QDialogButtonBox()
|
||||
buttonBox.setEnabled(False)
|
||||
STATUS.connect('not-all-homed', lambda w, axis: buttonBox.setEnabled(False))
|
||||
STATUS.connect('all-homed', lambda w: buttonBox.setEnabled(True))
|
||||
STATUS.connect('state-estop', lambda w: buttonBox.setEnabled(False))
|
||||
STATUS.connect('state-estop-reset', lambda w: buttonBox.setEnabled(STATUS.machine_is_on()
|
||||
and STATUS.is_all_homed()))
|
||||
and STATUS.is_all_homed()))
|
||||
STATUS.connect('interp-idle', lambda w: buttonBox.setEnabled(STATUS.machine_is_on()
|
||||
and STATUS.is_all_homed()))
|
||||
STATUS.connect('interp-run', lambda w: buttonBox.setEnabled(False))
|
||||
self.addtool = QPushButton('Add Tool')
|
||||
self.addtool.clicked.connect(lambda: self.addTool())
|
||||
buttonBox.addButton(self.addtool, 3)
|
||||
for i in('X', 'Y', 'Z'):
|
||||
b = 'button_%s' % i
|
||||
self[b] = QPushButton('Zero %s' % i)
|
||||
|
|
@ -661,8 +674,6 @@ class ToolOffsetDialog(QDialog, _HalWidgetBase):
|
|||
|
||||
v = QVBoxLayout()
|
||||
h = QHBoxLayout()
|
||||
self._o = TOOLVIEW_WIDGET()
|
||||
self._o._hal_init()
|
||||
self.setLayout(v)
|
||||
v.addWidget(self._o)
|
||||
b = QPushButton('OK')
|
||||
|
|
@ -690,6 +701,9 @@ class ToolOffsetDialog(QDialog, _HalWidgetBase):
|
|||
if message['NAME'] == self._request_name:
|
||||
self.load_dialog()
|
||||
|
||||
def addTool(self):
|
||||
self._o.add_tool()
|
||||
|
||||
# This weird code is just so we can get the axis
|
||||
# letter
|
||||
# using clicked.connect() apparently can't easily
|
||||
|
|
@ -703,7 +717,7 @@ class ToolOffsetDialog(QDialog, _HalWidgetBase):
|
|||
ACTION.SET_AXIS_ORIGIN(index, 0)
|
||||
|
||||
def load_dialog(self):
|
||||
STATUS.emit('focus-overlay-changed', True, 'Set Origin Offsets', self._color)
|
||||
STATUS.emit('focus-overlay-changed', True, 'Set Tool Offsets', self._color)
|
||||
self.calculate_placement()
|
||||
self.show()
|
||||
self.exec_()
|
||||
|
|
|
|||
|
|
@ -51,9 +51,6 @@ class OriginOffsetView(QTableView, _HalWidgetBase):
|
|||
|
||||
self.filename = INFO.PARAMETER_FILE
|
||||
self.axisletters = ["x", "y", "z", "a", "b", "c", "u", "v", "w"]
|
||||
self.linuxcnc = linuxcnc
|
||||
self.status = linuxcnc.stat()
|
||||
self.IS_RUNNING = False
|
||||
self.current_system = None
|
||||
self.current_tool = 0
|
||||
self.metric_display = False
|
||||
|
|
@ -65,6 +62,9 @@ class OriginOffsetView(QTableView, _HalWidgetBase):
|
|||
def _hal_init(self):
|
||||
self.delay = 0
|
||||
STATUS.connect('all-homed', lambda w: self.setEnabled(True))
|
||||
STATUS.connect('interp-idle', lambda w: self.setEnabled(STATUS.machine_is_on()
|
||||
and STATUS.is_all_homed()))
|
||||
STATUS.connect('interp-run', lambda w: self.setEnabled(False))
|
||||
STATUS.connect('periodic', self.periodic_check)
|
||||
STATUS.connect('metric-mode-changed', lambda w, data: self.metricMode(data))
|
||||
STATUS.connect('tool-in-spindle-changed', lambda w, data: self.currentTool(data))
|
||||
|
|
@ -143,19 +143,18 @@ class OriginOffsetView(QTableView, _HalWidgetBase):
|
|||
def reload_offsets(self):
|
||||
g54, g55, g56, g57, g58, g59, g59_1, g59_2, g59_3 = self.read_file()
|
||||
if g54 is None: return
|
||||
|
||||
# fake if linuxcnc is not running
|
||||
if STATUS.is_status_valid() == False:
|
||||
self.current_system = "G54"
|
||||
|
||||
# Get the offsets arrays and convert the units if the display
|
||||
# is not in machine native units
|
||||
try:
|
||||
self.status.poll()
|
||||
self.IS_RUNNING = True
|
||||
except:
|
||||
self.current_system = "G54"
|
||||
self.IS_RUNNING = False
|
||||
|
||||
ap = self.status.actual_position
|
||||
tool = self.status.tool_offset
|
||||
g92 = self.status.g92_offset
|
||||
rot = self.status.rotation_xy
|
||||
ap = STATUS.stat.actual_position
|
||||
tool = STATUS.stat.tool_offset
|
||||
g92 = STATUS.stat.g92_offset
|
||||
rot = STATUS.stat.rotation_xy
|
||||
|
||||
if self.metric_display != INFO.MACHINE_IS_METRIC:
|
||||
ap = INFO.convert_units_9(ap)
|
||||
|
|
@ -260,7 +259,7 @@ class OriginOffsetView(QTableView, _HalWidgetBase):
|
|||
LOG.exception(e)
|
||||
# now update linuxcnc to the change
|
||||
try:
|
||||
if self.IS_RUNNING:
|
||||
if STATUS.is_status_valid():
|
||||
ACTION.RECORD_CURRENT_MODE()
|
||||
if row == 0: # current Origin
|
||||
ACTION.CALL_MDI("G10 L2 P0 %s %10.4f" % (self.axisletters[col], qualified))
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ class ToolOffsetView(QTableView, _HalWidgetBase):
|
|||
|
||||
self.filename = INFO.PARAMETER_FILE
|
||||
self.axisletters = ["x", "y", "z", "a", "b", "c", "u", "v", "w"]
|
||||
self.IS_RUNNING = False
|
||||
self.editing_flag = False
|
||||
self.current_system = None
|
||||
self.current_tool = 0
|
||||
|
|
@ -66,6 +65,9 @@ class ToolOffsetView(QTableView, _HalWidgetBase):
|
|||
def _hal_init(self):
|
||||
self.delay = 0
|
||||
STATUS.connect('all-homed', lambda w: self.setEnabled(True))
|
||||
STATUS.connect('interp-idle', lambda w: self.setEnabled(STATUS.machine_is_on()
|
||||
and STATUS.is_all_homed()))
|
||||
STATUS.connect('interp-run', lambda w: self.setEnabled(False))
|
||||
STATUS.connect('periodic', self.periodic_check)
|
||||
STATUS.connect('metric-mode-changed', lambda w, data: self.metricMode(data))
|
||||
STATUS.connect('tool-in-spindle-changed', lambda w, data: self.currentTool(data))
|
||||
|
|
@ -80,22 +82,20 @@ class ToolOffsetView(QTableView, _HalWidgetBase):
|
|||
else:
|
||||
self.hideColumn(8)
|
||||
|
||||
# only update every 100th time periodic calls
|
||||
# only update every 10th time periodic calls
|
||||
# if editing don't update
|
||||
#
|
||||
def periodic_check(self, w):
|
||||
try:
|
||||
STATUS.stat.poll()
|
||||
self.IS_RUNNING = True
|
||||
except:
|
||||
self.IS_RUNNING = False
|
||||
return
|
||||
if self.delay < 9:
|
||||
self.delay += 1
|
||||
return
|
||||
if self.editing_flag: return
|
||||
if STATUS.is_status_valid() == False:
|
||||
return
|
||||
self.delay = 0
|
||||
self.tablemodel.update(TOOL.GET_TOOL_FILE())
|
||||
if self.editing_flag: return
|
||||
# check if hash of tool file changed
|
||||
if not TOOL.IS_HASH_CURRENT():
|
||||
self.tablemodel.update(TOOL.GET_TOOL_FILE())
|
||||
return True
|
||||
|
||||
def currentTool(self, data):
|
||||
|
|
@ -166,8 +166,7 @@ class ToolOffsetView(QTableView, _HalWidgetBase):
|
|||
print ' QUALIFIED:', qualified
|
||||
# now update linuxcnc to the change
|
||||
try:
|
||||
if self.IS_RUNNING:
|
||||
|
||||
if STATUS.is_status_valid():
|
||||
TOOL.SAVE_TOOLFILE(TOOL.CONVERT_TO_STANDARD(self.tablemodel.arraydata))
|
||||
ACTION.RECORD_CURRENT_MODE()
|
||||
ACTION.CALL_MDI('g43')
|
||||
|
|
@ -179,8 +178,10 @@ class ToolOffsetView(QTableView, _HalWidgetBase):
|
|||
LOG.exception("offsetpage widget error: MDI call error", exc_info=e)
|
||||
self.editing_flag = False
|
||||
|
||||
|
||||
|
||||
def add_tool(self):
|
||||
if not STATUS.is_auto_running():
|
||||
LOG.debug('add tool request')
|
||||
TOOL.ADD_TOOL(TOOL.CONVERT_TO_STANDARD(self.tablemodel.arraydata))
|
||||
|
||||
#########################################
|
||||
# custom model
|
||||
|
|
|
|||
|
|
@ -181,6 +181,9 @@ font: 75 18pt "Courier 10 Pitch";</string>
|
|||
<property name="zero_axis_action" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="zero_g5x_action" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="joint_number" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
|
|
@ -1207,6 +1210,41 @@ Origion Zero</string>
|
|||
<string>G53 G0 X0Y0Z0</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="ActionButton" name="actionbutton_38">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>286</y>
|
||||
<width>91</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Zero G5x</string>
|
||||
</property>
|
||||
<property name="zero_g5x_action" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="ActionButton" name="actionbutton_72">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>50</x>
|
||||
<y>340</y>
|
||||
<width>91</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Zero G92</string>
|
||||
</property>
|
||||
<property name="zero_g5x_action" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="zero_g92_action" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_auto">
|
||||
|
|
@ -1254,7 +1292,7 @@ file</string>
|
|||
<x>100</x>
|
||||
<y>10</y>
|
||||
<width>61</width>
|
||||
<height>61</height>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
|
|
@ -1850,6 +1888,67 @@ file</string>
|
|||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="ActionButton" name="actionbutton_39">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>50</y>
|
||||
<width>61</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Step</string>
|
||||
</property>
|
||||
<property name="estop_action" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="run_action" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="step_action" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="template_label_option" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="joint_number" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="incr_imperial_number" stdset="0">
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="incr_mm_number" stdset="0">
|
||||
<double>0.025000000000000</double>
|
||||
</property>
|
||||
<property name="incr_angular_number" stdset="0">
|
||||
<double>-1.000000000000000</double>
|
||||
</property>
|
||||
<property name="toggle_float_option" stdset="0">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="float_num" stdset="0">
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
<property name="float_alt_num" stdset="0">
|
||||
<double>50.000000000000000</double>
|
||||
</property>
|
||||
<property name="view_type_string" stdset="0">
|
||||
<string>P</string>
|
||||
</property>
|
||||
<property name="command_text_string" stdset="0">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="ini_mdi_number" stdset="0">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="textTemplate" stdset="0">
|
||||
<string>%1.3f in</string>
|
||||
</property>
|
||||
<property name="alt_textTemplate" stdset="0">
|
||||
<string>%1.2f mm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
|
|||
|
|
@ -35,11 +35,13 @@ def md5sum(filename):
|
|||
# warning any data that doesn't start with a _ will be saved
|
||||
# and reloaded - this could change the type
|
||||
class Data:
|
||||
def __init__(self, app, private_data_instance):
|
||||
def __init__(self, app, private_data_instance,base_dir):
|
||||
global _PD
|
||||
global _APP
|
||||
global _BASE
|
||||
_APP = app
|
||||
_PD = private_data_instance
|
||||
_BASE = base_dir
|
||||
# custom signal name lists
|
||||
self.halencoderinputsignames = []
|
||||
self.halmuxencodersignames = []
|
||||
|
|
@ -881,9 +883,9 @@ If you have a REALLY large config that you wish to convert to this newer version
|
|||
ncfiles = os.path.expanduser("~/linuxcnc/nc_files")
|
||||
if not os.path.exists(ncfiles):
|
||||
_APP.makedirs(ncfiles)
|
||||
examples = os.path.join(BASE, "share", "linuxcnc", "ncfiles")
|
||||
examples = os.path.join(_BASE, "share", "linuxcnc", "ncfiles")
|
||||
if not os.path.exists(examples):
|
||||
examples = os.path.join(BASE, "nc_files")
|
||||
examples = os.path.join(_BASE, "nc_files")
|
||||
if os.path.exists(examples):
|
||||
os.symlink(examples, os.path.join(ncfiles, "examples"))
|
||||
_APP.makedirs(base)
|
||||
|
|
@ -1043,8 +1045,8 @@ Choosing no will mean AXIS options such as size/position and force maximum might
|
|||
os.symlink(base,shortcut)
|
||||
|
||||
if self.createshortcut and os.path.exists(desktop):
|
||||
if os.path.exists(BASE + "/scripts/linuxcnc"):
|
||||
scriptspath = (BASE + "/scripts/linuxcnc")
|
||||
if os.path.exists(_BASE + "/scripts/linuxcnc"):
|
||||
scriptspath = (_BASE + "/scripts/linuxcnc")
|
||||
else:
|
||||
scriptspath ="linuxcnc"
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class App:
|
|||
self.firmware_block = False
|
||||
# Private data holds the array of pages to load, signals, and messages
|
||||
_PD = self._p = private_data.Private_Data(self,BIN,BASE)
|
||||
self.d = data.Data(self, _PD)
|
||||
self.d = data.Data(self, _PD, BASE)
|
||||
|
||||
self.splash_screen()
|
||||
#self.pbar.set_fraction(.2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue