X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsigsession.h;h=1221750b0bc039c0b33e95b9026d6b1ac4427a2f;hp=8b97f8c0364eedd1fcf60a9bd2782e800d46314f;hb=8bd26d8b9c831b509ee3241ea4dac6f50c023622;hpb=269528f55e7fd77f762c2008d257921cd30e1519;ds=sidebyside diff --git a/pv/sigsession.h b/pv/sigsession.h index 8b97f8c0..1221750b 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -1,7 +1,7 @@ /* * This file is part of the PulseView project. * - * Copyright (C) 2012 Joel Holdsworth + * Copyright (C) 2012-14 Joel Holdsworth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -35,7 +36,7 @@ #include struct srd_decoder; -struct srd_probe; +struct srd_channel; namespace pv { @@ -46,6 +47,11 @@ class Analog; class AnalogSnapshot; class Logic; class LogicSnapshot; +class SignalData; +} + +namespace device { +class DevInst; } namespace view { @@ -70,30 +76,32 @@ public: ~SigSession(); - struct sr_dev_inst* get_device() const; + boost::shared_ptr get_device() const; /** * Sets device instance that will be used in the next capture session. */ - void set_device(struct sr_dev_inst *sdi); + void set_device(boost::shared_ptr dev_inst) + throw(QString); - void release_device(struct sr_dev_inst *sdi); + void set_file(const std::string &name) + throw(QString); - void load_file(const std::string &name, - boost::function error_handler); + void set_default_device(); + + void release_device(device::DevInst *dev_inst); capture_state get_capture_state() const; - void start_capture(uint64_t record_length, - boost::function error_handler); + void start_capture(boost::function error_handler); void stop_capture(); + std::set< boost::shared_ptr > get_data() const; + std::vector< boost::shared_ptr > get_signals() const; - boost::shared_ptr get_data(); - #ifdef ENABLE_DECODE bool add_decoder(srd_decoder *const dec); @@ -106,9 +114,10 @@ public: private: void set_capture_state(capture_state state); - void update_signals(const sr_dev_inst *const sdi); + void update_signals(boost::shared_ptr dev_inst); - bool is_trigger_enabled() const; + boost::shared_ptr signal_from_probe( + const sr_channel *probe) const; void read_sample_rate(const sr_dev_inst *const sdi); @@ -128,14 +137,7 @@ private: boost::function error_handler, sr_input_format *format = NULL); - void load_session_thread_proc( - boost::function error_handler); - - void load_input_thread_proc(const std::string name, sr_input *in, - boost::function error_handler); - - void sample_thread_proc(struct sr_dev_inst *sdi, - uint64_t record_length, + void sample_thread_proc(boost::shared_ptr dev_inst, boost::function error_handler); void feed_in_header(const sr_dev_inst *sdi); @@ -143,6 +145,8 @@ private: void feed_in_meta(const sr_dev_inst *sdi, const sr_datafeed_meta &meta); + void feed_in_frame_begin(); + void feed_in_logic(const sr_datafeed_logic &logic); void feed_in_analog(const sr_datafeed_analog &analog); @@ -159,7 +163,7 @@ private: /** * The device instance that will be used in the next capture session. */ - struct sr_dev_inst *_sdi; + boost::shared_ptr _dev_inst; std::vector< boost::shared_ptr > _decode_traces; @@ -172,8 +176,8 @@ private: mutable boost::mutex _data_mutex; boost::shared_ptr _logic_data; boost::shared_ptr _cur_logic_snapshot; - boost::shared_ptr _analog_data; - boost::shared_ptr _cur_analog_snapshot; + std::map< const sr_channel*, boost::shared_ptr > + _cur_analog_snapshots; boost::thread _sampling_thread; @@ -182,7 +186,11 @@ signals: void signals_changed(); - void data_updated(); + void frame_began(); + + void data_received(); + + void frame_ended(); private: // TODO: This should not be necessary. Multiple concurrent