aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-12-01 11:29:41 -0500
committerKevin O'Connor <kevin@koconnor.net>2020-12-01 11:36:37 -0500
commitf90fbb56d2f94f330ab558c54ada41b0914849e4 (patch)
tree2141893fcf45db6c6bc3bd7d9661f9be8e345ca0 /klippy
parent6ead8dd9d97fc08aacf6e9afad44798f6bbbe7c2 (diff)
downloadkutter-f90fbb56d2f94f330ab558c54ada41b0914849e4.tar.gz
kutter-f90fbb56d2f94f330ab558c54ada41b0914849e4.tar.xz
kutter-f90fbb56d2f94f330ab558c54ada41b0914849e4.zip
input_shaper: Simplify input shaper type reporting
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/extras/input_shaper.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/klippy/extras/input_shaper.py b/klippy/extras/input_shaper.py
index ceca89f8..69ac3cde 100644
--- a/klippy/extras/input_shaper.py
+++ b/klippy/extras/input_shaper.py
@@ -134,15 +134,14 @@ class InputShaper:
shaper_freq_x, shaper_freq_y,
damping_ratio_x, damping_ratio_y)
+ id_to_name = {v: n for n, v in self.shapers.items()}
gcmd.respond_info("shaper_type_x:%s shaper_type_y:%s "
"shaper_freq_x:%.3f shaper_freq_y:%.3f "
- "damping_ratio_x:%.6f damping_ratio_y:%.6f" % (
- self.shapers.keys()[
- self.shapers.values().index(shaper_type_x)]
- , self.shapers.keys()[
- self.shapers.values().index(shaper_type_y)]
- , shaper_freq_x, shaper_freq_y
- , damping_ratio_x, damping_ratio_y))
+ "damping_ratio_x:%.6f damping_ratio_y:%.6f"
+ % (id_to_name[shaper_type_x],
+ id_to_name[shaper_type_y],
+ shaper_freq_x, shaper_freq_y,
+ damping_ratio_x, damping_ratio_y))
def load_config(config):
return InputShaper(config)