input_shaper: Simplify input shaper type reporting

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-12-01 11:29:41 -05:00
parent 6ead8dd9d9
commit f90fbb56d2
1 changed files with 6 additions and 7 deletions

View File

@ -134,15 +134,14 @@ class InputShaper:
shaper_freq_x, shaper_freq_y, shaper_freq_x, shaper_freq_y,
damping_ratio_x, damping_ratio_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 " gcmd.respond_info("shaper_type_x:%s shaper_type_y:%s "
"shaper_freq_x:%.3f shaper_freq_y:%.3f " "shaper_freq_x:%.3f shaper_freq_y:%.3f "
"damping_ratio_x:%.6f damping_ratio_y:%.6f" % ( "damping_ratio_x:%.6f damping_ratio_y:%.6f"
self.shapers.keys()[ % (id_to_name[shaper_type_x],
self.shapers.values().index(shaper_type_x)] id_to_name[shaper_type_y],
, self.shapers.keys()[ shaper_freq_x, shaper_freq_y,
self.shapers.values().index(shaper_type_y)] damping_ratio_x, damping_ratio_y))
, shaper_freq_x, shaper_freq_y
, damping_ratio_x, damping_ratio_y))
def load_config(config): def load_config(config):
return InputShaper(config) return InputShaper(config)