1834 lines
64 KiB
C
1834 lines
64 KiB
C
#include "app_screen_setting.h"
|
||
|
||
TABVIEW_DATA tabdata; //设置页面参数初始化
|
||
|
||
//设置菜单数据初始化
|
||
void tab_dada_init(void)
|
||
{
|
||
tabdata.item_cursor = 0; //选项卡的游标(焦点)
|
||
tabdata.item_cursor_prv = 0; //前一刻的选项卡游标
|
||
tabdata.content_cursor = 99; //某一选项卡内部的游标
|
||
tabdata.content_cursor_prv = 99; //前一刻的~
|
||
tabdata.content_focus = 0; //默认无焦点
|
||
tabdata.content_cursor_x = 0; //游标横坐标
|
||
tabdata.content_cursor_y = 0; //游标纵坐标
|
||
tabdata.window_deal_flag = 0; //弹窗处理标志
|
||
tabdata.window_cursor = 0; //弹窗游标
|
||
tabdata.window_cursor_prv = 0; //前一刻的弹窗游标
|
||
|
||
//设置界面的初始默认值
|
||
//ITEMS_0 选项卡0
|
||
//{
|
||
tabdata.content00 = VOLTAGE_V; //电压单位
|
||
tabdata.content01[0] = VOL[0].up; //电压V上限
|
||
tabdata.content01[1] = VOL[1].up; //电压mV上限
|
||
tabdata.content02[0] = VOL[0].low; //电压V下限
|
||
tabdata.content02[1] = VOL[1].low; //电压mV下限
|
||
tabdata.content03 = CUR.up; //电流上限
|
||
tabdata.content04 = CUR.low; //电流下限
|
||
tabdata.content05 = RES.up; //电阻上限
|
||
tabdata.content06 = RES.low; //电阻下限
|
||
tabdata.content07 = FRE.up; //频率上限
|
||
tabdata.content08 = FRE.low; //频率下限
|
||
tabdata.content09[0] = TC[0].up; //TCK上限
|
||
tabdata.content010[0] = TC[0].low; //TCK下限
|
||
tabdata.content09[1] = TC[1].up; //TCS上限
|
||
tabdata.content010[1] = TC[1].low; //TCS下限
|
||
tabdata.content09[2] = TC[2].up; //TCN上限
|
||
tabdata.content010[2] = TC[2].low; //TCN下限
|
||
tabdata.content09[3] = TC[3].up; //TCB上限
|
||
tabdata.content010[3] = TC[3].low; //TCB下限
|
||
tabdata.content09[4] = TC[4].up; //TCE上限
|
||
tabdata.content010[4] = TC[4].low; //TCE下限
|
||
tabdata.content09[5] = TC[5].up; //TCJ上限
|
||
tabdata.content010[5] = TC[5].low; //TCJ下限
|
||
tabdata.content09[6] = TC[6].up; //TCR上限
|
||
tabdata.content010[6] = TC[6].low; //TCR下限
|
||
tabdata.content09[7] = TC[7].up; //TCT上限
|
||
tabdata.content010[7] = TC[7].low; //TCT下限
|
||
tabdata.content011 = RTD.up; //RTD上限
|
||
tabdata.content012 = RTD.low; //RTD下限
|
||
tabdata.content013 = TC_K; //默认为K类型的热电偶
|
||
//}
|
||
|
||
//ITEMS_1 选项卡1
|
||
//{
|
||
tabdata.light_flag = 0; //默认手电熄灭
|
||
//}
|
||
}
|
||
|
||
//KEY_SETTING
|
||
void key_functions_setting(void)
|
||
{
|
||
if(tabdata.window_deal_flag)
|
||
{
|
||
//处理弹窗
|
||
tab_window_deal();
|
||
}
|
||
else
|
||
{
|
||
switch (key)
|
||
{
|
||
case KEY_BACK:
|
||
{
|
||
key = 0;
|
||
|
||
//所有选项卡均未选中时,返回主界面,否则熄灭当前选中
|
||
if(tabdata.content_cursor == 99)
|
||
{
|
||
//下次进入设置页面时,从选项卡0开始
|
||
tabdata.item_cursor = 0;
|
||
|
||
//加载主界面
|
||
setup_scr_screen_main(&guider_ui);
|
||
lv_scr_load(guider_ui.screen_main);
|
||
|
||
//切换至菜单后,清除主界面对象,释放内存
|
||
lv_obj_del(guider_ui.screen_setting);
|
||
|
||
//当前界面为主界面
|
||
m5data.scr_now = SCREEN_MAIN;
|
||
|
||
//恢复之前显示的数据
|
||
scr_main_recover();
|
||
}
|
||
else
|
||
{
|
||
if(tabdata.content_focus == 0)
|
||
{
|
||
//当不存在焦点时
|
||
//某个选项卡被选中时,熄灭内部选中的内容
|
||
switch (tabdata.item_cursor)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
//熄灭当前内容
|
||
setting_contents_check(99, tabdata.content_cursor);
|
||
|
||
//取消内容选中与焦点
|
||
tabdata.content_cursor = 99;
|
||
tabdata.content_cursor_prv = 99;
|
||
tabdata.content_focus = 0;
|
||
tabdata.content_cursor_x = 0;
|
||
tabdata.content_cursor_y = 0;
|
||
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
//取消内容选中与焦点
|
||
//熄灭当前内容
|
||
setting_contents_check(99, tabdata.content_cursor);
|
||
|
||
tabdata.content_cursor = 99;
|
||
tabdata.content_cursor_prv = 99;
|
||
tabdata.content_focus = 0;
|
||
tabdata.content_cursor_x = 0;
|
||
tabdata.content_cursor_y = 0;
|
||
}
|
||
break;
|
||
|
||
case ITEMS_2:
|
||
{
|
||
//取消内容选中与焦点
|
||
tabdata.content_cursor = 99;
|
||
tabdata.content_cursor_prv = 99;
|
||
tabdata.content_focus = 0;
|
||
tabdata.content_cursor_x = 0;
|
||
tabdata.content_cursor_y = 0;
|
||
}
|
||
break;
|
||
|
||
case ITEMS_3:
|
||
{
|
||
//取消内容选中与焦点
|
||
tabdata.content_cursor = 99;
|
||
tabdata.content_cursor_prv = 99;
|
||
tabdata.content_focus = 0;
|
||
tabdata.content_cursor_x = 0;
|
||
tabdata.content_cursor_y = 0;
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//当存在焦点时
|
||
tabdata.content_focus = 0;
|
||
setting_contents_check(tabdata.content_cursor, 99);
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case KEY_UP:
|
||
{
|
||
key = 0;
|
||
|
||
//内部游标为99时,说明未选中任何一个选项卡,此时的up和down用于切换选项卡
|
||
if(tabdata.content_cursor == 99)
|
||
{
|
||
tabdata.item_cursor_prv = tabdata.item_cursor;
|
||
tabdata.item_cursor = (tabdata.item_cursor <= 0)?(3):(tabdata.item_cursor - 1);
|
||
|
||
setting_items_check(tabdata.item_cursor, tabdata.item_cursor_prv);
|
||
}
|
||
else
|
||
{
|
||
//某个内容被焦点前,在此处选择内容值
|
||
if(tabdata.content_focus == 0)
|
||
{
|
||
switch (tabdata.item_cursor)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
tabdata.content_cursor_prv = tabdata.content_cursor;
|
||
if(tabdata.content_cursor_x != 1)
|
||
{
|
||
tabdata.content_cursor_y = (tabdata.content_cursor_y <= 0)?(5):(tabdata.content_cursor_y - 1);
|
||
}
|
||
else
|
||
{
|
||
tabdata.content_cursor_y = (tabdata.content_cursor_y == 0)?(4):(0);
|
||
}
|
||
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
tabdata.content_cursor_prv = tabdata.content_cursor;
|
||
|
||
tabdata.content_cursor_x = 4; //固定4
|
||
tabdata.content_cursor_y = (tabdata.content_cursor_y <= 0)?(2):(tabdata.content_cursor_y - 1);
|
||
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
|
||
}
|
||
else
|
||
{
|
||
//某个内容被焦点后,在此处修改内容值
|
||
setting_contents_modify(tabdata.item_cursor, tabdata.content_cursor, KEY_UP, 1);
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case KEY_DOWN:
|
||
{
|
||
key = 0;
|
||
|
||
//内部游标为99时,说明未选中任何一个选项卡,此时的up和down用于切换选项卡
|
||
if(tabdata.content_cursor == 99)
|
||
{
|
||
tabdata.item_cursor_prv = tabdata.item_cursor;
|
||
tabdata.item_cursor = (tabdata.item_cursor >= 3)?(0):(tabdata.item_cursor + 1);
|
||
|
||
setting_items_check(tabdata.item_cursor, tabdata.item_cursor_prv);
|
||
}
|
||
else
|
||
{
|
||
if(tabdata.content_focus == 0)
|
||
{
|
||
//某个内容被焦点前,在此处选择内容值
|
||
switch (tabdata.item_cursor)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
tabdata.content_cursor_prv = tabdata.content_cursor;
|
||
if(tabdata.content_cursor_x != 1)
|
||
{
|
||
tabdata.content_cursor_y = (tabdata.content_cursor_y >= 5)?(0):(tabdata.content_cursor_y + 1);
|
||
}
|
||
else
|
||
{
|
||
tabdata.content_cursor_y = (tabdata.content_cursor_y == 0)?(4):(0);
|
||
}
|
||
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
tabdata.content_cursor_prv = tabdata.content_cursor;
|
||
|
||
tabdata.content_cursor_x = 4; //固定4
|
||
tabdata.content_cursor_y = (tabdata.content_cursor_y >= 2)?(0):(tabdata.content_cursor_y + 1);
|
||
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//某个内容被焦点后,在此处修改内容值
|
||
setting_contents_modify(tabdata.item_cursor, tabdata.content_cursor, KEY_DOWN, 1);
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case KEY_OK:
|
||
{
|
||
key = 0;
|
||
|
||
//OK键用于选择选项卡时:选项卡未选中时内部内容全部熄灭
|
||
if(tabdata.content_cursor == 99)
|
||
{
|
||
//选中后点亮第一个内容
|
||
switch (tabdata.item_cursor)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
tabdata.content_cursor_x = 1;
|
||
tabdata.content_cursor_y = 0;
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
tabdata.content_cursor_prv = 99;
|
||
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
tabdata.content_cursor_x = 4;
|
||
tabdata.content_cursor_y = 0;
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
tabdata.content_cursor_prv = 99;
|
||
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_2:
|
||
{
|
||
tabdata.content_cursor_x = 0;
|
||
tabdata.content_cursor_y = 0;
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
tabdata.content_cursor_prv = 99;
|
||
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_3:
|
||
{
|
||
tabdata.content_cursor_x = 0;
|
||
tabdata.content_cursor_y = 0;
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
tabdata.content_cursor_prv = 99;
|
||
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//进入此处说明选项卡已被选中,此时需要选择内容
|
||
//内容焦点后,通过KEY_UP和KEY_DOWN修改
|
||
//KEY_BACK按下后,取消焦点
|
||
tabdata.content_focus = 1;
|
||
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
|
||
//部分内容特殊处理
|
||
//参数保存,确认窗口
|
||
if( ( tabdata.item_cursor == ITEMS_1 )&&( tabdata.content_cursor == CONTENT_1_1 ) )
|
||
{
|
||
tabdata.window_deal_flag = 1;
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_cont_window, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_question, "明暗完成");
|
||
|
||
}
|
||
|
||
//参数复位,确认窗口
|
||
if( ( tabdata.item_cursor == ITEMS_1 )&&( tabdata.content_cursor == CONTENT_1_2 ) )
|
||
{
|
||
tabdata.window_deal_flag = 1;
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_cont_window, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_question, "背景颜色");
|
||
}
|
||
}
|
||
|
||
}
|
||
break;
|
||
|
||
//仅用于选择内容
|
||
case KEY_LEFT:
|
||
{
|
||
key = 0;
|
||
|
||
if( (tabdata.content_cursor == 99)||(tabdata.content_focus == 1) )
|
||
{
|
||
//选项卡未选中时,直接返回
|
||
//已经存在焦点时,直接返回
|
||
return;
|
||
}
|
||
|
||
switch (tabdata.item_cursor)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
tabdata.content_cursor_prv = tabdata.content_cursor;
|
||
|
||
tabdata.content_cursor_x = (tabdata.content_cursor_x <= 1)?(5):(tabdata.content_cursor_x - 2);
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{}
|
||
break;
|
||
|
||
case ITEMS_2:
|
||
{}
|
||
break;
|
||
|
||
case ITEMS_3:
|
||
{
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
}
|
||
break;
|
||
|
||
//仅用于选择内容
|
||
case KEY_RIGHT:
|
||
{
|
||
key = 0;
|
||
|
||
if( (tabdata.content_cursor == 99)||(tabdata.content_focus == 1) )
|
||
{
|
||
//选项卡未选中时,直接返回
|
||
//已经存在焦点时,直接返回
|
||
return;
|
||
}
|
||
|
||
switch (tabdata.item_cursor)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
tabdata.content_cursor_prv = tabdata.content_cursor;
|
||
|
||
tabdata.content_cursor_x = (tabdata.content_cursor_x >= 5)?(1):(tabdata.content_cursor_x + 2);
|
||
tabdata.content_cursor = contents_xy2cursor(tabdata.content_cursor_x, tabdata.content_cursor_y);
|
||
|
||
setting_contents_check(tabdata.content_cursor, tabdata.content_cursor_prv);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{}
|
||
break;
|
||
|
||
case ITEMS_2:
|
||
{}
|
||
break;
|
||
|
||
case ITEMS_3:
|
||
{
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
break;
|
||
|
||
default:
|
||
{
|
||
key = 0;
|
||
}
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
void setting_items_check(uint8_t cursor, uint8_t cursor_prv)
|
||
{
|
||
//操作选项卡
|
||
switch (cursor) //点亮当前选中目标
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_s0, lv_color_hex(COLOR_ITEMS_CHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_s1, lv_color_hex(COLOR_ITEMS_CHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_2:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_s2, lv_color_hex(COLOR_ITEMS_CHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_3:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_s3, lv_color_hex(COLOR_ITEMS_CHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
switch (cursor_prv) //熄灭前一时刻的目标
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_s0, lv_color_hex(COLOR_ITEMS_UNCHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_s1, lv_color_hex(COLOR_ITEMS_UNCHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_2:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_s2, lv_color_hex(COLOR_ITEMS_UNCHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_3:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_s3, lv_color_hex(COLOR_ITEMS_UNCHECKED), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
contents_refresh(cursor_prv, cursor);
|
||
}
|
||
|
||
//设置界面选项卡内部内容选中:点亮cursor;熄灭cursor_prv;焦点focus
|
||
void setting_contents_check(uint8_t cursor, uint8_t cursor_prv)
|
||
{
|
||
//根据焦点与否切换点亮时的颜色
|
||
uint32_t color = 0;
|
||
if(tabdata.content_focus)
|
||
{
|
||
color = COLOR_CONTENTS_FOCUSED;
|
||
}
|
||
else
|
||
{
|
||
color = COLOR_CONTENTS_CHECKED;
|
||
}
|
||
|
||
//操作内容
|
||
switch (tabdata.item_cursor)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
//点亮cursor
|
||
set_contents_color(cursor, color);
|
||
|
||
//熄灭cursor_prv
|
||
color = COLOR_CONTENTS_UNCHECKED;
|
||
set_contents_color(cursor_prv, color);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
//点亮cursor
|
||
set_contents_color(cursor, color);
|
||
|
||
//熄灭cursor_prv
|
||
color = COLOR_CONTENTS_UNCHECKED;
|
||
set_contents_color(cursor_prv, color);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_2:
|
||
{
|
||
|
||
}
|
||
break;
|
||
|
||
case ITEMS_3:
|
||
{
|
||
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
//设置界面选项卡内部内容选中之后,修改内容,修改第ite个选项卡的第con个内容
|
||
void setting_contents_modify(uint8_t ite, uint8_t con, uint8_t key_val, int8_t step)
|
||
{
|
||
step = (key_val == KEY_UP)?(step):(0 - step);
|
||
//选中某一选项卡后,对选项卡内部的内容进行选择
|
||
switch (ite)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
contents_modify_item_0(con, step);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
contents_modify_item_1(con, step);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_2:
|
||
{
|
||
}
|
||
break;
|
||
|
||
case ITEMS_3:
|
||
{
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
}
|
||
|
||
//修改选项卡0的内容
|
||
void contents_modify_item_0(uint8_t cursor, int8_t step)
|
||
{
|
||
switch (cursor)
|
||
{
|
||
case CONTENT_0_0:
|
||
{
|
||
if(tabdata.content00 == VOLTAGE_V)
|
||
{
|
||
tabdata.content00 = VOLTAGE_MV;
|
||
}
|
||
else
|
||
{
|
||
tabdata.content00 = VOLTAGE_V;
|
||
}
|
||
|
||
//更新显示内容
|
||
//单位改变时,相关数值也要跟随
|
||
setting_update(ITEMS_0, CONTENT_0_0);
|
||
setting_update(ITEMS_0, CONTENT_0_1);
|
||
setting_update(ITEMS_0, CONTENT_0_2);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_1:
|
||
{
|
||
switch (tabdata.content00)
|
||
{
|
||
case VOLTAGE_MV:
|
||
{
|
||
tabdata.content01[1] += step;
|
||
|
||
//上下限幅
|
||
if( tabdata.content01[1] > VOL[1].up ) tabdata.content01[1] = VOL[1].up;
|
||
if( tabdata.content01[1] < VOL[1].low ) tabdata.content01[1] = VOL[1].low;
|
||
//上限不能低于下限值,避免自相矛盾
|
||
if( tabdata.content01[1] < tabdata.content02[1] ) tabdata.content01[1] = tabdata.content02[1];
|
||
}
|
||
break;
|
||
|
||
case VOLTAGE_V:
|
||
{
|
||
tabdata.content01[0] += step;
|
||
|
||
//上下限幅
|
||
if( tabdata.content01[0] > VOL[0].up ) tabdata.content01[0] = VOL[0].up;
|
||
if( tabdata.content01[0] < VOL[0].low ) tabdata.content01[0] = VOL[0].low;
|
||
//上限不能低于下限值,避免自相矛盾
|
||
if( tabdata.content01[0] < tabdata.content02[0] ) tabdata.content01[0] = tabdata.content02[0];
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_1);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_2:
|
||
{
|
||
switch (tabdata.content00)
|
||
{
|
||
case VOLTAGE_MV:
|
||
{
|
||
tabdata.content02[1] += step;
|
||
|
||
//上下限幅
|
||
if( tabdata.content02[1] > VOL[1].up ) tabdata.content02[1] = VOL[1].up;
|
||
if( tabdata.content02[1] < VOL[1].low ) tabdata.content02[1] = VOL[1].low;
|
||
//下限不能高于下限值,避免自相矛盾
|
||
if( tabdata.content02[1] > tabdata.content01[1] ) tabdata.content02[1] = tabdata.content01[1];
|
||
}
|
||
break;
|
||
|
||
case VOLTAGE_V:
|
||
{
|
||
tabdata.content02[0] += step;
|
||
|
||
//上下限幅
|
||
if( tabdata.content02[0] > VOL[0].up ) tabdata.content02[0] = VOL[0].up;
|
||
if( tabdata.content02[0] < VOL[0].low ) tabdata.content02[0] = VOL[0].low;
|
||
//下限不能高于下限值,避免自相矛盾
|
||
if( tabdata.content02[0] > tabdata.content01[0] ) tabdata.content02[0] = tabdata.content01[0];
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_2);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_3:
|
||
{
|
||
tabdata.content03 += step;
|
||
|
||
if( tabdata.content03 > CUR.up ) tabdata.content03 = CUR.up;
|
||
if( tabdata.content03 < CUR.low ) tabdata.content03 = CUR.low;
|
||
if( tabdata.content03 < tabdata.content04 ) tabdata.content03 = tabdata.content04;
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_3);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_4:
|
||
{
|
||
tabdata.content04 += step;
|
||
|
||
if( tabdata.content04 > CUR.up ) tabdata.content04 = CUR.up;
|
||
if( tabdata.content04 < CUR.low ) tabdata.content04 = CUR.low;
|
||
if( tabdata.content04 > tabdata.content03 ) tabdata.content04 = tabdata.content03;
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_4);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_5:
|
||
{
|
||
tabdata.content05 += step;
|
||
|
||
if( tabdata.content05 > RES.up ) tabdata.content05 = RES.up;
|
||
if( tabdata.content05 < RES.low ) tabdata.content05 = RES.low;
|
||
if( tabdata.content05 < tabdata.content06 ) tabdata.content05 = tabdata.content06;
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_5);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_6:
|
||
{
|
||
tabdata.content06 += step;
|
||
|
||
if( tabdata.content06 > RES.up ) tabdata.content06 = RES.up;
|
||
if( tabdata.content06 < RES.low ) tabdata.content06 = RES.low;
|
||
if( tabdata.content06 > tabdata.content05 ) tabdata.content06 = tabdata.content05;
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_6);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_7:
|
||
{
|
||
tabdata.content07 += step;
|
||
|
||
if( tabdata.content07 > FRE.up ) tabdata.content07 = FRE.up;
|
||
if( tabdata.content07 < FRE.low ) tabdata.content07 = FRE.low;
|
||
if( tabdata.content07 < tabdata.content08 ) tabdata.content07 = tabdata.content08;
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_7);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_8:
|
||
{
|
||
tabdata.content08 += step;
|
||
|
||
if( tabdata.content08 > FRE.up ) tabdata.content08 = FRE.up;
|
||
if( tabdata.content08 < FRE.low ) tabdata.content08 = FRE.low;
|
||
if( tabdata.content08 > tabdata.content07 ) tabdata.content08 = tabdata.content07;
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_8);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_9:
|
||
{
|
||
uint8_t c09_temp = 0;
|
||
c09_temp = (uint8_t)tabdata.content013;
|
||
c09_temp -= 5; //[5, 12]->[0, 7]
|
||
|
||
tabdata.content09[c09_temp] += step;
|
||
if( tabdata.content09[c09_temp] > TC[c09_temp].up ) tabdata.content09[c09_temp] = TC[c09_temp].up;
|
||
if( tabdata.content09[c09_temp] < TC[c09_temp].low ) tabdata.content09[c09_temp] = TC[c09_temp].low;
|
||
if( tabdata.content010[c09_temp] > tabdata.content09[c09_temp] ) tabdata.content09[c09_temp] = tabdata.content010[c09_temp];
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_9);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_10:
|
||
{
|
||
uint8_t c010_temp = 0;
|
||
c010_temp = (uint8_t)tabdata.content013;
|
||
c010_temp -= 5; //[5, 12]->[0, 7]
|
||
|
||
if( tabdata.content010[c010_temp] > TC[c010_temp].up ) tabdata.content010[c010_temp] = TC[c010_temp].up;
|
||
if( tabdata.content010[c010_temp] < TC[c010_temp].low ) tabdata.content010[c010_temp] = TC[c010_temp].low;
|
||
if( tabdata.content010[c010_temp] > tabdata.content09[c010_temp] ) tabdata.content010[c010_temp] = tabdata.content09[c010_temp];
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_10);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_11:
|
||
{
|
||
tabdata.content011 += step;
|
||
|
||
if( tabdata.content011 > RTD.up ) tabdata.content011 = RTD.up;
|
||
if( tabdata.content011 < RTD.low ) tabdata.content011 = RTD.low;
|
||
if( tabdata.content011 < tabdata.content012 ) tabdata.content011 = tabdata.content012;
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_11);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_12:
|
||
{
|
||
tabdata.content012 += step;
|
||
|
||
if( tabdata.content012 > RTD.up ) tabdata.content012 = RTD.up;
|
||
if( tabdata.content012 < RTD.low ) tabdata.content012 = RTD.low;
|
||
if( tabdata.content012 > tabdata.content011 ) tabdata.content012 = tabdata.content011;
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_12);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_13:
|
||
{
|
||
uint8_t c13_temp = 0;
|
||
c13_temp = (uint8_t)tabdata.content013;
|
||
c13_temp =(c13_temp >= 12)?(5):(c13_temp + 1); //不使用step
|
||
tabdata.content013 = (SIG_FUNCTIONS_TYPE)c13_temp;
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_0, CONTENT_0_13);
|
||
//类型改变时,相关数值也要跟随
|
||
setting_update(ITEMS_0, CONTENT_0_9);
|
||
setting_update(ITEMS_0, CONTENT_0_10);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
//修改选项卡1的内容
|
||
void contents_modify_item_1(uint8_t cursor, int8_t step)
|
||
{
|
||
switch (cursor)
|
||
{
|
||
case CONTENT_1_0:
|
||
{
|
||
//照明控制
|
||
if(tabdata.light_flag)
|
||
{
|
||
tabdata.light_flag = 0;
|
||
LIGHT_OFF;
|
||
|
||
}
|
||
else
|
||
{
|
||
tabdata.light_flag = 1;
|
||
LIGHT_ON;
|
||
}
|
||
|
||
//更新显示内容
|
||
setting_update(ITEMS_1, CONTENT_1_0);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_1_1:
|
||
{}
|
||
break;
|
||
|
||
case CONTENT_1_2:
|
||
{}
|
||
break;
|
||
|
||
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
void setting_update(uint8_t ite, uint8_t con)
|
||
{
|
||
char str_temp[16];
|
||
switch (ite)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
switch (con)
|
||
{
|
||
case CONTENT_0_0:
|
||
{
|
||
switch (tabdata.content00)
|
||
{
|
||
case VOLTAGE_MV:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_01, "mV");
|
||
}
|
||
break;
|
||
|
||
case VOLTAGE_V:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_01, "V");
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_1:
|
||
{
|
||
switch (tabdata.content00)
|
||
{
|
||
case VOLTAGE_MV:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content01[1]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_03, str_temp);
|
||
}
|
||
break;
|
||
|
||
case VOLTAGE_V:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content01[0]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_03, str_temp);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_2:
|
||
{
|
||
switch (tabdata.content00)
|
||
{
|
||
case VOLTAGE_MV:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content02[1]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_05, str_temp);
|
||
}
|
||
break;
|
||
|
||
case VOLTAGE_V:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content02[0]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_05, str_temp);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_3:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content03);
|
||
lv_label_set_text(guider_ui.screen_setting_label_13, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_4:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content04);
|
||
lv_label_set_text(guider_ui.screen_setting_label_15, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_5:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content05);
|
||
lv_label_set_text(guider_ui.screen_setting_label_23, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_6:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content06);
|
||
lv_label_set_text(guider_ui.screen_setting_label_25, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_7:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content07);
|
||
lv_label_set_text(guider_ui.screen_setting_label_33, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_8:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content08);
|
||
lv_label_set_text(guider_ui.screen_setting_label_35, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_9:
|
||
{
|
||
uint8_t c09_temp = 0;
|
||
c09_temp = (uint8_t)tabdata.content013;
|
||
c09_temp -= 5; //[5, 12]->[0, 7]
|
||
|
||
sprintf(str_temp,"%d",tabdata.content09[c09_temp]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_43, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_10:
|
||
{
|
||
uint8_t c10_temp = 0;
|
||
c10_temp = (uint8_t)tabdata.content013;
|
||
c10_temp -= 5; //[5, 12]->[0, 7]
|
||
|
||
sprintf(str_temp,"%d",tabdata.content010[c10_temp]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_45, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_11:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content011);
|
||
lv_label_set_text(guider_ui.screen_setting_label_53, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_12:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content012);
|
||
lv_label_set_text(guider_ui.screen_setting_label_55, str_temp);
|
||
}
|
||
break;
|
||
|
||
case CONTENT_0_13:
|
||
{
|
||
switch (tabdata.content013)
|
||
{
|
||
case TC_K:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_41, "K ℃");
|
||
}
|
||
break;
|
||
|
||
case TC_S:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_41, "S ℃");
|
||
}
|
||
break;
|
||
|
||
case TC_N:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_41, "N ℃");
|
||
}
|
||
break;
|
||
|
||
case TC_B:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_41, "B ℃");
|
||
}
|
||
break;
|
||
|
||
case TC_E:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_41, "E ℃");
|
||
}
|
||
break;
|
||
|
||
case TC_J:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_41, "J ℃");
|
||
}
|
||
break;
|
||
|
||
case TC_R:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_41, "R ℃");
|
||
}
|
||
break;
|
||
|
||
case TC_T:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_41, "T ℃");
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
switch (con)
|
||
{
|
||
case CONTENT_1_0:
|
||
{
|
||
if (tabdata.light_flag)
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_04, "ON");
|
||
}
|
||
else
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_04, "OFF");
|
||
}
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case ITEMS_2:
|
||
{}
|
||
break;
|
||
|
||
case ITEMS_3:
|
||
{}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
//设置界面刷新选项卡的内容,隐藏items_prv,显示items_now
|
||
void contents_refresh(uint8_t items_prv, uint8_t items_now)
|
||
{
|
||
char str_temp[14];
|
||
|
||
switch (items_prv)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_02, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_03, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_04, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_05, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_12, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_13, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_14, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_15, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_22, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_23, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_24, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_25, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_32, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_33, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_34, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_35, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_40, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_41, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_42, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_43, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_44, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_45, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_50, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_51, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_52, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_53, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_54, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_55, LV_OBJ_FLAG_HIDDEN);
|
||
|
||
|
||
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
//照明
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN);
|
||
//ON&OFF
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_04, LV_OBJ_FLAG_HIDDEN);
|
||
|
||
//参数 保存 保存
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_14, LV_OBJ_FLAG_HIDDEN);
|
||
|
||
//参数 复位 复位
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_add_flag(guider_ui.screen_setting_label_24, LV_OBJ_FLAG_HIDDEN);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
switch (items_now)
|
||
{
|
||
case ITEMS_0:
|
||
{
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_00, "电压");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_01, LV_OBJ_FLAG_HIDDEN);
|
||
switch (tabdata.content00)
|
||
{
|
||
case VOLTAGE_MV:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_01, "mV");
|
||
}
|
||
break;
|
||
|
||
case VOLTAGE_V:
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_01, "V");
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_02, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_02, "上限");
|
||
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_03, LV_OBJ_FLAG_HIDDEN);
|
||
switch (tabdata.content00)
|
||
{
|
||
case VOLTAGE_MV:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content01[1]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_03, str_temp);
|
||
}
|
||
break;
|
||
|
||
case VOLTAGE_V:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content01[0]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_03, str_temp);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_04, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_04, "下限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_05, LV_OBJ_FLAG_HIDDEN);
|
||
switch (tabdata.content00)
|
||
{
|
||
case VOLTAGE_MV:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content02[1]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_05, str_temp);
|
||
}
|
||
break;
|
||
|
||
case VOLTAGE_V:
|
||
{
|
||
sprintf(str_temp,"%d",tabdata.content02[0]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_05, str_temp);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_10, "电流");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_11, "mA");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_12, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_12, "上限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_13, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content03);
|
||
lv_label_set_text(guider_ui.screen_setting_label_13, str_temp);
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_14, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_14, "下限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_15, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content04);
|
||
lv_label_set_text(guider_ui.screen_setting_label_15, str_temp);
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_20, "电阻");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_21, "Ω");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_22, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_22, "上限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_23, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content05);
|
||
lv_label_set_text(guider_ui.screen_setting_label_23, str_temp);
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_24, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_24, "下限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_25, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content06);
|
||
lv_label_set_text(guider_ui.screen_setting_label_25, str_temp);
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_30, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_30, "频率");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_31, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_31, "KHz");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_32, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_32, "上限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_33, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content07);
|
||
lv_label_set_text(guider_ui.screen_setting_label_33, str_temp);
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_34, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_34, "下限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_35, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content08);
|
||
lv_label_set_text(guider_ui.screen_setting_label_35, str_temp);
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_40, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_40, "TC");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_41, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_41, "℃");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_42, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_42, "上限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_43, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content09[ (uint8_t)tabdata.content013 ]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_43, str_temp);
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_44, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_44, "下限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_45, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content010[ (uint8_t)tabdata.content013 ]);
|
||
lv_label_set_text(guider_ui.screen_setting_label_45, str_temp);
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_50, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_50, "RTD");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_51, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_51, "℃");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_52, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_52, "上限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_53, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content011);
|
||
lv_label_set_text(guider_ui.screen_setting_label_53, str_temp);
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_54, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_54, "下限");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_55, LV_OBJ_FLAG_HIDDEN);
|
||
sprintf(str_temp,"%d",tabdata.content012);
|
||
lv_label_set_text(guider_ui.screen_setting_label_55, str_temp);
|
||
}
|
||
break;
|
||
|
||
case ITEMS_1:
|
||
{
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_00, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_00, "照明");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_04, LV_OBJ_FLAG_HIDDEN);
|
||
if(tabdata.light_flag)
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_04, "ON");
|
||
}
|
||
else
|
||
{
|
||
lv_label_set_text(guider_ui.screen_setting_label_04, "OFF");
|
||
}
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_10, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_10, "参数");
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_11, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_11, "保存");
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_14, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_14, "保存");
|
||
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_20, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_20, "参数");
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_21, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_21, "复位");
|
||
lv_obj_clear_flag(guider_ui.screen_setting_label_24, LV_OBJ_FLAG_HIDDEN);
|
||
lv_label_set_text(guider_ui.screen_setting_label_24, "复位");
|
||
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
//将游标的横纵坐标转换成游标值,x[0,5], y[0,5], cursor[0,35]
|
||
uint8_t contents_xy2cursor(uint8_t px, uint8_t py)
|
||
{
|
||
uint8_t result = 0;
|
||
|
||
result = px + 6 * py;
|
||
|
||
return result;
|
||
}
|
||
|
||
//设置内容的底色
|
||
void set_contents_color(uint8_t cursor, uint32_t color)
|
||
{
|
||
switch (cursor)
|
||
{
|
||
case 0:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_00, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 1:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_01, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 2:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_02, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 3:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_03, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 4:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_04, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 5:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_05, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 6:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_10, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 7:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_11, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 8:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_12, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 9:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_13, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 10:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_14, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 11:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_15, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 12:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_20, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 13:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_21, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 14:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_22, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 15:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_23, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 16:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_24, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 17:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_25, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 18:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_30, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 19:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_31, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 20:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_32, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 21:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_33, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 22:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_34, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 23:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_35, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 24:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_40, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 25:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_41, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 26:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_42, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 27:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_43, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 28:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_44, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 29:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_45, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 30:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_50, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 31:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_51, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 32:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_52, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 33:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_53, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 34:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_54, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
case 35:
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_55, lv_color_hex(color), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
void scr_setting_recover(void)
|
||
{
|
||
//在这里恢复选项卡0的显示内容
|
||
//ITEMS_0
|
||
setting_update(ITEMS_0, CONTENT_0_0);
|
||
setting_update(ITEMS_0, CONTENT_0_1);
|
||
setting_update(ITEMS_0, CONTENT_0_2);
|
||
setting_update(ITEMS_0, CONTENT_0_3);
|
||
setting_update(ITEMS_0, CONTENT_0_4);
|
||
setting_update(ITEMS_0, CONTENT_0_5);
|
||
setting_update(ITEMS_0, CONTENT_0_6);
|
||
setting_update(ITEMS_0, CONTENT_0_7);
|
||
setting_update(ITEMS_0, CONTENT_0_8);
|
||
setting_update(ITEMS_0, CONTENT_0_9);
|
||
setting_update(ITEMS_0, CONTENT_0_10);
|
||
setting_update(ITEMS_0, CONTENT_0_11);
|
||
setting_update(ITEMS_0, CONTENT_0_12);
|
||
setting_update(ITEMS_0, CONTENT_0_13);
|
||
|
||
}
|
||
|
||
//处理弹窗
|
||
void tab_window_deal(void)
|
||
{
|
||
uint8_t step_window = key;
|
||
key = 0;
|
||
switch (step_window)
|
||
{
|
||
case KEY_LEFT:
|
||
{
|
||
tabdata.window_cursor_prv = tabdata.window_cursor;
|
||
tabdata.window_cursor = !tabdata.window_cursor;
|
||
|
||
if(tabdata.window_cursor == 0)
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_ok, lv_color_hex(0x629aff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_back, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
else
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_ok, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_back, lv_color_hex(0x629aff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case KEY_RIGHT:
|
||
{
|
||
tabdata.window_cursor_prv = tabdata.window_cursor;
|
||
tabdata.window_cursor = !tabdata.window_cursor;
|
||
|
||
if(tabdata.window_cursor == 0)
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_ok, lv_color_hex(0x629aff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_back, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
else
|
||
{
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_ok, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_back, lv_color_hex(0x629aff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case KEY_OK:
|
||
{
|
||
if(tabdata.window_cursor == 0)
|
||
{
|
||
//OK
|
||
}
|
||
else
|
||
{
|
||
//BACK
|
||
step_window = KEY_BACK;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case KEY_BACK:
|
||
{
|
||
tabdata.content_focus = 0;
|
||
setting_contents_check(tabdata.content_cursor, 99);
|
||
|
||
tabdata.window_deal_flag = 0;
|
||
tabdata.window_cursor_prv = 0;
|
||
tabdata.window_cursor = 0;
|
||
lv_obj_add_flag(guider_ui.screen_setting_cont_window, LV_OBJ_FLAG_HIDDEN);
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_ok, lv_color_hex(0x629aff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
lv_obj_set_style_bg_color(guider_ui.screen_setting_label_back, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_DEFAULT);
|
||
}
|
||
break;
|
||
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
uint8_t scroll_flag = 0;
|
||
void scr_setting_run(void) //详细设置界面
|
||
{
|
||
//电压mV显示,溢出部分特殊处理
|
||
//默认为DOT,游标移动至对应位置后变为SCROLL_CIRCULAR
|
||
if(tabdata.content_cursor == 5)
|
||
{
|
||
if(scroll_flag == 0)
|
||
{
|
||
scroll_flag = 1;
|
||
lv_label_set_long_mode(guider_ui.screen_setting_label_05, LV_LABEL_LONG_SCROLL_CIRCULAR);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if(scroll_flag == 1)
|
||
{
|
||
scroll_flag = 0;
|
||
lv_label_set_long_mode(guider_ui.screen_setting_label_05, LV_LABEL_LONG_DOT);
|
||
}
|
||
}
|
||
}
|
||
|
||
|