X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fview.cpp;h=00a1c23968c0eb255b2f2b4a9957ce63242569e2;hb=7ea2a4ff0765fdad34b84e4b4631d6f3f5588714;hp=292933e7eefa70abb5753a0a3e66f9614292415a;hpb=ffc00fdd5946593ad2a587078fd4ee9ba0a507ec;p=pulseview.git diff --git a/pv/views/trace/view.cpp b/pv/views/trace/view.cpp index 292933e..00a1c23 100644 --- a/pv/views/trace/view.cpp +++ b/pv/views/trace/view.cpp @@ -506,6 +506,11 @@ const pv::util::Timestamp& View::tick_period() const return tick_period_; } +unsigned int View::minor_tick_count() const +{ + return minor_tick_count_; +} + void View::set_tick_period(const pv::util::Timestamp& tick_period) { if (tick_period_ != tick_period) { @@ -536,6 +541,10 @@ void View::set_current_segment(uint32_t segment_id) for (shared_ptr dt : decode_traces_) dt->set_current_segment(current_segment_); + trigger_markers_.clear(); + for (util::Timestamp timestamp : session_.get_triggers(segment_id)) + trigger_markers_.push_back(make_shared(*this, timestamp)); + viewport_->update(); segment_changed(segment_id); @@ -553,6 +562,8 @@ Trace::SegmentDisplayMode View::segment_display_mode() const void View::set_segment_display_mode(Trace::SegmentDisplayMode mode) { + trigger_markers_.clear(); + segment_display_mode_ = mode; for (shared_ptr signal : signals_) @@ -821,8 +832,12 @@ void View::restack_all_trace_tree_items() i->animate_to_layout_v_offset(); } -void View::trigger_event(util::Timestamp location) +void View::trigger_event(int segment_id, util::Timestamp location) { + // TODO This doesn't work if we're showing multiple segments at once + if ((uint32_t)segment_id != current_segment_) + return; + // Set up ruler_shift if the Key_View_TriggerIsZeroTime option is set. GlobalSettings settings; bool trigger_is_zero_time = settings.value(GlobalSettings::Key_View_TriggerIsZeroTime).toBool(); @@ -896,6 +911,7 @@ void View::calculate_tick_spacing() (ScaleUnits[unit++] + tp_margin); } while (tp_with_margin < min_period && unit < countof(ScaleUnits)); + minor_tick_count_ = (unit == 2) ? (4) : (5); tick_period = order_decimal * ScaleUnits[unit - 1]; tick_prefix = static_cast( (order - pv::util::exponent(pv::util::SIPrefix::yocto)) / 3);