24 #include <boost/none_t.hpp> 26 #include <libsigrokcxx/libsigrokcxx.hpp> 40 using std::shared_ptr;
44 using Glib::VariantBase;
45 using Glib::VariantType;
60 const map<
string, shared_ptr<Option>> &
options)
62 for (
const pair<
const string, shared_ptr<Option>>& o :
options) {
63 const shared_ptr<Option> &opt = o.second;
66 const QString name = QString::fromStdString(opt->name());
67 const QString desc = QString::fromStdString(opt->description());
69 const VariantBase def_val = opt->default_value();
70 const vector<VariantBase> values = opt->values();
74 const Property::Getter
get = [&, opt]() {
76 const Property::Setter
set = [&, opt](VariantBase
value) {
79 shared_ptr<Property> prop;
81 if (!opt->values().empty())
82 prop =
bind_enum(name, desc, values,
get,
set);
83 else if (def_val.is_of_type(VariantType(
"b")))
84 prop = shared_ptr<Property>(
new Bool(name, desc,
get,
set));
85 else if (def_val.is_of_type(VariantType(
"d")))
86 prop = shared_ptr<Property>(
new Double(name, desc, 2,
"",
87 none, none,
get,
set));
88 else if (def_val.is_of_type(VariantType(
"i")) ||
89 def_val.is_of_type(VariantType(
"t")) ||
90 def_val.is_of_type(VariantType(
"u")))
91 prop = shared_ptr<Property>(
92 new Int(name, desc,
"", none,
get,
set));
93 else if (def_val.is_of_type(VariantType(
"s")))
94 prop = shared_ptr<Property>(
95 new String(name, desc,
get,
set));
109 const QString &name,
const QString &desc,
const vector<VariantBase> &values,
110 Property::Getter getter, Property::Setter setter)
112 vector< pair<VariantBase, QString> > enum_vals;
113 for (VariantBase var : values)
115 return shared_ptr<Property>(
new Enum(name, desc, enum_vals, getter, setter));
T value(details::expression_node< T > *n)
Mac OS X or Android For some we provide binary for others we provide installers and for others we provide AppImage containers that you can run without the need to install anything Check the the usual way to install PulseView is to install the packages provided by your distro s package manager sometimes only outdated packages are made available to you In that you have two options
vector< shared_ptr< prop::Property > > properties_
static QString print_gvariant(Glib::VariantBase gvar)