]> sigrok.org Git - pulseview.git/commitdiff
Rename 'probe' to 'channel' (libsigrokdecode change).
authorUwe Hermann <redacted>
Sat, 5 Apr 2014 12:00:56 +0000 (14:00 +0200)
committerUwe Hermann <redacted>
Mon, 14 Apr 2014 19:53:39 +0000 (21:53 +0200)
Variables of type 'struct srd_channel *' are consistently named 'pdch' to
make them easily distinguishable from libsigrok's 'struct sr_channel *'
variables that are consistently named 'ch'.

pv/data/decode/decoder.cpp
pv/data/decode/decoder.h
pv/data/decoderstack.cpp
pv/data/decoderstack.h
pv/dialogs/connect.cpp
pv/sigsession.cpp
pv/sigsession.h
pv/view/decodetrace.cpp
pv/view/decodetrace.h
pv/widgets/decodermenu.cpp

index 89d19b3ad7c3ec80dd3c6d2c4f7c73d0f2d5038d..44e474b942c4bfbd82281b42c8d7d909b7430d6f 100644 (file)
@@ -62,13 +62,13 @@ void Decoder::show(bool show)
        _shown = show;
 }
 
-const map<const srd_probe*, shared_ptr<view::LogicSignal> >&
-Decoder::probes() const
+const map<const srd_channel*, shared_ptr<view::LogicSignal> >&
+Decoder::channels() const
 {
        return _probes;
 }
 
