Rename 'probe' to 'channel' everywhere.
authorMartin Ling <martin-git@earth.li>
Wed, 27 Aug 2014 18:55:48 +0000 (19:55 +0100)
committerUwe Hermann <uwe@hermann-uwe.de>
Fri, 29 Aug 2014 19:33:59 +0000 (21:33 +0200)
27 files changed:
CMakeLists.txt
pv/data/decode/decoder.cpp
pv/data/decode/decoder.h
pv/data/decoderstack.cpp
pv/data/logic.cpp
pv/data/logic.h
pv/device/devinst.cpp
pv/device/devinst.h
pv/popups/channels.cpp [new file with mode: 0644]
pv/popups/channels.h [new file with mode: 0644]
pv/popups/probes.cpp [deleted file]
pv/popups/probes.h [deleted file]
pv/sigsession.cpp
pv/sigsession.h
pv/storesession.cpp
pv/toolbars/samplingbar.cpp
pv/toolbars/samplingbar.h
pv/view/analogsignal.cpp
pv/view/analogsignal.h
pv/view/decodetrace.cpp
pv/view/decodetrace.h
pv/view/logicsignal.cpp
pv/view/logicsignal.h
pv/view/signal.cpp
pv/view/signal.h
pv/widgets/decodermenu.cpp
test/data/logicsnapshot.cpp

index 2c1faddc10c9a0f5d8210fec5f571caa9e5b79b0..d85948c095afbd7713709f0705c5f334a8dddb66 100644 (file)
@@ -143,7 +143,7 @@ set(pulseview_SOURCES
        pv/dialogs/connect.cpp
        pv/dialogs/storeprogress.cpp
        pv/popups/deviceoptions.cpp
-       pv/popups/probes.cpp
+       pv/popups/channels.cpp
        pv/prop/bool.cpp
        pv/prop/double.cpp
        pv/prop/enum.cpp
@@ -185,7 +185,7 @@ set(pulseview_HEADERS
        pv/dialogs/about.h
        pv/dialogs/connect.h
        pv/dialogs/storeprogress.h
-       pv/popups/probes.h
+       pv/popups/channels.h
        pv/popups/deviceoptions.h
        pv/prop/bool.h
        pv/prop/double.h
index d3e483bd8d0435ea0aea65ea3d1df0661d5e743e..14097cfdc03453431a66d22f81f8d1ae87a40692 100644 (file)
@@ -66,13 +66,13 @@ void Decoder::show(bool show)
 const map<const srd_channel*, shared_ptr<view::LogicSignal> >&
 Decoder::channels() const
 {
-       return _probes;
+       return _channels;
 }
 
-void Decoder::set_probes(std::map<const srd_channel*,
-       std::shared_ptr<view::LogicSignal> > probes)
+void Decoder::set_channels(std::map<const srd_channel*,
+       std::shared_ptr<view::LogicSignal> > channels)
 {
-       _probes = probes;
+       _channels = channels;
 }
 
 const std::map<std::string, GVariant*>& Decoder::options() const
@@ -87,12 +87,12 @@ void Decoder::set_option(const char *id, GVariant *value)
        _options[id] = value;
 }
 
-bool Decoder::have_required_probes() const
+bool Decoder::have_required_channels() const
 {
        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())
+               if (_channels.find(pdch) == _channels.end())
                        return false;
        }
 
