summaryrefslogtreecommitdiff
path: root/lib/lennart/EnergyInterface.py
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2020-12-03 15:16:24 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2020-12-03 15:16:24 +0100
commit85374727ad66b884b25ddd659600ee9317db071b (patch)
tree36c29c86feb8bfa3e3fdb7fd18d11dd7be7c7eb8 /lib/lennart/EnergyInterface.py
parente226cb81dd57b9810a093936e750a0e2d4512173 (diff)
use common energytrace loader code
this also fixes a nasty off-by-one in the barcode loader (now _load_energytrace): wrong: interval_start_timestamp = data[:-1, 0] * 1e-6 correct: interval_start_timestamp = data[1:, 0] * 1e-6
Diffstat (limited to 'lib/lennart/EnergyInterface.py')
-rw-r--r--lib/lennart/EnergyInterface.py33
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/lennart/EnergyInterface.py b/lib/lennart/EnergyInterface.py
index 19aae84..55bf7c1 100644
--- a/lib/lennart/EnergyInterface.py
+++ b/lib/lennart/EnergyInterface.py
@@ -70,39 +70,6 @@ class EnergyInterface(DataInterface):
return
self.energytrace.wait()
- def getData(self):
- """
- cleans the string data and creates int list
- :return: list of data, in format [[int,int,int,int], [int,int,int,int], ... ]
- """
- energytrace_log = open(self.temp_file)
- lines = energytrace_log.readlines()[21:]
- data = []
- for line in lines:
- if "MSP430_DisableEnergyTrace" in line:
- break
- else:
- data.append([int(i) for i in line.split()])
- return data
-
- @classmethod
- def getDataFromString(cls, string, delimiter="\\n"):
- """
- Parsing the data from string
-
- :param string: input string which will be parsed
- :param delimiter: for normal file its \n
- :return: list of data, in format [[int,int,int,int], [int,int,int,int], ... ]
- """
- lines = string.split(delimiter)[21:]
- data = []
- for line in lines:
- if "MSP430_DisableEnergyTrace" in line:
- break
- else:
- data.append([int(i) for i in line.split()])
- return data
-
def setFile(self, path):
"""
changeing the temporary file