X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fsigsession.cpp;h=719f9ded3610b948438c65a2ebda098d76555f53;hb=fe15e0bc0503b8eecd503c1685031be3e4ef12cf;hp=8936574a4e238c3f9b3fa65afce4a92985bdee8c;hpb=7491a29f33471b38e161b3254f4d8e708b05f929;p=pulseview.git diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 8936574..719f9de 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -18,7 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef ENABLE_DECODE #include +#endif #include "sigsession.h" @@ -45,8 +47,14 @@ #include -using namespace boost; -using namespace std; +using boost::dynamic_pointer_cast; +using boost::function; +using boost::lock_guard; +using boost::mutex; +using boost::shared_ptr; +using std::map; +using std::string; +using std::vector; namespace pv { @@ -83,6 +91,9 @@ struct sr_dev_inst* SigSession::get_device() const void SigSession::set_device(struct sr_dev_inst *sdi) { + // Ensure we are not capturing before setting the device + stop_capture(); + if (_sdi) _device_manager.release_device(_sdi); if (sdi) @@ -118,6 +129,7 @@ void SigSession::load_file(const string &name, sr_dev_inst *const sdi = (sr_dev_inst*)devlist->data; g_slist_free(devlist); + _decode_traces.clear(); update_signals(sdi); read_sample_rate(sdi); @@ -132,6 +144,7 @@ void SigSession::load_file(const string &name, error_handler))) return; + _decode_traces.clear(); update_signals(in->sdi); read_sample_rate(in->sdi); @@ -200,6 +213,7 @@ boost::shared_ptr SigSession::get_data() return _logic_data; } +#ifdef ENABLE_DECODE bool SigSession::add_decoder(srd_decoder *const dec) { map > probes; @@ -221,7 +235,8 @@ bool SigSession::add_decoder(srd_decoder *const dec) { shared_ptr l = dynamic_pointer_cast(s); - if (l && QString(probe->name).toLower().contains( + if (l && QString::fromUtf8(probe->name). + toLower().contains( l->get_name().toLower())) probes[probe] = l; } @@ -270,6 +285,7 @@ void SigSession::remove_decode_signal(view::DecodeTrace *signal) return; } } +#endif void SigSession::set_capture_state(capture_state state) {