From 9ab9e61ccd6f0ca36d736eff2329a4dd7f356c5e Mon Sep 17 00:00:00 2001 From: guoge Date: Tue, 10 Dec 2024 14:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE=E5=8F=98?= =?UTF-8?q?=E9=87=8F,=E6=8E=A7=E5=88=B6=E6=98=AF=E5=90=A6=E5=9C=A8?= =?UTF-8?q?=E6=A0=A1=E5=87=86=E5=90=8E=E8=87=AA=E5=8A=A8=E4=BF=9D=E5=AD=98?= =?UTF-8?q?bedmesh=E6=95=B0=E6=8D=AE=E5=88=B0config=E4=B8=AD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- klippy/extras/bed_mesh.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py index 5c026d8c3619..476ec32664cf 100644 --- a/klippy/extras/bed_mesh.py +++ b/klippy/extras/bed_mesh.py @@ -309,6 +309,7 @@ def __init__(self, config, bedmesh): self._init_mesh_config(config) self._generate_points(config.error) self._profile_name = "default" + self._autosave = config.getint('autosave', 1) self.probe_helper = probe.ProbePointsHelper( config, self.probe_finalize, self._get_adjusted_points()) self.probe_helper.minimum_points(3) @@ -670,6 +671,7 @@ def update_config(self, gcmd): self.origin = self.orig_config['origin'] self.mesh_min = self.orig_config['mesh_min'] self.mesh_max = self.orig_config['mesh_max'] + self._autosave = gcmd.get_int('AUTOSAVE', self._autosave) for key in list(self.mesh_config.keys()): self.mesh_config[key] = self.orig_config[key] @@ -873,7 +875,7 @@ def probe_finalize(self, offsets, positions): z_mesh.set_zero_reference(*self.zero_ref_pos) self.bedmesh.set_mesh(z_mesh) self.gcode.respond_info("Mesh Bed Leveling Complete") - if self._profile_name is not None: + if self._autosave and (self._profile_name is not None): self.bedmesh.save_profile(self._profile_name) def _dump_points(self, probed_pts, corrected_pts, offsets): # logs generated points with offset applied, points received