X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fpopups%2Fchannels.cpp;h=bffd0dfefbb15e6182b6c4ed54ee5ae9ac3dbd27;hp=beacfb436d8eaf0166522e233ca822316277716c;hb=35750e4dc619d538f105ed024f3a72b630108234;hpb=8dbbc7f0b9ea59d0f0d62225772f8a56eee125f5 diff --git a/pv/popups/channels.cpp b/pv/popups/channels.cpp index beacfb43..bffd0dfe 100644 --- a/pv/popups/channels.cpp +++ b/pv/popups/channels.cpp @@ -20,18 +20,27 @@ #include +#ifdef _WIN32 +// Windows: Avoid boost/thread namespace pollution (which includes windows.h). +#define NOGDI +#define NORESOURCE +#endif +#include +#include + #include #include #include #include -#include "channels.h" +#include "channels.hpp" -#include -#include -#include +#include +#include +#include +#include -#include +#include using namespace Qt; @@ -42,6 +51,7 @@ using std::map; using std::mutex; using std::set; using std::shared_ptr; +using std::unordered_set; using std::vector; using sigrok::Channel; @@ -53,7 +63,7 @@ using pv::view::Signal; namespace pv { namespace popups { -Channels::Channels(SigSession &session, QWidget *parent) : +Channels::Channels(Session &session, QWidget *parent) : Popup(parent), session_(session), updating_channels_(false), @@ -64,14 +74,13 @@ Channels::Channels(SigSession &session, QWidget *parent) : // Create the layout setLayout(&layout_); - shared_ptr device = session_.device(); + const shared_ptr device = session_.device()->device(); assert(device); // Collect a set of signals map, shared_ptr > signal_map; - shared_lock lock(session_.signals_mutex()); - const vector< shared_ptr > &sigs(session_.signals()); + const unordered_set< shared_ptr > sigs(session_.signals()); for (const shared_ptr &sig : sigs) signal_map[sig->channel()] = sig; @@ -108,7 +117,7 @@ Channels::Channels(SigSession &session, QWidget *parent) : } // 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()), @@ -151,14 +160,14 @@ void Channels::set_all_channels(bool set) void Channels::populate_group(shared_ptr group, const vector< shared_ptr > 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. - shared_ptr binding; + shared_ptr binding; if (group) - binding = shared_ptr(new DeviceOptions(group)); + binding = shared_ptr(new Device(group)); // Create a title if the group is going to have any content if ((!sigs.empty() || (binding && !binding->properties().empty())) && @@ -198,7 +207,7 @@ QGridLayout* Channels::create_channel_group_grid( check_box_signal_map_[checkbox] = sig; - if(++col >= 8) + if (++col >= 8) col = 0, row++; }