* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <boost/foreach.hpp>
+#include <cassert>
#include <libsigrok/libsigrok.h>
#include "connect.h"
#include "pv/devicemanager.h"
-#include "pv/devinst.h"
+#include "pv/device/device.h"
extern "C" {
/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
#include <libsigrok/libsigrok.h>
}
-using boost::shared_ptr;
using std::list;
+using std::shared_ptr;
using std::string;
extern sr_context *sr_ctx;
_layout.addWidget(&_button_box);
}
-shared_ptr<DevInst> Connect::get_selected_device() const
+shared_ptr<device::Device> Connect::get_selected_device() const
{
const QListWidgetItem *const item = _device_list.currentItem();
if (!item)
- return shared_ptr<DevInst>();
+ return shared_ptr<device::Device>();
const sr_dev_inst *const sdi = (sr_dev_inst*)item->data(
Qt::UserRole).value<void*>();
assert(sdi);
- std::map<const sr_dev_inst*, boost::shared_ptr<pv::DevInst> >::
- const_iterator iter = _device_map.find(sdi);
+ const auto iter = _device_map.find(sdi);
assert(iter != _device_map.end());
return (*iter).second;
hwopts = (const int32_t *)g_variant_get_fixed_array(gvar_opts,
&num_opts, sizeof(int32_t));
for (unsigned int j = 0; j < num_opts; j++)
- if (hwopts[j] == SR_CONF_SAMPLERATE) {
+ if ((hwopts[j] & SR_CONF_MASK) == SR_CONF_SAMPLERATE) {
supported_device = true;
break;
}
drvopts = g_slist_append(drvopts, src);
}
- const list< shared_ptr<DevInst> > devices = _device_manager.driver_scan(
- driver, drvopts);
+ const list< shared_ptr<device::Device> > devices =
+ _device_manager.driver_scan(driver, drvopts);
g_slist_free_full(drvopts, (GDestroyNotify)free_drvopts);
- BOOST_FOREACH(shared_ptr<DevInst> dev_inst, devices)
+ for (shared_ptr<device::Device> dev_inst : devices)
{
assert(dev_inst);
const sr_dev_inst *const sdi = dev_inst->dev_inst();
const string title = dev_inst->format_device_title();
QString text = QString::fromUtf8(title.c_str());
- if (sdi->probes) {
- text += QString(" with %1 probes").arg(
- g_slist_length(sdi->probes));
+ if (sdi->channels) {
+ text += QString(" with %1 channels").arg(
+ g_slist_length(sdi->channels));
}
QListWidgetItem *const item = new QListWidgetItem(text,