X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fstoresession.hpp;h=f0c8de778d5723e957a7035f19f8bf21e66511f7;hp=62cf18958e251229e02b19abb29a189fd999dda1;hb=2601ce965fc455d23f5a964b84ddd74eb93705c4;hpb=2b81ae4682ade4109ffa442794de36ceb32045eb diff --git a/pv/storesession.hpp b/pv/storesession.hpp index 62cf1895..f0c8de77 100644 --- a/pv/storesession.hpp +++ b/pv/storesession.hpp @@ -14,24 +14,38 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ -#ifndef PULSEVIEW_PV_STORESESSION_H -#define PULSEVIEW_PV_STORESESSION_H - -#include +#ifndef PULSEVIEW_PV_STORESESSION_HPP +#define PULSEVIEW_PV_STORESESSION_HPP #include +#include +#include +#include +#include #include #include #include +#include + #include +using std::atomic; +using std::string; +using std::shared_ptr; +using std::pair; +using std::map; +using std::vector; +using std::thread; +using std::mutex; +using std::ofstream; + namespace sigrok { class Output; +class OutputFormat; } namespace pv { @@ -39,7 +53,9 @@ namespace pv { class Session; namespace data { -class LogicSnapshot; +class SignalBase; +class AnalogSegment; +class LogicSegment; } class StoreSession : public QObject @@ -50,12 +66,15 @@ private: static const size_t BlockSize; public: - StoreSession(const std::string &file_name, + StoreSession(const string &file_name, + const shared_ptr &output_format, + const map &options, + const pair sample_range, const Session &session); ~StoreSession(); - std::pair progress() const; + pair progress() const; const QString& error() const; @@ -66,27 +85,37 @@ public: void cancel(); private: - void store_proc(std::shared_ptr snapshot); + void store_proc(vector< shared_ptr > achannel_list, + vector< shared_ptr > asegment_list, + shared_ptr lsegment); Q_SIGNALS: void progress_updated(); + void store_successful(); + private: - const std::string file_name_; + const string file_name_; + const shared_ptr output_format_; + const map options_; + const pair sample_range_; const Session &session_; - std::shared_ptr output_; + shared_ptr output_; + ofstream output_stream_; std::thread thread_; - std::atomic interrupt_; + atomic interrupt_; - std::atomic units_stored_, unit_count_; + atomic units_stored_, unit_count_; - mutable std::mutex mutex_; + mutable mutex mutex_; QString error_; + + uint64_t start_sample_, sample_count_; }; -} // pv +} // namespace pv -#endif // PULSEVIEW_PV_STORESESSION_H +#endif // PULSEVIEW_PV_STORESESSION_HPP