From 7bf81734d4b2c6899fa7342333d274bb49efe982 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Mon, 17 Oct 2022 09:06:02 +0800 Subject: [PATCH] update build script --- CMakeLists.txt | 1 + DSView/pv/mainwindow.cpp | 8 +++++++- DSView/pv/prop/binding/deviceoptions.cpp | 2 +- DSView/pv/ui/langresource.h | 2 +- DSView/pv/ui/string_ids.h | 4 ++-- libsigrok4DSL/hardware/DSL/dslogic.c | 3 ++- libsigrok4DSL/libsigrok.h | 7 +------ 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8c3072f..05b645aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -345,6 +345,7 @@ set(DSView_SOURCES DSView/pv/utility/encoding.cpp DSView/pv/utility/path.cpp DSView/pv/deviceagent.cpp + DSView/pv/ui/langresource.cpp ) set(DSView_HEADERS diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index 8dbd1597..34f75e6d 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -663,7 +663,13 @@ namespace pv else if (info->datatype == SR_T_FLOAT) _device_agent->set_config(NULL, NULL, info->key, g_variant_new_double(sessionObj[info->name].toDouble())); else if (info->datatype == SR_T_CHAR) - _device_agent->set_config(NULL, NULL, info->key, g_variant_new_string(sessionObj[info->name].toString().toUtf8())); + { + QString v = sessionObj[info->name].toString(); + if (info->key == SR_CONF_OPERATION_MODE){ + + } + _device_agent->set_config(NULL, NULL, info->key, g_variant_new_string(v.toUtf8())); + } } } diff --git a/DSView/pv/prop/binding/deviceoptions.cpp b/DSView/pv/prop/binding/deviceoptions.cpp index c647cba9..9f322b0f 100644 --- a/DSView/pv/prop/binding/deviceoptions.cpp +++ b/DSView/pv/prop/binding/deviceoptions.cpp @@ -79,7 +79,7 @@ DeviceOptions::DeviceOptions() label_char = info->label_cn; g_variant_unref(gvar_tmp); } - const QString label(label_char); + QString label(label_char); switch(key) { diff --git a/DSView/pv/ui/langresource.h b/DSView/pv/ui/langresource.h index aa8683fc..cd1fed44 100644 --- a/DSView/pv/ui/langresource.h +++ b/DSView/pv/ui/langresource.h @@ -61,7 +61,7 @@ static const struct lang_page_item lange_page_keys[] = {STR_PAGE_MAIN, "main.json"}, {STR_PAGE_TOOLBAR, "toolbar.json"}, {STR_PAGE_MSG, "msg.json"}, - {STR_PAGE_DEVICE, "device.json"}, + {STR_PAGE_DSL, "DSL.json"}, }; class LangResource diff --git a/DSView/pv/ui/string_ids.h b/DSView/pv/ui/string_ids.h index b0ad2671..9863ee15 100644 --- a/DSView/pv/ui/string_ids.h +++ b/DSView/pv/ui/string_ids.h @@ -24,8 +24,8 @@ #define STR_PAGE_MAIN 1 #define STR_PAGE_MSG 2 -#define STR_PAGE_DEVICE 3 -#define STR_PAGE_TOOLBAR 4 +#define STR_PAGE_TOOLBAR 3 +#define STR_PAGE_DSL 100 #define IDS_TOOLBAR_MODE #define IDS_TOOLBAR_START diff --git a/libsigrok4DSL/hardware/DSL/dslogic.c b/libsigrok4DSL/hardware/DSL/dslogic.c index 772e236b..8d213074 100644 --- a/libsigrok4DSL/hardware/DSL/dslogic.c +++ b/libsigrok4DSL/hardware/DSL/dslogic.c @@ -930,7 +930,8 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi, if (sdi->mode != LOGIC) { dso_init(sdi); } - } else if (id == SR_CONF_OPERATION_MODE) { + } + else if (id == SR_CONF_OPERATION_MODE) { stropt = g_variant_get_string(data, NULL); if (sdi->mode == LOGIC) { if (!strcmp(stropt, get_opmodes(devc)[OP_BUFFER])) { diff --git a/libsigrok4DSL/libsigrok.h b/libsigrok4DSL/libsigrok.h index 2e3e9fde..2607d1a0 100644 --- a/libsigrok4DSL/libsigrok.h +++ b/libsigrok4DSL/libsigrok.h @@ -1162,12 +1162,7 @@ struct ds_trigger_pos { uint32_t status; }; -/** - * @file - * - * Header file containing API function prototypes. - */ - + /*--- input/input.c ---------------------------------------------------------*/