X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdevicemanager.cpp;h=ac6ce6fb433da3fa29eefa9ba551c043c70f63b5;hp=540f88150e4cf117be1ca1fa12762e8b734f3943;hb=941e22a645e89e7253f0faeb63b74ee97201dd91;hpb=724f29f311db4f8b47169e58f3f3b50e6a50ed08 diff --git a/pv/devicemanager.cpp b/pv/devicemanager.cpp index 540f8815..ac6ce6fb 100644 --- a/pv/devicemanager.cpp +++ b/pv/devicemanager.cpp @@ -68,20 +68,7 @@ DeviceManager::DeviceManager(shared_ptr context) : progress->setLabelText(QObject::tr("Scanning for %1...") .arg(QString::fromStdString(entry.first))); - /** - * We currently only support devices that can deliver - * samples at a fixed samplerate i.e. oscilloscopes and - * logic analysers. - * @todo Add support for non-monotonic devices i.e. DMMs - * and sensors. - */ - const auto keys = (entry.second)->config_keys(); - - bool supported_device = keys.count(ConfigKey::LOGIC_ANALYZER) | - keys.count(ConfigKey::OSCILLOSCOPE); - - if (supported_device) - driver_scan(entry.second, map()); + driver_scan(entry.second, map()); progress->setValue(entry_num++); QApplication::processEvents(); @@ -114,6 +101,18 @@ DeviceManager::driver_scan( assert(driver); + /* + * We currently only support devices that can deliver samples at + * a fixed samplerate (i.e. oscilloscopes and logic analysers). + * + * @todo Add support for non-monotonic devices (DMMs, sensors, etc). + */ + const auto keys = driver->config_keys(); + bool supported_device = keys.count(ConfigKey::LOGIC_ANALYZER) | + keys.count(ConfigKey::OSCILLOSCOPE); + if (!supported_device) + return driver_devices; + // Remove any device instances from this driver from the device // list. They will not be valid after the scan. devices_.remove_if([&](shared_ptr device) {