feat: --relative-time selects the counter-derived clock

This commit is contained in:
Martino Ferrari committed 2026-10-08 17:03:28 +02:00
1 parent 2b89f72960
commit b645859f64
2 files changed
+10

No files matched your search

+5
View File
@@ -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" " --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" " --plots N stacked plots to start with, 1..8 (default 1); rows are\n"
" added and removed from the layout editor\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", " -h, --help this text\n",
argv0); argv0);
} }
@@ -98,6 +101,8 @@ Config parse_args(int argc, char** argv) {
fail("--plots must be 1.." + std::to_string(RowSet::kMaxRows) + ": " + v); fail("--plots must be 1.." + std::to_string(RowSet::kMaxRows) + ": " + v);
} }
c.plots = static_cast<int>(n); c.plots = static_cast<int>(n);
} else if (a == "--relative-time") {
c.relative_time = true;
} else { } else {
fail("unknown argument: " + a); fail("unknown argument: " + a);
} }
+5
View File
@@ -35,6 +35,11 @@ struct Config {
/// Number of stacked plots (rows) to start with, 1..`RowSet::kMaxRows`. Only the /// Number of stacked plots (rows) to start with, 1..`RowSet::kMaxRows`. Only the
/// starting point: rows are added and removed from the layout editor. /// starting point: rows are added and removed from the layout editor.
int plots = 1; 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 /// Parses argv. On `--help` prints usage to stdout and exits(0); on a bad