aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/corexy.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-04-11 11:37:09 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-04-11 11:42:55 -0400
commit7b03b04c786863bc32d3b790862857061f71f072 (patch)
tree4396da5121caf1f7f6e5072115a4ddff345fa476 /klippy/corexy.py
parent7a7b98cc31dff8cb7f1a6a1ab886362a0802be66 (diff)
downloadkutter-7b03b04c786863bc32d3b790862857061f71f072.tar.gz
kutter-7b03b04c786863bc32d3b790862857061f71f072.tar.xz
kutter-7b03b04c786863bc32d3b790862857061f71f072.zip
klippy: Support minimum/maximum value checks on configuration variables
Verify that numeric parameters are in a sane range when reading the config. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/corexy.py')
-rw-r--r--klippy/corexy.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/klippy/corexy.py b/klippy/corexy.py
index dfee7bb3..d429496c 100644
--- a/klippy/corexy.py
+++ b/klippy/corexy.py
@@ -15,8 +15,10 @@ class CoreXYKinematics:
for n in ['x', 'y', 'z']]
self.steppers[0].mcu_endstop.add_stepper(self.steppers[1].mcu_stepper)
self.steppers[1].mcu_endstop.add_stepper(self.steppers[0].mcu_stepper)
- self.max_z_velocity = config.getfloat('max_z_velocity', 9999999.9)
- self.max_z_accel = config.getfloat('max_z_accel', 9999999.9)
+ self.max_z_velocity = config.getfloat(
+ 'max_z_velocity', 9999999.9, above=0.)
+ self.max_z_accel = config.getfloat(
+ 'max_z_accel', 9999999.9, above=0.)
self.need_motor_enable = True
self.limits = [(1.0, -1.0)] * 3
def set_max_jerk(self, max_xy_halt_velocity, max_velocity, max_accel):