poll for power readings much more rapidly - traces now look great

This commit is contained in:
Kevin Hester committed 2024-07-11 11:49:12 -07:00
1 parent 7e007e7e24
commit 3c76e19c33
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -63,7 +63,7 @@ class PPK2PowerSupply(PowerSupply):
"""Endless measurement loop will run in a thread."""
while self.measuring:
with self.want_measurement:
self.want_measurement.wait(0.0001 if self.num_data_reads == 0 else 0.01)
self.want_measurement.wait(0.0001 if self.num_data_reads == 0 else 0.001)
# normally we poll using this timeout, but sometimes
# reset_measurement() will notify us to read immediately
+1 -1
View File
@@ -71,7 +71,7 @@ log_regex = re.compile(".*S:([0-9A-Za-z]+):(.*)")
class PowerLogger:
"""Logs current watts reading periodically using PowerMeter and ArrowWriter."""
def __init__(self, pMeter: PowerMeter, file_path: str, interval=0.2) -> None:
def __init__(self, pMeter: PowerMeter, file_path: str, interval=0.01) -> None:
"""Initialize the PowerLogger object."""
self.pMeter = pMeter
self.writer = FeatherWriter(file_path)