aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras
diff options
context:
space:
mode:
authorArksine <arksine.code@gmail.com>2019-12-17 11:05:07 -0500
committerKevinOConnor <kevin@koconnor.net>2020-01-09 14:14:13 -0500
commit2a2191d2013a5ef527b521a2765e433ec241ea53 (patch)
treec1644ddbe3875170f864b3dfaaf911fa8cc77f5f /klippy/extras
parent13d16afa0c36c1c10bd4d1777708f85fbcaf3173 (diff)
downloadkutter-2a2191d2013a5ef527b521a2765e433ec241ea53.tar.gz
kutter-2a2191d2013a5ef527b521a2765e433ec241ea53.tar.xz
kutter-2a2191d2013a5ef527b521a2765e433ec241ea53.zip
bed_mesh: fix LOAD_PROFILE
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'klippy/extras')
-rw-r--r--klippy/extras/bed_mesh.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py
index 67626a47..d0363d51 100644
--- a/klippy/extras/bed_mesh.py
+++ b/klippy/extras/bed_mesh.py
@@ -10,6 +10,12 @@ import json
import probe
import collections
+PROFILE_OPTIONS = {
+ 'min_x': float, 'max_x': float, 'min_y': float, 'max_y': float,
+ 'x_count': int, 'y_count': int, 'mesh_x_pps': int, 'mesh_y_pps': int,
+ 'algo': str, 'tension': float
+}
+
class BedMeshError(Exception):
pass
@@ -363,12 +369,12 @@ class BedMeshCalibrate:
for line in z_values if line.strip()]
self.profiles[name]['mesh_params'] = params = \
collections.OrderedDict()
- for key, value in self.mesh_params.iteritems():
- if type(value) is int:
+ for key, t in PROFILE_OPTIONS.iteritems():
+ if t is int:
params[key] = profile.getint(key)
- elif type(value) is float:
+ elif t is float:
params[key] = profile.getfloat(key)
- elif type(value) is str:
+ elif t is str:
params[key] = profile.get(key)
def save_profile(self, prof_name):
if self.probed_matrix is None: