Update for 'probe_group' -> 'channel_group' rename in libsigrok.
[pulseview.git] / pv / popups / probes.cpp
index fa0d488de35a3b7c55b64b3fed91efe38faccdc4..2e1e59249b746b3cc86adc50a1e9e6b2af4708f0 100644 (file)
 
 #include <map>
 
+#include <boost/foreach.hpp>
+
+#include <QCheckBox>
 #include <QFormLayout>
 #include <QGridLayout>
+#include <QLabel>
 
 #include "probes.h"
 
+#include <pv/device/devinst.h>
 #include <pv/prop/binding/deviceoptions.h>
 #include <pv/sigsession.h>
 #include <pv/view/signal.h>
@@ -52,7 +57,9 @@ Probes::Probes(SigSession &session, QWidget *parent) :
        // Create the layout
        setLayout(&_layout);
 
-       sr_dev_inst *const sdi = _session.get_device();
+       shared_ptr<device::DevInst> dev_inst = _session.get_device();
+       assert(dev_inst);
+       const sr_dev_inst *const sdi = dev_inst->dev_inst();
        assert(sdi);
 
        // Collect a set of signals
@@ -61,11 +68,11 @@ Probes::Probes(SigSession &session, QWidget *parent) :
        BOOST_FOREACH(const shared_ptr<Signal> &sig, sigs)
                signal_map[sig->probe()] = sig;
 
-       // Populate probe groups
-       for (const GSList *g = sdi->probe_groups; g; g = g->next)
+       // Populate channel groups
+       for (const GSList *g = sdi->channel_groups; g; g = g->next)
        {
-               const sr_probe_group *const group =
-                       (const sr_probe_group*)g->data;
+               const sr_channel_group *const group =
+                       (const sr_channel_group*)g->data;
                assert(group);
 
                // Make a set of signals, and removed this signals from the
@@ -141,7 +148,7 @@ void Probes::set_all_probes(bool set)
        _updating_probes = false;
 }
 
-void Probes::populate_group(const sr_probe_group *group,
+void Probes::populate_group(const sr_channel_group *group,
        const vector< shared_ptr<pv::view::Signal> > sigs)
 {
        using pv::prop::binding::DeviceOptions;
@@ -160,12 +167,12 @@ void Probes::populate_group(const sr_probe_group *group,
                _layout.addRow(new QLabel(
                        QString("<h3>%1</h3>").arg(group->name)));
 
-       // Create the probe group grid
+       // Create the channel group grid
        QGridLayout *const probe_grid =
-               create_probe_group_grid(sigs);
+               create_channel_group_grid(sigs);
        _layout.addRow(probe_grid);
 
-       // Create the probe group options
+       // Create the channel group options
        if (binding)
        {
                binding->add_properties_to_form(&_layout, true);
@@ -173,7 +180,7 @@ void Probes::populate_group(const sr_probe_group *group,
        }
 }
 
-QGridLayout* Probes::create_probe_group_grid(
+QGridLayout* Probes::create_channel_group_grid(
        const vector< shared_ptr<pv::view::Signal> > sigs)
 {
        int row = 0, col = 0;