summaryrefslogtreecommitdiff
path: root/DSLogic-gui/pv/sigsession.h
diff options
context:
space:
mode:
Diffstat (limited to 'DSLogic-gui/pv/sigsession.h')
-rw-r--r--DSLogic-gui/pv/sigsession.h48
1 files changed, 31 insertions, 17 deletions
diff --git a/DSLogic-gui/pv/sigsession.h b/DSLogic-gui/pv/sigsession.h
index 9debdea..a8d8cfb 100644
--- a/DSLogic-gui/pv/sigsession.h
+++ b/DSLogic-gui/pv/sigsession.h
@@ -41,6 +41,7 @@
#include <QVariant>
#include <libsigrok4DSLogic/libsigrok.h>
+#include <libusb.h>
namespace pv {
@@ -49,6 +50,8 @@ class DeviceManager;
namespace data {
class Analog;
class AnalogSnapshot;
+class Dso;
+class DsoSnapshot;
class Logic;
class LogicSnapshot;
class Group;
@@ -110,7 +113,7 @@ public:
get_pro_signals();
int get_logic_probe_cnt(const struct sr_dev_inst *sdi);
-
+ int get_dso_probe_cnt(const struct sr_dev_inst *sdi);
int get_analog_probe_cnt(const struct sr_dev_inst *sdi);
void init_signals(const struct sr_dev_inst *sdi);
@@ -147,45 +150,47 @@ public:
std::list<int> get_decode_probes(int decode_index);
QMap<QString, int> get_decode_options_index(int decode_index);
- void start_hot_plug_proc(boost::function<void (const QString)> error_handler);
- void stop_hot_plug_proc();
- int hot_plug_active();
+ void start_hotplug_proc(boost::function<void (const QString)> error_handler);
+ void stop_hotplug_proc();
+ void register_hotplug_callback();
+ void deregister_hotplug_callback();
void set_adv_trigger(bool adv_trigger);
+ void start_dso_ctrl_proc(boost::function<void (const QString)> error_handler);
+ void stop_dso_ctrl_proc();
+ int set_dso_ctrl(int key);
+ uint16_t get_dso_ch_num();
+
private:
void set_capture_state(capture_state state);
private:
+ // thread for sample/load
void load_thread_proc(const std::string name,
boost::function<void (const QString)> error_handler);
-
void sample_thread_proc(struct sr_dev_inst *sdi,
uint64_t record_length,
boost::function<void (const QString)> error_handler);
+ // data feed
void feed_in_header(const sr_dev_inst *sdi);
-
void feed_in_meta(const sr_dev_inst *sdi,
const sr_datafeed_meta &meta);
-
void feed_in_trigger(const ds_trigger_pos &trigger_pos);
-
void feed_in_logic(const sr_datafeed_logic &logic);
-
+ void feed_in_dso(const sr_datafeed_dso &dso);
void feed_in_analog(const sr_datafeed_analog &analog);
-
void data_feed_in(const struct sr_dev_inst *sdi,
const struct sr_datafeed_packet *packet);
-
static void data_feed_in_proc(const struct sr_dev_inst *sdi,
const struct sr_datafeed_packet *packet, void *cb_data);
- void hot_plug_proc(boost::function<void (const QString)> error_handler);
+ void hotplug_proc(boost::function<void (const QString)> error_handler);
+ static int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev,
+ libusb_hotplug_event event, void *user_data);
- static void dev_attach_callback(struct libusbhp_device_t *device, void *user_data);
-
- static void dev_detach_callback(struct libusbhp_device_t *device, void *user_data);
+ void dso_ctrl_proc(boost::function<void (const QString)> error_handler);
private:
DeviceManager &_device_manager;
@@ -208,6 +213,8 @@ private:
mutable boost::mutex _data_mutex;
boost::shared_ptr<data::Logic> _logic_data;
boost::shared_ptr<data::LogicSnapshot> _cur_logic_snapshot;
+ boost::shared_ptr<data::Dso> _dso_data;
+ boost::shared_ptr<data::DsoSnapshot> _cur_dso_snapshot;
boost::shared_ptr<data::Analog> _analog_data;
boost::shared_ptr<data::AnalogSnapshot> _cur_analog_snapshot;
boost::shared_ptr<data::Group> _group_data;
@@ -221,13 +228,18 @@ private:
quint64 _total_sample_len;
- struct libusbhp_t *_hot_plug_handle;
- std::auto_ptr<boost::thread> _hot_plug;
+ libusb_hotplug_callback_handle _hotplug_handle;
+ std::auto_ptr<boost::thread> _hotplug;
bool _hot_attach;
bool _hot_detach;
bool _adv_trigger;
+ bool _vDial_changed;
+ bool _hDial_changed;
+ uint16_t _dso_ctrl_channel;
+ std::auto_ptr<boost::thread> _dso_ctrl_thread;
+
signals:
void capture_state_changed(int state);
@@ -246,6 +258,8 @@ signals:
void receive_trigger(quint64 trigger_pos);
+ void dso_ch_changed(uint16_t num);
+
public slots: