]> sigrok.org Git - pulseview.git/commitdiff
Use presence of logic/analog data as indicator of channel type
authorSoeren Apel <redacted>
Wed, 15 Mar 2017 18:22:17 +0000 (19:22 +0100)
committerSoeren Apel <redacted>
Wed, 22 Mar 2017 21:46:26 +0000 (22:46 +0100)
However, don't do this for the StoreSession. Reason is that we
only want to save the original data and not treat any converted
data as its own channel.

pv/session.cpp
pv/view/decodetrace.cpp

index 2712af1200ab12082bb400c50d0e3f493b0ee5c5..f5f1e4974b6ea155dcdb923924a05c0fef4077c3 100644 (file)
@@ -637,7 +637,7 @@ bool Session::add_decoder(srd_decoder *const dec)
                // Auto select the initial channels
                for (const srd_channel *pdch : all_channels)
                        for (shared_ptr<data::SignalBase> b : signalbases_) {
-                               if (b->type() == data::SignalBase::LogicChannel) {
+                               if (b->logic_data()) {
                                        if (QString::fromUtf8(pdch->name).toLower().
                                                contains(b->name().toLower()))
                                                channels[pdch] = b;
index 5944fd6430876471f1976c3e992318fc9419ae86..0d8a0edbb993ab5982c901dca4c7f4fdfbf6f408 100644 (file)
@@ -877,7 +877,7 @@ QComboBox* DecodeTrace::create_channel_selector(
 
        for (const shared_ptr<data::SignalBase> &b : sig_list) {
                assert(b);
-               if (b->type() == data::SignalBase::LogicChannel && b->enabled()) {
+               if (b->logic_data() && b->enabled()) {
                        selector->addItem(b->name(),
                                qVariantFromValue((void*)b.get()));