probe: Use config.getlists() for points config option

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-08-19 14:40:41 -04:00
parent 673ecec6a2
commit d3484efe73
1 changed files with 2 additions and 8 deletions

View File

@ -360,14 +360,8 @@ class ProbePointsHelper:
self.gcode = self.printer.lookup_object('gcode') self.gcode = self.printer.lookup_object('gcode')
# Read config settings # Read config settings
if default_points is None or config.get('points', None) is not None: if default_points is None or config.get('points', None) is not None:
points = config.get('points').split('\n') self.probe_points = config.getlists('points', seps=(',', '\n'),
try: parser=float, count=2)
points = [line.split(',', 1) for line in points if line.strip()]
self.probe_points = [(float(p[0].strip()), float(p[1].strip()))
for p in points]
except:
raise config.error("Unable to parse probe points in %s" % (
self.name))
self.horizontal_move_z = config.getfloat('horizontal_move_z', 5.) self.horizontal_move_z = config.getfloat('horizontal_move_z', 5.)
self.speed = config.getfloat('speed', 50., above=0.) self.speed = config.getfloat('speed', 50., above=0.)
self.use_offsets = False self.use_offsets = False