projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ViewItem: Make paint_label optional
[pulseview.git]
/
pv
/
popups
/
channels.cpp
diff --git
a/pv/popups/channels.cpp
b/pv/popups/channels.cpp
index f8061d9ac2c3514ba72cf2bea5cc06a316373238..ea5f5fbed8d10c91c61dc1d39cca1826030ab81b 100644
(file)
--- a/
pv/popups/channels.cpp
+++ b/
pv/popups/channels.cpp
@@
-20,6
+20,9
@@
#include <map>
#include <map>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/shared_mutex.hpp>
+
#include <QCheckBox>
#include <QFormLayout>
#include <QGridLayout>
#include <QCheckBox>
#include <QFormLayout>
#include <QGridLayout>
@@
-27,11
+30,12
@@
#include "channels.hpp"
#include "channels.hpp"
-#include <pv/prop/binding/deviceoptions.hpp>
-#include <pv/sigsession.hpp>
+#include <pv/binding/device.hpp>
+#include <pv/devices/device.hpp>
+#include <pv/session.hpp>
#include <pv/view/signal.hpp>
#include <pv/view/signal.hpp>
-#include <libsigrok
/libsigrok
.hpp>
+#include <libsigrok
cxx/libsigrokcxx
.hpp>
using namespace Qt;
using namespace Qt;
@@
-42,6
+46,7
@@
using std::map;
using std::mutex;
using std::set;
using std::shared_ptr;
using std::mutex;
using std::set;
using std::shared_ptr;
+using std::unordered_set;
using std::vector;
using sigrok::Channel;
using std::vector;
using sigrok::Channel;
@@
-64,14
+69,13
@@
Channels::Channels(Session &session, QWidget *parent) :
// Create the layout
setLayout(&layout_);
// Create the layout
setLayout(&layout_);
-
shared_ptr<sigrok::Device> device = session_.
device();
+
const shared_ptr<sigrok::Device> device = session_.device()->
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;
- shared_lock<shared_mutex> lock(session_.signals_mutex());
- const vector< shared_ptr<Signal> > &sigs(session_.signals());
+ const unordered_set< 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;
@@
-108,7
+112,7
@@
Channels::Channels(Session &session, QWidget *parent) :
}
// Create a group
}
// Create a group
- populate_group(
NULL
, global_sigs);
+ populate_group(
nullptr
, global_sigs);
// Create the enable/disable all buttons
connect(&enable_all_channels_, SIGNAL(clicked()),
// Create the enable/disable all buttons
connect(&enable_all_channels_, SIGNAL(clicked()),
@@
-151,14
+155,14
@@
void Channels::set_all_channels(bool set)
void Channels::populate_group(shared_ptr<ChannelGroup> group,
const vector< shared_ptr<pv::view::Signal> > sigs)
{
void Channels::populate_group(shared_ptr<ChannelGroup> group,
const vector< shared_ptr<pv::view::Signal> > sigs)
{
- using pv::
prop::binding::DeviceOptions
;
+ using pv::
binding::Device
;
// Only bind options if this is a group. We don't do it for general
// options, because these properties are shown in the device config
// popup.
// Only bind options if this is a group. We don't do it for general
// options, because these properties are shown in the device config
// popup.
- shared_ptr<Device
Options
> binding;
+ shared_ptr<Device> binding;
if (group)
if (group)
- binding = shared_ptr<Device
Options>(new DeviceOptions
(group));
+ binding = shared_ptr<Device
>(new Device
(group));
// Create a title if the group is going to have any content
if ((!sigs.empty() || (binding && !binding->properties().empty())) &&
// Create a title if the group is going to have any content
if ((!sigs.empty() || (binding && !binding->properties().empty())) &&
@@
-198,7
+202,7
@@
QGridLayout* Channels::create_channel_group_grid(
check_box_signal_map_[checkbox] = sig;
check_box_signal_map_[checkbox] = sig;
- if(++col >= 8)
+ if
(++col >= 8)
col = 0, row++;
}
col = 0, row++;
}