]> sigrok.org Git - pulseview.git/commitdiff
Update for 'probe' -> 'channel' rename in libsigrok.
authorUwe Hermann <redacted>
Mon, 24 Mar 2014 21:49:57 +0000 (22:49 +0100)
committerUwe Hermann <redacted>
Tue, 25 Mar 2014 18:45:21 +0000 (19:45 +0100)
This is an update related to bug #259.

13 files changed:
pv/device/device.cpp
pv/device/devinst.cpp
pv/device/devinst.h
pv/dialogs/connect.cpp
pv/popups/probes.cpp
pv/sigsession.cpp
pv/sigsession.h
pv/view/analogsignal.cpp
pv/view/analogsignal.h
pv/view/logicsignal.cpp
pv/view/logicsignal.h
pv/view/signal.cpp
pv/view/signal.h

index e70be02592f0c58e3c2b59340068b39478f94842..4f9a7799539b5e125b01e0a1591ac8c165da7414 100644 (file)
@@ -91,8 +91,8 @@ std::string Device::format_device_title() const
 bool Device::is_trigger_enabled() const
 {
        assert(_sdi);
-       for (const GSList *l = _sdi->probes; l; l = l->next) {
-               const sr_probe *const p = (const sr_probe *)l->data;
+       for (const GSList *l = _sdi->channels; l; l = l->next) {
+               const sr_channel *const p = (const sr_channel *)l->data;
                assert(p);
                if (p->trigger && p->trigger[0] != '\0')
                        return true;
index f85c6f5e0dd7ea8756784521f6eca36df2e60af8..4543e5c81d8dba5cf212918bdb31cfa199e6476d 100644 (file)
@@ -90,14 +90,14 @@ GVariant* DevInst::list_config(const sr_channel_group *group, int key)
        return data;
 }
 
-void DevInst::enable_probe(const sr_probe *probe, bool enable)
+void DevInst::enable_probe(const sr_channel *probe, bool enable)
 {
        assert(_owner);
        sr_dev_inst *const sdi = dev_inst();
        assert(sdi);
-       for (const GSList *p = sdi->probes; p; p = p->next)
+       for (const GSList *p = sdi->channels; p; p = p->next)
                if (probe == p->data) {
-                       const_cast<sr_probe*>(probe)->enabled = enable;
+                       const_cast<sr_channel*>(probe)->enabled = enable;
                        config_changed();
                        return;
                }
index bdadc2c3e72e44eccc2ca7012f3260358d412824..e6a5140989dcea0a58ec8ace4a40bae4714eba3a 100644 (file)
@@ -32,7 +32,7 @@
 #include <stdint.h>
 
 struct sr_dev_inst;
-struct sr_probe;
+struct sr_channel;
 struct sr_channel_group;
 
 namespace pv {
@@ -65,7 +65,7 @@ public:
 
        GVariant* list_config(const sr_channel_group *group, int key);
 
-       void enable_probe(const sr_probe *probe, bool enable = true);
+       void enable_probe(const sr_channel *probe, bool enable = true);
 
        /**
         * @brief Gets the sample limit from the driver.
index c9e8d82c9ba832e1e90b6b209860b2f07767d858..611c9cc50d7f3fb10a81963f1a4138de06b9064b 100644 (file)
@@ -184,9 +184,9 @@ void Connect::scan_pressed()
                const string title = dev_inst->format_device_title();
                QString text = QString::fromUtf8(title.c_str());
 
-               if (sdi->probes) {
+               if (sdi->channels) {
                        text += QString(" with %1 probes").arg(
-                               g_slist_length(sdi->probes));
+                               g_slist_length(sdi->channels));
                }
 
                QListWidgetItem *const item = new QListWidgetItem(text,
index 2e1e59249b746b3cc86adc50a1e9e6b2af4708f0..ca1a2fb609a5da541dceb0cd017dd8cb6f0960f3 100644 (file)
@@ -63,7 +63,7 @@ Probes::Probes(SigSession &session, QWidget *parent) :
        assert(sdi);
 
        // Collect a set of signals
-       map<const sr_probe*, shared_ptr<Signal> > signal_map;
+       map<const sr_channel*, shared_ptr<Signal> > signal_map;
        const vector< shared_ptr<Signal> > sigs = _session.get_signals();
        BOOST_FOREACH(const shared_ptr<Signal> &sig, sigs)
                signal_map[sig->probe()] = sig;
@@ -78,12 +78,12 @@ Probes::Probes(SigSession &session, QWidget *parent) :
                // Make a set of signals, and removed this signals from the
                // signal map.
                vector< shared_ptr<Signal> > group_sigs;
-               for (const GSList *p = group->probes; p; p = p->next)
+               for (const GSList *p = group->channels; p; p = p->next)
                {
-                       const sr_probe *const probe = (const sr_probe*)p->data;
+                       const sr_channel *const probe = (const sr_channel*)p->data;
                        assert(probe);
 
-                       const map<const sr_probe*, shared_ptr<Signal> >::
+                       const map<const sr_channel*, shared_ptr<Signal> >::
                                iterator iter = signal_map.find(probe);
                        assert(iter != signal_map.end());
 
@@ -96,12 +96,12 @@ Probes::Probes(SigSession &session, QWidget *parent) :
 
        // Make a vector of the remaining probes
        vector< shared_ptr<Signal> > global_sigs;
-       for (const GSList *p = sdi->probes; p; p = p->next)
+       for (const GSList *p = sdi->channels; p; p = p->next)
        {
-               const sr_probe *const probe = (const sr_probe*)p->data;
+               const sr_channel *const probe = (const sr_channel*)p->data;
                assert(probe);
 
-               const map<const sr_probe*, shared_ptr<Signal> >::
+               const map<const sr_channel*, shared_ptr<Signal> >::
                        const_iterator iter = signal_map.find(probe);
                if (iter != signal_map.end())
                        global_sigs.push_back((*iter).second);
index c152481e9841814d93669c8c85e3cccf2176e94c..e51acde2b6a2d93733177dd1865641c3512abd9d 100644 (file)
@@ -177,15 +177,15 @@ void SigSession::start_capture(function<void (const QString)> error_handler)
 
        // Check that at least one probe is enabled
        const GSList *l;
-       for (l = _dev_inst->dev_inst()->probes; l; l = l->next) {
-               sr_probe *const probe = (sr_probe*)l->data;
+       for (l = _dev_inst->dev_inst()->channels; l; l = l->next) {
+               sr_channel *const probe = (sr_channel*)l->data;
                assert(probe);
                if (probe->enabled)
                        break;
        }
 
        if (!l) {
-               error_handler(tr("No probes enabled."));
+               error_handler(tr("No channels enabled."));
                return;
        }
 
@@ -325,14 +325,14 @@ void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
        // Detect what data types we will receive
        if(dev_inst) {
                assert(dev_inst->dev_inst());
-               for (const GSList *l = dev_inst->dev_inst()->probes;
+               for (const GSList *l = dev_inst->dev_inst()->channels;
                        l; l = l->next) {
-                       const sr_probe *const probe = (const sr_probe *)l->data;
+                       const sr_channel *const probe = (const sr_channel *)l->data;
                        if (!probe->enabled)
                                continue;
 
                        switch(probe->type) {
-                       case SR_PROBE_LOGIC:
+                       case SR_CHANNEL_LOGIC:
                                logic_probe_count++;
                                break;
                        }
@@ -361,20 +361,20 @@ void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
                        break;
 
                assert(dev_inst->dev_inst());
-               for (const GSList *l = dev_inst->dev_inst()->probes;
+               for (const GSList *l = dev_inst->dev_inst()->channels;
                        l; l = l->next) {
                        shared_ptr<view::Signal> signal;
-                       sr_probe *const probe = (sr_probe *)l->data;
+                       sr_channel *const probe = (sr_channel *)l->data;
                        assert(probe);
 
                        switch(probe->type) {
-                       case SR_PROBE_LOGIC:
+                       case SR_CHANNEL_LOGIC:
                                signal = shared_ptr<view::Signal>(
                                        new view::LogicSignal(dev_inst,
                                                probe, _logic_data));
                                break;
 
-                       case SR_PROBE_ANALOG:
+                       case SR_CHANNEL_ANALOG:
                        {
                                shared_ptr<data::Analog> data(
                                        new data::Analog());
@@ -399,7 +399,7 @@ void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
 }
 
 shared_ptr<view::Signal> SigSession::signal_from_probe(
-       const sr_probe *probe) const
+       const sr_channel *probe) const
 {
        lock_guard<mutex> lock(_signals_mutex);
        BOOST_FOREACH(shared_ptr<view::Signal> sig, _signals) {
@@ -538,20 +538,20 @@ void SigSession::feed_in_analog(const sr_datafeed_analog &analog)
 {
        lock_guard<mutex> lock(_data_mutex);
 
-       const unsigned int probe_count = g_slist_length(analog.probes);
+       const unsigned int probe_count = g_slist_length(analog.channels);
        const size_t sample_count = analog.num_samples / probe_count;
        const float *data = analog.data;
        bool sweep_beginning = false;
 
-       for (GSList *p = analog.probes; p; p = p->next)
+       for (GSList *p = analog.channels; p; p = p->next)
        {
                shared_ptr<data::AnalogSnapshot> snapshot;
 
-               sr_probe *const probe = (sr_probe*)p->data;
+               sr_channel *const probe = (sr_channel*)p->data;
                assert(probe);
 
                // Try to get the snapshot of the probe
-               const map< const sr_probe*, shared_ptr<data::AnalogSnapshot> >::
+               const map< const sr_channel*, shared_ptr<data::AnalogSnapshot> >::
                        iterator iter = _cur_analog_snapshots.find(probe);
                if (iter != _cur_analog_snapshots.end())
                        snapshot = (*iter).second;
index 5953902df02750714df9dc944bd0b802439d49b7..a5f2aa728dbfb25ca7a347b094635d8eb9066425 100644 (file)
@@ -117,7 +117,7 @@ private:
        void update_signals(boost::shared_ptr<device::DevInst> dev_inst);
 
        boost::shared_ptr<view::Signal> signal_from_probe(
-               const sr_probe *probe) const;
+               const sr_channel *probe) const;
 
        void read_sample_rate(const sr_dev_inst *const sdi);
 
@@ -176,7 +176,7 @@ private:
        mutable boost::mutex _data_mutex;
        boost::shared_ptr<data::Logic> _logic_data;
        boost::shared_ptr<data::LogicSnapshot> _cur_logic_snapshot;
-       std::map< const sr_probe*, boost::shared_ptr<data::AnalogSnapshot> >
+       std::map< const sr_channel*, boost::shared_ptr<data::AnalogSnapshot> >
                _cur_analog_snapshots;
 
        boost::thread _sampling_thread;
index 182e9abdfbf4bcb874242b8c671455f9aa553363..c3f273839adccbed51b4e2a3abc03a2d8ce9959a 100644 (file)
@@ -45,7 +45,7 @@ const QColor AnalogSignal::SignalColours[4] = {
 const float AnalogSignal::EnvelopeThreshold = 256.0f;
 
 AnalogSignal::AnalogSignal(shared_ptr<pv::device::DevInst> dev_inst,
-       const sr_probe *const probe, shared_ptr<data::Analog> data) :
+       const sr_channel *const probe, shared_ptr<data::Analog> data) :
        Signal(dev_inst, probe),
        _data(data),
        _scale(1.0f)
index 8101167d5677ff001591936071c24d6a3d4ffd24..f22d128bc01494c0f2188cbcb963d431cd6c3ac4 100644 (file)
@@ -43,7 +43,7 @@ private:
 
 public:
        AnalogSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
-               const sr_probe *const probe,
+               const sr_channel *const probe,
                boost::shared_ptr<pv::data::Analog> data);
 
        virtual ~AnalogSignal();
index 52cf4ac1ab24af7ae09051d4c30ec93e36b3c819..0b4426475d6e52a36e7f87f96a58933e144a903c 100644 (file)
@@ -64,7 +64,7 @@ const QColor LogicSignal::SignalColours[10] = {
 };
 
 LogicSignal::LogicSignal(shared_ptr<pv::device::DevInst> dev_inst,
-       const sr_probe *const probe, shared_ptr<data::Logic> data) :
+       const sr_channel *const probe, shared_ptr<data::Logic> data) :
        Signal(dev_inst, probe),
        _data(data),
        _trigger_none(NULL),
@@ -306,7 +306,7 @@ void LogicSignal::set_trigger(char type)
        const sr_dev_inst *const sdi = _dev_inst->dev_inst();
        assert(sdi);
 
-       const int probe_count = g_slist_length(sdi->probes);
+       const int probe_count = g_slist_length(sdi->channels);
        assert(probe_count > 0);
 
        assert(_probe && _probe->index < probe_count);
index 9b7865743a76b0fd9458f3358760c1355abbafcd..c3e1666184912ae8f92b1a8ca9fcc3bc9f0938c8 100644 (file)
@@ -50,7 +50,7 @@ private:
 
 public:
        LogicSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
-               const sr_probe *const probe,
+               const sr_channel *const probe,
                boost::shared_ptr<pv::data::Logic> data);
 
        virtual ~LogicSignal();
index aadaed78f7d238cac06a1a1ec789eb5795864650..3312c5924576b9517c5aa6425de4f935cbf95e63 100644 (file)
@@ -57,7 +57,7 @@ const char *const ProbeNames[] = {
 };
 
 Signal::Signal(shared_ptr<pv::device::DevInst> dev_inst,
-       const sr_probe *const probe) :
+       const sr_channel *const probe) :
        Trace(probe->name),
        _dev_inst(dev_inst),
        _probe(probe),
@@ -86,7 +86,7 @@ void Signal::enable(bool enable)
        visibility_changed();
 }
 
-const sr_probe* Signal::probe() const
+const sr_channel* Signal::probe() const
 {
        return _probe;
 }
index 3123519b9dcb6e5778d1e78f39302674a1afbb9d..32d181772fce2ce2c48e571d50573608e7d6018f 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "trace.h"
 
-struct sr_probe;
+struct sr_channel;
 
 namespace pv {
 
@@ -50,7 +50,7 @@ class Signal : public Trace
 
 protected:
        Signal(boost::shared_ptr<pv::device::DevInst> dev_inst,
-               const sr_probe *const probe);
+               const sr_channel *const probe);
 
 public:
        /**
@@ -67,7 +67,7 @@ public:
 
        void enable(bool enable = true);
 
-       const sr_probe* probe() const;
+       const sr_channel* probe() const;
 
        virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
 
@@ -80,7 +80,7 @@ private slots:
 
 protected:
        boost::shared_ptr<pv::device::DevInst> _dev_inst;
-       const sr_probe *const _probe;
+       const sr_channel *const _probe;
 
        QComboBox *_name_widget;
        bool _updating_name_widget;