X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fbinding%2Fdevice.hpp;h=d4fbf3714ba040236cb055488a5dbc2fd4014a5a;hp=a8acd1669b00f05c9356ea1faff93dadebbd101e;hb=4e2195c8d934f7f874b612eaace8c6849e8b475d;hpb=7a01bd3654ed046216308fa64edfd79be7cd525f diff --git a/pv/binding/device.hpp b/pv/binding/device.hpp index a8acd16..d4fbf37 100644 --- a/pv/binding/device.hpp +++ b/pv/binding/device.hpp @@ -14,13 +14,14 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #ifndef PULSEVIEW_PV_BINDING_DEVICE_HPP #define PULSEVIEW_PV_BINDING_DEVICE_HPP +#include + #include #include @@ -30,43 +31,49 @@ #include -namespace sigrok { - class Configurable; -} +#include + +using std::function; +using std::pair; +using std::set; +using std::shared_ptr; namespace pv { namespace binding { -class Device : public QObject, public Binding +class Device : public Binding { Q_OBJECT public: - Device(std::shared_ptr configurable); + Device(shared_ptr configurable); Q_SIGNALS: void config_changed(); private: - void bind_bool(const QString &name, + void bind_bool(const QString &name, const QString &desc, prop::Property::Getter getter, prop::Property::Setter setter); - void bind_enum(const QString &name, Glib::VariantContainerBase gvar_list, + void bind_enum(const QString &name, const QString &desc, + const sigrok::ConfigKey *key, + set capabilities, prop::Property::Getter getter, prop::Property::Setter setter, - std::function printer = print_gvariant); - void bind_int(const QString &name, QString suffix, - boost::optional< std::pair > range, + function printer = print_gvariant); + void bind_int(const QString &name, const QString &desc, QString suffix, + boost::optional< pair > range, prop::Property::Getter getter, prop::Property::Setter setter); static QString print_timebase(Glib::VariantBase gvar); static QString print_vdiv(Glib::VariantBase gvar); static QString print_voltage_threshold(Glib::VariantBase gvar); + static QString print_probe_factor(Glib::VariantBase gvar); protected: - std::shared_ptr configurable_; + shared_ptr configurable_; }; -} // binding -} // pv +} // namespace binding +} // namespace pv #endif // PULSEVIEW_PV_BINDING_DEVICE_HPP