From: Joel Holdsworth Date: Tue, 11 Mar 2014 22:35:02 +0000 (+0100) Subject: Added decoder options binding for double values X-Git-Tag: pulseview-0.2.0~22 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=a28c30252fd32d3185c62062dfad74ae659ae383 Added decoder options binding for double values --- diff --git a/pv/prop/binding/decoderoptions.cpp b/pv/prop/binding/decoderoptions.cpp index d9904852..063daf8e 100644 --- a/pv/prop/binding/decoderoptions.cpp +++ b/pv/prop/binding/decoderoptions.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -72,6 +73,9 @@ DecoderOptions::DecoderOptions( if (opt->values) prop = bind_enum(name, opt, getter, setter); + else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("d"))) + prop = shared_ptr(new Double(name, 2, "", + none, none, getter, setter)); else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("x"))) prop = shared_ptr( new Int(name, "", none, getter, setter)); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0aeb0bc2..f76e8b36 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -62,6 +62,7 @@ set(pulseview_TEST_SOURCES ${PROJECT_SOURCE_DIR}/pv/device/file.cpp ${PROJECT_SOURCE_DIR}/pv/device/inputfile.cpp ${PROJECT_SOURCE_DIR}/pv/device/sessionfile.cpp + ${PROJECT_SOURCE_DIR}/pv/prop/double.cpp ${PROJECT_SOURCE_DIR}/pv/prop/enum.cpp ${PROJECT_SOURCE_DIR}/pv/prop/int.cpp ${PROJECT_SOURCE_DIR}/pv/prop/property.cpp @@ -94,6 +95,7 @@ set(pulseview_TEST_SOURCES set(pulseview_TEST_HEADERS ${PROJECT_SOURCE_DIR}/pv/sigsession.h ${PROJECT_SOURCE_DIR}/pv/device/devinst.h + ${PROJECT_SOURCE_DIR}/pv/prop/double.h ${PROJECT_SOURCE_DIR}/pv/prop/enum.h ${PROJECT_SOURCE_DIR}/pv/prop/int.h ${PROJECT_SOURCE_DIR}/pv/prop/property.h