mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-23 13:42:55 +08:00
Merge pull request #616 from yunyaobaihong/demo
demo filename and pathname
This commit is contained in:
commit
956a9624ac
@ -117,7 +117,7 @@ namespace pv
|
|||||||
_is_auto_switch_device = false;
|
_is_auto_switch_device = false;
|
||||||
_is_save_confirm_msg = false;
|
_is_save_confirm_msg = false;
|
||||||
|
|
||||||
_pattern_mode = "RANDOM";
|
_pattern_mode = "random";
|
||||||
|
|
||||||
setup_ui();
|
setup_ui();
|
||||||
|
|
||||||
@ -1779,7 +1779,7 @@ namespace pv
|
|||||||
{
|
{
|
||||||
_view->auto_set_max_scale();
|
_view->auto_set_max_scale();
|
||||||
|
|
||||||
if(_pattern_mode != "RANDOM")
|
if(_pattern_mode != "random")
|
||||||
{
|
{
|
||||||
StoreSession ss(_session);
|
StoreSession ss(_session);
|
||||||
QJsonArray deArray = get_decoder_json_from_file(_device_agent->path());
|
QJsonArray deArray = get_decoder_json_from_file(_device_agent->path());
|
||||||
@ -1833,7 +1833,7 @@ namespace pv
|
|||||||
|
|
||||||
if(_device_agent->get_work_mode() == LOGIC)
|
if(_device_agent->get_work_mode() == LOGIC)
|
||||||
{
|
{
|
||||||
if(_pattern_mode != "RANDOM")
|
if(_pattern_mode != "random")
|
||||||
{
|
{
|
||||||
_device_agent->update();
|
_device_agent->update();
|
||||||
StoreSession ss(_session);
|
StoreSession ss(_session);
|
||||||
@ -1948,7 +1948,7 @@ namespace pv
|
|||||||
|
|
||||||
_protocol_widget->del_all_protocol();
|
_protocol_widget->del_all_protocol();
|
||||||
|
|
||||||
if(_pattern_mode != "RANDOM")
|
if(_pattern_mode != "random")
|
||||||
{
|
{
|
||||||
StoreSession ss(_session);
|
StoreSession ss(_session);
|
||||||
QJsonArray deArray = get_decoder_json_from_file(_device_agent->path());
|
QJsonArray deArray = get_decoder_json_from_file(_device_agent->path());
|
||||||
|
@ -528,7 +528,7 @@ namespace pv
|
|||||||
QString rand_mode = g_variant_get_string(gvar,NULL);
|
QString rand_mode = g_variant_get_string(gvar,NULL);
|
||||||
g_variant_unref(gvar);
|
g_variant_unref(gvar);
|
||||||
|
|
||||||
if (rand_mode != "RANDOM"){
|
if (rand_mode != "random"){
|
||||||
set_operation_mode(OPT_SINGLE);
|
set_operation_mode(OPT_SINGLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1270,7 +1270,7 @@ namespace pv
|
|||||||
QString rand_mode = g_variant_get_string(gvar,NULL);
|
QString rand_mode = g_variant_get_string(gvar,NULL);
|
||||||
g_variant_unref(gvar);
|
g_variant_unref(gvar);
|
||||||
|
|
||||||
bool is_rand = rand_mode.toUpper() == "RANDOM";
|
bool is_rand = rand_mode.toUpper() == "random";
|
||||||
_action_loop->setVisible(is_rand);
|
_action_loop->setVisible(is_rand);
|
||||||
|
|
||||||
if (!is_rand){
|
if (!is_rand){
|
||||||
|
@ -207,7 +207,7 @@ static int get_pattern_mode_from_file(uint8_t device_mode)
|
|||||||
|
|
||||||
strcpy(dir_str,DS_RES_PATH);
|
strcpy(dir_str,DS_RES_PATH);
|
||||||
strcat(dir_str,"../");
|
strcat(dir_str,"../");
|
||||||
strcat(dir_str,"demo-file/");
|
strcat(dir_str,"demo/");
|
||||||
|
|
||||||
if(device_mode == LOGIC)
|
if(device_mode == LOGIC)
|
||||||
strcat(dir_str,"logic/");
|
strcat(dir_str,"logic/");
|
||||||
@ -227,10 +227,10 @@ static int get_pattern_mode_from_file(uint8_t device_mode)
|
|||||||
{
|
{
|
||||||
if (FALSE == g_file_test(filename,G_FILE_TEST_IS_DIR))
|
if (FALSE == g_file_test(filename,G_FILE_TEST_IS_DIR))
|
||||||
{
|
{
|
||||||
if(strstr(filename,".dsl") != NULL)
|
if(strstr(filename,".demo") != NULL)
|
||||||
{
|
{
|
||||||
char *tmp_file_name = g_try_malloc0(strlen(filename)-strlen(".dsl")+1);
|
char *tmp_file_name = g_try_malloc0(strlen(filename)-strlen(".demo")+1);
|
||||||
snprintf(tmp_file_name, strlen(filename)-strlen(".dsl")+1 , "%s", filename);
|
snprintf(tmp_file_name, strlen(filename)-strlen(".demo")+1 , "%s", filename);
|
||||||
if(device_mode == LOGIC)
|
if(device_mode == LOGIC)
|
||||||
pattern_strings_logic[index] = tmp_file_name;
|
pattern_strings_logic[index] = tmp_file_name;
|
||||||
else if(device_mode == DSO)
|
else if(device_mode == DSO)
|
||||||
@ -288,7 +288,7 @@ static int reset_dsl_path(struct sr_dev_inst *sdi,uint8_t device_mode ,uint8_t p
|
|||||||
char *str = g_try_malloc0(500);
|
char *str = g_try_malloc0(500);
|
||||||
strcpy(str,DS_RES_PATH);
|
strcpy(str,DS_RES_PATH);
|
||||||
strcat(str,"../");
|
strcat(str,"../");
|
||||||
strcat(str,"demo-file/");
|
strcat(str,"demo/");
|
||||||
|
|
||||||
if (pattern_mode != PATTERN_RANDOM)
|
if (pattern_mode != PATTERN_RANDOM)
|
||||||
{
|
{
|
||||||
@ -318,7 +318,7 @@ static int reset_dsl_path(struct sr_dev_inst *sdi,uint8_t device_mode ,uint8_t p
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
strcat(str,".dsl");
|
strcat(str,".demo");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pattern_mode != PATTERN_RANDOM)
|
if(pattern_mode != PATTERN_RANDOM)
|
||||||
@ -1814,7 +1814,6 @@ static int receive_data_dso(int fd, int revents, const struct sr_dev_inst *sdi)
|
|||||||
int index;
|
int index;
|
||||||
int bit = get_bit(vdev->timebase);
|
int bit = get_bit(vdev->timebase);
|
||||||
|
|
||||||
sr_info("bit per circle(double channels):%d",bit);
|
|
||||||
void* tmp_buf = g_try_malloc0(bit);
|
void* tmp_buf = g_try_malloc0(bit);
|
||||||
for(int i = 0 ; i < bit ; i++)
|
for(int i = 0 ; i < bit ; i++)
|
||||||
{
|
{
|
||||||
@ -2381,7 +2380,6 @@ static int load_virtual_device_session(struct sr_dev_inst *sdi)
|
|||||||
for (j = 0; keys[j]; j++)
|
for (j = 0; keys[j]; j++)
|
||||||
{
|
{
|
||||||
val = g_key_file_get_string(kf, sections[i], keys[j], NULL);
|
val = g_key_file_get_string(kf, sections[i], keys[j], NULL);
|
||||||
sr_info("keys:%s , val:%s", keys[j],val);
|
|
||||||
|
|
||||||
if (!strcmp(keys[j], "device mode"))
|
if (!strcmp(keys[j], "device mode"))
|
||||||
{
|
{
|
||||||
|
@ -31,9 +31,9 @@ enum DEMO_PATTERN {
|
|||||||
PATTERN_DEFAULT = 1,
|
PATTERN_DEFAULT = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *pattern_strings_logic[100] = {"RANDOM"};
|
static char *pattern_strings_logic[100] = {"random"};
|
||||||
static char *pattern_strings_dso[100] = {"RANDOM"};
|
static char *pattern_strings_dso[100] = {"random"};
|
||||||
static char *pattern_strings_analog[100] = {"RANDOM"};
|
static char *pattern_strings_analog[100] = {"random"};
|
||||||
static int pattern_logic_count = 1;
|
static int pattern_logic_count = 1;
|
||||||
static int pattern_dso_count= 1;
|
static int pattern_dso_count= 1;
|
||||||
static int pattern_analog_count= 1;
|
static int pattern_analog_count= 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user