From 12dbbcbb15ca607f0c8c713ed2b24378b24c713c Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 1 Feb 2015 18:26:24 +0100 Subject: TOOLS/stats-conv: change unit of X-axis to seconds ...instead of milliseconds. --- TOOLS/stats-conv.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'TOOLS/stats-conv.py') diff --git a/TOOLS/stats-conv.py b/TOOLS/stats-conv.py index 1d64fd8bb8..0390a52d30 100755 --- a/TOOLS/stats-conv.py +++ b/TOOLS/stats-conv.py @@ -62,12 +62,14 @@ def get_event(event, evtype): G.events[event] = e return G.events[event] +SCALE = 1e6 # microseconds to seconds + for line in [line.split("#")[0].strip() for line in open(filename, "r")]: line = line.strip() if not line: continue ts, event = line.split(" ", 1) - ts = int(ts) / 1000 # milliseconds + ts = int(ts) / SCALE if G.start is None: G.start = ts ts = ts - G.start @@ -86,12 +88,12 @@ for line in [line.split("#")[0].strip() for line in open(filename, "r")]: e.vals.append((ts, val)) elif event.startswith("event-timed "): _, val, name = event.split(" ", 2) - val = int(val) / 1000 - G.start + val = int(val) / SCALE - G.start e = get_event(name, "event-signal") e.vals.append((val, 1)) elif event.startswith("value-timed "): _, tsval, val, name = event.split(" ", 3) - tsval = int(tsval) / 1000 - G.start + tsval = int(tsval) / SCALE - G.start val = float(val) e = get_event(name, "value") e.vals.append((tsval, val)) -- cgit v1.2.3