projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SigSession: Added signals_mutex(), and made signals() give a reference
[pulseview.git]
/
pv
/
popups
/
channels.cpp
diff --git
a/pv/popups/channels.cpp
b/pv/popups/channels.cpp
index 5a854453c3eebf1d78e27c5b7a205b45fe4e8656..9afc3b48952754047eecce46b3f7aefb2630beb8 100644
(file)
--- a/
pv/popups/channels.cpp
+++ b/
pv/popups/channels.cpp
@@
-35,7
+35,9
@@
using namespace Qt;
using namespace Qt;
+using std::lock_guard;
using std::map;
using std::map;
+using std::mutex;
using std::set;
using std::shared_ptr;
using std::vector;
using std::set;
using std::shared_ptr;
using std::vector;
@@
-60,12
+62,14
@@
Channels::Channels(SigSession &session, QWidget *parent) :
// Create the layout
setLayout(&_layout);
// Create the layout
setLayout(&_layout);
- shared_ptr<sigrok::Device> device = _session.
get_
device();
+ shared_ptr<sigrok::Device> device = _session.device();
assert(device);
// Collect a set of signals
map<shared_ptr<Channel>, shared_ptr<Signal> > signal_map;
assert(device);
// Collect a set of signals
map<shared_ptr<Channel>, shared_ptr<Signal> > signal_map;
- const vector< shared_ptr<Signal> > sigs = _session.get_signals();
+
+ lock_guard<mutex> lock(_session.signals_mutex());
+ const vector< shared_ptr<Signal> > &sigs(_session.signals());
for (const shared_ptr<Signal> &sig : sigs)
signal_map[sig->channel()] = sig;
for (const shared_ptr<Signal> &sig : sigs)
signal_map[sig->channel()] = sig;
@@
-183,7
+187,7
@@
QGridLayout* Channels::create_channel_group_grid(
{
assert(sig);
{
assert(sig);
- QCheckBox *const checkbox = new QCheckBox(sig->
get_
name());
+ QCheckBox *const checkbox = new QCheckBox(sig->name());
_check_box_mapper.setMapping(checkbox, checkbox);
connect(checkbox, SIGNAL(toggled(bool)),
&_check_box_mapper, SLOT(map()));
_check_box_mapper.setMapping(checkbox, checkbox);
connect(checkbox, SIGNAL(toggled(bool)),
&_check_box_mapper, SLOT(map()));