Conversation
| log("Ending stream...") | ||
|
|
||
| # Always switch to mm, in case the job put you in inches | ||
| self.write_command('G21') |
There was a problem hiding this comment.
Would be good to have this (for both unit options) as a readable router_machine function, like zUp, spindle_off etc.
| self.m.s.write_command('G20') | ||
|
|
||
| # If Z is below safe height, then raise it up | ||
| if self.m.mpos_z() < z_safe_height: |
There was a problem hiding this comment.
I suspect that G20 changes the pos read? So this logic might not work after the unit change
| if self.using_inches: | ||
| self.m.set_machine_unit_to_inch() | ||
| self.m.s.write_command('G90 G0 X%s Y%s' % (self.pos_x, self.pos_y)) | ||
| self.m.set_machine_unit_to_mm() |
There was a problem hiding this comment.
Why do you switch back to mm if the recovered file is in inches? Doesn't that mean, that when you re-run the job from the recover position all subsequent moves will be in mm again?
There was a problem hiding this comment.
This function is just used for the GO XY button on the job recovery screen - it sets to inches just while it moves to the position currently being displayed on that screen, then it needs to go back to mm, and when the user runs the job recovery file, then it will insert the G20 back in
Two different fixes related to G20/G21 unit gcodes:
Tested on windows, by using manual move and doing 1mm movements and seeing if it goes way too far