+
+ bool zoom_to_fit_after_acq =
+ settings.value(GlobalSettings::Key_View_ZoomToFitAfterAcq).toBool();
+
+ // Only perform zoom-to-fit if the user hasn't altered the viewport and
+ // we didn't restore settings in the meanwhile
+ if (zoom_to_fit_after_acq &&
+ !suppress_zoom_to_fit_after_acq_ &&
+ (scale_ == scale_at_acq_start_) &&
+ (offset_ == offset_at_acq_start_))
+ zoom_fit(false); // We're stopped, so the GUI state doesn't matter
+
+ suppress_zoom_to_fit_after_acq_ = false;
+ }
+}
+
+void View::on_new_segment(int new_segment_id)
+{
+ on_segment_changed(new_segment_id);
+ segment_changed(new_segment_id);
+}
+
+void View::on_segment_completed(int segment_id)
+{
+ on_segment_changed(segment_id);
+ segment_changed(segment_id);
+}
+
+void View::on_segment_changed(int segment)
+{
+ switch (segment_display_mode_) {
+ case Trace::ShowLastSegmentOnly:
+ case Trace::ShowSingleSegmentOnly:
+ set_current_segment(segment);
+ break;
+
+ case Trace::ShowLastCompleteSegmentOnly:
+ {
+ // Only update if all segments are complete
+ bool all_complete = true;
+
+ for (shared_ptr<Signal> signal : signals_)
+ if (!signal->base()->segment_is_complete(segment))
+ all_complete = false;
+
+ if (all_complete)
+ set_current_segment(segment);
+ }
+ break;
+
+ case Trace::ShowAllSegments:
+ case Trace::ShowAccumulatedIntensity:
+ default:
+ break;