File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -495,7 +495,6 @@ These bit/s32/float pins are related to external offsets if they are used:
495495[source,{hal}]
496496----
497497qtdragon.eoffset-clear
498- qtdragon.eoffset-count
499498qtdragon.eoffset-enable
500499qtdragon.eoffset-value
501500qtdragon.eoffset-spindle-count
Original file line number Diff line number Diff 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########################################
You can’t perform that action at this time.
0 commit comments