X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fprop%2Fbinding%2Fdeviceoptions.cpp;h=f71cbac2a42aeb57a3db42d4377b973346e679d5;hp=50af3ed4ffdec51a09565537a997f2578f2d366b;hb=a2b921574b467fd9193d06497bf0ee058e8f7470;hpb=0d600d54070777aa706dbad1d2bbd5191e953cbb diff --git a/pv/prop/binding/deviceoptions.cpp b/pv/prop/binding/deviceoptions.cpp index 50af3ed4..f71cbac2 100644 --- a/pv/prop/binding/deviceoptions.cpp +++ b/pv/prop/binding/deviceoptions.cpp @@ -30,6 +30,7 @@ #include #include #include +#include using namespace boost; using namespace std; @@ -71,6 +72,10 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) : bind_samplerate(name, gvar_list); break; + case SR_CONF_CAPTURE_RATIO: + bind_int(name, key, "%", make_pair(0L, 100L)); + break; + case SR_CONF_PATTERN_MODE: case SR_CONF_BUFFERSIZE: case SR_CONF_TRIGGER_SOURCE: @@ -143,6 +148,15 @@ void DeviceOptions::bind_enum(const QString &name, int key, bind(config_setter, _sdi, key, _1)))); } +void DeviceOptions::bind_int(const QString &name, int key, QString suffix, + optional< std::pair > range) +{ + _properties.push_back(shared_ptr( + new Int(name, suffix, range, + bind(config_getter, _sdi, key), + bind(config_setter, _sdi, key, _1)))); +} + QString DeviceOptions::print_gvariant(GVariant *const gvar) { QString s;