MainCode/adalm1000_logger.py aktualisiert
Working (D)
This commit is contained in:
parent
418885aca8
commit
20fe83a319
@ -315,51 +315,55 @@ class BatteryTester(QMainWindow):
|
|||||||
|
|
||||||
# Measurement values
|
# Measurement values
|
||||||
measurement_labels = [
|
measurement_labels = [
|
||||||
("Voltage (V)", "V"),
|
("Voltage", "V"), ("Current", "A"), ("Test Phase", ""),
|
||||||
("Current (A)", "A"),
|
("Elapsed Time", "s"), ("Discharge Capacity", "Ah"), ("Charge Capacity", "Ah"),
|
||||||
("Test Phase", ""),
|
("Coulomb Eff.", "%"), ("Cycle Count", ""), ("Battery Temp", "°C"),
|
||||||
("Elapsed Time", "s"),
|
("Internal R", "Ω"), ("Power", "W"), ("Energy", "Wh")
|
||||||
("Discharge Capacity", "Ah"),
|
|
||||||
("Charge Capacity", "Ah"),
|
|
||||||
("Coulomb Eff.", "%"),
|
|
||||||
("Cycle Count", ""),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
self.value_labels = {}
|
# 4 Zeilen × 3 Spalten Anordnung
|
||||||
for i, (label, unit) in enumerate(measurement_labels):
|
for i, (label, unit) in enumerate(measurement_labels):
|
||||||
row = i // 2
|
row = i // 3 # 0-3 (4 Zeilen)
|
||||||
col = (i % 2) * 2
|
col = (i % 3) * 3 # 0, 3, 6 (3 Spalten mit je 3 Widgets)
|
||||||
|
|
||||||
|
# Label für den Messwertnamen
|
||||||
lbl = QLabel(f"{label}:")
|
lbl = QLabel(f"{label}:")
|
||||||
lbl.setStyleSheet(f"color: {self.fg_color};")
|
lbl.setStyleSheet(f"color: {self.fg_color}; font-size: 11px;")
|
||||||
display_layout.addWidget(lbl, row, col)
|
display_layout.addWidget(lbl, row, col)
|
||||||
|
|
||||||
|
# Label für den Messwert
|
||||||
value_lbl = QLabel("0.000")
|
value_lbl = QLabel("0.000")
|
||||||
value_lbl.setStyleSheet(f"color: {self.fg_color}; font-weight: bold;")
|
value_lbl.setStyleSheet(f"""
|
||||||
|
color: {self.fg_color};
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 12px;
|
||||||
|
min-width: 60px;
|
||||||
|
""")
|
||||||
display_layout.addWidget(value_lbl, row, col + 1)
|
display_layout.addWidget(value_lbl, row, col + 1)
|
||||||
|
|
||||||
|
# Einheit falls vorhanden
|
||||||
if unit:
|
if unit:
|
||||||
unit_lbl = QLabel(unit)
|
unit_lbl = QLabel(unit)
|
||||||
unit_lbl.setStyleSheet(f"color: {self.fg_color};")
|
unit_lbl.setStyleSheet(f"color: {self.fg_color}; font-size: 11px;")
|
||||||
display_layout.addWidget(unit_lbl, row, col + 2)
|
display_layout.addWidget(unit_lbl, row, col + 2)
|
||||||
|
|
||||||
# Store references to important labels
|
# Spaltenabstände anpassen
|
||||||
if i == 0:
|
for i in range(9): # 3 Spalten × 3 Widgets
|
||||||
self.voltage_label = value_lbl
|
display_layout.setColumnStretch(i, 1 if i % 3 == 1 else 0) # Nur Wert-Spalten dehnen
|
||||||
elif i == 1:
|
|
||||||
self.current_label = value_lbl
|
# Referenzen aktualisieren
|
||||||
elif i == 2:
|
self.voltage_label = display_layout.itemAtPosition(0, 1).widget()
|
||||||
self.phase_label = value_lbl
|
self.current_label = display_layout.itemAtPosition(0, 4).widget()
|
||||||
elif i == 3:
|
self.phase_label = display_layout.itemAtPosition(0, 7).widget()
|
||||||
self.time_label = value_lbl
|
self.time_label = display_layout.itemAtPosition(1, 1).widget()
|
||||||
elif i == 4:
|
self.capacity_label = display_layout.itemAtPosition(1, 4).widget()
|
||||||
self.capacity_label = value_lbl
|
self.charge_capacity_label = display_layout.itemAtPosition(1, 7).widget()
|
||||||
elif i == 5:
|
self.efficiency_label = display_layout.itemAtPosition(2, 1).widget()
|
||||||
self.charge_capacity_label = value_lbl
|
self.cycle_label = display_layout.itemAtPosition(2, 4).widget()
|
||||||
elif i == 6:
|
self.temp_label = display_layout.itemAtPosition(2, 7).widget()
|
||||||
self.efficiency_label = value_lbl
|
self.resistance_label = display_layout.itemAtPosition(3, 1).widget()
|
||||||
elif i == 7:
|
self.power_label = display_layout.itemAtPosition(3, 4).widget()
|
||||||
self.cycle_label = value_lbl
|
self.energy_label = display_layout.itemAtPosition(3, 7).widget()
|
||||||
|
|
||||||
self.main_layout.addWidget(display_frame)
|
self.main_layout.addWidget(display_frame)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user