X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fprop%2Fbinding%2Fdeviceoptions.h;h=445361fd6f80467421d2e90c303719643862268f;hp=c2c2917536ab019511f2c4cb71b53cea5f8165d7;hb=2445160a5d1eb98196d2a1d57246d4c37dd13811;hpb=fd3783c82e3db7ef42227051e480d4f2f7faacbf diff --git a/pv/prop/binding/deviceoptions.h b/pv/prop/binding/deviceoptions.h index c2c29175..445361fd 100644 --- a/pv/prop/binding/deviceoptions.h +++ b/pv/prop/binding/deviceoptions.h @@ -21,34 +21,48 @@ #ifndef PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H #define PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H -#include +#include +#include -#include +#include #include "binding.h" +#include + +struct sr_dev_inst; +struct sr_channel_group; + namespace pv { + +namespace device { +class DevInst; +} + namespace prop { namespace binding { class DeviceOptions : public Binding { public: - DeviceOptions(struct sr_dev_inst *sdi); + DeviceOptions(boost::shared_ptr dev_inst, + const sr_channel_group *group = NULL); private: - void expose_enum(const struct sr_config_info *info, - const std::vector > &values, - int opt); - - void bind_stropt(const struct sr_config_info *info, int key); + void bind_bool(const QString &name, int key); + void bind_enum(const QString &name, int key, + GVariant *const gvar_list, + boost::function printer = print_gvariant); + void bind_int(const QString &name, int key, QString suffix, + boost::optional< std::pair > range); - void bind_buffer_size(const struct sr_config_info *info); - void bind_time_base(const struct sr_config_info *info); - void bind_vdiv(const struct sr_config_info *info); + static QString print_timebase(GVariant *const gvar); + static QString print_vdiv(GVariant *const gvar); + static QString print_voltage_threshold(GVariant *const gvar); protected: - struct sr_dev_inst *const _sdi; + boost::shared_ptr _dev_inst; + const sr_channel_group *const _group; }; } // binding