From: Tilman Sauerbeck Date: Mon, 23 Nov 2015 18:07:59 +0000 (+0100) Subject: LogicSignal: Put all trigger matches into a single trigger stage. X-Git-Tag: pulseview-0.3.0~38 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fcc00c4d9d3c4e00a3e15bff666e0ceedfa9d0ea;p=pulseview.git LogicSignal: Put all trigger matches into a single trigger stage. Previously each trigger match was assigned its own trigger stage, which is problematic because devices may not support more than one stage. Ideally we would want the user to decide which matches go into which stages, but that's a long way off and this change makes things work just a little bit better for more devices. Fixes bug #683. --- diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 717360b8..c23f0922 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -447,8 +447,15 @@ void LogicSignal::modify_trigger() } } - if (trigger_match_) - new_trigger->add_stage()->add_match(channel_, trigger_match_); + if (trigger_match_) { + // Until we can let the user decide how to group trigger matches + // into stages, put all of the matches into a single stage -- + // most devices only support a single trigger stage. + if (new_trigger->stages().empty()) + new_trigger->add_stage(); + + new_trigger->stages().back()->add_match(channel_, trigger_match_); + } session_.session()->set_trigger( new_trigger->stages().empty() ? nullptr : new_trigger);