aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/screws_tilt_adjust.py
diff options
context:
space:
mode:
authorPedro Lamas <pedrolamas@gmail.com>2023-01-18 00:06:45 +0000
committerKevinOConnor <kevin@koconnor.net>2023-02-03 18:16:19 -0500
commitfa78e6b8fb392baf0a8fdcdda9fad7c0383bd1ff (patch)
treeefae63e2306581bd622df71bcfa26eaad8992475 /klippy/extras/screws_tilt_adjust.py
parentd479366242cadc43775f74e0772c9c961c597ec4 (diff)
downloadkutter-fa78e6b8fb392baf0a8fdcdda9fad7c0383bd1ff.tar.gz
kutter-fa78e6b8fb392baf0a8fdcdda9fad7c0383bd1ff.tar.xz
kutter-fa78e6b8fb392baf0a8fdcdda9fad7c0383bd1ff.zip
screws_tilt_adjust: status result as dictionary
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
Diffstat (limited to 'klippy/extras/screws_tilt_adjust.py')
-rw-r--r--klippy/extras/screws_tilt_adjust.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/klippy/extras/screws_tilt_adjust.py b/klippy/extras/screws_tilt_adjust.py
index 82d12bc1..5698f0bd 100644
--- a/klippy/extras/screws_tilt_adjust.py
+++ b/klippy/extras/screws_tilt_adjust.py
@@ -64,7 +64,7 @@ class ScrewsTiltAdjust:
'results': self.results}
def probe_finalize(self, offsets, positions):
- self.results = []
+ self.results = {}
self.max_diff_error = False
# Factors used for CW-M3, CCW-M3, CW-M4, CCW-M4, CW-M5 and CCW-M5
threads_factor = {0: 0.5, 1: 0.5, 2: 0.7, 3: 0.7, 4: 0.8, 5: 0.8}
@@ -92,8 +92,9 @@ class ScrewsTiltAdjust:
self.gcode.respond_info(
"%s : x=%.1f, y=%.1f, z=%.5f" %
(name + ' (base)', coord[0], coord[1], z))
- self.results.append({'name': name + ' (base)', 'x': coord[0],
- 'y': coord[1], 'z': z, 'sign': 'CW', 'adjust':'00:00'})
+ sign = "CW" if is_clockwise_thread else "CCW"
+ self.results["screw%d" % (i + 1,)] = {'z': z, 'sign': sign,
+ 'adjust': '00:00', 'is_base': True}
else:
# Calculate how knob must be adjusted for other positions
diff = z_base - z
@@ -114,9 +115,9 @@ class ScrewsTiltAdjust:
self.gcode.respond_info(
"%s : x=%.1f, y=%.1f, z=%.5f : adjust %s %02d:%02d" %
(name, coord[0], coord[1], z, sign, full_turns, minutes))
- self.results.append({'name': name, 'x': coord[0], 'y': coord[1],
- 'z': z, 'sign': sign,
- 'adjust':"%02d:%02d" % (full_turns, minutes)})
+ self.results["screw%d" % (i + 1,)] = {'z': z, 'sign': sign,
+ 'adjust':"%02d:%02d" % (full_turns, minutes),
+ 'is_base': False}
if self.max_diff and any((d > self.max_diff) for d in screw_diff):
self.max_diff_error = True
raise self.gcode.error(