+void View::on_new_segment(int new_segment_id)
+{
+ on_segment_changed(new_segment_id);
+ segment_changed(new_segment_id);
+}
+
+void View::on_segment_changed(int segment)
+{
+ switch (segment_display_mode_) {
+ case Trace::ShowLastSegmentOnly:
+ case Trace::ShowSingleSegmentOnly:
+ current_segment_ = segment;
+ for (shared_ptr<Signal> signal : signals_)
+ signal->set_current_segment(current_segment_);
+ for (shared_ptr<DecodeTrace> dt : decode_traces_)
+ dt->set_current_segment(current_segment_);
+ viewport_->update();
+ break;
+
+ case Trace::ShowAllSegments:
+ case Trace::ShowAccumulatedIntensity:
+ default:
+ break;
+ }
+}
+