From f31ae7a8291650d6d3aef820edc9024b1d0f4695 Mon Sep 17 00:00:00 2001 From: alfrix Date: Wed, 7 Dec 2022 16:59:55 -0300 Subject: [PATCH] hide popups from panel initialization ideally the initialization should not contain this commands but at the moment klipper nor moonraker provide a way to identify the required status --- panels/input_shaper.py | 12 +++--------- screen.py | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/panels/input_shaper.py b/panels/input_shaper.py index 1d8e744b..6368acdc 100644 --- a/panels/input_shaper.py +++ b/panels/input_shaper.py @@ -152,17 +152,11 @@ class InputShaperPanel(ScreenPanel): def activate(self): # This will return the current values - self._screen._ws.klippy.gcode_script( - 'SET_INPUT_SHAPER' - ) + self._screen._ws.klippy.gcode_script('SET_INPUT_SHAPER') # Check for the accelerometer - self._screen._ws.klippy.gcode_script( - 'ACCELEROMETER_QUERY' - ) + self._screen._ws.klippy.gcode_script('ACCELEROMETER_QUERY') # Send at least two commands, with my accelerometer the first command after a reboot will fail - self._screen._ws.klippy.gcode_script( - 'MEASURE_AXES_NOISE' - ) + self._screen._ws.klippy.gcode_script('MEASURE_AXES_NOISE') def process_update(self, action, data): if action != "notify_gcode_response": diff --git a/screen.py b/screen.py index 57fd57a5..65f56a05 100755 --- a/screen.py +++ b/screen.py @@ -724,7 +724,8 @@ class KlipperScreen(Gtk.Window): self.show_popup_message(data[6:], 1) elif data.startswith("!! "): self.show_popup_message(data[3:], 3) - elif "unknown" in data.lower(): + elif "unknown" in data.lower() and \ + not ("TESTZ" in data or "MEASURE_AXES_NOISE" in data or "ACCELEROMETER_QUERY" in data): self.show_popup_message(data) if "SAVE_CONFIG" in data and self.printer.state == "ready": script = {"script": "SAVE_CONFIG"}