feat(input): live x follow with relative zoom and mouse panning
This commit is contained in:
1 parent
eaae07d8e0
commit
77e861f79e
10 files changed
+971
-28
No files matched your search
@@ -30,6 +30,15 @@ class Series {
|
||||
virtual Range x_bounds() const = 0;
|
||||
virtual Range y_bounds() const = 0;
|
||||
virtual const MinMaxPyramid& pyramid() const = 0;
|
||||
/// True when the retained window slides as samples are produced, so that
|
||||
/// `x_bounds()` reports the window the series currently holds rather than an
|
||||
/// extent that only changes when the caller replaces the data. Only such a
|
||||
/// series has a *live edge* for `XFollow::Live` to follow -- the newest x it
|
||||
/// holds, which moves forward on its own -- so the follow path asks this rather
|
||||
/// than guessing from a type: `StreamSeries` says true, and every other series
|
||||
/// keeps the default. Virtual rather than a flag a caller could disagree with,
|
||||
/// so the series that owns the sliding window is the one that answers.
|
||||
virtual bool streaming() const noexcept { return false; }
|
||||
|
||||
/// Appends interleaved (x, y) pairs in data coordinates for level `level`.
|
||||
///
|
||||
|
||||
@@ -29,7 +29,8 @@ namespace plot::data {
|
||||
/// base, so that acquire re-reads the whole window.
|
||||
///
|
||||
/// x0() is therefore the x of the oldest retained sample, x_bounds().min == x0(),
|
||||
/// and y_bounds() covers exactly the published samples.
|
||||
/// and y_bounds() covers exactly the published samples. `streaming()` says true:
|
||||
/// this is the window that slides, the one `XFollow::Live` follows.
|
||||
///
|
||||
/// THREADING NOTE. The ring overwrites the oldest samples -- that is what keeps a
|
||||
/// live stream showing the newest data, and what the drop test pins down -- so a
|
||||
@@ -72,6 +73,9 @@ class StreamSeries final : public Series {
|
||||
Range y_bounds() const override;
|
||||
const MinMaxPyramid& pyramid() const override;
|
||||
void gather(u32 level, u64 begin, u64 end, std::vector<f32>& out_xy) const override;
|
||||
/// Always true: this series' `x_bounds()` is the retained ring window, which
|
||||
/// slides with every `acquire()` -- the property `XFollow::Live` follows.
|
||||
bool streaming() const noexcept override { return true; }
|
||||
|
||||
protected:
|
||||
void copy_raw(u64 begin, u64 end, f32* out) const override;
|
||||
|
||||
Reference in new issue
Block a user