X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Flogicsignal.cpp;h=5d3ac102164375ae9aae4c5b30284ee89853eb8e;hp=717360b852fa65b9aedf5a513f578d47a45e1e40;hb=fcb97d775ddc37e59efc195666d612da9dba04d1;hpb=303d6ea697468ee79f4c3f73afc57db0ce6319a8 diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 717360b8..5d3ac102 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -113,7 +113,7 @@ LogicSignal::LogicSignal( { shared_ptr trigger; - colour_ = SignalColours[channel->index() % countof(SignalColours)]; + set_colour(SignalColours[channel->index() % countof(SignalColours)]); /* Populate this channel's trigger setting with whatever we * find in the current session trigger, if anything. */ @@ -163,12 +163,6 @@ void LogicSignal::scale_handle_dragged(int offset) signal_height_ = ((units < 1) ? 1 : units) * font_height; } -void LogicSignal::paint_back(QPainter &p, const ViewItemPaintParams &pp) -{ - if (channel_->enabled()) - paint_axis(p, pp, get_visual_y()); -} - void LogicSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp) { QLineF *line; @@ -249,7 +243,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 +441,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);