X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fstoresession.cpp;h=eaa17ea5f98096519f88f44be1373a8a697c171c;hp=00f6af63ed0a9e1374e673bbc5adfb22e9db3b54;hb=09f55d9665efb3b17ba7de4bae47be6989e884fe;hpb=73a25a6e488f1813c1cd12da085a16e4f91ed4da;ds=sidebyside diff --git a/pv/storesession.cpp b/pv/storesession.cpp index 00f6af63..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->base()); + 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();