Merge code of ding to fixed setting and play screen bug.

This commit is contained in:
xiaojiazhu 2023-11-03 14:32:51 +08:00
parent b313530625
commit 1ecfe61844
4 changed files with 129 additions and 44 deletions

View File

@ -18,6 +18,11 @@ static lv_obj_t* menu_tab = NULL;
static lv_obj_t* menu_item = NULL; static lv_obj_t* menu_item = NULL;
//static lv_obj_t* menu_option = NULL; //static lv_obj_t* menu_option = NULL;
//static lv_obj_t* label_menu_item = NULL; //static lv_obj_t* label_menu_item = NULL;
//#NT#2023/11/03#Eric - begin
//#NT#Support IVOT_N12144_CO-148 -5
BOOL PrevSel_Img = false;
//#NT#2023/11/03#Eric - end
#if 0 #if 0
static lv_obj_t* container_option1 = NULL; static lv_obj_t* container_option1 = NULL;
static lv_obj_t* container_option2 = NULL; static lv_obj_t* container_option2 = NULL;
@ -145,6 +150,10 @@ static void LV_MenuItem_OnNext(lv_obj_t* obj)
lv_plugin_menu_select_item(menu_item, pPage->SelItem); lv_plugin_menu_select_item(menu_item, pPage->SelItem);
return; return;
} }
//#NT#2023/11/03#Eric - begin
//#NT#Support IVOT_N12144_CO-148 -5
PrevSel_Img = false;
//#NT#2023/11/03#Eric - end
LV_MenuCommonItem_UpdateContent(pMenu); LV_MenuCommonItem_UpdateContent(pMenu);
lv_plugin_menu_select_next_item(menu_item); lv_plugin_menu_select_next_item(menu_item);
} }
@ -157,13 +166,22 @@ static void LV_MenuItem_OnUp(lv_obj_t* obj)
TM_PAGE *pPage; TM_PAGE *pPage;
pPage = &pMenu->pPages[pMenu->SelPage]; pPage = &pMenu->pPages[pMenu->SelPage];
if (pMenu->Status == TMS_ON_TAB) if (pMenu->Status == TMS_ON_TAB)
{ {
printf("handle on tab.\n"); printf("handle on tab.\n");
TM_ShiftTab(pMenu, -1); TM_ShiftTab(pMenu, -1);
lv_plugin_menu_select_prev_item(menu_tab); //#NT#2023/11/03#Eric - begin
//#NT#Support //#NT#Support IVOT_N12144_CO-148 -1
lv_plugin_menu_select_first_item(menu_item);
//#NT#2023/11/03#Eric - end
LV_MenuCommonItem_UpdateContent(pMenu); LV_MenuCommonItem_UpdateContent(pMenu);
lv_plugin_menu_select_prev_item(menu_tab);
}else{ }else{
printf("handle on item.\n");
//#NT#2023/11/03#Eric - begin
//#NT#Support IVOT_N12144_CO-148
//if (pMenu->Status == TMS_ON_TAB)
//#NT#2023/11/03#Eric - end
pPage->SelItem = 0; pPage->SelItem = 0;
pMenu->Status = TMS_ON_TAB; pMenu->Status = TMS_ON_TAB;
lv_plugin_menu_clear_selected_item(menu_item); lv_plugin_menu_clear_selected_item(menu_item);
@ -266,7 +284,10 @@ static void LV_MenuItem_OnSelected(lv_obj_t* obj)
if (pMenu->Status == TMS_ON_ITEM) if (pMenu->Status == TMS_ON_ITEM)
{ {
pItem = &pPage->pItems[pPage->SelItem]; pItem = &pPage->pItems[pPage->SelItem];
// DBG_DUMP("\r\n %s pPage SelItem= %d\r\n", __func__, pPage->SelItem); //#NT#2023/11/03#Eric - begin
//#NT#Support IVOT_N12144_CO-148 -5
PrevSel_Img = true;
//#NT#2023/11/03#Eric - end
//#NT#2016/09/20#Bob Huang -begin //#NT#2016/09/20#Bob Huang -begin
//#NT#Support HDMI Display with 3DNR Out //#NT#Support HDMI Display with 3DNR Out
//Only support FHD p30 size, cannot change size when 3DNR Out enabled //Only support FHD p30 size, cannot change size when 3DNR Out enabled
@ -277,7 +298,10 @@ static void LV_MenuItem_OnSelected(lv_obj_t* obj)
} }
#endif #endif
if((pItem->ItemId == IDM_CHECK_IN_PHOTO) || (pItem->ItemId == IDM_SD_LOOP) \ if((pItem->ItemId == IDM_CHECK_IN_PHOTO) || (pItem->ItemId == IDM_SD_LOOP) \
//#NT#2023/11/03#Eric - begin
//#NT#Support IVOT_N12144_CO-148 -6
|| (pItem->ItemId == IDM_GPS)){ || (pItem->ItemId == IDM_GPS)){
//#NT#2023/11/03#Eric - end
//pItem = &pPage->pItems[pPage->SelItem]; //pItem = &pPage->pItems[pPage->SelItem];
#define SWITCH_OFF 0 #define SWITCH_OFF 0
#define SWITCH_ON 1 #define SWITCH_ON 1
@ -404,6 +428,11 @@ void LV_MenuItem_OnOpen(lv_obj_t* obj)
lv_plugin_menu_init_items(menu_item, PAGE); lv_plugin_menu_init_items(menu_item, PAGE);
} }
// lv_plugin_menu_select_item(menu_item, 0); // lv_plugin_menu_select_item(menu_item, 0);
//#NT#2023/11/03#Eric - begin
//#NT#Support IVOT_N12144_CO-148 -6
PrevSel_Img = 0;
//#NT#2023/11/03#Eric - end
LV_MenuCommonItem_UpdateContent(pMenu); LV_MenuCommonItem_UpdateContent(pMenu);
} }
@ -555,43 +584,79 @@ static void LV_MenuCommonItem_UpdateContent(TM_MENU *pMenu)
if(!u_hiddenitem){ if(!u_hiddenitem){
if(i == 0){ if(i == 0){
// lv_obj_set_hidden(image_option_01_scr_uiflowmenucommonitem, true); lv_obj_set_hidden(image_option_01_scr_uiflowmenucommonitem, true);
lv_plugin_img_set_src(image_option_01_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2); //#NT#2023/11/03#Eric - begin
lv_obj_set_hidden(image_option_01_scr_uiflowmenucommonitem, false); //#NT#Support IVOT_N12144_CO-148 -5
if((pPage->SelItem == 0)&&(pMenu->Status == TMS_ON_ITEM)){
lv_plugin_img_set_src(image_option_1_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
}else{
lv_plugin_img_set_src(image_option_1_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1);
}
//#NT#2023/11/03#Eric - end
lv_plugin_label_set_text(label_option_1_scr_uiflowmenucommonitem, pOption->TextId); lv_plugin_label_set_text(label_option_1_scr_uiflowmenucommonitem, pOption->TextId);
lv_plugin_label_update_font(label_option_1_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN); lv_plugin_label_update_font(label_option_1_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN);
lv_obj_set_hidden(container_option_1_scr_uiflowmenucommonitem, false); lv_obj_set_hidden(container_option_1_scr_uiflowmenucommonitem, false);
}else if(i == 1){ }else if(i == 1){
// lv_obj_set_hidden(image_option_02_scr_uiflowmenucommonitem, true); lv_obj_set_hidden(image_option_02_scr_uiflowmenucommonitem, true);
lv_plugin_img_set_src(image_option_02_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2); //#NT#2023/11/03#Eric - begin
lv_obj_set_hidden(image_option_02_scr_uiflowmenucommonitem, false); //#NT#Support IVOT_N12144_CO-148 -5
if((pPage->SelItem == 1)&&(pMenu->Status == TMS_ON_ITEM)){
lv_plugin_img_set_src(image_option_2_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
}else{
lv_plugin_img_set_src(image_option_2_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1);
}
//#NT#2023/11/03#Eric - end
lv_plugin_label_set_text(label_option_2_scr_uiflowmenucommonitem, pOption->TextId); lv_plugin_label_set_text(label_option_2_scr_uiflowmenucommonitem, pOption->TextId);
lv_plugin_label_update_font(label_option_2_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN); lv_plugin_label_update_font(label_option_2_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN);
lv_obj_set_hidden(container_option_2_scr_uiflowmenucommonitem, false); lv_obj_set_hidden(container_option_2_scr_uiflowmenucommonitem, false);
}else if(i == 2){ }else if(i == 2){
// lv_obj_set_hidden(image_option_03_scr_uiflowmenucommonitem, true); lv_obj_set_hidden(image_option_03_scr_uiflowmenucommonitem, true);
lv_plugin_img_set_src(image_option_03_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2); //#NT#2023/11/03#Eric - begin
lv_obj_set_hidden(image_option_03_scr_uiflowmenucommonitem, false); //#NT#Support IVOT_N12144_CO-148 -5
if((pPage->SelItem == 2)&&(pMenu->Status == TMS_ON_ITEM)){
lv_plugin_img_set_src(image_option_3_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
}else{
lv_plugin_img_set_src(image_option_3_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1);
}
//#NT#2023/11/03#Eric - end
lv_plugin_label_set_text(label_option_3_scr_uiflowmenucommonitem, pOption->TextId); lv_plugin_label_set_text(label_option_3_scr_uiflowmenucommonitem, pOption->TextId);
lv_plugin_label_update_font(label_option_3_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN); lv_plugin_label_update_font(label_option_3_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN);
lv_obj_set_hidden(container_option_3_scr_uiflowmenucommonitem, false); lv_obj_set_hidden(container_option_3_scr_uiflowmenucommonitem, false);
}else if(i == 3){ }else if(i == 3){
// lv_obj_set_hidden(image_option_04_scr_uiflowmenucommonitem, true); lv_obj_set_hidden(image_option_04_scr_uiflowmenucommonitem, true);
lv_plugin_img_set_src(image_option_04_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2); //#NT#2023/11/03#Eric - begin
lv_obj_set_hidden(image_option_04_scr_uiflowmenucommonitem, false); //#NT#Support IVOT_N12144_CO-148 -5
if((pPage->SelItem == 3)&&(pMenu->Status == TMS_ON_ITEM)){
lv_plugin_img_set_src(image_option_4_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
}else{
lv_plugin_img_set_src(image_option_4_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1);
}
//#NT#2023/11/03#Eric - end
lv_plugin_label_set_text(label_option_4_scr_uiflowmenucommonitem, pOption->TextId); lv_plugin_label_set_text(label_option_4_scr_uiflowmenucommonitem, pOption->TextId);
lv_plugin_label_update_font(label_option_4_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN); lv_plugin_label_update_font(label_option_4_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN);
lv_obj_set_hidden(container_option_4_scr_uiflowmenucommonitem, false); lv_obj_set_hidden(container_option_4_scr_uiflowmenucommonitem, false);
}else if(i == 4){ }else if(i == 4){
// lv_obj_set_hidden(image_option_05_scr_uiflowmenucommonitem, true); lv_obj_set_hidden(image_option_05_scr_uiflowmenucommonitem, true);
lv_plugin_img_set_src(image_option_05_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2); //#NT#2023/11/03#Eric - begin
lv_obj_set_hidden(image_option_05_scr_uiflowmenucommonitem, false); //#NT#Support IVOT_N12144_CO-148 -5
if((pPage->SelItem == 4)&&(pMenu->Status == TMS_ON_ITEM)){
lv_plugin_img_set_src(image_option_5_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT2);
}else{
lv_plugin_img_set_src(image_option_5_scr_uiflowmenucommonitem, LV_PLUGIN_IMG_ID_SF_NEXT1);
}
//#NT#2023/11/03#Eric - end
lv_plugin_label_set_text(label_option_5_scr_uiflowmenucommonitem, pOption->TextId); lv_plugin_label_set_text(label_option_5_scr_uiflowmenucommonitem, pOption->TextId);
lv_plugin_label_update_font(label_option_5_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN); lv_plugin_label_update_font(label_option_5_scr_uiflowmenucommonitem, LV_OBJ_PART_MAIN);
lv_obj_set_hidden(container_option_5_scr_uiflowmenucommonitem, false); lv_obj_set_hidden(container_option_5_scr_uiflowmenucommonitem, false);
} }
}else{ }else{
//#NT#2023/11/03#Eric - begin
//#NT#Support IVOT_N12144_CO-148 -5
if((pPage->SelItem == i)&&(pMenu->Status == TMS_ON_ITEM)&&(PrevSel_Img)){
lv_plugin_menu_select_item(menu_item, pPage->SelItem);
PrevSel_Img = false;
}
//#NT#2023/11/03#Eric - end
if(i == 0){ if(i == 0){
lv_obj_set_hidden(container_option_1_scr_uiflowmenucommonitem, true); lv_obj_set_hidden(container_option_1_scr_uiflowmenucommonitem, true);
lv_plugin_img_set_src(image_option_01_scr_uiflowmenucommonitem, img_id); lv_plugin_img_set_src(image_option_01_scr_uiflowmenucommonitem, img_id);
@ -620,7 +685,6 @@ static void LV_MenuCommonItem_UpdateContent(TM_MENU *pMenu)
#endif #endif
} }
if(u_ItemSel){ if(u_ItemSel){
printf(" ============================= select = %d\n", i);
if(i == 0){ if(i == 0){
lv_obj_set_hidden(image_option_01_scr_uiflowmenucommonitem, true); lv_obj_set_hidden(image_option_01_scr_uiflowmenucommonitem, true);
lv_obj_set_hidden(container_option_1_scr_uiflowmenucommonitem, true); lv_obj_set_hidden(container_option_1_scr_uiflowmenucommonitem, true);

View File

@ -1003,6 +1003,10 @@ static void UIFlowPlay_ChildScrClose(lv_obj_t* obj, const void * data)
/* once child scr closed, set keypad group again */ /* once child scr closed, set keypad group again */
set_indev_keypad_group(obj); set_indev_keypad_group(obj);
//#NT#2023/11/03#Eric - begin
//#NT#Support //#NT#Support IVOT_N12144_CO-148 -5
g_bUIFlowWndPlayNoImgWndOpened = FALSE;
//#NT#2023/11/03#Eric - end
if(data){ if(data){
@ -1034,11 +1038,24 @@ static void UIFlowPlay_ChildScrClose(lv_obj_t* obj, const void * data)
} }
break; break;
case NVTRET_ENTER_MENU: case NVTRET_ENTER_MENU:
DBG_DUMP("NVTRET_ENTER_MENU"); DBG_DUMP("NVTRET_ENTER_MENU");
SysSetFlag(FL_PROTECT, PROTECT_ONE); //#NT#2023/11/03#Eric - begin
lv_plugin_scr_open(UIFlowMenuCommonItem, NULL); //#NT#Support //#NT#Support IVOT_N12144_CO-148 -3
g_bUIFlowWndPlayNoImgWndOpened = FALSE; UIPlay_PlaySingle(PB_SINGLE_CURR);
uiStatus = PB_WaitCommandFinish(PB_WAIT_INFINITE);
if (uiStatus & PB_STA_NOIMAGE)
{
if (!g_bUIFlowWndPlayNoImgWndOpened) {
g_PlbData.State = PLB_ST_IDLE;
UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_NO_IMAGE, warn_msgbox_auto_close_ms);
g_bUIFlowWndPlayNoImgWndOpened = TRUE;
}
}else{
//#NT#2023/11/03#Eric - end
SysSetFlag(FL_PROTECT, PROTECT_ONE);
lv_plugin_scr_open(UIFlowMenuCommonItem, NULL);
g_bUIFlowWndPlayNoImgWndOpened = FALSE;
}
break; break;
case NVTRET_WARNING: case NVTRET_WARNING:
@ -1047,23 +1064,23 @@ static void UIFlowPlay_ChildScrClose(lv_obj_t* obj, const void * data)
break; break;
} }
} else { } else {
UIPlay_PlaySingle(PB_SINGLE_CURR); // UIPlay_PlaySingle(PB_SINGLE_CURR);
uiStatus = PB_WaitCommandFinish(PB_WAIT_INFINITE); // uiStatus = PB_WaitCommandFinish(PB_WAIT_INFINITE);
if (uiStatus & PB_STA_NOIMAGE) // if (uiStatus & PB_STA_NOIMAGE)
{ // {
if (!g_bUIFlowWndPlayNoImgWndOpened) { // if (!g_bUIFlowWndPlayNoImgWndOpened) {
g_PlbData.State = PLB_ST_IDLE; // g_PlbData.State = PLB_ST_IDLE;
UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_NO_IMAGE, warn_msgbox_auto_close_ms); // UIFlowWrnMsgAPI_Open_StringID(LV_PLUGIN_STRING_ID_STRID_NO_IMAGE, warn_msgbox_auto_close_ms);
g_bUIFlowWndPlayNoImgWndOpened = TRUE; // g_bUIFlowWndPlayNoImgWndOpened = TRUE;
} else { // } else {
g_PlbData.State = PLB_ST_MENU; // g_PlbData.State = PLB_ST_MENU;
SysSetFlag(FL_PROTECT, PROTECT_ONE); // SysSetFlag(FL_PROTECT, PROTECT_ONE);
lv_plugin_scr_open(UIFlowMenuCommonItem, NULL); // lv_plugin_scr_open(UIFlowMenuCommonItem, NULL);
} // }
} else { // } else {
g_PlbData.State = PLB_ST_FULL; // g_PlbData.State = PLB_ST_FULL;
} // }
} }
update_playicons(g_PlbData.State); update_playicons(g_PlbData.State);

View File

@ -15,8 +15,9 @@ extern "C" {
***************************/ ***************************/
#define LVGL_VERSION_MAJOR 7 #define LVGL_VERSION_MAJOR 7
#define LVGL_VERSION_MINOR 11 #define LVGL_VERSION_MINOR 11
#define LVGL_VERSION_PATCH 0 #define LVGL_VERSION_PATCH 1
#define LVGL_VERSION_INFO "" #define LVGL_VERSION_INFO "NVT"
/********************* /*********************
* INCLUDES * INCLUDES

View File

@ -220,7 +220,7 @@ void lv_init(void)
lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE); lv_img_cache_set_size(LV_IMG_CACHE_DEF_SIZE);
#endif #endif
/*Test if the IDE has UTF-8 encoding*/ /*Test if the IDE has UTF-8 encoding*/
char * txt = "Á"; char * txt = "á";
uint8_t * txt_u8 = (uint8_t *) txt; uint8_t * txt_u8 = (uint8_t *) txt;
if(txt_u8[0] != 0xc3 || txt_u8[1] != 0x81 || txt_u8[2] != 0x00) { if(txt_u8[0] != 0xc3 || txt_u8[1] != 0x81 || txt_u8[2] != 0x00) {
@ -613,11 +613,14 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
par = lv_obj_get_parent(par); par = lv_obj_get_parent(par);
} }
}
return true; return true;
}
return false;
} }
/** /**
* Tell whether an object is visible (even partially) now or not * Tell whether an object is visible (even partially) now or not
* @param obj pointer to an object * @param obj pointer to an object