20 #include <libsigrokdecode/libsigrokdecode.h> 24 #include <boost/none_t.hpp> 36 using std::shared_ptr;
50 shared_ptr<pv::data::DecodeSignal> decode_signal,
51 shared_ptr<data::decode::Decoder> decoder) :
52 decode_signal_(decode_signal),
57 const srd_decoder *
const dec =
decoder_->get_srd_decoder();
60 for (GSList *l = dec->options; l; l = l->next) {
61 const srd_decoder_option *
const opt = (srd_decoder_option*)l->data;
63 const QString name = QString::fromUtf8(opt->desc);
65 const Property::Getter
get = [&, opt]() {
67 const Property::Setter
set = [&, opt](Glib::VariantBase
value) {
70 shared_ptr<Property> prop;
73 prop =
bind_enum(name,
"", opt,
get,
set);
74 else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE(
"d")))
75 prop = shared_ptr<Property>(
new Double(name,
"", 2,
"",
76 none, none,
get,
set));
77 else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE(
"x")))
78 prop = shared_ptr<Property>(
79 new Int(name,
"",
"", none,
get,
set));
80 else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE(
"s")))
81 prop = shared_ptr<Property>(
82 new String(name,
"",
get,
set));
91 const QString &name,
const QString &desc,
92 const srd_decoder_option *
option,
95 vector< pair<Glib::VariantBase, QString> > values;
96 for (GSList *l = option->values; l; l = l->next) {
97 Glib::VariantBase var = Glib::VariantBase((GVariant*)l->data,
true);
101 return shared_ptr<Property>(
new Enum(name, desc, values, getter, setter));
106 GVariant *val =
nullptr;
112 const auto iter = options.find(
id);
114 if (iter != options.end())
115 val = (*iter).second;
117 assert(
decoder_->get_srd_decoder());
120 for (GSList *l =
decoder_->get_srd_decoder()->options; l; l = l->next) {
121 const srd_decoder_option *
const opt = (srd_decoder_option*)l->data;
122 if (strcmp(opt->id,
id) == 0) {
129 return (val) ? Glib::VariantBase(val,
true) : Glib::VariantBase();
135 decoder_->set_option(
id, value.gobj());
manual pdf if(NOT EXISTS"${CMAKE_CURRENT_BINARY_DIR}/images") message(STATUS"creating symlink for manual's images/ subdirectory") execute_process(COMMAND $
Glib::VariantBase getter(const char *id)
CMake option(DISABLE_WERROR"Build without -Werror"TRUE) option(ENABLE_SIGNALS"Build with UNIX signals"TRUE) option(ENABLE_STACKTRACE"Enable stack trace when crashing"FALSE) option(ENABLE_DECODE"Build with libsigrokdecode"TRUE) option(ENABLE_FLOW"Build with libsigrokflow"FALSE) option(ENABLE_TESTS"Enable unit tests"FALSE) option(STATIC_PKGDEPS_LIBS"Statically link to (pkg-config) libraries"FALSE) option(ENABLE_TS_UPDATE"Update .ts source files (Qt l10n)"FALSE) if(WIN32) set(STATIC_PKGDEPS_LIBS TRUE) set(ENABLE_SIGNALS FALSE) endif() if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING"Choose the type of build (None
T value(details::expression_node< T > *n)
static shared_ptr< prop::Property > bind_enum(const QString &name, const QString &desc, const srd_decoder_option *option, prop::Property::Getter getter, prop::Property::Setter setter)
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
Decoder(shared_ptr< pv::data::DecodeSignal > decode_signal, shared_ptr< pv::data::decode::Decoder > decoder)
vector< shared_ptr< prop::Property > > properties_
shared_ptr< pv::data::decode::Decoder > decoder_
void setter(const char *id, Glib::VariantBase value)
shared_ptr< pv::data::DecodeSignal > decode_signal_
static QString print_gvariant(Glib::VariantBase gvar)