]> sigrok.org Git - pulseview.git/blobdiff - pv/view/logicsignal.cpp
LogicSignal: Only draw the trigger marker for enabled channels.
[pulseview.git] / pv / view / logicsignal.cpp
index 717360b852fa65b9aedf5a513f578d47a45e1e40..63d15314cdcf23470261f72a82dafedde51619e3 100644 (file)
@@ -249,7 +249,7 @@ void LogicSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
 void LogicSignal::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
 {
        // Draw the trigger marker
-       if (!trigger_match_)
+       if (!trigger_match_ || !channel_->enabled())
                return;
 
        const int y = get_visual_y();
@@ -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);