]> sigrok.org Git - pulseview.git/commitdiff
Fix #404 by only saving enabled signals
authorSoeren Apel <redacted>
Fri, 31 Jul 2015 06:22:40 +0000 (08:22 +0200)
committerSoeren Apel <redacted>
Fri, 31 Jul 2015 06:22:40 +0000 (08:22 +0200)
pv/storesession.cpp

index e4af5db7bcf40d8b123449a676e472c814f3c9d2..a3d745b387834e4f76a2516164ca0aa48540125e 100644 (file)
@@ -91,12 +91,15 @@ const QString& StoreSession::error() const
 
 bool StoreSession::start()
 {
-       set< shared_ptr<data::SignalData> > data_set =
-               session_.get_data();
-
        shared_lock<shared_mutex> lock(session_.signals_mutex());
-       const unordered_set< shared_ptr<view::Signal> > &sigs(
-               session_.signals());
+       unordered_set< shared_ptr<view::Signal> > sigs(session_.signals());
+
+       // Add enabled channels to the data set
+       set< shared_ptr<data::SignalData> > data_set;
+
+       for (shared_ptr<view::Signal> signal : sigs)
+               if (signal->enabled())
+                       data_set.insert(signal->data());
 
        // Check we have logic data
        if (data_set.empty() || sigs.empty()) {
@@ -114,7 +117,7 @@ bool StoreSession::start()
        shared_ptr<data::Logic> data;
        if (!(data = dynamic_pointer_cast<data::Logic>(*data_set.begin()))) {
                error_ = tr("PulseView currently only has support for "
-                       "storing logic data.");
+                       "storing logic data.");
                return false;
        }