X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fbinding%2Fdevice.cpp;h=27a1a38adee15877bb1c0eefe162a4566fa9b7d5;hb=0623eb8c7d596c8507f6c69263990973ba65f70c;hp=6f9788932c8dd0d4377d98771cee69ad6b6760e3;hpb=1e1b3a668e6f3462d45c2047484dc1b86f41da51;p=pulseview.git diff --git a/pv/binding/device.cpp b/pv/binding/device.cpp index 6f97889..27a1a38 100644 --- a/pv/binding/device.cpp +++ b/pv/binding/device.cpp @@ -56,17 +56,12 @@ namespace binding { Device::Device(shared_ptr configurable) : configurable_(configurable) { - std::map< const ConfigKey*, std::set > keys; - try { - keys = configurable->config_keys(ConfigKey::DEVICE_OPTIONS); - } catch (const Error) { - return; - } + auto keys = configurable->config_keys(); + + for (auto key : keys) { - for (auto entry : keys) { - auto key = entry.first; - auto capabilities = entry.second; + auto capabilities = configurable->config_capabilities(key); if (!capabilities.count(Capability::GET) || !capabilities.count(Capability::SET)) @@ -88,8 +83,7 @@ Device::Device(shared_ptr configurable) : config_changed(); }; - switch (key->id()) - { + switch (key->id()) { case SR_CONF_SAMPLERATE: // Sample rate values are not bound because they are shown // in the MainBar @@ -104,12 +98,12 @@ Device::Device(shared_ptr configurable) : case SR_CONF_BUFFERSIZE: case SR_CONF_TRIGGER_SOURCE: case SR_CONF_TRIGGER_SLOPE: - case SR_CONF_FILTER: case SR_CONF_COUPLING: case SR_CONF_CLOCK_EDGE: bind_enum(name, key, capabilities, get, set); break; + case SR_CONF_FILTER: case SR_CONF_EXTERNAL_CLOCK: case SR_CONF_RLE: case SR_CONF_POWER_OFF: @@ -147,7 +141,7 @@ void Device::bind_bool(const QString &name, } void Device::bind_enum(const QString &name, - const ConfigKey *key, std::set capabilities, + const ConfigKey *key, std::set capabilities, Property::Getter getter, Property::Setter setter, function printer) {