]> sigrok.org Git - pulseview.git/commitdiff
DeviceManager: Don't perform scans with DMM drivers
authorSoeren Apel <redacted>
Fri, 9 Jun 2017 22:57:48 +0000 (00:57 +0200)
committerSoeren Apel <redacted>
Fri, 9 Jun 2017 22:57:48 +0000 (00:57 +0200)
pv/devicemanager.cpp

index 58f507c92fae06c2cd2b84dfce474a5dfc5638de..540f88150e4cf117be1ca1fa12762e8b734f3943 100644 (file)
@@ -68,7 +68,20 @@ DeviceManager::DeviceManager(shared_ptr<Context> context) :
                progress->setLabelText(QObject::tr("Scanning for %1...")
                        .arg(QString::fromStdString(entry.first)));
 
-               driver_scan(entry.second, map<const ConfigKey *, VariantBase>());
+               /**
+                * 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<const ConfigKey *, VariantBase>());
 
                progress->setValue(entry_num++);
                QApplication::processEvents();