]> sigrok.org Git - pulseview.git/blobdiff - pv/session.cpp
Session: Record acquisition start time and use it when saving
[pulseview.git] / pv / session.cpp
index 0e17a07bb05f9c663c139d5ed17ad6c965e8939e..f1a153e7e44932518b34566c3cdfac2d77001b99 100644 (file)
@@ -829,6 +829,8 @@ void Session::start_capture(function<void (const QString)> error_handler)
                name_changed();
        }
 
+       acq_start_time_ = Glib::DateTime::create_now_local();
+
        // Begin the session
        sampling_thread_ = std::thread(&Session::sample_thread_proc, this, error_handler);
 }
@@ -923,6 +925,11 @@ double Session::get_samplerate() const
        return samplerate;
 }
 
+Glib::DateTime Session::get_acquisition_start_time() const
+{
+       return acq_start_time_;
+}
+
 uint32_t Session::get_highest_segment_id() const
 {
        return highest_segment_id_;