From 3bfc1aa714e282d74b801155d830377ca58d8f59 Mon Sep 17 00:00:00 2001 From: zkk <1007518571@qq.com> Date: Thu, 2 Jan 2025 11:17:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=BB=E8=BD=B4=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=A7=BB=E8=BD=B4=E5=8A=9F=E8=83=BD=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- panels/move.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/panels/move.py b/panels/move.py index d6fa890f..6e90ad44 100644 --- a/panels/move.py +++ b/panels/move.py @@ -118,6 +118,15 @@ class Panel(ScreenPanel): self.content.add(self.labels["move_menu"]) + printer_cfg = self._printer.get_config_section("printer") + # The max_velocity parameter is not optional in klipper config. + # The minimum is 1, but least 2 values are needed to create a scale + max_velocity = max(int(float(printer_cfg["max_velocity"])), 2) + if "max_z_velocity" in printer_cfg: + self.max_z_velocity = max(int(float(printer_cfg["max_z_velocity"])), 2) + else: + self.max_z_velocity = max_velocity + def process_update(self, action, data): if action != "notify_status_update": return