+void View::set_current_segment(uint32_t segment_id)
+{
+ current_segment_ = segment_id;
+
+ for (shared_ptr<Signal> signal : signals_)
+ signal->set_current_segment(current_segment_);
+#ifdef ENABLE_DECODE
+ for (shared_ptr<DecodeTrace> dt : decode_traces_)
+ dt->set_current_segment(current_segment_);
+#endif
+
+ vector<util::Timestamp> triggers = session_.get_triggers(current_segment_);
+
+ trigger_markers_.clear();
+ for (util::Timestamp timestamp : triggers)
+ trigger_markers_.push_back(make_shared<TriggerMarker>(*this, timestamp));
+
+ // When enabled, the first trigger for this segment is used as the zero position
+ GlobalSettings settings;
+ bool trigger_is_zero_time = settings.value(GlobalSettings::Key_View_TriggerIsZeroTime).toBool();
+
+ if (trigger_is_zero_time && (triggers.size() > 0))
+ set_zero_position(triggers.front());
+
+ viewport_->update();
+
+ segment_changed(segment_id);
+}
+