bed_mesh: refactor print_generated_points()

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2019-12-18 18:26:02 -05:00 committed by KevinOConnor
parent 2a2191d201
commit 8013699c45
1 changed files with 6 additions and 9 deletions

View File

@ -300,20 +300,17 @@ class BedMeshCalibrate:
if probe is not None: if probe is not None:
x_offset, y_offset = probe.get_offsets()[:2] x_offset, y_offset = probe.get_offsets()[:2]
print_func("bed_mesh: generated points\nIndex" print_func("bed_mesh: generated points\nIndex"
" | Automatic | Manual") " | Tool Adjusted | Probe")
for i, (x, y) in enumerate(self.points): for i, (x, y) in enumerate(self.points):
auto_pt = "(%.1f, %.1f)" % (x - x_offset, y - y_offset) adj_pt = "(%.1f, %.1f)" % (x - x_offset, y - y_offset)
man_pt = "(%.1f, %.1f)" % (x, y) mesh_pt = "(%.1f, %.1f)" % (x, y)
print_func( print_func(
" %-4d| %-16s| %s" % (i, auto_pt, man_pt)) " %-4d| %-16s| %s" % (i, adj_pt, mesh_pt))
if self.relative_reference_index is not None: if self.relative_reference_index is not None:
rri = self.relative_reference_index rri = self.relative_reference_index
print_func( print_func(
"bed_mesh: relative_reference_index %d is (%.2f, %.2f)," "bed_mesh: relative_reference_index %d is (%.2f, %.2f)"
" (%.2f, %.2f)" % % (rri, self.points[rri][0], self.points[rri][1]))
(rri, self.points[rri][0] - x_offset,
self.points[rri][1] - y_offset,
self.points[rri][0], self.points[rri][1]))
def _init_mesh_params(self, config, points): def _init_mesh_params(self, config, points):
pps = parse_pair(config, ('mesh_pps', '2'), check=False, pps = parse_pair(config, ('mesh_pps', '2'), check=False,
cast=int, minval=0) cast=int, minval=0)