MainCode/adalm1000_logger.py aktualisiert
.empty() replaced with not deque (C)
This commit is contained in:
parent
06546bca76
commit
adc7edd501
@ -927,7 +927,7 @@ class BatteryTester(QMainWindow):
|
|||||||
|
|
||||||
def update_plot(self):
|
def update_plot(self):
|
||||||
"""Update the plot with new data."""
|
"""Update the plot with new data."""
|
||||||
if self.time_data.empty():
|
if not self.time_data:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.line_voltage.set_data(list(self.time_data), list(self.voltage_data))
|
self.line_voltage.set_data(list(self.time_data), list(self.voltage_data))
|
||||||
@ -937,7 +937,7 @@ class BatteryTester(QMainWindow):
|
|||||||
|
|
||||||
def auto_scale_axes(self):
|
def auto_scale_axes(self):
|
||||||
"""Automatically adjust plot axes."""
|
"""Automatically adjust plot axes."""
|
||||||
if self.time_data.empty():
|
if not self.time_data:
|
||||||
return
|
return
|
||||||
|
|
||||||
# X-axis adjustment
|
# X-axis adjustment
|
||||||
@ -949,7 +949,7 @@ class BatteryTester(QMainWindow):
|
|||||||
self.ax2.set_xlim(0, new_xmax)
|
self.ax2.set_xlim(0, new_xmax)
|
||||||
|
|
||||||
# Y-axes adjustment
|
# Y-axes adjustment
|
||||||
if not self.voltage_data.empty():
|
if self.voltage_data:
|
||||||
voltage_padding = 0.2
|
voltage_padding = 0.2
|
||||||
min_v = max(0, min(list(self.voltage_data)) - voltage_padding)
|
min_v = max(0, min(list(self.voltage_data)) - voltage_padding)
|
||||||
max_v = min(5.0, max(list(self.voltage_data)) + voltage_padding)
|
max_v = min(5.0, max(list(self.voltage_data)) + voltage_padding)
|
||||||
@ -958,7 +958,7 @@ class BatteryTester(QMainWindow):
|
|||||||
new_max = current_ylim[1] + (max_v - current_ylim[1]) * 0.1
|
new_max = current_ylim[1] + (max_v - current_ylim[1]) * 0.1
|
||||||
self.ax.set_ylim(new_min, new_max)
|
self.ax.set_ylim(new_min, new_max)
|
||||||
|
|
||||||
if not self.current_data.empty():
|
if self.current_data:
|
||||||
current_padding = 0.05
|
current_padding = 0.05
|
||||||
min_c = max(-0.25, min(list(self.current_data)) - current_padding)
|
min_c = max(-0.25, min(list(self.current_data)) - current_padding)
|
||||||
max_c = min(0.25, max(list(self.current_data)) + current_padding)
|
max_c = min(0.25, max(list(self.current_data)) + current_padding)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user