X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fstoresession.cpp;h=eaa17ea5f98096519f88f44be1373a8a697c171c;hp=f8ab2e69bc78c1a2ed985e86d176c662b56084d3;hb=09f55d9665efb3b17ba7de4bae47be6989e884fe;hpb=bf0edd2b0cbb5f4bd5d69b0f00bcea7d037e2287
diff --git a/pv/storesession.cpp b/pv/storesession.cpp
index f8ab2e69..eaa17ea5 100644
--- a/pv/storesession.cpp
+++ b/pv/storesession.cpp
@@ -14,8 +14,7 @@
* 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
+ * along with this program; if not, see .
*/
#include
@@ -38,7 +37,6 @@
#include
#include
#include
-#include
#include
@@ -63,6 +61,7 @@ using std::vector;
using Glib::VariantBase;
+using sigrok::ChannelType;
using sigrok::ConfigKey;
using sigrok::Error;
using sigrok::OutputFormat;
@@ -106,22 +105,20 @@ const QString& StoreSession::error() const
bool StoreSession::start()
{
- const unordered_set< shared_ptr > sigs(session_.signals());
+ const unordered_set< shared_ptr > sigs(session_.signalbases());
shared_ptr any_segment;
shared_ptr lsegment;
vector< shared_ptr > achannel_list;
vector< shared_ptr > asegment_list;
- for (shared_ptr signal : sigs) {
+ for (shared_ptr signal : sigs) {
if (!signal->enabled())
continue;
- shared_ptr data = signal->data();
-
- if (dynamic_pointer_cast(data)) {
+ if (signal->type() == ChannelType::LOGIC) {
// All logic channels share the same data segments
- shared_ptr ldata = dynamic_pointer_cast(data);
+ shared_ptr ldata = signal->logic_data();
const deque< shared_ptr > &lsegments =
ldata->logic_segments();
@@ -135,10 +132,9 @@ bool StoreSession::start()
any_segment = lsegment;
}
- if (dynamic_pointer_cast(data)) {
+ if (signal->type() == ChannelType::ANALOG) {
// Each analog channel has its own segments
- shared_ptr adata =
- dynamic_pointer_cast(data);
+ shared_ptr adata = signal->analog_data();
const deque< shared_ptr > &asegments =
adata->analog_segments();
@@ -151,7 +147,7 @@ bool StoreSession::start()
asegment_list.push_back(asegments.front());
any_segment = asegments.front();
- achannel_list.push_back(signal->channel());
+ achannel_list.push_back(signal);
}
}
@@ -304,6 +300,7 @@ void StoreSession::store_proc(vector< shared_ptr > achannel_li
// Zeroing the progress variables indicates completion
units_stored_ = unit_count_ = 0;
+ store_successful();
progress_updated();
output_.reset();