probe: Move move_next() method within ProbePointsHelper class

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-09-26 11:51:29 -04:00 committed by KevinOConnor
parent 8e7eac9b08
commit cb3fede19a
1 changed files with 12 additions and 12 deletions

View File

@ -199,6 +199,18 @@ class ProbePointsHelper:
except homing.EndstopError as e: except homing.EndstopError as e:
self.finalize(False) self.finalize(False)
raise self.gcode.error(str(e)) raise self.gcode.error(str(e))
def move_next(self):
x, y = self.probe_points[len(self.results)/self.samples]
curpos = self.toolhead.get_position()
curpos[0] = x
curpos[1] = y
curpos[2] = self.horizontal_move_z
try:
self.toolhead.move(curpos, self.speed)
except homing.EndstopError as e:
self.finalize(False)
raise self.gcode.error(str(e))
self.gcode.reset_last_position()
def probe_point(self): def probe_point(self):
for i in range(self.samples): for i in range(self.samples):
self.gcode.run_script_from_command("PROBE") self.gcode.run_script_from_command("PROBE")
@ -228,18 +240,6 @@ class ProbePointsHelper:
except: except:
self.finalize(False) self.finalize(False)
raise raise
def move_next(self):
x, y = self.probe_points[len(self.results)/self.samples]
curpos = self.toolhead.get_position()
curpos[0] = x
curpos[1] = y
curpos[2] = self.horizontal_move_z
try:
self.toolhead.move(curpos, self.speed)
except homing.EndstopError as e:
self.finalize(False)
raise self.gcode.error(str(e))
self.gcode.reset_last_position()
cmd_NEXT_help = "Move to the next XY position to probe" cmd_NEXT_help = "Move to the next XY position to probe"
def cmd_NEXT(self, params): def cmd_NEXT(self, params):
if self.probe is None: if self.probe is None: