diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-04-11 11:37:09 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-04-11 11:42:55 -0400 |
commit | 7b03b04c786863bc32d3b790862857061f71f072 (patch) | |
tree | 4396da5121caf1f7f6e5072115a4ddff345fa476 /klippy/cartesian.py | |
parent | 7a7b98cc31dff8cb7f1a6a1ab886362a0802be66 (diff) | |
download | kutter-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/cartesian.py')
-rw-r--r-- | klippy/cartesian.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/klippy/cartesian.py b/klippy/cartesian.py index ab95df5d..f69855f6 100644 --- a/klippy/cartesian.py +++ b/klippy/cartesian.py @@ -13,8 +13,10 @@ class CartKinematics: self.steppers = [stepper.PrinterStepper( printer, config.getsection('stepper_' + n), n) for n in ['x', 'y', 'z']] - 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): |