X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fpopups%2Fchannels.cpp;h=ea5f5fbed8d10c91c61dc1d39cca1826030ab81b;hb=bf9146988d2298e1750142dccdcf597ef13d6606;hp=c00863b0161dc3dfd4b124f13541c8832c3efcf0;hpb=61703a0124c7ace84caf415f7d491a3ad6f42599;p=pulseview.git diff --git a/pv/popups/channels.cpp b/pv/popups/channels.cpp index c00863b..ea5f5fb 100644 --- a/pv/popups/channels.cpp +++ b/pv/popups/channels.cpp @@ -20,6 +20,9 @@ #include +#include +#include + #include #include #include @@ -27,7 +30,8 @@ #include "channels.hpp" -#include +#include +#include #include #include @@ -42,6 +46,7 @@ using std::map; using std::mutex; using std::set; using std::shared_ptr; +using std::unordered_set; using std::vector; using sigrok::Channel; @@ -64,14 +69,13 @@ Channels::Channels(Session &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 +112,7 @@ Channels::Channels(Session &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 +155,14 @@ void Channels::set_all_channels(bool set) void Channels::populate_group(shared_ptr group, const vector< shared_ptr > sigs) { - using pv::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 +202,7 @@ QGridLayout* Channels::create_channel_group_grid( check_box_signal_map_[checkbox] = sig; - if(++col >= 8) + if (++col >= 8) col = 0, row++; }