Fixed triggering mode change when acquiring

This commit is contained in:
Martino Ferrari committed 2026-10-01 17:54:17 +02:00
1 parent 3d4085898e
commit 0d741c401b
10 files changed
+504 -106

No files matched your search

+20 -14
View File
@@ -143,7 +143,7 @@ int RowSet::channel_of(int row_index, int slot) const {
return row(row_index).channel[static_cast<std::size_t>(slot)];
}
void RowSet::bind(ScopeModel& model) {
void RowSet::bind(ScopeModel& model, DisplayMode mode) {
const std::vector<SignalInfo>& signals = model.signals();
const std::vector<ChannelInfo>& channels = model.channels();
for (int i = 0; i < kMaxRows; ++i) {
@@ -181,20 +181,26 @@ void RowSet::bind(ScopeModel& model) {
r.slots[si].bind(nullptr);
continue;
}
// In trigger mode the trace shows the captured event and nothing else: the
// last one latched, or nothing at all before the first. Never the live ring,
// not even while the post window is filling -- a frozen picture that only
// changes on an event is the whole point of trigger mode, and binding the
// live ring mid-capture made the plot scroll for most of every event cycle.
// The source is the frame's one `DisplayMode`, decided by the caller: `Held` is
// the frozen snapshot, `Waiting` is blank (armed, nothing captured yet), and both
// `Live` and `Capturing` are the live ring -- what differs between those two is
// the *clock*, which the display epoch carries, not the binding.
const std::size_t ci = static_cast<std::size_t>(channel);
if (model.trigger_enabled()) {
if (auto snap = model.event()) {
r.slots[si].bind_event(std::move(snap), ci);
} else {
r.slots[si].bind(nullptr); // armed, waiting for the first event: blank
}
} else {
r.slots[si].bind(model.live().shared_channel(ci));
switch (mode) {
case DisplayMode::Held:
if (auto snap = model.event()) {
r.slots[si].bind_event(std::move(snap), ci);
} else {
r.slots[si].bind(nullptr);
}
break;
case DisplayMode::Waiting:
r.slots[si].bind(nullptr);
break;
case DisplayMode::Live:
case DisplayMode::Capturing:
r.slots[si].bind(model.live().shared_channel(ci));
break;
}
}
}