diff options
author | Lennart <lekaiser@uos.de> | 2020-09-22 00:03:23 +0200 |
---|---|---|
committer | Lennart <lekaiser@uos.de> | 2020-09-22 00:03:23 +0200 |
commit | f8cf50af8564094e145124af08e5e12e13ed352f (patch) | |
tree | fffcfbdf98b63c7c7d9e42cf7151d263446bde3d /lib/runner.py | |
parent | aa0a56a8f1ba32235e1b2664835e35b6641a5715 (diff) |
Changed code import and black formattedlennart
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: |