projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved DevInst into the pv::device namespace
[pulseview.git]
/
pv
/
sigsession.cpp
diff --git
a/pv/sigsession.cpp
b/pv/sigsession.cpp
index 10ea4ffbea6dc1ad4e171b9054289e938fad66f0..622bf8d2c5b4dedf18143df7e5824282178c4995 100644
(file)
--- a/
pv/sigsession.cpp
+++ b/
pv/sigsession.cpp
@@
-25,7
+25,7
@@
#include "sigsession.h"
#include "devicemanager.h"
#include "sigsession.h"
#include "devicemanager.h"
-#include "devinst.h"
+#include "devi
ce/devi
nst.h"
#include "data/analog.h"
#include "data/analogsnapshot.h"
#include "data/analog.h"
#include "data/analogsnapshot.h"
@@
-75,7
+75,8
@@
SigSession::~SigSession()
{
stop_capture();
{
stop_capture();
- _sampling_thread.join();
+ if (_sampling_thread.joinable())
+ _sampling_thread.join();
if (_dev_inst)
_device_manager.release_device(_dev_inst);
if (_dev_inst)
_device_manager.release_device(_dev_inst);
@@
-84,12
+85,12
@@
SigSession::~SigSession()
_session = NULL;
}
_session = NULL;
}
-shared_ptr<DevInst> SigSession::get_device() const
+shared_ptr<
device::
DevInst> SigSession::get_device() const
{
return _dev_inst;
}
{
return _dev_inst;
}
-void SigSession::set_device(shared_ptr<DevInst> dev_inst)
+void SigSession::set_device(shared_ptr<
device::
DevInst> dev_inst)
{
// Ensure we are not capturing before setting the device
stop_capture();
{
// Ensure we are not capturing before setting the device
stop_capture();
@@
-102,12
+103,12
@@
void SigSession::set_device(shared_ptr<DevInst> dev_inst)
update_signals(dev_inst);
}
update_signals(dev_inst);
}
-void SigSession::release_device(shared_ptr<DevInst> dev_inst)
+void SigSession::release_device(shared_ptr<
device::
DevInst> dev_inst)
{
(void)dev_inst;
assert(_capture_state == Stopped);
{
(void)dev_inst;
assert(_capture_state == Stopped);
- _dev_inst = shared_ptr<DevInst>();
+ _dev_inst = shared_ptr<
device::
DevInst>();
}
void SigSession::load_file(const string &name,
}
void SigSession::load_file(const string &name,
@@
-125,8
+126,8
@@
void SigSession::load_file(const string &name,
return;
}
return;
}
- shared_ptr<DevInst> dev_inst(
- new DevInst((sr_dev_inst*)devlist->data));
+ shared_ptr<
device::
DevInst> dev_inst(
+ new
device::
DevInst((sr_dev_inst*)devlist->data));
g_slist_free(devlist);
_decode_traces.clear();
g_slist_free(devlist);
_decode_traces.clear();
@@
-145,7
+146,8
@@
void SigSession::load_file(const string &name,
return;
_decode_traces.clear();
return;
_decode_traces.clear();
- update_signals(shared_ptr<DevInst>(new DevInst(in->sdi)));
+ update_signals(shared_ptr<device::DevInst>(
+ new device::DevInst(in->sdi)));
read_sample_rate(in->sdi);
_sampling_thread = boost::thread(
read_sample_rate(in->sdi);
_sampling_thread = boost::thread(
@@
-200,7
+202,8
@@
void SigSession::stop_capture()
sr_session_stop();
// Check that sampling stopped
sr_session_stop();
// Check that sampling stopped
- _sampling_thread.join();
+ if (_sampling_thread.joinable())
+ _sampling_thread.join();
}
set< shared_ptr<data::SignalData> > SigSession::get_data() const
}
set< shared_ptr<data::SignalData> > SigSession::get_data() const
@@
-384,7
+387,7
@@
sr_input* SigSession::load_input_file_format(const string &filename,
return in;
}
return in;
}
-void SigSession::update_signals(shared_ptr<DevInst> dev_inst)
+void SigSession::update_signals(shared_ptr<
device::
DevInst> dev_inst)
{
assert(dev_inst);
assert(_capture_state == Stopped);
{
assert(dev_inst);
assert(_capture_state == Stopped);
@@
-566,7
+569,7
@@
void SigSession::load_input_thread_proc(const string name,
delete in;
}
delete in;
}
-void SigSession::sample_thread_proc(shared_ptr<DevInst> dev_inst,
+void SigSession::sample_thread_proc(shared_ptr<
device::
DevInst> dev_inst,
function<void (const QString)> error_handler)
{
assert(dev_inst);
function<void (const QString)> error_handler)
{
assert(dev_inst);