Skip to content

Commit a1d4bcf

Browse files
committed
Merge branch '2.9'
2 parents 55aafbc + 934d3dd commit a1d4bcf

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

docs/src/gui/qtdragon.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ These bit/s32/float pins are related to external offsets if they are used:
495495
[source,{hal}]
496496
----
497497
qtdragon.eoffset-clear
498-
qtdragon.eoffset-count
499498
qtdragon.eoffset-enable
500499
qtdragon.eoffset-value
501500
qtdragon.eoffset-spindle-count

lib/python/qtvcp/widgets/probe_subprog.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,16 @@ def process_command(self, cmd):
164164
cmd = cmd.rstrip().split('$')
165165
if cmd[0] in dir(self):
166166
if not STATUS.is_on_and_idle(): return None
167+
pre = self.prechecks()
168+
if pre is not None: return pre
167169
parms = json.loads(cmd[1])
168170
self.update_data(parms)
169171
# start polling errors here - parent program should have blocked their polling
170172
STATUS.unblock_error_polling()
171173
error = self[cmd[0]]()
172174
if (error != 1 or type(error)== str) and STATUS.is_on_and_idle():
173175
ACTION.CALL_MDI("G90")
176+
self.postreset()
174177
return error
175178
else:
176179
return None
@@ -211,6 +214,24 @@ def collect_status(self):
211214
# self.send_dict.update( {key: data} )
212215
#return
213216

217+
# need to be in the right mode - entries are in machine units
218+
def prechecks(self):
219+
if INFO.MACHINE_IS_METRIC and STATUS.is_metric_mode():
220+
return None
221+
if not INFO.MACHINE_IS_METRIC and not STATUS.is_metric_mode():
222+
return None
223+
# record motion modes
224+
ACTION.CALL_MDI('M70')
225+
if INFO.MACHINE_IS_METRIC:
226+
ACTION.CALL_MDI('g21')
227+
else:
228+
ACTION.CALL_MDI('g20')
229+
return None
230+
231+
# return to previous motion modes
232+
def postreset(self):
233+
ACTION.CALL_MDI('M72')
234+
214235
########################################
215236
# required boiler code
216237
########################################

0 commit comments

Comments
 (0)