projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests/CMakeLists.txt: Add missing boost-thread check.
[pulseview.git]
/
pv
/
sigsession.cpp
diff --git
a/pv/sigsession.cpp
b/pv/sigsession.cpp
index dacf65e56b55df4c8266d603928c86c0ce02a6fc..e81d36051fa068e361eafb01c18ef3aeee02caaa 100644
(file)
--- a/
pv/sigsession.cpp
+++ b/
pv/sigsession.cpp
@@
-34,6
+34,8
@@
#include <assert.h>
#include <assert.h>
+#include <stdexcept>
+
#include <sys/stat.h>
#include <QDebug>
#include <sys/stat.h>
#include <QDebug>
@@
-193,20
+195,15
@@
boost::shared_ptr<data::Logic> SigSession::get_data()
return _logic_data;
}
return _logic_data;
}
-
void
SigSession::add_decoder(srd_decoder *const dec,
+
bool
SigSession::add_decoder(srd_decoder *const dec,
std::map<const srd_probe*,
boost::shared_ptr<view::Signal> > probes,
GHashTable *options)
{
std::map<const srd_probe*,
boost::shared_ptr<view::Signal> > probes,
GHashTable *options)
{
+ try
{
lock_guard<mutex> lock(_signals_mutex);
{
lock_guard<mutex> lock(_signals_mutex);
- if (!_decode_traces.empty()) {
- qDebug("Currently only one decode trace can be added "
- "at once");
- _decode_traces.clear();
- }
-
shared_ptr<data::Decoder> decoder(
new data::Decoder(dec, probes, options));
shared_ptr<view::DecodeSignal> d(
shared_ptr<data::Decoder> decoder(
new data::Decoder(dec, probes, options));
shared_ptr<view::DecodeSignal> d(
@@
-214,7
+211,14
@@
void SigSession::add_decoder(srd_decoder *const dec,
_decode_traces.size()));
_decode_traces.push_back(d);
}
_decode_traces.size()));
_decode_traces.push_back(d);
}
+ catch(std::runtime_error e)
+ {
+ return false;
+ }
+
signals_changed();
signals_changed();
+
+ return true;
}
vector< shared_ptr<view::DecodeSignal> > SigSession::get_decode_signals() const
}
vector< shared_ptr<view::DecodeSignal> > SigSession::get_decode_signals() const
@@
-378,8
+382,7
@@
void SigSession::update_signals(const sr_dev_inst *const sdi)
if(sdi) {
for (const GSList *l = sdi->probes; l; l = l->next) {
if(sdi) {
for (const GSList *l = sdi->probes; l; l = l->next) {
- const sr_probe *const probe =
- (const sr_probe *)l->data;
+ sr_probe *const probe = (sr_probe *)l->data;
assert(probe);
switch(probe->type) {
assert(probe);
switch(probe->type) {