diff --git a/src/config.cpp b/src/config.cpp index 93c3162..902c384 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -54,6 +54,9 @@ void print_usage(std::FILE* out, const char* argv0) { " --recv-buffer BYTES SO_RCVBUF for the receiver socket (default 8388608)\n" " --plots N stacked plots to start with, 1..8 (default 1); rows are\n" " added and removed from the layout editor\n" + " --relative-time take the plot's time from the packet counter and the\n" + " declared rate, not the stream's time signal; absolute\n" + " time is then kept for export only\n" " -h, --help this text\n", argv0); } @@ -98,6 +101,8 @@ Config parse_args(int argc, char** argv) { fail("--plots must be 1.." + std::to_string(RowSet::kMaxRows) + ": " + v); } c.plots = static_cast(n); + } else if (a == "--relative-time") { + c.relative_time = true; } else { fail("unknown argument: " + a); } diff --git a/src/config.hpp b/src/config.hpp index d869280..3de5783 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -35,6 +35,11 @@ struct Config { /// Number of stacked plots (rows) to start with, 1..`RowSet::kMaxRows`. Only the /// starting point: rows are added and removed from the layout editor. int plots = 1; + + /// Take the plot's time from the packet counter and the declared sample rate rather than + /// from the stream's own time signal, so arrival and producer-clock jitter cannot move a + /// sample's x. Absolute stream time is still recorded, for export only (`todo.md` item 2). + bool relative_time = false; }; /// Parses argv. On `--help` prints usage to stdout and exits(0); on a bad