Skip to content

Commit

Permalink
resonance_tester: use gcmd.get_float()
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerlz committed Jun 21, 2024
1 parent 10ea987 commit 83850c0
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions klippy/extras/resonance_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _run_test(
test_points = self.test.get_start_test_points()

if test_accel_per_hz is not None:
self.test.accel_per_hz=test_accel_per_hz
self.test.accel_per_hz = test_accel_per_hz

for point in test_points:
toolhead.manual_move(point, self.move_speed)
Expand Down Expand Up @@ -331,7 +331,7 @@ def cmd_TEST_RESONANCES(self, gcmd):
axis = _parse_axis(gcmd, gcmd.get("AXIS").lower())
chips_str = gcmd.get("CHIPS", None)
test_point = gcmd.get("POINT", None)
test_accel_per_hz = gcmd.get("ACCEL_PER_HZ", None, above=0.0)
test_accel_per_hz = gcmd.get_float("ACCEL_PER_HZ", None, above=0.0)

if test_point:
test_coords = test_point.split(",")
Expand All @@ -345,12 +345,6 @@ def cmd_TEST_RESONANCES(self, gcmd):
" where x, y and z are valid floating point numbers"
)

if test_accel_per_hz:
try:
test_accel_per_hz = float(test_accel_per_hz)
except ValueError:
raise gcmd.error("Accel Per Hz value has to be larger than 0")

accel_chips = self._parse_chips(chips_str) if chips_str else None

outputs = gcmd.get("OUTPUT", "resonances").lower().split(",")
Expand Down

0 comments on commit 83850c0

Please sign in to comment.