]> sigrok.org Git - pulseview.git/commitdiff
Added decoder options binding for double values
authorJoel Holdsworth <redacted>
Tue, 11 Mar 2014 22:35:02 +0000 (23:35 +0100)
committerJoel Holdsworth <redacted>
Thu, 13 Mar 2014 17:00:33 +0000 (17:00 +0000)
pv/prop/binding/decoderoptions.cpp
test/CMakeLists.txt

index d9904852ca645e21f6b4b4d447a200860e301d94..063daf8e13d08739bc7241e50e0f2480eb388021 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <pv/data/decoderstack.h>
 #include <pv/data/decode/decoder.h>
+#include <pv/prop/double.h>
 #include <pv/prop/enum.h>
 #include <pv/prop/int.h>
 #include <pv/prop/string.h>
@@ -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<Property>(new Double(name, 2, "",
+                               none, none, getter, setter));
                else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("x")))
                        prop = shared_ptr<Property>(
                                new Int(name, "", none, getter, setter));
index 0aeb0bc2dcba10787cbd7747679931fe034f74e7..f76e8b36b15fcc2850376c166b0391351be57460 100644 (file)
@@ -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