projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update to new configuration API.
[pulseview.git]
/
pv
/
binding
/
device.cpp
diff --git
a/pv/binding/device.cpp
b/pv/binding/device.cpp
index 7547a46b341b33d3f472c2fce56812fa491fbe9c..026ca16c6b49354f5e51cbbe89b59a1c09f5bf86 100644
(file)
--- a/
pv/binding/device.cpp
+++ b/
pv/binding/device.cpp
@@
-56,11
+56,12
@@
namespace binding {
Device::Device(shared_ptr<sigrok::Configurable> configurable) :
configurable_(configurable)
{
Device::Device(shared_ptr<sigrok::Configurable> configurable) :
configurable_(configurable)
{
- assert(configurable);
- for (auto entry : configurable->config_keys(ConfigKey::DEVICE_OPTIONS)) {
- auto key = entry.first;
- auto capabilities = entry.second;
+ auto keys = configurable->config_keys();
+
+ for (auto key : keys) {
+
+ auto capabilities = configurable->config_capabilities(key);
if (!capabilities.count(Capability::GET) ||
!capabilities.count(Capability::SET))
if (!capabilities.count(Capability::GET) ||
!capabilities.count(Capability::SET))
@@
-82,8
+83,7
@@
Device::Device(shared_ptr<sigrok::Configurable> configurable) :
config_changed();
};
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
case SR_CONF_SAMPLERATE:
// Sample rate values are not bound because they are shown
// in the MainBar
@@
-106,6
+106,7
@@
Device::Device(shared_ptr<sigrok::Configurable> configurable) :
case SR_CONF_EXTERNAL_CLOCK:
case SR_CONF_RLE:
case SR_CONF_EXTERNAL_CLOCK:
case SR_CONF_RLE:
+ case SR_CONF_POWER_OFF:
bind_bool(name, get, set);
break;
bind_bool(name, get, set);
break;
@@
-121,6
+122,10
@@
Device::Device(shared_ptr<sigrok::Configurable> configurable) :
bind_enum(name, key, capabilities, get, set, print_voltage_threshold);
break;
bind_enum(name, key, capabilities, get, set, print_voltage_threshold);
break;
+ case SR_CONF_PROBE_FACTOR:
+ bind_int(name, "", pair<int64_t, int64_t>(1, 500), get, set);
+ break;
+
default:
break;
}
default:
break;
}
@@
-136,7
+141,7
@@
void Device::bind_bool(const QString &name,
}
void Device::bind_enum(const QString &name,
}
void Device::bind_enum(const QString &name,
- const ConfigKey *key, std::set<
Capability
> capabilities,
+ const ConfigKey *key, std::set<
const Capability *
> capabilities,
Property::Getter getter,
Property::Setter setter, function<QString (Glib::VariantBase)> printer)
{
Property::Getter getter,
Property::Setter setter, function<QString (Glib::VariantBase)> printer)
{