From a5aa58c63c6f0b1ee43d8ac90e0ae0dd57de194a Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 11 May 2015 17:20:30 +0200 Subject: TOOLS/stats-conv.py: add another event type --- TOOLS/stats-conv.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'TOOLS/stats-conv.py') diff --git a/TOOLS/stats-conv.py b/TOOLS/stats-conv.py index 0390a52d30..6f8c424fec 100755 --- a/TOOLS/stats-conv.py +++ b/TOOLS/stats-conv.py @@ -26,8 +26,8 @@ Currently, the following event types are supported: 'end' end of the named event 'value' a normal value (as opposed to event) 'event-timed' singular event at the given timestamp - 'value-timed' - a value for an event at the given timestamp + 'value-timed' a value for an event at the given timestamp + 'range-timed' like start/end, but explicit times singular event (same as 'signal') """ @@ -91,6 +91,15 @@ for line in [line.split("#")[0].strip() for line in open(filename, "r")]: val = int(val) / SCALE - G.start e = get_event(name, "event-signal") e.vals.append((val, 1)) + elif event.startswith("range-timed "): + _, ts1, ts2, name = event.split(" ", 3) + ts1 = int(ts1) / SCALE - G.start + ts2 = int(ts2) / SCALE - G.start + e = get_event(name, "event") + e.vals.append((ts1, 0)) + e.vals.append((ts1, 1)) + e.vals.append((ts2, 1)) + e.vals.append((ts2, 0)) elif event.startswith("value-timed "): _, tsval, val, name = event.split(" ", 3) tsval = int(tsval) / SCALE - G.start -- cgit v1.2.3