X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fsigsession.h;h=10d1e23de55d618d9a44ea36085955d23b55b3e7;hb=3b68d03ddae96edb38a80f31bf6a990bde21cd1d;hp=a9a7ce23dce93b5bbd70efdabc3c84a7bf1db4c3;hpb=19adbc2c342b190161ec1223377a3619974b91f7;p=pulseview.git diff --git a/pv/sigsession.h b/pv/sigsession.h index a9a7ce2..10d1e23 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -22,12 +22,13 @@ #define PULSEVIEW_PV_SIGSESSION_H #include -#include -#include #include +#include +#include #include #include +#include #include #include @@ -36,12 +37,11 @@ #include struct srd_decoder; -struct srd_probe; +struct srd_channel; namespace pv { class DeviceManager; -class DevInst; namespace data { class Analog; @@ -51,6 +51,10 @@ class LogicSnapshot; class SignalData; } +namespace device { +class DevInst; +} + namespace view { class DecodeTrace; class LogicSignal; @@ -73,17 +77,20 @@ public: ~SigSession(); - boost::shared_ptr get_device() const; + std::shared_ptr get_device() const; /** * Sets device instance that will be used in the next capture session. */ - void set_device(boost::shared_ptr dev_inst); + void set_device(std::shared_ptr dev_inst) + throw(QString); - void release_device(boost::shared_ptr dev_inst); + 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; @@ -91,15 +98,15 @@ public: void stop_capture(); - std::set< boost::shared_ptr > get_data() const; + std::set< std::shared_ptr > get_data() const; - std::vector< boost::shared_ptr > + std::vector< std::shared_ptr > get_signals() const; #ifdef ENABLE_DECODE bool add_decoder(srd_decoder *const dec); - std::vector< boost::shared_ptr > + std::vector< std::shared_ptr > get_decode_signals() const; void remove_decode_signal(view::DecodeTrace *signal); @@ -108,12 +115,10 @@ public: private: void set_capture_state(capture_state state); - void update_signals(boost::shared_ptr dev_inst); - - bool is_trigger_enabled() const; + void update_signals(std::shared_ptr dev_inst); - boost::shared_ptr signal_from_probe( - const sr_probe *probe) const; + std::shared_ptr signal_from_probe( + const sr_channel *probe) const; void read_sample_rate(const sr_dev_inst *const sdi); @@ -133,13 +138,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(boost::shared_ptr dev_inst, + void sample_thread_proc(std::shared_ptr dev_inst, boost::function error_handler); void feed_in_header(const sr_dev_inst *sdi); @@ -147,6 +146,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); @@ -163,30 +164,34 @@ private: /** * The device instance that will be used in the next capture session. */ - boost::shared_ptr _dev_inst; + std::shared_ptr _dev_inst; - std::vector< boost::shared_ptr > _decode_traces; + std::vector< std::shared_ptr > _decode_traces; - mutable boost::mutex _sampling_mutex; + mutable std::mutex _sampling_mutex; capture_state _capture_state; - mutable boost::mutex _signals_mutex; - std::vector< boost::shared_ptr > _signals; + mutable std::mutex _signals_mutex; + std::vector< std::shared_ptr > _signals; - mutable boost::mutex _data_mutex; - boost::shared_ptr _logic_data; - boost::shared_ptr _cur_logic_snapshot; - std::map< const sr_probe*, boost::shared_ptr > + mutable std::mutex _data_mutex; + std::shared_ptr _logic_data; + std::shared_ptr _cur_logic_snapshot; + std::map< const sr_channel*, std::shared_ptr > _cur_analog_snapshots; - boost::thread _sampling_thread; + std::thread _sampling_thread; signals: void capture_state_changed(int state); void signals_changed(); - void data_updated(); + void frame_began(); + + void data_received(); + + void frame_ended(); private: // TODO: This should not be necessary. Multiple concurrent