@@ -102,7 +102,7 @@ bool Decoder::have_required_probes() const
 set< shared_ptr<pv::data::Logic> > Decoder::get_data()
 {
        set< shared_ptr<pv::data::Logic> > data;
-       for(auto i = _probes.cbegin(); i != _probes.cend(); i++) {
+       for(auto i = _channels.cbegin(); i != _channels.cend(); i++) {
                shared_ptr<view::LogicSignal> signal((*i).second);
                assert(signal);
                data.insert(signal->logic_data());
@@ -131,20 +131,20 @@ srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session, int unit_si
        if(!decoder_inst)
                return NULL;
 
-       // Setup the probes
-       GHashTable *const probes = g_hash_table_new_full(g_str_hash,
+       // Setup the channels
+       GHashTable *const channels = g_hash_table_new_full(g_str_hash,
                g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
 
-       for(auto i = _probes.cbegin(); i != _probes.cend(); i++)
+       for(auto i = _channels.cbegin(); i != _channels.cend(); i++)
        {
                shared_ptr<view::LogicSignal> signal((*i).second);
                GVariant *const gvar = g_variant_new_int32(
-                       signal->probe()->index);
+                       signal->channel()->index);
                g_variant_ref_sink(gvar);
-               g_hash_table_insert(probes, (*i).first->id, gvar);
+               g_hash_table_insert(channels, (*i).first->id, gvar);
        }
 
-       srd_inst_channel_set_all(decoder_inst, probes, unit_size);
+       srd_inst_channel_set_all(decoder_inst, channels, unit_size);
 
        return decoder_inst;
 }
index 3920aa4c40012f4313631984c434d6cd3d14ed66..4eeb09e1af01718091ef3456604b886aea548a21 100644 (file)
@@ -58,14 +58,14 @@ public:
 
        const std::map<const srd_channel*,
                std::shared_ptr<view::LogicSignal> >& channels() const;
-       void set_probes(std::map<const srd_channel*,
-               std::shared_ptr<view::LogicSignal> > probes);
+       void set_channels(std::map<const srd_channel*,
+               std::shared_ptr<view::LogicSignal> > channels);
 
        const std::map<std::string, GVariant*>& options() const;
 
        void set_option(const char *id, GVariant *value);
 
-       bool have_required_probes() const;
+       bool have_required_channels() const;
 
        srd_decoder_inst* create_decoder_inst(
                srd_session *session, int unit_size) const;
@@ -78,7 +78,7 @@ private:
        bool _shown;
 
        std::map<const srd_channel*, std::shared_ptr<pv::view::LogicSignal> >
-               _probes;
+               _channels;
        std::map<std::string, GVariant*> _options;
 };
 
index 414aaf0ca1ae338629fdcf2e60ce5b4dd4c5fafd..5c26371b891f2d856fc04342a435ba3fdd413257 100644 (file)
@@ -194,7 +194,7 @@ void DecoderStack::begin_decode()
 
        // Check that all decoders have the required channels
        for (const shared_ptr<decode::Decoder> &dec : _stack)
-               if (!dec->have_required_probes()) {
+               if (!dec->have_required_channels()) {
                        _error_message = tr("One or more required channels "
                                "have not been specified");
                        return;
index 6addea3b10a4440ec84357dd2d3fe47bc5ff1590..e23283ac2952e23c3f87f0945e7fc91c5ce6b970 100644 (file)
@@ -30,16 +30,16 @@ using std::shared_ptr;
 namespace pv {
 namespace data {
 
-Logic::Logic(unsigned int num_probes) :
+Logic::Logic(unsigned int num_channels) :
        SignalData(),
-       _num_probes(num_probes)
+       _num_channels(num_channels)
 {
-       assert(_num_probes > 0);
+       assert(_num_channels > 0);
 }
 
-int Logic::get_num_probes() const
+int Logic::get_num_channels() const
 {
-       return _num_probes;
+       return _num_channels;
 }
 
 void Logic::push_snapshot(
index 607e0bd450d78f56c1462a2adf158105972657ce..3756ed9a2de0f860c560bb75ac57e1902f360acf 100644 (file)
@@ -34,9 +34,9 @@ class LogicSnapshot;
 class Logic : public SignalData
 {
 public:
-       Logic(unsigned int num_probes);
+       Logic(unsigned int num_channels);
 
-       int get_num_probes() const;
+       int get_num_channels() const;
 
        void push_snapshot(
                std::shared_ptr<LogicSnapshot> &snapshot);
@@ -49,7 +49,7 @@ public:
        uint64_t get_max_sample_count() const;
 
 private:
-       const unsigned int _num_probes;
+       const unsigned int _num_channels;
        std::deque< std::shared_ptr<LogicSnapshot> > _snapshots;
 };
 
index cb37ceefd51d39b5a5783c4960af9aabbc58f4d0..0301063440200d4b693105623f329fbce303b9f6 100644 (file)
@@ -90,19 +90,19 @@ GVariant* DevInst::list_config(const sr_channel_group *group, int key)
        return data;
 }
 
-void DevInst::enable_probe(const sr_channel *probe, bool enable)
+void DevInst::enable_channel(const sr_channel *channel, bool enable)
 {
        assert(_owner);
        sr_dev_inst *const sdi = dev_inst();
        assert(sdi);
        for (const GSList *p = sdi->channels; p; p = p->next)
-               if (probe == p->data) {
-                       const_cast<sr_channel*>(probe)->enabled = enable;
+               if (channel == p->data) {
+                       const_cast<sr_channel*>(channel)->enabled = enable;
                        config_changed();
                        return;
                }
 
-       // Probe was not found in the device
+       // Channel was not found in the device
        assert(0);
 }
 
index 4f0b6dec3137fedf5f679b4b015f27cacee02703..5a994372d347ca76dca32d151760a6b735d358a9 100644 (file)
@@ -64,7 +64,7 @@ public:
 
        GVariant* list_config(const sr_channel_group *group, int key);
 
-       void enable_probe(const sr_channel *probe, bool enable = true);
+       void enable_channel(const sr_channel *channel, bool enable = true);
 
        /**
         * @brief Gets the sample limit from the driver.
diff --git a/pv/popups/channels.cpp b/pv/popups/channels.cpp
new file mode 100644 (file)
index 0000000..1e4bc57
--- /dev/null
@@ -0,0 +1,258 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include <map>
+
+#include <QCheckBox>
+#include <QFormLayout>
+#include <QGridLayout>
+#include <QLabel>
+
+#include "channels.h"
+
+#include <pv/device/devinst.h>
+#include <pv/prop/binding/deviceoptions.h>
+#include <pv/sigsession.h>
+#include <pv/view/signal.h>
+
+using namespace Qt;
+
+using std::map;
+using std::set;
+using std::shared_ptr;
+using std::vector;
+
+using pv::view::Signal;
+
+namespace pv {
+namespace popups {
+
+Channels::Channels(SigSession &session, QWidget *parent) :
+       Popup(parent),
+       _session(session),
+       _updating_channels(false),
+       _enable_all_channels(tr("Enable All"), this),
+       _disable_all_channels(tr("Disable All"), this),
+       _check_box_mapper(this)
+{
+       // Create the layout
+       setLayout(&_layout);
+
+       shared_ptr<device::DevInst> dev_inst = _session.get_device();
+       assert(dev_inst);
+       const sr_dev_inst *const sdi = dev_inst->dev_inst();
+       assert(sdi);
+
+       // Collect a set of signals
+       map<const sr_channel*, shared_ptr<Signal> > signal_map;
+       const vector< shared_ptr<Signal> > sigs = _session.get_signals();
+
+       for (const shared_ptr<Signal> &sig : sigs)
+               signal_map[sig->channel()] = sig;
+
+       // Populate channel groups
+       for (const GSList *g = sdi->channel_groups; g; g = g->next)
+       {
+               const sr_channel_group *const group =
+                       (const sr_channel_group*)g->data;
+               assert(group);
+
+               // Make a set of signals and remove these signals from the
+               // signal map.
+               vector< shared_ptr<Signal> > group_sigs;
+               for (const GSList *p = group->channels; p; p = p->next)
+               {
+                       const sr_channel *const channel = (const sr_channel*)p->data;
+                       assert(channel);
+
+                       const auto iter = signal_map.find(channel);
+
+                       if (iter == signal_map.end())
+                               break;
+
+                       group_sigs.push_back((*iter).second);
+                       signal_map.erase(iter);
+               }
+
+               populate_group(group, group_sigs);
+       }
+
+       // Make a vector of the remaining channels
+       vector< shared_ptr<Signal> > global_sigs;
+       for (const GSList *p = sdi->channels; p; p = p->next)
+       {
+               const sr_channel *const channel = (const sr_channel*)p->data;
+               assert(channel);
+
+               const map<const sr_channel*, shared_ptr<Signal> >::
+                       const_iterator iter = signal_map.find(channel);
+               if (iter != signal_map.end())
+                       global_sigs.push_back((*iter).second);
+       }
+
+       // Create a group
+       populate_group(NULL, global_sigs);
+
+       // Create the enable/disable all buttons
+       connect(&_enable_all_channels, SIGNAL(clicked()),
+               this, SLOT(enable_all_channels()));
+       connect(&_disable_all_channels, SIGNAL(clicked()),
+               this, SLOT(disable_all_channels()));
+
+       _enable_all_channels.setFlat(true);
+       _disable_all_channels.setFlat(true);
+
+       _buttons_bar.addWidget(&_enable_all_channels);
+       _buttons_bar.addWidget(&_disable_all_channels);
+       _buttons_bar.addStretch(1);
+
+       _layout.addRow(&_buttons_bar);
+
+       // Connect the check-box signal mapper
+       connect(&_check_box_mapper, SIGNAL(mapped(QWidget*)),
+               this, SLOT(on_channel_checked(QWidget*)));
+}
+
+void Channels::set_all_channels(bool set)
+{
+       _updating_channels = true;
+
+       for (map<QCheckBox*, shared_ptr<Signal> >::const_iterator i =
+               _check_box_signal_map.begin();
+               i != _check_box_signal_map.end(); i++)
+       {
+               const shared_ptr<Signal> sig = (*i).second;
+               assert(sig);
+
+               sig->enable(set);
+               (*i).first->setChecked(set);
+       }
+
+       _updating_channels = false;
+}
+
+void Channels::populate_group(const sr_channel_group *group,
+       const vector< shared_ptr<pv::view::Signal> > sigs)
+{
+       using pv::prop::binding::DeviceOptions;
+
+       // Only bind options if this is a group. We don't do it for general
+       // options, because these properties are shown in the device config
+       // popup.
+       shared_ptr<DeviceOptions> binding;
+       if (group)
+               binding = shared_ptr<DeviceOptions>(new DeviceOptions(
+                       _session.get_device(), group));
+
+       // Create a title if the group is going to have any content
+       if ((!sigs.empty() || (binding && !binding->properties().empty())) &&
+               group && group->name)
+               _layout.addRow(new QLabel(
+                       QString("<h3>%1</h3>").arg(group->name)));
+
+       // Create the channel group grid
+       QGridLayout *const channel_grid =
+               create_channel_group_grid(sigs);
+       _layout.addRow(channel_grid);
+
+       // Create the channel group options
+       if (binding)
+       {
+               binding->add_properties_to_form(&_layout, true);
+               _group_bindings.push_back(binding);
+       }
+}
+
+QGridLayout* Channels::create_channel_group_grid(
+       const vector< shared_ptr<pv::view::Signal> > sigs)
+{
+       int row = 0, col = 0;
+       QGridLayout *const grid = new QGridLayout();
+
+       for (const shared_ptr<pv::view::Signal>& sig : sigs)
+       {
+               assert(sig);
+
+               QCheckBox *const checkbox = new QCheckBox(sig->get_name());
+               _check_box_mapper.setMapping(checkbox, checkbox);
+               connect(checkbox, SIGNAL(toggled(bool)),
+                       &_check_box_mapper, SLOT(map()));
+
+               grid->addWidget(checkbox, row, col);
+
+               _check_box_signal_map[checkbox] = sig;
+
+               if(++col >= 8)
+                       col = 0, row++;
+       }
+
+       return grid;
+}
+
+void Channels::showEvent(QShowEvent *e)
+{
+       pv::widgets::Popup::showEvent(e);
+
+       _updating_channels = true;
+
+       for (map<QCheckBox*, shared_ptr<Signal> >::const_iterator i =
+               _check_box_signal_map.begin();
+               i != _check_box_signal_map.end(); i++)
+       {
+               const shared_ptr<Signal> sig = (*i).second;
+               assert(sig);
+
+               (*i).first->setChecked(sig->enabled());
+       }
+
+       _updating_channels = false;
+}
+
+void Channels::on_channel_checked(QWidget *widget)
+{
+       if (_updating_channels)
+               return;
+
+       QCheckBox *const check_box = (QCheckBox*)widget;
+       assert(check_box);
+
+       // Look up the signal of this check-box
+       map< QCheckBox*, shared_ptr<Signal> >::const_iterator iter =
+               _check_box_signal_map.find((QCheckBox*)check_box);
+       assert(iter != _check_box_signal_map.end());
+
+       const shared_ptr<pv::view::Signal> s = (*iter).second;
+       assert(s);
+
+       s->enable(check_box->isChecked());
+}
+
+void Channels::enable_all_channels()
+{
+       set_all_channels(true);
+}
+
+void Channels::disable_all_channels()
+{
+       set_all_channels(false);
+}
+
+} // popups
+} // pv
diff --git a/pv/popups/channels.h b/pv/popups/channels.h
new file mode 100644 (file)
index 0000000..3cd9eef
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#ifndef PULSEVIEW_PV_POPUPS_CHANNELS_H
+#define PULSEVIEW_PV_POPUPS_CHANNELS_H
+
+#include <map>
+#include <memory>
+#include <vector>
+
+#include <QFormLayout>
+#include <QHBoxLayout>
+#include <QPushButton>
+#include <QSignalMapper>
+
+#include <pv/widgets/popup.h>
+
+struct sr_channel_group;
+
+class QCheckBox;
+class QGridLayout;
+
+namespace pv {
+
+class SigSession;
+
+namespace prop {
+namespace binding {
+class DeviceOptions;
+}
+}
+
+namespace view {
+class Signal;
+}
+
+namespace popups {
+
+class Channels : public pv::widgets::Popup
+{
+       Q_OBJECT
+
+public:
+       Channels(SigSession &_session, QWidget *parent);
+
+private:
+       void set_all_channels(bool set);
+
+       void populate_group(const sr_channel_group *group,
+               const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
+
+       QGridLayout* create_channel_group_grid(
+               const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
+
+private:
+       void showEvent(QShowEvent *e);
+
+private Q_SLOTS:
+       void on_channel_checked(QWidget *widget);
+
+       void enable_all_channels();
+       void disable_all_channels();
+
+private:
+       pv::SigSession &_session;
+
+       QFormLayout _layout;
+
+       bool _updating_channels;
+
+       std::vector< std::shared_ptr<pv::prop::binding::DeviceOptions> >
+                _group_bindings;
+       std::map< QCheckBox*, std::shared_ptr<pv::view::Signal> >
+               _check_box_signal_map;
+
+       QHBoxLayout _buttons_bar;
+       QPushButton _enable_all_channels;
+       QPushButton _disable_all_channels;
+
+       QSignalMapper _check_box_mapper;
+};
+
+} // popups
+} // pv
+
+#endif // PULSEVIEW_PV_POPUPS_CHANNELS_H
diff --git a/pv/popups/probes.cpp b/pv/popups/probes.cpp
deleted file mode 100644 (file)
index a20dfcc..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#include <map>
-
-#include <QCheckBox>
-#include <QFormLayout>
-#include <QGridLayout>
-#include <QLabel>
-
-#include "probes.h"
-
-#include <pv/device/devinst.h>
-#include <pv/prop/binding/deviceoptions.h>
-#include <pv/sigsession.h>
-#include <pv/view/signal.h>
-
-using namespace Qt;
-
-using std::map;
-using std::set;
-using std::shared_ptr;
-using std::vector;
-
-using pv::view::Signal;
-
-namespace pv {
-namespace popups {
-
-Probes::Probes(SigSession &session, QWidget *parent) :
-       Popup(parent),
-       _session(session),
-       _updating_probes(false),
-       _enable_all_probes(tr("Enable All"), this),
-       _disable_all_probes(tr("Disable All"), this),
-       _check_box_mapper(this)
-{
-       // Create the layout
-       setLayout(&_layout);
-
-       shared_ptr<device::DevInst> dev_inst = _session.get_device();
-       assert(dev_inst);
-       const sr_dev_inst *const sdi = dev_inst->dev_inst();
-       assert(sdi);
-
-       // Collect a set of signals
-       map<const sr_channel*, shared_ptr<Signal> > signal_map;
-       const vector< shared_ptr<Signal> > sigs = _session.get_signals();
-
-       for (const shared_ptr<Signal> &sig : sigs)
-               signal_map[sig->probe()] = sig;
-
-       // Populate channel groups
-       for (const GSList *g = sdi->channel_groups; g; g = g->next)
-       {
-               const sr_channel_group *const group =
-                       (const sr_channel_group*)g->data;
-               assert(group);
-
-               // Make a set of signals and remove these signals from the
-               // signal map.
-               vector< shared_ptr<Signal> > group_sigs;
-               for (const GSList *p = group->channels; p; p = p->next)
-               {
-                       const sr_channel *const probe = (const sr_channel*)p->data;
-                       assert(probe);
-
-                       const auto iter = signal_map.find(probe);
-
-                       if (iter == signal_map.end())
-                               break;
-
-                       group_sigs.push_back((*iter).second);
-                       signal_map.erase(iter);
-               }
-
-               populate_group(group, group_sigs);
-       }
-
-       // Make a vector of the remaining probes
-       vector< shared_ptr<Signal> > global_sigs;
-       for (const GSList *p = sdi->channels; p; p = p->next)
-       {
-               const sr_channel *const probe = (const sr_channel*)p->data;
-               assert(probe);
-
-               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);
-       }
-
-       // Create a group
-       populate_group(NULL, global_sigs);
-
-       // Create the enable/disable all buttons
-       connect(&_enable_all_probes, SIGNAL(clicked()),
-               this, SLOT(enable_all_probes()));
-       connect(&_disable_all_probes, SIGNAL(clicked()),
-               this, SLOT(disable_all_probes()));
-
-       _enable_all_probes.setFlat(true);
-       _disable_all_probes.setFlat(true);
-
-       _buttons_bar.addWidget(&_enable_all_probes);
-       _buttons_bar.addWidget(&_disable_all_probes);
-       _buttons_bar.addStretch(1);
-
-       _layout.addRow(&_buttons_bar);
-
-       // Connect the check-box signal mapper
-       connect(&_check_box_mapper, SIGNAL(mapped(QWidget*)),
-               this, SLOT(on_probe_checked(QWidget*)));
-}
-
-void Probes::set_all_probes(bool set)
-{
-       _updating_probes = true;
-
-       for (map<QCheckBox*, shared_ptr<Signal> >::const_iterator i =
-               _check_box_signal_map.begin();
-               i != _check_box_signal_map.end(); i++)
-       {
-               const shared_ptr<Signal> sig = (*i).second;
-               assert(sig);
-
-               sig->enable(set);
-               (*i).first->setChecked(set);
-       }
-
-       _updating_probes = false;
-}
-
-void Probes::populate_group(const sr_channel_group *group,
-       const vector< shared_ptr<pv::view::Signal> > sigs)
-{
-       using pv::prop::binding::DeviceOptions;
-
-       // Only bind options if this is a group. We don't do it for general
-       // options, because these properties are shown in the device config
-       // popup.
-       shared_ptr<DeviceOptions> binding;
-       if (group)
-               binding = shared_ptr<DeviceOptions>(new DeviceOptions(
-                       _session.get_device(), group));
-
-       // Create a title if the group is going to have any content
-       if ((!sigs.empty() || (binding && !binding->properties().empty())) &&
-               group && group->name)
-               _layout.addRow(new QLabel(
-                       QString("<h3>%1</h3>").arg(group->name)));
-
-       // Create the channel group grid
-       QGridLayout *const probe_grid =
-               create_channel_group_grid(sigs);
-       _layout.addRow(probe_grid);
-
-       // Create the channel group options
-       if (binding)
-       {
-               binding->add_properties_to_form(&_layout, true);
-               _group_bindings.push_back(binding);
-       }
-}
-
-QGridLayout* Probes::create_channel_group_grid(
-       const vector< shared_ptr<pv::view::Signal> > sigs)
-{
-       int row = 0, col = 0;
-       QGridLayout *const grid = new QGridLayout();
-
-       for (const shared_ptr<pv::view::Signal>& sig : sigs)
-       {
-               assert(sig);
-
-               QCheckBox *const checkbox = new QCheckBox(sig->get_name());
-               _check_box_mapper.setMapping(checkbox, checkbox);
-               connect(checkbox, SIGNAL(toggled(bool)),
-                       &_check_box_mapper, SLOT(map()));
-
-               grid->addWidget(checkbox, row, col);
-
-               _check_box_signal_map[checkbox] = sig;
-
-               if(++col >= 8)
-                       col = 0, row++;
-       }
-
-       return grid;
-}
-
-void Probes::showEvent(QShowEvent *e)
-{
-       pv::widgets::Popup::showEvent(e);
-
-       _updating_probes = true;
-
-       for (map<QCheckBox*, shared_ptr<Signal> >::const_iterator i =
-               _check_box_signal_map.begin();
-               i != _check_box_signal_map.end(); i++)
-       {
-               const shared_ptr<Signal> sig = (*i).second;
-               assert(sig);
-
-               (*i).first->setChecked(sig->enabled());
-       }
-
-       _updating_probes = false;
-}
-
-void Probes::on_probe_checked(QWidget *widget)
-{
-       if (_updating_probes)
-               return;
-
-       QCheckBox *const check_box = (QCheckBox*)widget;
-       assert(check_box);
-
-       // Look up the signal of this check-box
-       map< QCheckBox*, shared_ptr<Signal> >::const_iterator iter =
-               _check_box_signal_map.find((QCheckBox*)check_box);
-       assert(iter != _check_box_signal_map.end());
-
-       const shared_ptr<pv::view::Signal> s = (*iter).second;
-       assert(s);
-
-       s->enable(check_box->isChecked());
-}
-
-void Probes::enable_all_probes()
-{
-       set_all_probes(true);
-}
-
-void Probes::disable_all_probes()
-{
-       set_all_probes(false);
-}
-
-} // popups
-} // pv
diff --git a/pv/popups/probes.h b/pv/popups/probes.h
deleted file mode 100644 (file)
index 434d039..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-
-#ifndef PULSEVIEW_PV_POPUPS_PROBES_H
-#define PULSEVIEW_PV_POPUPS_PROBES_H
-
-#include <map>
-#include <memory>
-#include <vector>
-
-#include <QFormLayout>
-#include <QHBoxLayout>
-#include <QPushButton>
-#include <QSignalMapper>
-
-#include <pv/widgets/popup.h>
-
-struct sr_channel_group;
-
-class QCheckBox;
-class QGridLayout;
-
-namespace pv {
-
-class SigSession;
-
-namespace prop {
-namespace binding {
-class DeviceOptions;
-}
-}
-
-namespace view {
-class Signal;
-}
-
-namespace popups {
-
-class Probes : public pv::widgets::Popup
-{
-       Q_OBJECT
-
-public:
-       Probes(SigSession &_session, QWidget *parent);
-
-private:
-       void set_all_probes(bool set);
-
-       void populate_group(const sr_channel_group *group,
-               const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
-
-       QGridLayout* create_channel_group_grid(
-               const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
-
-private:
-       void showEvent(QShowEvent *e);
-
-private Q_SLOTS:
-       void on_probe_checked(QWidget *widget);
-
-       void enable_all_probes();
-       void disable_all_probes();
-
-private:
-       pv::SigSession &_session;
-
-       QFormLayout _layout;
-
-       bool _updating_probes;
-
-       std::vector< std::shared_ptr<pv::prop::binding::DeviceOptions> >
-                _group_bindings;
-       std::map< QCheckBox*, std::shared_ptr<pv::view::Signal> >
-               _check_box_signal_map;
-
-       QHBoxLayout _buttons_bar;
-       QPushButton _enable_all_probes;
-       QPushButton _disable_all_probes;
-
-       QSignalMapper _check_box_mapper;
-};
-
-} // popups
-} // pv
-
-#endif // PULSEVIEW_PV_POPUPS_PROBES_H
index dfd0cedb6dc96877871bbbd4774dc1af77c2da2c..90854c7dbaf2b9d2cc26f6fc3d82e4b26bf44c61 100644 (file)
@@ -178,12 +178,12 @@ void SigSession::start_capture(function<void (const QString)> error_handler)
 
        assert(_dev_inst->dev_inst());
 
-       // Check that at least one probe is enabled
+       // Check that at least one channel is enabled
        const GSList *l;
        for (l = _dev_inst->dev_inst()->channels; l; l = l->next) {
-               sr_channel *const probe = (sr_channel*)l->data;
-               assert(probe);
-               if (probe->enabled)
+               sr_channel *const channel = (sr_channel*)l->data;
+               assert(channel);
+               if (channel->enabled)
                        break;
        }
 
@@ -229,7 +229,7 @@ vector< shared_ptr<view::Signal> > SigSession::get_signals() const
 #ifdef ENABLE_DECODE
 bool SigSession::add_decoder(srd_decoder *const dec)
 {
-       map<const srd_channel*, shared_ptr<view::LogicSignal> > probes;
+       map<const srd_channel*, shared_ptr<view::LogicSignal> > channels;
        shared_ptr<data::DecoderStack> decoder_stack;
 
        try
@@ -240,15 +240,15 @@ bool SigSession::add_decoder(srd_decoder *const dec)
                decoder_stack = shared_ptr<data::DecoderStack>(
                        new data::DecoderStack(*this, dec));
 
-               // Make a list of all the probes
-               std::vector<const srd_channel*> all_probes;
+               // Make a list of all the channels
+               std::vector<const srd_channel*> all_channels;
                for(const GSList *i = dec->channels; i; i = i->next)
-                       all_probes.push_back((const srd_channel*)i->data);
+                       all_channels.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);
+                       all_channels.push_back((const srd_channel*)i->data);
 
-               // Auto select the initial probes
-               for (const srd_channel *pdch : all_probes)
+               // Auto select the initial channels
+               for (const srd_channel *pdch : all_channels)
                        for (shared_ptr<view::Signal> s : _signals)
                        {
                                shared_ptr<view::LogicSignal> l =
@@ -256,13 +256,13 @@ bool SigSession::add_decoder(srd_decoder *const dec)
                                if (l && QString::fromUtf8(pdch->name).
                                        toLower().contains(
                                        l->get_name().toLower()))
-                                       probes[pdch] = l;
+                                       channels[pdch] = l;
                        }
 
                assert(decoder_stack);
                assert(!decoder_stack->stack().empty());
                assert(decoder_stack->stack().front());
-               decoder_stack->stack().front()->set_probes(probes);
+               decoder_stack->stack().front()->set_channels(channels);
 
                // Create the decode signal
                shared_ptr<view::DecodeTrace> d(
@@ -315,7 +315,7 @@ void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
        assert(dev_inst);
        assert(_capture_state == Stopped);
 
-       unsigned int logic_probe_count = 0;
+       unsigned int logic_channel_count = 0;
 
        // Clear the decode traces
        _decode_traces.clear();
@@ -325,13 +325,13 @@ void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
                assert(dev_inst->dev_inst());
                for (const GSList *l = dev_inst->dev_inst()->channels;
                        l; l = l->next) {
-                       const sr_channel *const probe = (const sr_channel *)l->data;
-                       if (!probe->enabled)
+                       const sr_channel *const channel = (const sr_channel *)l->data;
+                       if (!channel->enabled)
                                continue;
 
-                       switch(probe->type) {
+                       switch(channel->type) {
                        case SR_CHANNEL_LOGIC:
-                               logic_probe_count++;
+                               logic_channel_count++;
                                break;
                        }
                }
@@ -342,9 +342,9 @@ void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
                lock_guard<mutex> data_lock(_data_mutex);
 
                _logic_data.reset();
-               if (logic_probe_count != 0) {
+               if (logic_channel_count != 0) {
                        _logic_data.reset(new data::Logic(
-                               logic_probe_count));
+                               logic_channel_count));
                        assert(_logic_data);
                }
        }
@@ -362,14 +362,14 @@ void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
                for (const GSList *l = dev_inst->dev_inst()->channels;
                        l; l = l->next) {
                        shared_ptr<view::Signal> signal;
-                       sr_channel *const probe = (sr_channel *)l->data;
-                       assert(probe);
+                       sr_channel *const channel = (sr_channel *)l->data;
+                       assert(channel);
 
-                       switch(probe->type) {
+                       switch(channel->type) {
                        case SR_CHANNEL_LOGIC:
                                signal = shared_ptr<view::Signal>(
                                        new view::LogicSignal(dev_inst,
-                                               probe, _logic_data));
+                                               channel, _logic_data));
                                break;
 
                        case SR_CHANNEL_ANALOG:
@@ -378,7 +378,7 @@ void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
                                        new data::Analog());
                                signal = shared_ptr<view::Signal>(
                                        new view::AnalogSignal(dev_inst,
-                                               probe, data));
+                                               channel, data));
                                break;
                        }
 
@@ -396,13 +396,13 @@ void SigSession::update_signals(shared_ptr<device::DevInst> dev_inst)
        signals_changed();
 }
 
-shared_ptr<view::Signal> SigSession::signal_from_probe(
-       const sr_channel *probe) const
+shared_ptr<view::Signal> SigSession::signal_from_channel(
+       const sr_channel *channel) const
 {
        lock_guard<mutex> lock(_signals_mutex);
        for (shared_ptr<view::Signal> sig : _signals) {
                assert(sig);
-               if (sig->probe() == probe)
+               if (sig->channel() == channel)
                        return sig;
        }
        return shared_ptr<view::Signal>();
@@ -536,8 +536,8 @@ 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.channels);
-       const size_t sample_count = analog.num_samples / probe_count;
+       const unsigned int channel_count = g_slist_length(analog.channels);
+       const size_t sample_count = analog.num_samples / channel_count;
        const float *data = analog.data;
        bool sweep_beginning = false;
 
@@ -545,12 +545,12 @@ void SigSession::feed_in_analog(const sr_datafeed_analog &analog)
        {
                shared_ptr<data::AnalogSnapshot> snapshot;
 
-               sr_channel *const probe = (sr_channel*)p->data;
-               assert(probe);
+               sr_channel *const channel = (sr_channel*)p->data;
+               assert(channel);
 
-               // Try to get the snapshot of the probe
+               // Try to get the snapshot of the channel
                const map< const sr_channel*, shared_ptr<data::AnalogSnapshot> >::
-                       iterator iter = _cur_analog_snapshots.find(probe);
+                       iterator iter = _cur_analog_snapshots.find(channel);
                if (iter != _cur_analog_snapshots.end())
                        snapshot = (*iter).second;
                else
@@ -560,15 +560,15 @@ void SigSession::feed_in_analog(const sr_datafeed_analog &analog)
                        // in the sweep containing this snapshot.
                        sweep_beginning = true;
 
-                       // Create a snapshot, keep it in the maps of probes
+                       // Create a snapshot, keep it in the maps of channels
                        snapshot = shared_ptr<data::AnalogSnapshot>(
                                new data::AnalogSnapshot(_dev_inst->get_sample_limit()));
-                       _cur_analog_snapshots[probe] = snapshot;
+                       _cur_analog_snapshots[channel] = snapshot;
 
-                       // Find the annalog data associated with the probe
+                       // Find the annalog data associated with the channel
                        shared_ptr<view::AnalogSignal> sig =
                                dynamic_pointer_cast<view::AnalogSignal>(
-                                       signal_from_probe(probe));
+                                       signal_from_channel(channel));
                        assert(sig);
 
                        shared_ptr<data::Analog> data(sig->analog_data());
@@ -582,7 +582,7 @@ void SigSession::feed_in_analog(const sr_datafeed_analog &analog)
 
                // Append the samples in the snapshot
                snapshot->append_interleaved_samples(data++, sample_count,
-                       probe_count);
+                       channel_count);
        }
 
        if (sweep_beginning) {
index a4e14d9cd099e8a6755ace39ddd26fd9d3bd21b5..9359176c784ac5ebbd633741e4d4eb9782dde19b 100644 (file)
@@ -115,8 +115,8 @@ private:
 
        void update_signals(std::shared_ptr<device::DevInst> dev_inst);
 
-       std::shared_ptr<view::Signal> signal_from_probe(
-               const sr_channel *probe) const;
+       std::shared_ptr<view::Signal> signal_from_channel(
+               const sr_channel *channel) const;
 
        void read_sample_rate(const sr_dev_inst *const sdi);
 
index 9b8dac9c579783aafada6f25fea13f0db53a19af..9ad494e2be3e34a2fced82ea34a961f354358483 100644 (file)
@@ -110,26 +110,26 @@ bool StoreSession::start()
        const shared_ptr<data::LogicSnapshot> snapshot(snapshots.front());
        assert(snapshot);
 
-       // Make a list of probes
-       char **const probes = new char*[sigs.size() + 1];
+       // Make a list of channels
+       char **const channels = new char*[sigs.size() + 1];
        for (size_t i = 0; i < sigs.size(); i++) {
                shared_ptr<view::Signal> sig(sigs[i]);
                assert(sig);
-               probes[i] = strdup(sig->get_name().toUtf8().constData());
+               channels[i] = strdup(sig->get_name().toUtf8().constData());
        }
-       probes[sigs.size()] = NULL;
+       channels[sigs.size()] = NULL;
 
        // Begin storing
        if (sr_session_save_init(SigSession::_sr_session, _file_name.c_str(),
-               data->samplerate(), probes) != SR_OK) {
+               data->samplerate(), channels) != SR_OK) {
                _error = tr("Error while saving.");
                return false;
        }
 
-       // Delete the probes array
+       // Delete the channels array
        for (size_t i = 0; i <= sigs.size(); i++)
-               free(probes[i]);
-       delete[] probes;
+               free(channels[i]);
+       delete[] channels;
 
        _thread = std::thread(&StoreSession::store_proc, this, snapshot);
        return true;
index af5afb0c27774b980ae843c68e73a81b6e135217..550fc8482d1c7891a586adc8734dac3d684ac352 100644 (file)
@@ -32,7 +32,7 @@
 #include <pv/devicemanager.h>
 #include <pv/device/devinst.h>
 #include <pv/popups/deviceoptions.h>
-#include <pv/popups/probes.h>
+#include <pv/popups/channels.h>
 #include <pv/util.h>
 
 using std::map;
@@ -55,7 +55,7 @@ SamplingBar::SamplingBar(SigSession &session, QWidget *parent) :
        _updating_device_selector(false),
        _configure_button(this),
        _configure_button_action(NULL),
-       _probes_button(this),
+       _channels_button(this),
        _sample_count(" samples", this),
        _sample_rate("Hz", this),
        _updating_sample_rate(false),
@@ -82,14 +82,14 @@ SamplingBar::SamplingBar(SigSession &session, QWidget *parent) :
        _configure_button.setIcon(QIcon::fromTheme("configure",
                QIcon(":/icons/configure.png")));
 
-       _probes_button.setIcon(QIcon::fromTheme("probes",
-               QIcon(":/icons/probes.svg")));
+       _channels_button.setIcon(QIcon::fromTheme("channels",
+               QIcon(":/icons/channels.svg")));
 
        _run_stop_button.setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
 
        addWidget(&_device_selector);
        _configure_button_action = addWidget(&_configure_button);
-       addWidget(&_probes_button);
+       addWidget(&_channels_button);
        addWidget(&_sample_count);
        addWidget(&_sample_rate);
 
@@ -322,9 +322,9 @@ void SamplingBar::update_device_config_widgets()
                !opts->binding().properties().empty());
        _configure_button.set_popup(opts);
 
-       // Update the probes popup
-       Probes *const probes = new Probes(_session, this);
-       _probes_button.set_popup(probes);
+       // Update the channels popup
+       Channels *const channels = new Channels(_session, this);
+       _channels_button.set_popup(channels);
 
        // Update supported options.
        _sample_count_supported = false;
index 0f4c2ee5549b92cd2c3d9f40c168b1fa9b690207..b2e7def25f7c4d1a2f112b4c3838f24bae7e7328 100644 (file)
@@ -102,7 +102,7 @@ private:
        pv::widgets::PopupToolButton _configure_button;
        QAction *_configure_button_action;
 
-       pv::widgets::PopupToolButton _probes_button;
+       pv::widgets::PopupToolButton _channels_button;
 
        pv::widgets::SweepTimingWidget _sample_count;
        pv::widgets::SweepTimingWidget _sample_rate;
index 82e31a842c0134bfed1c94dafdb1c2c3b06129f9..e3f51aabc6d787b00f10955432a1c53e73d5a179 100644 (file)
@@ -46,12 +46,12 @@ const QColor AnalogSignal::SignalColours[4] = {
 const float AnalogSignal::EnvelopeThreshold = 256.0f;
 
 AnalogSignal::AnalogSignal(shared_ptr<pv::device::DevInst> dev_inst,
-       const sr_channel *const probe, shared_ptr<data::Analog> data) :
-       Signal(dev_inst, probe),
+       const sr_channel *const channel, shared_ptr<data::Analog> data) :
+       Signal(dev_inst, channel),
        _data(data),
        _scale(1.0f)
 {
-       _colour = SignalColours[probe->index % countof(SignalColours)];
+       _colour = SignalColours[channel->index % countof(SignalColours)];
 }
 
 AnalogSignal::~AnalogSignal()
@@ -75,7 +75,7 @@ void AnalogSignal::set_scale(float scale)
 
 void AnalogSignal::paint_back(QPainter &p, int left, int right)
 {
-       if (_probe->enabled)
+       if (_channel->enabled)
                paint_axis(p, get_y(), left, right);
 }
 
@@ -92,7 +92,7 @@ void AnalogSignal::paint_mid(QPainter &p, int left, int right)
 
        const double offset = _view->offset();
 
-       if (!_probe->enabled)
+       if (!_channel->enabled)
                return;
 
        const deque< shared_ptr<pv::data::AnalogSnapshot> > &snapshots =
index 6f0e49d7409095eb8d381bb5afab941313fec1f5..934203366dca78b93591402b57fc49d56b996c8e 100644 (file)
@@ -43,7 +43,7 @@ private:
 
 public:
        AnalogSignal(std::shared_ptr<pv::device::DevInst> dev_inst,
-               const sr_channel *const probe,
+               const sr_channel *const channel,
                std::shared_ptr<pv::data::Analog> data);
 
        virtual ~AnalogSignal();
index 53eb22f1adfe4f2ff0d542d8aec2f394dc8031a1..c8a20dc3c9c6cf7eb3888080351e624ba38349c7 100644 (file)
@@ -288,7 +288,7 @@ void DecodeTrace::populate_popup_form(QWidget *parent, QFormLayout *form)
 
        // Add the decoder options
        _bindings.clear();
-       _probe_selectors.clear();
+       _channel_selectors.clear();
        _decoder_forms.clear();
 
        const list< shared_ptr<Decoder> >& stack = _decoder_stack->stack();
@@ -476,7 +476,7 @@ void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left,
 
        const list< shared_ptr<Decoder> > &stack = _decoder_stack->stack();
 
-       // 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
        for (const shared_ptr<Decoder> &dec : stack)
@@ -544,30 +544,30 @@ void DecodeTrace::create_decoder_form(int index,
        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);
+               QComboBox *const combo = create_channel_selector(parent, dec, pdch);
                connect(combo, SIGNAL(currentIndexChanged(int)),
-                       this, SLOT(on_probe_selected(int)));
+                       this, SLOT(on_channel_selected(int)));
                decoder_form->addRow(tr("<b>%1</b> (%2) *")
                        .arg(QString::fromUtf8(pdch->name))
                        .arg(QString::fromUtf8(pdch->desc)), combo);
 
-               const ProbeSelector s = {combo, dec, pdch};
-               _probe_selectors.push_back(s);
+               const ChannelSelector s = {combo, dec, pdch};
+               _channel_selectors.push_back(s);
        }
 
        // 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);
+               QComboBox *const combo = create_channel_selector(parent, dec, pdch);
                connect(combo, SIGNAL(currentIndexChanged(int)),
-                       this, SLOT(on_probe_selected(int)));
+                       this, SLOT(on_channel_selected(int)));
                decoder_form->addRow(tr("<b>%1</b> (%2)")
                        .arg(QString::fromUtf8(pdch->name))
                        .arg(QString::fromUtf8(pdch->desc)), combo);
 
-               const ProbeSelector s = {combo, dec, pdch};
-               _probe_selectors.push_back(s);
+               const ChannelSelector s = {combo, dec, pdch};
+               _channel_selectors.push_back(s);
        }
 
        // Add the options
@@ -581,7 +581,7 @@ void DecodeTrace::create_decoder_form(int index,
        _decoder_forms.push_back(group);
 }
 
-QComboBox* DecodeTrace::create_probe_selector(
+QComboBox* DecodeTrace::create_channel_selector(
        QWidget *parent, const shared_ptr<data::decode::Decoder> &dec,
        const srd_channel *const pdch)
 {
@@ -590,13 +590,13 @@ QComboBox* DecodeTrace::create_probe_selector(
        const vector< shared_ptr<Signal> > sigs = _session.get_signals();
 
        assert(_decoder_stack);
-       const auto probe_iter = dec->channels().find(pdch);
+       const auto channel_iter = dec->channels().find(pdch);
 
        QComboBox *selector = new QComboBox(parent);
 
        selector->addItem("-", qVariantFromValue((void*)NULL));
 
-       if (probe_iter == dec->channels().end())
+       if (channel_iter == dec->channels().end())
                selector->setCurrentIndex(0);
 
        for(size_t i = 0; i < sigs.size(); i++) {
@@ -607,7 +607,7 @@ QComboBox* DecodeTrace::create_probe_selector(
                {
                        selector->addItem(s->get_name(),
                                qVariantFromValue((void*)s.get()));
-                       if ((*probe_iter).second == s)
+                       if ((*channel_iter).second == s)
                                selector->setCurrentIndex(i + 1);
                }
        }
@@ -615,14 +615,14 @@ QComboBox* DecodeTrace::create_probe_selector(
        return selector;
 }
 
-void DecodeTrace::commit_decoder_probes(shared_ptr<data::decode::Decoder> &dec)
+void DecodeTrace::commit_decoder_channels(shared_ptr<data::decode::Decoder> &dec)
 {
        assert(dec);
 
-       map<const srd_channel*, shared_ptr<LogicSignal> > probe_map;
+       map<const srd_channel*, shared_ptr<LogicSignal> > channel_map;
        const vector< shared_ptr<Signal> > sigs = _session.get_signals();
 
-       for (const ProbeSelector &s : _probe_selectors)
+       for (const ChannelSelector &s : _channel_selectors)
        {
                if(s._decoder != dec)
                        break;
@@ -633,20 +633,20 @@ void DecodeTrace::commit_decoder_probes(shared_ptr<data::decode::Decoder> &dec)
 
                for (shared_ptr<Signal> sig : sigs)
                        if(sig.get() == selection) {
-                               probe_map[s._pdch] =
+                               channel_map[s._pdch] =
                                        dynamic_pointer_cast<LogicSignal>(sig);
                                break;
                        }
        }
 
-       dec->set_probes(probe_map);
+       dec->set_channels(channel_map);
 }
 
-void DecodeTrace::commit_probes()
+void DecodeTrace::commit_channels()
 {
        assert(_decoder_stack);
        for (shared_ptr<data::decode::Decoder> dec : _decoder_stack->stack())
-               commit_decoder_probes(dec);
+               commit_decoder_channels(dec);
 
        _decoder_stack->begin_decode();
 }
@@ -667,9 +667,9 @@ void DecodeTrace::on_delete()
        _session.remove_decode_signal(this);
 }
 
-void DecodeTrace::on_probe_selected(int)
+void DecodeTrace::on_channel_selected(int)
 {
-       commit_probes();
+       commit_channels();
 }
 
 void DecodeTrace::on_stack_decoder(srd_decoder *decoder)
index 4b3bc3dec21ca6322cb4de879ebb01ffab020e75..b93aa01f0a4cc8f69cfd44eb9ab37260b448db5d 100644 (file)
@@ -61,7 +61,7 @@ class DecodeTrace : public Trace
        Q_OBJECT
 
 private:
-       struct ProbeSelector
+       struct ChannelSelector
        {
                const QComboBox *_combo;
                const std::shared_ptr<pv::data::decode::Decoder> _decoder;
@@ -145,21 +145,21 @@ private:
                std::shared_ptr<pv::data::decode::Decoder> &dec,
                QWidget *parent, QFormLayout *form);
 
-       QComboBox* create_probe_selector(QWidget *parent,
+       QComboBox* create_channel_selector(QWidget *parent,
                const std::shared_ptr<pv::data::decode::Decoder> &dec,
                const srd_channel *const pdch);
 
-       void commit_decoder_probes(
+       void commit_decoder_channels(
                std::shared_ptr<data::decode::Decoder> &dec);
 
-       void commit_probes();
+       void commit_channels();
 
 private Q_SLOTS:
        void on_new_decode_data();
 
        void on_delete();
 
-       void on_probe_selected(int);
+       void on_channel_selected(int);
 
        void on_stack_decoder(srd_decoder *decoder);
 
@@ -176,7 +176,7 @@ private:
        std::list< std::shared_ptr<pv::prop::binding::DecoderOptions> >
                _bindings;
 
-       std::list<ProbeSelector> _probe_selectors;
+       std::list<ChannelSelector> _channel_selectors;
        std::vector<pv::widgets::DecoderGroupBox*> _decoder_forms;
 
        std::vector<QString> _cur_row_headings;
index 3a2ec4862dc5d6ae94432e799fcdf8860b5669b8..27635f902f1fe80e47595e95a829fd3ad49957b7 100644 (file)
@@ -65,8 +65,8 @@ const QColor LogicSignal::SignalColours[10] = {
 };
 
 LogicSignal::LogicSignal(shared_ptr<pv::device::DevInst> dev_inst,
-       const sr_channel *const probe, shared_ptr<data::Logic> data) :
-       Signal(dev_inst, probe),
+       const sr_channel *const channel, shared_ptr<data::Logic> data) :
+       Signal(dev_inst, channel),
        _data(data),
        _trigger_none(NULL),
        _trigger_rising(NULL),
@@ -80,7 +80,7 @@ LogicSignal::LogicSignal(shared_ptr<pv::device::DevInst> dev_inst,
        struct sr_trigger_match *match;
        const GSList *l, *m;
 
-       _colour = SignalColours[probe->index % countof(SignalColours)];
+       _colour = SignalColours[channel->index % countof(SignalColours)];
 
        /* Populate this channel's trigger setting with whatever we
         * find in the current session trigger, if anything. */
@@ -90,7 +90,7 @@ LogicSignal::LogicSignal(shared_ptr<pv::device::DevInst> dev_inst,
                        stage = (struct sr_trigger_stage *)l->data;
                        for (m = stage->matches; m && !_trigger_match; m = m->next) {
                                match = (struct sr_trigger_match *)m->data;
-                               if (match->channel == _probe)
+                               if (match->channel == _channel)
                                        _trigger_match = match->match;
                        }
                }
@@ -113,7 +113,7 @@ shared_ptr<pv::data::Logic> LogicSignal::logic_data() const
 
 void LogicSignal::paint_back(QPainter &p, int left, int right)
 {
-       if (_probe->enabled)
+       if (_channel->enabled)
                paint_axis(p, get_y(), left, right);
 }
 
@@ -125,7 +125,7 @@ void LogicSignal::paint_mid(QPainter &p, int left, int right)
 
        vector< pair<int64_t, bool> > edges;
 
-       assert(_probe);
+       assert(_channel);
        assert(_data);
        assert(right >= left);
 
@@ -137,7 +137,7 @@ void LogicSignal::paint_mid(QPainter &p, int left, int right)
        
        const double offset = _view->offset();
 
-       if (!_probe->enabled)
+       if (!_channel->enabled)
                return;
 
        const float high_offset = y - View::SignalHeight + 0.5f;
@@ -167,7 +167,7 @@ void LogicSignal::paint_mid(QPainter &p, int left, int right)
        snapshot->get_subsampled_edges(edges,
                min(max((int64_t)floor(start), (int64_t)0), last_sample),
                min(max((int64_t)ceil(end), (int64_t)0), last_sample),
-               samples_per_pixel / Oversampling, _probe->index);
+               samples_per_pixel / Oversampling, _channel->index);
        assert(edges.size() >= 2);
 
        // Paint the edges
index 4e10d7179b9d75f0cb54333b3caa0d635c9c683f..0f6714cf0ce11661c58e0c264d6973e5350b6753 100644 (file)
@@ -50,7 +50,7 @@ private:
 
 public:
        LogicSignal(std::shared_ptr<pv::device::DevInst> dev_inst,
-               const sr_channel *const probe,
+               const sr_channel *const channel,
                std::shared_ptr<pv::data::Logic> data);
 
        virtual ~LogicSignal();
index 2ee4b1850ded6f36e18b817df0482d0bd9bba431..97e05494cca05eac922a47a6bb0c1dd878472d93 100644 (file)
@@ -41,7 +41,7 @@ using std::shared_ptr;
 namespace pv {
 namespace view {
 
-const char *const ProbeNames[] = {
+const char *const ChannelNames[] = {
        "CLK",
        "DATA",
        "IN",
@@ -59,14 +59,14 @@ const char *const ProbeNames[] = {
 };
 
 Signal::Signal(shared_ptr<pv::device::DevInst> dev_inst,
-       const sr_channel *const probe) :
-       Trace(probe->name),
+       const sr_channel *const channel) :
+       Trace(channel->name),
        _dev_inst(dev_inst),
-       _probe(probe),
+       _channel(channel),
        _name_widget(NULL),
        _updating_name_widget(false)
 {
-       assert(_probe);
+       assert(_channel);
 }
 
 void Signal::set_name(QString name)
@@ -79,18 +79,18 @@ void Signal::set_name(QString name)
 
 bool Signal::enabled() const
 {
-       return _probe->enabled;
+       return _channel->enabled;
 }
 
 void Signal::enable(bool enable)
 {
-       _dev_inst->enable_probe(_probe, enable);
+       _dev_inst->enable_channel(_channel, enable);
        visibility_changed();
 }
 
-const sr_channel* Signal::probe() const
+const sr_channel* Signal::channel() const
 {
-       return _probe;
+       return _channel;
 }
 
 void Signal::populate_popup_form(QWidget *parent, QFormLayout *form)
@@ -100,8 +100,8 @@ void Signal::populate_popup_form(QWidget *parent, QFormLayout *form)
        _name_widget = new QComboBox(parent);
        _name_widget->setEditable(true);
 
-       for(unsigned int i = 0; i < countof(ProbeNames); i++)
-               _name_widget->insertItem(i, ProbeNames[i]);
+       for(unsigned int i = 0; i < countof(ChannelNames); i++)
+               _name_widget->insertItem(i, ChannelNames[i]);
 
        index = _name_widget->findText(_name, Qt::MatchExactly);
 
index d62709729cbcfe760f376de6d83b663698c43a88..7cf08b2913503c1e3d89c5f0aa78d3226ff8b96e 100644 (file)
@@ -50,7 +50,7 @@ class Signal : public Trace
 
 protected:
        Signal(std::shared_ptr<pv::device::DevInst> dev_inst,
-               const sr_channel *const probe);
+               const sr_channel *const channel);
 
 public:
        /**
@@ -67,7 +67,7 @@ public:
 
        void enable(bool enable = true);
 
-       const sr_channel* probe() const;
+       const sr_channel* channel() const;
 
        virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
 
@@ -82,7 +82,7 @@ private Q_SLOTS:
 
 protected:
        std::shared_ptr<pv::device::DevInst> _dev_inst;
-       const sr_channel *const _probe;
+       const sr_channel *const _channel;
 
        QComboBox *_name_widget;
        bool _updating_name_widget;
index b90c86d7403e3df7bc7e2848d84d2579bbd74126..60eb8e8a576205a8ec480f2a6669fc43695cb82c 100644 (file)
@@ -38,8 +38,8 @@ DecoderMenu::DecoderMenu(QWidget *parent, bool first_level_decoder) :
                const srd_decoder *const d = (srd_decoder*)l->data;
                assert(d);
 
-               const bool have_probes = (d->channels || d->opt_channels) != 0;
-               if (first_level_decoder == have_probes) {
+               const bool have_channels = (d->channels || d->opt_channels) != 0;
+               if (first_level_decoder == have_channels) {
                        QAction *const action =
                                addAction(QString::fromUtf8(d->name));
                        action->setData(qVariantFromValue(l->data));
index 5fc17213ba1ca06e2a2d5d0b84686ee0b60957a3..7b7d4e7ff0940fa5360db02fbf0b3817f20c8084 100644 (file)
@@ -470,9 +470,9 @@ BOOST_AUTO_TEST_CASE(LisaMUsbHid)
 }
 
 /*
- * This test checks the rendering of wide data (more than 8 probes)
+ * This test checks the rendering of wide data (more than 8 channels)
  * Probe signals are either all-high, or all-low, but are interleaved such that
- * they would toggle during every sample if treated like 8 probes.
+ * they would toggle during every sample if treated like 8 channels.
  * The packet contains a large number of samples, so the mipmap generation kicks
  * in.
  *