From a5ad053a0cccdced281486e1f9023eedd73d0ebd Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 28 Jun 2025 01:03:50 +0200 Subject: [PATCH] MainCode/adalm1000_logger.py aktualisiert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zeit bei messbeginn zurücksetzen (D) --- MainCode/adalm1000_logger.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/MainCode/adalm1000_logger.py b/MainCode/adalm1000_logger.py index 1a203cc..06046fa 100644 --- a/MainCode/adalm1000_logger.py +++ b/MainCode/adalm1000_logger.py @@ -484,6 +484,8 @@ class BatteryTester(QMainWindow): self.charge_capacity = 0.0 self.coulomb_efficiency = 0.0 self.cycle_count = 0 + self.start_time = time.time() + self.time_label.setText("00:00:00") self.reset_plot() # Protokolldatei vorbereiten @@ -826,17 +828,12 @@ class BatteryTester(QMainWindow): self.line_voltage.set_data([], []) self.line_current.set_data([], []) - # Initiale Achsenbereiche setzen + # Achsen auf Startwerte zurücksetzen + self.ax.set_xlim(0, 10) # X-Achse (Zeit) bei 0 beginnen voltage_padding = 0.2 min_voltage = max(0, float(self.discharge_cutoff_input.text()) - voltage_padding) max_voltage = float(self.charge_cutoff_input.text()) + voltage_padding - self.ax.set_xlim(0, 10) - self.ax.set_ylim(min_voltage, max_voltage) - - current_padding = 0.05 - test_current = float(self.c_rate_input.text()) * float(self.capacity_input.text()) - max_current = test_current * 1.5 - self.ax2.set_ylim(-max_current - current_padding, max_current + current_padding) + self.ax.set_ylim(min_voltage, max_volume) self.canvas.draw()