-void Decoder::set_probes(std::map<const srd_probe*,
+void Decoder::set_probes(std::map<const srd_channel*,
        boost::shared_ptr<view::LogicSignal> > probes)
 {
        _probes = probes;
@@ -88,10 +88,10 @@ void Decoder::set_option(const char *id, GVariant *value)
 
 bool Decoder::have_required_probes() const
 {
-       for (GSList *p = _decoder->probes; p; p = p->next) {
-               const srd_probe *const probe = (const srd_probe*)p->data;
-               assert(probe);
-               if (_probes.find(probe) == _probes.end())
+       for (GSList *l = _decoder->channels; l; l = l->next) {
+               const srd_channel *const pdch = (const srd_channel*)l->data;
+               assert(pdch);
+               if (_probes.find(pdch) == _probes.end())
                        return false;
        }
 
@@ -101,7 +101,7 @@ bool Decoder::have_required_probes() const
 set< shared_ptr<pv::data::Logic> > Decoder::get_data()
 {
        set< shared_ptr<pv::data::Logic> > data;
-       for(map<const srd_probe*, shared_ptr<view::LogicSignal> >::
+       for(map<const srd_channel*, shared_ptr<view::LogicSignal> >::
                const_iterator i = _probes.begin();
                i != _probes.end(); i++)
        {
@@ -138,7 +138,7 @@ srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session, int unit_si
        GHashTable *const probes = g_hash_table_new_full(g_str_hash,
                g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
 
-       for(map<const srd_probe*, shared_ptr<view::LogicSignal> >::
+       for(map<const srd_channel*, shared_ptr<view::LogicSignal> >::
                const_iterator i = _probes.begin();
                i != _probes.end(); i++)
        {
@@ -149,7 +149,7 @@ srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session, int unit_si
                g_hash_table_insert(probes, (*i).first->id, gvar);
        }
 
-       srd_inst_probe_set_all(decoder_inst, probes, unit_size);
+       srd_inst_channel_set_all(decoder_inst, probes, unit_size);
 
        return decoder_inst;
 }
index 0c3662cb5f75604aa0bf7cbd89ad94c4a3a67344..dffefab22e2119f6a44fc7a2dbe869196320d431 100644 (file)
@@ -30,7 +30,7 @@
 
 struct srd_decoder;
 struct srd_decoder_inst;
-struct srd_probe;
+struct srd_channel;
 struct srd_session;
 
 namespace pv {
@@ -57,9 +57,9 @@ public:
        bool shown() const;
        void show(bool show = true);
 
-       const std::map<const srd_probe*,
-               boost::shared_ptr<view::LogicSignal> >& probes() const;
-       void set_probes(std::map<const srd_probe*,
+       const std::map<const srd_channel*,
+               boost::shared_ptr<view::LogicSignal> >& channels() const;
+       void set_probes(std::map<const srd_channel*,
                boost::shared_ptr<view::LogicSignal> > probes);
 
        const std::map<std::string, GVariant*>& options() const;
@@ -78,7 +78,7 @@ private:
 
        bool _shown;
 
-       std::map<const srd_probe*, boost::shared_ptr<pv::view::LogicSignal> >
+       std::map<const srd_channel*, boost::shared_ptr<pv::view::LogicSignal> >
                _probes;
        std::map<std::string, GVariant*> _options;
 };
index 9a13769ccf2a32ffbec850b88cf1225b5718a7bc..c3bf26d25699c12135707b40512414c9ee0ef4f3 100644 (file)
@@ -194,10 +194,10 @@ void DecoderStack::begin_decode()
 
        clear();
 
-       // Check that all decoders have the required probes
+       // Check that all decoders have the required channels
        BOOST_FOREACH(const shared_ptr<decode::Decoder> &dec, _stack)
                if (!dec->have_required_probes()) {
-                       _error_message = tr("One or more required probes "
+                       _error_message = tr("One or more required channels "
                                "have not been specified");
                        return;
                }
@@ -233,12 +233,12 @@ void DecoderStack::begin_decode()
                }
        }
 
-       // We get the logic data of the first probe in the list.
+       // We get the logic data of the first channel in the list.
        // This works because we are currently assuming all
        // LogicSignals have the same data/snapshot
        BOOST_FOREACH (const shared_ptr<decode::Decoder> &dec, _stack)
-               if (dec && !dec->probes().empty() &&
-                       ((logic_signal = (*dec->probes().begin()).second)) &&
+               if (dec && !dec->channels().empty() &&
+                       ((logic_signal = (*dec->channels().begin()).second)) &&
                        ((data = logic_signal->logic_data())))
                        break;
 
index 4b2717279ba034fab245855c5273030eec521fd8..2eeaf1c76fa4c1cba4718c8e627c05e1bb0e7afa 100644 (file)
@@ -37,7 +37,7 @@
 
 struct srd_decoder;
 struct srd_decoder_annotation_row;
-struct srd_probe;
+struct srd_channel;
 struct srd_proto_data;
 struct srd_session;
 
index 611c9cc50d7f3fb10a81963f1a4138de06b9064b..d5ab9c4789f6dd9d79b4e601518bc9c4cd27bc44 100644 (file)
@@ -185,7 +185,7 @@ void Connect::scan_pressed()
                QString text = QString::fromUtf8(title.c_str());
 
                if (sdi->channels) {
-                       text += QString(" with %1 probes").arg(
+                       text += QString(" with %1 channels").arg(
                                g_slist_length(sdi->channels));
                }
 
index e51acde2b6a2d93733177dd1865641c3512abd9d..b441dab8aaf429608dc6d848b47be4156902e57d 100644 (file)
@@ -228,7 +228,7 @@ vector< shared_ptr<view::Signal> > SigSession::get_signals() const
 #ifdef ENABLE_DECODE
 bool SigSession::add_decoder(srd_decoder *const dec)
 {
-       map<const srd_probe*, shared_ptr<view::LogicSignal> > probes;
+       map<const srd_channel*, shared_ptr<view::LogicSignal> > probes;
        shared_ptr<data::DecoderStack> decoder_stack;
 
        try
@@ -240,22 +240,22 @@ bool SigSession::add_decoder(srd_decoder *const dec)
                        new data::DecoderStack(*this, dec));
 
                // Make a list of all the probes
-               std::vector<const srd_probe*> all_probes;
-               for(const GSList *i = dec->probes; i; i = i->next)
-                       all_probes.push_back((const srd_probe*)i->data);
-               for(const GSList *i = dec->opt_probes; i; i = i->next)
-                       all_probes.push_back((const srd_probe*)i->data);
+               std::vector<const srd_channel*> all_probes;
+               for(const GSList *i = dec->channels; i; i = i->next)
+                       all_probes.push_back((const srd_channel*)i->data);
+               for(const GSList *i = dec->opt_channels; i; i = i->next)
+                       all_probes.push_back((const srd_channel*)i->data);
 
                // Auto select the initial probes
-               BOOST_FOREACH(const srd_probe *probe, all_probes)
+               BOOST_FOREACH(const srd_channel *pdch, all_probes)
                        BOOST_FOREACH(shared_ptr<view::Signal> s, _signals)
                        {
                                shared_ptr<view::LogicSignal> l =
                                        dynamic_pointer_cast<view::LogicSignal>(s);
-                               if (l && QString::fromUtf8(probe->name).
+                               if (l && QString::fromUtf8(pdch->name).
                                        toLower().contains(
                                        l->get_name().toLower()))
-                                       probes[probe] = l;
+                                       probes[pdch] = l;
                        }
 
                assert(decoder_stack);
index a5f2aa728dbfb25ca7a347b094635d8eb9066425..1221750b0bc039c0b33e95b9026d6b1ac4427a2f 100644 (file)
@@ -36,7 +36,7 @@
 #include <libsigrok/libsigrok.h>
 
 struct srd_decoder;
-struct srd_probe;
+struct srd_channel;
 
 namespace pv {
 
index e4f02760eaa0b6b1719cdeb8bb323be3bd10a512..c3bc1dff0a4981170e86b748fe8f45c1a7206b33 100644 (file)
@@ -311,7 +311,7 @@ void DecodeTrace::populate_popup_form(QWidget *parent, QFormLayout *form)
                }
 
                form->addRow(new QLabel(
-                       tr("<i>* Required Probes</i>"), parent));
+                       tr("<i>* Required channels</i>"), parent));
        }
 
        // Add stacking button
@@ -482,8 +482,8 @@ void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left,
        // This works because we are currently assuming all
        // LogicSignals have the same data/snapshot
        BOOST_FOREACH (const shared_ptr<Decoder> &dec, stack)
-               if (dec && !dec->probes().empty() &&
-                       ((logic_signal = (*dec->probes().begin()).second)) &&
+               if (dec && !dec->channels().empty() &&
+                       ((logic_signal = (*dec->channels().begin()).second)) &&
                        ((data = logic_signal->logic_data())))
                        break;
 
@@ -521,7 +521,7 @@ void DecodeTrace::create_decoder_form(int index,
        shared_ptr<data::decode::Decoder> &dec, QWidget *parent,
        QFormLayout *form)
 {
-       const GSList *probe;
+       const GSList *l;
 
        assert(dec);
        const srd_decoder *const decoder = dec->decoder();
@@ -542,33 +542,33 @@ void DecodeTrace::create_decoder_form(int index,
        QFormLayout *const decoder_form = new QFormLayout;
        group->add_layout(decoder_form);
 
-       // Add the mandatory probes
-       for(probe = decoder->probes; probe; probe = probe->next) {
-               const struct srd_probe *const p =
-                       (struct srd_probe *)probe->data;
-               QComboBox *const combo = create_probe_selector(parent, dec, p);
+       // Add the mandatory channels
+       for(l = decoder->channels; l; l = l->next) {
+               const struct srd_channel *const pdch =
+                       (struct srd_channel *)l->data;
+               QComboBox *const combo = create_probe_selector(parent, dec, pdch);
                connect(combo, SIGNAL(currentIndexChanged(int)),
                        this, SLOT(on_probe_selected(int)));
                decoder_form->addRow(tr("<b>%1</b> (%2) *")
-                       .arg(QString::fromUtf8(p->name))
-                       .arg(QString::fromUtf8(p->desc)), combo);
+                       .arg(QString::fromUtf8(pdch->name))
+                       .arg(QString::fromUtf8(pdch->desc)), combo);
 
-               const ProbeSelector s = {combo, dec, p};
+               const ProbeSelector s = {combo, dec, pdch};
                _probe_selectors.push_back(s);
        }
 
-       // Add the optional probes
-       for(probe = decoder->opt_probes; probe; probe = probe->next) {
-               const struct srd_probe *const p =
-                       (struct srd_probe *)probe->data;
-               QComboBox *const combo = create_probe_selector(parent, dec, p);
+       // Add the optional channels
+       for(l = decoder->opt_channels; l; l = l->next) {
+               const struct srd_channel *const pdch =
+                       (struct srd_channel *)l->data;
+               QComboBox *const combo = create_probe_selector(parent, dec, pdch);
                connect(combo, SIGNAL(currentIndexChanged(int)),
                        this, SLOT(on_probe_selected(int)));
                decoder_form->addRow(tr("<b>%1</b> (%2)")
-                       .arg(QString::fromUtf8(p->name))
-                       .arg(QString::fromUtf8(p->desc)), combo);
+                       .arg(QString::fromUtf8(pdch->name))
+                       .arg(QString::fromUtf8(pdch->desc)), combo);
 
-               const ProbeSelector s = {combo, dec, p};
+               const ProbeSelector s = {combo, dec, pdch};
                _probe_selectors.push_back(s);
        }
 
@@ -585,22 +585,22 @@ void DecodeTrace::create_decoder_form(int index,
 
 QComboBox* DecodeTrace::create_probe_selector(
        QWidget *parent, const shared_ptr<data::decode::Decoder> &dec,
-       const srd_probe *const probe)
+       const srd_channel *const pdch)
 {
        assert(dec);
 
        const vector< shared_ptr<Signal> > sigs = _session.get_signals();
 
        assert(_decoder_stack);
-       const map<const srd_probe*,
+       const map<const srd_channel*,
                shared_ptr<LogicSignal> >::const_iterator probe_iter =
-               dec->probes().find(probe);
+               dec->channels().find(pdch);
 
        QComboBox *selector = new QComboBox(parent);
 
        selector->addItem("-", qVariantFromValue((void*)NULL));
 
-       if (probe_iter == dec->probes().end())
+       if (probe_iter == dec->channels().end())
                selector->setCurrentIndex(0);
 
        for(size_t i = 0; i < sigs.size(); i++) {
@@ -623,7 +623,7 @@ void DecodeTrace::commit_decoder_probes(shared_ptr<data::decode::Decoder> &dec)
 {
        assert(dec);
 
-       map<const srd_probe*, shared_ptr<LogicSignal> > probe_map;
+       map<const srd_channel*, shared_ptr<LogicSignal> > probe_map;
        const vector< shared_ptr<Signal> > sigs = _session.get_signals();
 
        BOOST_FOREACH(const ProbeSelector &s, _probe_selectors)
@@ -637,7 +637,7 @@ void DecodeTrace::commit_decoder_probes(shared_ptr<data::decode::Decoder> &dec)
 
                BOOST_FOREACH(shared_ptr<Signal> sig, sigs)
                        if(sig.get() == selection) {
-                               probe_map[s._probe] =
+                               probe_map[s._pdch] =
                                        dynamic_pointer_cast<LogicSignal>(sig);
                                break;
                        }
index 642f2a0ed4394cec7d2c90f67548f4d027e0396b..9a991fcb436c63596fb3c2d3cedd9fff4b7a3aa3 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <pv/prop/binding/decoderoptions.h>
 
-struct srd_probe;
+struct srd_channel;
 struct srd_decoder;
 
 class QComboBox;
@@ -66,7 +66,7 @@ private:
        {
                const QComboBox *_combo;
                const boost::shared_ptr<pv::data::decode::Decoder> _decoder;
-               const srd_probe *_probe;
+               const srd_channel *_pdch;
        };
 
 private:
@@ -148,7 +148,7 @@ private:
 
        QComboBox* create_probe_selector(QWidget *parent,
                const boost::shared_ptr<pv::data::decode::Decoder> &dec,
-               const srd_probe *const probe);
+               const srd_channel *const pdch);
 
        void commit_decoder_probes(
                boost::shared_ptr<data::decode::Decoder> &dec);
index ff687e4cb85a6d279d5a532b73c9ba35cebbb92d..2f828a203604ab039608419ac957add1c8ef3cf8 100644 (file)
@@ -36,7 +36,7 @@ DecoderMenu::DecoderMenu(QWidget *parent, bool first_level_decoder) :
                const srd_decoder *const d = (srd_decoder*)l->data;
                assert(d);
 
-               const bool have_probes = (d->probes || d->opt_probes) != 0;
+               const bool have_probes = (d->channels || d->opt_channels) != 0;
                if (first_level_decoder == have_probes) {
                        QAction *const action =
                                addAction(QString::fromUtf8(d->name));