diff options
author | wm4 <wm4@nowhere> | 2015-02-01 18:26:24 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-01 18:26:24 +0100 |
commit | 12dbbcbb15ca607f0c8c713ed2b24378b24c713c (patch) | |
tree | e94b984529042be27c2798f76b7b3bb59c0e7ebb | |
parent | 720eb187fd33c6ccf7f6f75a94fb5a7b94c9ebf8 (diff) |
TOOLS/stats-conv: change unit of X-axis to seconds
...instead of milliseconds.
-rwxr-xr-x | TOOLS/stats-conv.py | 8 |
1 files changed, 5 insertions, 3 deletions
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)) |