From 4c7a19d3d7049bcc9fb3185ce2bc91333a7ca9e1 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Sat, 10 Jun 2017 00:57:48 +0200 Subject: [PATCH] DeviceManager: Don't perform scans with DMM drivers --- pv/devicemanager.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pv/devicemanager.cpp b/pv/devicemanager.cpp index 58f507c9..540f8815 100644 --- a/pv/devicemanager.cpp +++ b/pv/devicemanager.cpp @@ -68,7 +68,20 @@ DeviceManager::DeviceManager(shared_ptr context) : progress->setLabelText(QObject::tr("Scanning for %1...") .arg(QString::fromStdString(entry.first))); - driver_scan(entry.second, map()); + /** + * 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()); progress->setValue(entry_num++); QApplication::processEvents(); -- 2.30.2