From: Martin Ling Date: Wed, 27 Aug 2014 18:55:48 +0000 (+0100) Subject: Rename 'probe' to 'channel' everywhere. X-Git-Tag: pulseview-0.3.0~551 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=6ac6242b25cfbd4df14abe7580adc9d0f4cffe43 Rename 'probe' to 'channel' everywhere. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c1faddc..d85948c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/pv/data/decode/decoder.cpp b/pv/data/decode/decoder.cpp index d3e483bd..14097cfd 100644 --- a/pv/data/decode/decoder.cpp +++ b/pv/data/decode/decoder.cpp @@ -66,13 +66,13 @@ void Decoder::show(bool show) const map >& Decoder::channels() const { - return _probes; + return _channels; } -void Decoder::set_probes(std::map > probes) +void Decoder::set_channels(std::map > channels) { - _probes = probes; + _channels = channels; } const std::map& 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 > Decoder::get_data() { set< shared_ptr > data; - for(auto i = _probes.cbegin(); i != _probes.cend(); i++) { + for(auto i = _channels.cbegin(); i != _channels.cend(); i++) { shared_ptr 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 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; } diff --git a/pv/data/decode/decoder.h b/pv/data/decode/decoder.h index 3920aa4c..4eeb09e1 100644 --- a/pv/data/decode/decoder.h +++ b/pv/data/decode/decoder.h @@ -58,14 +58,14 @@ public: const std::map >& channels() const; - void set_probes(std::map > probes); + void set_channels(std::map > channels); const std::map& 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 > - _probes; + _channels; std::map _options; }; diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index 414aaf0c..5c26371b 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -194,7 +194,7 @@ void DecoderStack::begin_decode() // Check that all decoders have the required channels for (const shared_ptr &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; diff --git a/pv/data/logic.cpp b/pv/data/logic.cpp index 6addea3b..e23283ac 100644 --- a/pv/data/logic.cpp +++ b/pv/data/logic.cpp @@ -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( diff --git a/pv/data/logic.h b/pv/data/logic.h index 607e0bd4..3756ed9a 100644 --- a/pv/data/logic.h +++ b/pv/data/logic.h @@ -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 &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 > _snapshots; }; diff --git a/pv/device/devinst.cpp b/pv/device/devinst.cpp index cb37ceef..03010634 100644 --- a/pv/device/devinst.cpp +++ b/pv/device/devinst.cpp @@ -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(probe)->enabled = enable; + if (channel == p->data) { + const_cast(channel)->enabled = enable; config_changed(); return; } - // Probe was not found in the device + // Channel was not found in the device assert(0); } diff --git a/pv/device/devinst.h b/pv/device/devinst.h index 4f0b6dec..5a994372 100644 --- a/pv/device/devinst.h +++ b/pv/device/devinst.h @@ -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 index 00000000..1e4bc578 --- /dev/null +++ b/pv/popups/channels.cpp @@ -0,0 +1,258 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * 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 + +#include +#include +#include +#include + +#include "channels.h" + +#include +#include +#include +#include + +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 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 > signal_map; + const vector< shared_ptr > sigs = _session.get_signals(); + + for (const shared_ptr &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 > 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 > 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_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 >::const_iterator i = + _check_box_signal_map.begin(); + i != _check_box_signal_map.end(); i++) + { + const shared_ptr 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 > 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 binding; + if (group) + binding = shared_ptr(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("

%1

").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 > sigs) +{ + int row = 0, col = 0; + QGridLayout *const grid = new QGridLayout(); + + for (const shared_ptr& 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 >::const_iterator i = + _check_box_signal_map.begin(); + i != _check_box_signal_map.end(); i++) + { + const shared_ptr 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 >::const_iterator iter = + _check_box_signal_map.find((QCheckBox*)check_box); + assert(iter != _check_box_signal_map.end()); + + const shared_ptr 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 index 00000000..3cd9eef9 --- /dev/null +++ b/pv/popups/channels.h @@ -0,0 +1,103 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * 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 +#include +#include + +#include +#include +#include +#include + +#include + +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 > sigs); + + QGridLayout* create_channel_group_grid( + const std::vector< std::shared_ptr > 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 > + _group_bindings; + std::map< QCheckBox*, std::shared_ptr > + _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 index a20dfcca..00000000 --- a/pv/popups/probes.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * This file is part of the PulseView project. - * - * Copyright (C) 2012 Joel Holdsworth - * - * 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 - -#include -#include -#include -#include - -#include "probes.h" - -#include -#include -#include -#include - -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 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 > signal_map; - const vector< shared_ptr > sigs = _session.get_signals(); - - for (const shared_ptr &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 > 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 > 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_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 >::const_iterator i = - _check_box_signal_map.begin(); - i != _check_box_signal_map.end(); i++) - { - const shared_ptr 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 > 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 binding; - if (group) - binding = shared_ptr(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("

%1

").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 > sigs) -{ - int row = 0, col = 0; - QGridLayout *const grid = new QGridLayout(); - - for (const shared_ptr& 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 >::const_iterator i = - _check_box_signal_map.begin(); - i != _check_box_signal_map.end(); i++) - { - const shared_ptr 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 >::const_iterator iter = - _check_box_signal_map.find((QCheckBox*)check_box); - assert(iter != _check_box_signal_map.end()); - - const shared_ptr 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 index 434d0398..00000000 --- a/pv/popups/probes.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This file is part of the PulseView project. - * - * Copyright (C) 2012 Joel Holdsworth - * - * 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 -#include -#include - -#include -#include -#include -#include - -#include - -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 > sigs); - - QGridLayout* create_channel_group_grid( - const std::vector< std::shared_ptr > 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 > - _group_bindings; - std::map< QCheckBox*, std::shared_ptr > - _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 diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index dfd0cedb..90854c7d 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -178,12 +178,12 @@ void SigSession::start_capture(function 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 > SigSession::get_signals() const #ifdef ENABLE_DECODE bool SigSession::add_decoder(srd_decoder *const dec) { - map > probes; + map > channels; shared_ptr decoder_stack; try @@ -240,15 +240,15 @@ bool SigSession::add_decoder(srd_decoder *const dec) decoder_stack = shared_ptr( new data::DecoderStack(*this, dec)); - // Make a list of all the probes - std::vector all_probes; + // Make a list of all the channels + std::vector 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 s : _signals) { shared_ptr 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 d( @@ -315,7 +315,7 @@ void SigSession::update_signals(shared_ptr 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 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 dev_inst) lock_guard 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 dev_inst) for (const GSList *l = dev_inst->dev_inst()->channels; l; l = l->next) { shared_ptr 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( 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 dev_inst) new data::Analog()); signal = shared_ptr( new view::AnalogSignal(dev_inst, - probe, data)); + channel, data)); break; } @@ -396,13 +396,13 @@ void SigSession::update_signals(shared_ptr dev_inst) signals_changed(); } -shared_ptr SigSession::signal_from_probe( - const sr_channel *probe) const +shared_ptr SigSession::signal_from_channel( + const sr_channel *channel) const { lock_guard lock(_signals_mutex); for (shared_ptr sig : _signals) { assert(sig); - if (sig->probe() == probe) + if (sig->channel() == channel) return sig; } return shared_ptr(); @@ -536,8 +536,8 @@ void SigSession::feed_in_analog(const sr_datafeed_analog &analog) { lock_guard 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 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 >:: - 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( 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 sig = dynamic_pointer_cast( - signal_from_probe(probe)); + signal_from_channel(channel)); assert(sig); shared_ptr 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) { diff --git a/pv/sigsession.h b/pv/sigsession.h index a4e14d9c..9359176c 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -115,8 +115,8 @@ private: void update_signals(std::shared_ptr dev_inst); - std::shared_ptr signal_from_probe( - const sr_channel *probe) const; + std::shared_ptr signal_from_channel( + const sr_channel *channel) const; void read_sample_rate(const sr_dev_inst *const sdi); diff --git a/pv/storesession.cpp b/pv/storesession.cpp index 9b8dac9c..9ad494e2 100644 --- a/pv/storesession.cpp +++ b/pv/storesession.cpp @@ -110,26 +110,26 @@ bool StoreSession::start() const shared_ptr 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 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; diff --git a/pv/toolbars/samplingbar.cpp b/pv/toolbars/samplingbar.cpp index af5afb0c..550fc848 100644 --- a/pv/toolbars/samplingbar.cpp +++ b/pv/toolbars/samplingbar.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include 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; diff --git a/pv/toolbars/samplingbar.h b/pv/toolbars/samplingbar.h index 0f4c2ee5..b2e7def2 100644 --- a/pv/toolbars/samplingbar.h +++ b/pv/toolbars/samplingbar.h @@ -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; diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index 82e31a84..e3f51aab 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -46,12 +46,12 @@ const QColor AnalogSignal::SignalColours[4] = { const float AnalogSignal::EnvelopeThreshold = 256.0f; AnalogSignal::AnalogSignal(shared_ptr dev_inst, - const sr_channel *const probe, shared_ptr data) : - Signal(dev_inst, probe), + const sr_channel *const channel, shared_ptr 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 > &snapshots = diff --git a/pv/view/analogsignal.h b/pv/view/analogsignal.h index 6f0e49d7..93420336 100644 --- a/pv/view/analogsignal.h +++ b/pv/view/analogsignal.h @@ -43,7 +43,7 @@ private: public: AnalogSignal(std::shared_ptr dev_inst, - const sr_channel *const probe, + const sr_channel *const channel, std::shared_ptr data); virtual ~AnalogSignal(); diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 53eb22f1..c8a20dc3 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -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 >& stack = _decoder_stack->stack(); @@ -476,7 +476,7 @@ void DecodeTrace::draw_unresolved_period(QPainter &p, int h, int left, const list< shared_ptr > &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 &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("%1 (%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("%1 (%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 &dec, const srd_channel *const pdch) { @@ -590,13 +590,13 @@ QComboBox* DecodeTrace::create_probe_selector( const vector< shared_ptr > 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 &dec) +void DecodeTrace::commit_decoder_channels(shared_ptr &dec) { assert(dec); - map > probe_map; + map > channel_map; const vector< shared_ptr > 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 &dec) for (shared_ptr sig : sigs) if(sig.get() == selection) { - probe_map[s._pdch] = + channel_map[s._pdch] = dynamic_pointer_cast(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 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) diff --git a/pv/view/decodetrace.h b/pv/view/decodetrace.h index 4b3bc3de..b93aa01f 100644 --- a/pv/view/decodetrace.h +++ b/pv/view/decodetrace.h @@ -61,7 +61,7 @@ class DecodeTrace : public Trace Q_OBJECT private: - struct ProbeSelector + struct ChannelSelector { const QComboBox *_combo; const std::shared_ptr _decoder; @@ -145,21 +145,21 @@ private: std::shared_ptr &dec, QWidget *parent, QFormLayout *form); - QComboBox* create_probe_selector(QWidget *parent, + QComboBox* create_channel_selector(QWidget *parent, const std::shared_ptr &dec, const srd_channel *const pdch); - void commit_decoder_probes( + void commit_decoder_channels( std::shared_ptr &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 > _bindings; - std::list _probe_selectors; + std::list _channel_selectors; std::vector _decoder_forms; std::vector _cur_row_headings; diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 3a2ec486..27635f90 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -65,8 +65,8 @@ const QColor LogicSignal::SignalColours[10] = { }; LogicSignal::LogicSignal(shared_ptr dev_inst, - const sr_channel *const probe, shared_ptr data) : - Signal(dev_inst, probe), + const sr_channel *const channel, shared_ptr data) : + Signal(dev_inst, channel), _data(data), _trigger_none(NULL), _trigger_rising(NULL), @@ -80,7 +80,7 @@ LogicSignal::LogicSignal(shared_ptr 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 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 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 > 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 diff --git a/pv/view/logicsignal.h b/pv/view/logicsignal.h index 4e10d717..0f6714cf 100644 --- a/pv/view/logicsignal.h +++ b/pv/view/logicsignal.h @@ -50,7 +50,7 @@ private: public: LogicSignal(std::shared_ptr dev_inst, - const sr_channel *const probe, + const sr_channel *const channel, std::shared_ptr data); virtual ~LogicSignal(); diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index 2ee4b185..97e05494 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -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 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); diff --git a/pv/view/signal.h b/pv/view/signal.h index d6270972..7cf08b29 100644 --- a/pv/view/signal.h +++ b/pv/view/signal.h @@ -50,7 +50,7 @@ class Signal : public Trace protected: Signal(std::shared_ptr 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 _dev_inst; - const sr_channel *const _probe; + const sr_channel *const _channel; QComboBox *_name_widget; bool _updating_name_widget; diff --git a/pv/widgets/decodermenu.cpp b/pv/widgets/decodermenu.cpp index b90c86d7..60eb8e8a 100644 --- a/pv/widgets/decodermenu.cpp +++ b/pv/widgets/decodermenu.cpp @@ -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)); diff --git a/test/data/logicsnapshot.cpp b/test/data/logicsnapshot.cpp index 5fc17213..7b7d4e7f 100644 --- a/test/data/logicsnapshot.cpp +++ b/test/data/logicsnapshot.cpp @@ -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. *