From 876fecb4668baff01a9ac92db9c39947b6583ac4 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 26 May 2025 13:35:44 +0200 Subject: [PATCH] MainCode/adalm1000_logger.py aktualisiert This change ensures that: The plot data buffers are cleared The plot lines are reset to empty data The axes are reset to default ranges (0-1) The canvas is redrawn to show the cleared plot (Deepseek) --- MainCode/adalm1000_logger.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MainCode/adalm1000_logger.py b/MainCode/adalm1000_logger.py index e973c4b..9db43a8 100644 --- a/MainCode/adalm1000_logger.py +++ b/MainCode/adalm1000_logger.py @@ -502,6 +502,17 @@ class BatteryTester: self.dev.channels['A'].mode = pysmu.Mode.HI_Z self.dev.channels['A'].constant(0) + # Clear plot data + self.time_data.clear() + self.voltage_data.clear() + self.current_data.clear() + if hasattr(self, 'line_voltage') and hasattr(self, 'line_current'): + self.line_voltage.set_data([], []) + self.line_current.set_data([], []) + self.ax.set_xlim(0, 1) + self.ax2.set_xlim(0, 1) + self.canvas.draw() + self.status_var.set("Test stopped immediately") self.stop_button.config(state=tk.DISABLED) self.start_button.config(state=tk.NORMAL)