diff options
Diffstat (limited to 'lib/runner.py')
-rw-r--r-- | lib/runner.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/lib/runner.py b/lib/runner.py index 8093a55..4cab9ed 100644 --- a/lib/runner.py +++ b/lib/runner.py @@ -180,9 +180,7 @@ class EnergyTraceMonitor(SerialMonitor): # MSP430FR5969: 3,6V (wird aktuell nicht unterstützt) # MSP430FR5994: 3,3V (default) def get_config(self) -> dict: - return { - "voltage": self._voltage, - } + return {"voltage": self._voltage} class EnergyTraceLogicAnalyzerMonitor(EnergyTraceMonitor): @@ -191,13 +189,16 @@ class EnergyTraceLogicAnalyzerMonitor(EnergyTraceMonitor): def __init__(self, port: str, baud: int, callback=None, voltage=3.3): super().__init__(port=port, baud=baud, callback=callback, voltage=voltage) - #TODO Max length - options = {'length': 90, 'fake': False, 'sample_rate': 1_000_000} - self.log_file = 'logic_output_log_%s.json' % (time.strftime("%Y%m%d-%H%M%S")) + # TODO Max length + options = {"length": 90, "fake": False, "sample_rate": 1_000_000} + self.log_file = "logic_output_log_%s.json" % (time.strftime("%Y%m%d-%H%M%S")) # Initialization of Interfaces - self.sig = SigrokCLIInterface(sample_rate=options['sample_rate'], - sample_count=options['length'] * options['sample_rate'], fake=options['fake']) + self.sig = SigrokCLIInterface( + sample_rate=options["sample_rate"], + sample_count=options["length"] * options["sample_rate"], + fake=options["fake"], + ) # Start Measurements self.sig.runMeasureAsynchronous() @@ -205,11 +206,11 @@ class EnergyTraceLogicAnalyzerMonitor(EnergyTraceMonitor): def close(self): super().close() # Read measured data - #self.sig.waitForAsynchronousMeasure() + # self.sig.waitForAsynchronousMeasure() self.sig.forceStopMeasure() time.sleep(0.2) sync_data = self.sig.getData() - with open(self.log_file, 'w') as fp: + with open(self.log_file, "w") as fp: json.dump(sync_data.getDict(), fp) def get_files(self) -> list: @@ -293,11 +294,7 @@ class MIMOSAMonitor(SerialMonitor): return [self.mim_file] def get_config(self) -> dict: - return { - "offset": self._offset, - "shunt": self._shunt, - "voltage": self._voltage, - } + return {"offset": self._offset, "shunt": self._shunt, "voltage": self._voltage} class ShellMonitor: |