X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fview.cpp;h=6a342915972312b96e29e731fd75fed59191df6e;hb=92ff2b60d60c8191a6f4a923b5a9099ec544adbd;hp=7f9caa4cb50e69fb63f50e621d5dad01adbebc99;hpb=48257a69ffad409c9893605d99cd6e15161dff4f;p=pulseview.git diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 7f9caa4..6a34291 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -48,6 +48,7 @@ #include "ruler.hpp" #include "signal.hpp" #include "tracegroup.hpp" +#include "triggermarker.hpp" #include "view.hpp" #include "viewport.hpp" @@ -114,6 +115,7 @@ View::View(Session &session, QWidget *parent) : show_cursors_(false), cursors_(new CursorPair(*this)), next_flag_text_('A'), + trigger_markers_(), hover_point_(-1, -1) { connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), @@ -207,6 +209,10 @@ vector< shared_ptr > View::time_items() const items.push_back(cursors_); items.push_back(cursors_->first()); items.push_back(cursors_->second()); + + for (auto trigger_marker : trigger_markers_) + items.push_back(trigger_marker); + return items; } @@ -466,10 +472,6 @@ void View::add_flag(const Timestamp& time) next_flag_text_ = (next_flag_text_ >= 'Z') ? 'A' : (next_flag_text_ + 1); - // Skip 'T' (for trigger) as it's treated special - if (next_flag_text_ == 'T') - next_flag_text_ += 1; - time_item_appearance_changed(true, true); } @@ -526,12 +528,8 @@ void View::restack_all_trace_tree_items() void View::trigger_event(util::Timestamp location) { - char next_flag_text = next_flag_text_; - - next_flag_text_ = 'T'; - add_flag(location); - - next_flag_text_ = next_flag_text; + trigger_markers_.push_back(shared_ptr( + new TriggerMarker(*this, location))); } void View::get_scroll_layout(double &length, Timestamp &offset) const @@ -1021,9 +1019,12 @@ void View::signals_changed() void View::capture_state_updated(int state) { - if (state == Session::Running) + if (state == Session::Running) { set_time_unit(util::TimeUnit::Samples); + trigger_markers_.clear(); + } + if (state == Session::Stopped) { // After acquisition has stopped we need to re-calculate the ticks once // as it's otherwise done when the user pans or zooms, which is too late