projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a mechanism to make ViewItem classes immovable.
[pulseview.git]
/
pv
/
popups
/
channels.cpp
diff --git
a/pv/popups/channels.cpp
b/pv/popups/channels.cpp
index 61a8aee071b382e9fc626a89ec08e2cda7975213..bffd0dfefbb15e6182b6c4ed54ee5ae9ac3dbd27 100644
(file)
--- a/
pv/popups/channels.cpp
+++ b/
pv/popups/channels.cpp
@@
-20,6
+20,14
@@
#include <map>
#include <map>
+#ifdef _WIN32
+// Windows: Avoid boost/thread namespace pollution (which includes windows.h).
+#define NOGDI
+#define NORESOURCE
+#endif
+#include <boost/thread/locks.hpp>
+#include <boost/thread/shared_mutex.hpp>
+
#include <QCheckBox>
#include <QFormLayout>
#include <QGridLayout>
#include <QCheckBox>
#include <QFormLayout>
#include <QGridLayout>
@@
-28,6
+36,7
@@
#include "channels.hpp"
#include <pv/binding/device.hpp>
#include "channels.hpp"
#include <pv/binding/device.hpp>
+#include <pv/devices/device.hpp>
#include <pv/session.hpp>
#include <pv/view/signal.hpp>
#include <pv/session.hpp>
#include <pv/view/signal.hpp>
@@
-42,6
+51,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
+74,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
+117,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()),
@@
-198,7
+207,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++;
}