X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsigsession.h;h=1221750b0bc039c0b33e95b9026d6b1ac4427a2f;hp=3848a3d4d6267a35093471cd7495a32c75595821;hb=8bd26d8b9c831b509ee3241ea4dac6f50c023622;hpb=d99dc9f29066fba8948f1fca8b18a54b33064837 diff --git a/pv/sigsession.h b/pv/sigsession.h index 3848a3d4..1221750b 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -36,7 +36,7 @@ #include struct srd_decoder; -struct srd_probe; +struct srd_channel; namespace pv { @@ -50,6 +50,10 @@ class LogicSnapshot; class SignalData; } +namespace device { +class DevInst; +} + namespace view { class DecodeTrace; class LogicSignal; @@ -72,17 +76,20 @@ 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; @@ -107,12 +114,10 @@ public: private: void set_capture_state(capture_state state); - void update_signals(const sr_dev_inst *const sdi); - - bool is_trigger_enabled() const; + void update_signals(boost::shared_ptr dev_inst); boost::shared_ptr signal_from_probe( - const sr_probe *probe) const; + const sr_channel *probe) const; void read_sample_rate(const sr_dev_inst *const sdi); @@ -132,13 +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, + void sample_thread_proc(boost::shared_ptr dev_inst, boost::function error_handler); void feed_in_header(const sr_dev_inst *sdi); @@ -146,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); @@ -162,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; @@ -175,7 +176,7 @@ private: mutable boost::mutex _data_mutex; boost::shared_ptr _logic_data; boost::shared_ptr _cur_logic_snapshot; - std::map< const sr_probe*, boost::shared_ptr > + std::map< const sr_channel*, boost::shared_ptr > _cur_analog_snapshots; boost::thread _sampling_thread; @@ -185,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