730 lines
21 KiB
C
730 lines
21 KiB
C
#include "scr_setting_item_text.h"
|
|
//该部分代码用于修改选项卡内部,右侧一列的文本
|
|
|
|
//修改选项卡0的文本
|
|
void set_item0_text(ITEM_CONTENTS con)
|
|
{
|
|
char str_temp[16] = {0};
|
|
uint8_t enum_temp = 0;
|
|
|
|
switch (con)
|
|
{
|
|
case VOL_UNIT_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
if(tabdata.item0_page0_vunit == VOLTAGE_V)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, "V");
|
|
}
|
|
else if(tabdata.item0_page0_vunit == VOLTAGE_MV)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, "mV");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(tabdata.item0_page0_vunit == VOLTAGE_V)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, "< V >");
|
|
}
|
|
else if(tabdata.item0_page0_vunit == VOLTAGE_MV)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, "< mV >");
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
case VOL_UP_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
if(tabdata.item0_page0_vunit == VOLTAGE_V)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page0_vup[0]);
|
|
}
|
|
else if(tabdata.item0_page0_vunit == VOLTAGE_MV)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page0_vup[1]);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(tabdata.item0_page0_vunit == VOLTAGE_V)
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page0_vup[0]);
|
|
}
|
|
else if(tabdata.item0_page0_vunit == VOLTAGE_MV)
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page0_vup[1]);
|
|
}
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, str_temp);
|
|
}
|
|
break;
|
|
|
|
case VOL_LOW_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
if(tabdata.item0_page0_vunit == VOLTAGE_V)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page0_vlow[0]);
|
|
}
|
|
else if(tabdata.item0_page0_vunit == VOLTAGE_MV)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page0_vlow[1]);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(tabdata.item0_page0_vunit == VOLTAGE_V)
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page0_vlow[0]);
|
|
}
|
|
else if(tabdata.item0_page0_vunit == VOLTAGE_MV)
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page0_vlow[1]);
|
|
}
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_21, str_temp);
|
|
}
|
|
break;
|
|
|
|
case CURRENT_UP_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page0_cup);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page0_cup);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, str_temp);
|
|
}
|
|
break;
|
|
|
|
case CURRENT_LOW_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page0_clow);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page0_clow);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_41, str_temp);
|
|
}
|
|
break;
|
|
|
|
case RES_UP_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page0_rup);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page0_rup);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_51, str_temp);
|
|
}
|
|
break;
|
|
|
|
case RES_LOW_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page1_rlow);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page1_rlow);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, str_temp);
|
|
}
|
|
break;
|
|
|
|
case FRE_UP_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page1_fup);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page1_fup);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, str_temp);
|
|
}
|
|
break;
|
|
|
|
case FRE_LOW_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page1_flow);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page1_flow);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_21, str_temp);
|
|
}
|
|
break;
|
|
|
|
case TC_TYPE_SET:
|
|
{
|
|
switch (tabdata.item0_page1_TCtype)
|
|
{
|
|
case TC_K:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "K ℃");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "< K ℃ >");
|
|
}
|
|
}
|
|
break;
|
|
|
|
case TC_S:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "S ℃");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "< S ℃ >");
|
|
}
|
|
}
|
|
break;
|
|
|
|
case TC_N:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "N ℃");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "< N ℃ >");
|
|
}
|
|
}
|
|
break;
|
|
|
|
case TC_B:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "B ℃");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "< B ℃ >");
|
|
}
|
|
}
|
|
break;
|
|
|
|
case TC_E:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "E ℃");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "< E ℃ >");
|
|
}
|
|
}
|
|
break;
|
|
|
|
case TC_J:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "J ℃");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "< J ℃ >");
|
|
}
|
|
}
|
|
break;
|
|
|
|
case TC_R:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "R ℃");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "< R ℃ >");
|
|
}
|
|
}
|
|
break;
|
|
|
|
case TC_T:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "T ℃");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "< T ℃ >");
|
|
}
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
break;
|
|
|
|
case TC_UP_SET:
|
|
{
|
|
enum_temp = (uint8_t)tabdata.item0_page1_TCtype;
|
|
enum_temp -= 5;
|
|
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page1_TCup[enum_temp]);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page1_TCup[enum_temp]);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_41, str_temp);
|
|
}
|
|
break;
|
|
|
|
case TC_LOW_SET:
|
|
{
|
|
enum_temp = (uint8_t)tabdata.item0_page1_TCtype;
|
|
enum_temp -= 5;
|
|
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page1_TClow[enum_temp]);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page1_TClow[enum_temp]);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_51, str_temp);
|
|
}
|
|
break;
|
|
|
|
case RTD_UP_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page2_RTDup);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >",tabdata.item0_page2_RTDup);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, str_temp);
|
|
}
|
|
break;
|
|
|
|
case RTD_LOW_SET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d",tabdata.item0_page2_RTDlow);
|
|
}
|
|
else
|
|
{sprintf(str_temp,"< %d >",tabdata.item0_page2_RTDlow);}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, str_temp);
|
|
}
|
|
break;
|
|
|
|
case PAGE_PV_ITEM_0:
|
|
{
|
|
sprintf(str_temp,"< %d/%d >",tabdata.item_page, I0_PAGE_MAX);
|
|
lv_label_set_text(guider_ui.screen_setting_label_page, str_temp);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
//修改选项卡1的文本
|
|
void set_item1_text(ITEM_CONTENTS con)
|
|
{
|
|
char str_temp[16] = {0};
|
|
|
|
switch (con)
|
|
{
|
|
case SAMPLE_INTERVAL:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d", tabdata.item1_page0_sample_interval);
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, str_temp);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >", tabdata.item1_page0_sample_interval);
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, str_temp);
|
|
}
|
|
}
|
|
break;
|
|
|
|
case PLOT_NUM:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
sprintf(str_temp,"%d", tabdata.item1_page0_plot_num);
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, str_temp);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %d >", tabdata.item1_page0_plot_num);
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, str_temp);
|
|
}
|
|
}
|
|
break;
|
|
|
|
case INPUT_COLOR:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_21, "===");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_21, "<===>");
|
|
set_contents_color(2, 0x000000);
|
|
}
|
|
|
|
set_obj_color(guider_ui.screen_setting_label_21, tabdata.item1_page0_color_input);
|
|
}
|
|
break;
|
|
|
|
case OUTPUT_COLOR:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "===");
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, "<===>");
|
|
set_contents_color(3, 0x000000);
|
|
}
|
|
set_obj_color(guider_ui.screen_setting_label_31, tabdata.item1_page0_color_output);
|
|
}
|
|
break;
|
|
|
|
case PAGE_PV_ITEM_1:
|
|
{
|
|
sprintf(str_temp,"< %d/%d >",tabdata.item_page, I1_PAGE_MAX);
|
|
lv_label_set_text(guider_ui.screen_setting_label_page, str_temp);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
//修改选项卡2的文本
|
|
void set_item2_text(ITEM_CONTENTS con)
|
|
{
|
|
char str_temp[16] = {0};
|
|
|
|
switch (con)
|
|
{
|
|
case INPUT_LOG:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, ">");
|
|
}
|
|
break;
|
|
|
|
case OUTPUT_LOG:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, ">");
|
|
}
|
|
break;
|
|
|
|
case COMMUNICATION:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_21, ">");
|
|
}
|
|
break;
|
|
|
|
case PROGRAM_OUTPUT:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, ">");
|
|
}
|
|
break;
|
|
|
|
case PAGE_PV_ITEM_2:
|
|
{
|
|
sprintf(str_temp,"< %d/%d >",tabdata.item_page, I2_PAGE_MAX);
|
|
lv_label_set_text(guider_ui.screen_setting_label_page, str_temp);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
//修改选项卡3的文本
|
|
void set_item3_text(ITEM_CONTENTS con)
|
|
{
|
|
char str_temp[32] = {0};
|
|
|
|
switch (con)
|
|
{
|
|
case LIGHT_STATUS:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
if(tabdata.item3_page0_lightflag)
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, text_pack.item_3_val[0]);
|
|
}
|
|
else
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, text_pack.item_3_val[1]);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(tabdata.item3_page0_lightflag)
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[0]);
|
|
}
|
|
else
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[1]);
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_01, str_temp);
|
|
}
|
|
}
|
|
break;
|
|
|
|
case LANGUAGE_SELECT:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
switch (tabdata.item3_page0_language)
|
|
{
|
|
case MENU_SIMPLYFY_CHINESE:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, text_pack.item_3_val[2]);
|
|
}
|
|
break;
|
|
|
|
case MENU_ENGLISH:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, text_pack.item_3_val[3]);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
switch (tabdata.item3_page0_language)
|
|
{
|
|
case MENU_SIMPLYFY_CHINESE:
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[2]);
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, str_temp);
|
|
|
|
//切换语言后,更新本页的其他文本
|
|
setting_laguage_switch(MENU_SIMPLYFY_CHINESE);
|
|
title_item_refresh();
|
|
}
|
|
break;
|
|
|
|
case MENU_ENGLISH:
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[3]);
|
|
lv_label_set_text(guider_ui.screen_setting_label_11, str_temp);
|
|
|
|
//切换语言后,更新本页的其他文本
|
|
setting_laguage_switch(MENU_ENGLISH);
|
|
title_item_refresh();
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
case DATA_SAVE:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
switch (tabdata.item3_page0_saveflag)
|
|
{
|
|
case 0:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_21, text_pack.item_3_val[4]);
|
|
}
|
|
break;
|
|
|
|
case 1:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_21, text_pack.item_3_val[5]);
|
|
}
|
|
break;
|
|
|
|
case 2:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_21, text_pack.item_3_val[6]);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
switch (tabdata.item3_page0_saveflag)
|
|
{
|
|
case 0:
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[4]);
|
|
}
|
|
break;
|
|
|
|
case 1:
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[5]);
|
|
}
|
|
break;
|
|
|
|
case 2:
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[6]);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_21, str_temp);
|
|
}
|
|
}
|
|
break;
|
|
|
|
case DATA_RESET:
|
|
{
|
|
if(tabdata.content_focus == 0)
|
|
{
|
|
switch (tabdata.item3_page0_resetflag)
|
|
{
|
|
case 0:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, text_pack.item_3_val[7]);
|
|
}
|
|
break;
|
|
|
|
case 1:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, text_pack.item_3_val[8]);
|
|
}
|
|
break;
|
|
|
|
case 2:
|
|
{
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, text_pack.item_3_val[9]);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
switch (tabdata.item3_page0_resetflag)
|
|
{
|
|
case 0:
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[7]);
|
|
}
|
|
break;
|
|
|
|
case 1:
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[8]);
|
|
}
|
|
break;
|
|
|
|
case 2:
|
|
{
|
|
sprintf(str_temp,"< %s >",text_pack.item_3_val[9]);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
lv_label_set_text(guider_ui.screen_setting_label_31, str_temp);
|
|
}
|
|
}
|
|
break;
|
|
|
|
case PAGE_PV_ITEM_3:
|
|
{
|
|
sprintf(str_temp,"< %d/%d >",tabdata.item_page, I3_PAGE_MAX);
|
|
lv_label_set_text(guider_ui.screen_setting_label_page, str_temp);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
//修改对象颜色
|
|
void set_obj_color(lv_obj_t * obj, uint8_t color)
|
|
{
|
|
lv_obj_set_style_text_color(obj, lv_color_hex(color_table[color]), LV_PART_MAIN|LV_STATE_DEFAULT);
|
|
}
|
|
|
|
|