network菜单延时一秒问题

This commit is contained in:
xiehongyan 2024-01-23 16:03:58 +08:00
parent 816de6639b
commit e88c800b2c
5 changed files with 78 additions and 25 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
#用于gitlab-ci.yml编译使用
make app_clean
#make app_clean
echo "Start compile."
export ROOT_PATH=$PWD
@ -9,7 +9,7 @@ export ROOT_PATH=$PWD
cd rtos
source build/envsetup.sh
lunch rtos cfg_565_HUNTING_EVB_LINUX_4G_S550 gcc-6.5-newlib-2.4-2019.11-arm-ca9-eabihf
make clean
#make clean
bear make all > /dev/null
cp output/application.bin ../
cp output/rtos-main.bin ../
@ -18,7 +18,7 @@ cp output/rtos-main.bin ../
cd $ROOT_PATH
source build/envsetup.sh
lunch Linux cfg_565_HUNTING_EVB_LINUX_4G_S550 arm-ca9-linux-uclibcgnueabihf-8.4.01
make clean
#make clean
bear make all > /dev/null
cd $ROOT_PATH

View File

@ -130,9 +130,9 @@ int Qr_MenuCallback(UINT32 uiMessage, UINT32 uiParam)
static lv_style_t gMatrixStylebg;
static lv_style_t gMatrixStylebtn;
static lv_style_t gStyleLabel0;
static int isinitialized = 0;
static void init_Matrix_style(void)
{
static int isinitialized = 0;
if(isinitialized)
return;
@ -308,12 +308,14 @@ static int ProfileTotal = 0;
static int ProfileSelected = 0;
static int ProfileFocused = 0;
static unsigned char ProfileNameList[PROFILE_MAX][PROFILE_NAME_SIZE] = {0};
int ReadFile = 0;
int isFirst = 0;
static int Countdown = 0;
static void update_Network_Selection_msg(lv_obj_t* obj)
{
if(pMenu == NULL || plabel == NULL)
if(pMenu == NULL)
{
printf("[error]Network Selection abnormal operation\n");
return;
@ -327,7 +329,7 @@ static void update_Network_Selection_msg(lv_obj_t* obj)
int selectedPage = ProfileFocused / ITEMS_PER_PAGE;
int ishidden = 0;
printf("ProfileTotal: %d, ProfileFocused: %d \n", ProfileTotal, ProfileFocused);
for(int i = 0; i < ITEMS_PER_PAGE; i++)
{
// printf("i:%d data:%d\n", i, (IDS_NETWORK_SELECTION_1 + (ITEMS_PER_PAGE * selectedPage) + i));
@ -336,25 +338,47 @@ static void update_Network_Selection_msg(lv_obj_t* obj)
lv_plugin_menu_set_item_img_id(pMenu, i, LV_PLUGIN_MENU_ITEM_STATE_DISABLED, LV_PLUGIN_IMG_ID_ICON_OK);
ishidden = true;
if((ITEMS_PER_PAGE * selectedPage) + i < ProfileTotal)
if(isFirst == 0)
{
lv_plugin_menu_set_item_hidden(pMenu, i, false);//整项
if((ITEMS_PER_PAGE * selectedPage) + i == ProfileFocused)
if((ITEMS_PER_PAGE * selectedPage) + i < ProfileTotal)
{
lv_plugin_menu_select_item(pMenu, i);//白条
if((ITEMS_PER_PAGE * selectedPage) + i == ProfileSelected)
{
printf("[%s:%d]profileSelected : %d, i : %d\n", __FUNCTION__, __LINE__, ProfileSelected, i);
lv_plugin_menu_select_item(pMenu, i);
ishidden = false;
}
}
if((ITEMS_PER_PAGE * selectedPage) + i == ProfileSelected)
else
{
ishidden = false;
lv_plugin_menu_set_item_hidden(pMenu, i, true);
}
}
else
{
lv_plugin_menu_set_item_hidden(pMenu, i, true);//整项
if((ITEMS_PER_PAGE * selectedPage) + i < ProfileTotal)
{
lv_plugin_menu_set_item_hidden(pMenu, i, false);
if((ITEMS_PER_PAGE * selectedPage) + i == ProfileFocused)
{
printf("[*x]i: %d\n", i);
lv_plugin_menu_select_item(pMenu, i);
}
if((ITEMS_PER_PAGE * selectedPage) + i == ProfileSelected)
{
ishidden = false;
}
}
else
{
lv_plugin_menu_set_item_hidden(pMenu, i, true);
}
}
if(i==0){
lv_obj_set_hidden(image_option1_scr_uiflowmenucommonoption, ishidden);//打钩
lv_obj_set_hidden(image_option1_scr_uiflowmenucommonoption, ishidden);
}else if(i == 1){
lv_obj_set_hidden(image_option2_scr_uiflowmenucommonoption, ishidden);
}else if(i == 2){
@ -365,6 +389,7 @@ static void update_Network_Selection_msg(lv_obj_t* obj)
lv_obj_set_hidden(image_option5_scr_uiflowmenucommonoption, ishidden);
}
}
isFirst = 1;
}
static void network_scan_task_end(void)
@ -384,7 +409,16 @@ static void network_scan_task_cb(lv_task_t* task)
unsigned char Buff[1024] = { 0 };
lv_obj_t* obj = (lv_obj_t*)task->user_data;
printf("[%s]Check simcard...\n", __FUNCTION__);
printf("[%s]Check simcard...\n", __FUNCTION__);
if(ReadFile == 1)
{
network_scan_task_end();
update_Network_Selection_msg(obj);
lv_obj_set_hidden(container_main_menu_scr_uiflowmenucommonoption, false);
return;
}
if(Countdown)
{
printf("[%s]Countdown:%d\n", __FUNCTION__, Countdown);
@ -488,6 +522,7 @@ static void network_scan_task_cb(lv_task_t* task)
update_Network_Selection_msg(obj);
lv_obj_set_hidden(container_main_menu_scr_uiflowmenucommonoption, false);
}
ReadFile = 1;
return;
}
}
@ -565,18 +600,21 @@ void show_Network_Selection_page(lv_obj_t* obj, lv_obj_t* menu_obj)
pMenu = menu_obj;
init_Matrix_style();
plabel = lv_label_create(obj, NULL);
lv_label_set_long_mode(plabel, LV_LABEL_LONG_BREAK);
//lv_label_set_align(plabel, LV_LABEL_ALIGN_CENTER);
lv_label_set_text(plabel, "");
lv_obj_set_pos(plabel, 32, 67);
lv_obj_set_width(plabel, 256);
lv_obj_add_style(plabel, 0, &gMatrixStylebtn);
if (NULL == plabel)
{
plabel = lv_label_create(obj, NULL);
lv_label_set_long_mode(plabel, LV_LABEL_LONG_BREAK);
//lv_label_set_align(plabel, LV_LABEL_ALIGN_CENTER);
lv_label_set_text(plabel, "");
lv_obj_set_pos(plabel, 32, 67);
lv_obj_set_width(plabel, 256);
lv_obj_add_style(plabel, 0, &gMatrixStylebtn);
}
lv_task_t tas = {0,0,NULL,NULL,0,3};
Countdown = 0;
network_scan_task_cb(&tas);
if(network_scan_task == NULL){
if(network_scan_task == NULL && ReadFile == 0){
Countdown = 0;
network_scan_task = lv_task_create(network_scan_task_cb, 1000, LV_TASK_PRIO_HIGHEST, (void*)obj);
}
@ -594,6 +632,7 @@ void hidde_Network_Selection_page(void)
lv_obj_del(plabel);
plabel = NULL;
}
isFirst = 0;
}
void Option_Network_Selection_Key(lv_obj_t* obj, uint32_t key)
@ -633,6 +672,7 @@ void Option_Network_Selection_Key(lv_obj_t* obj, uint32_t key)
case LV_USER_KEY_LEFT:
lv_plugin_scr_close(obj, gen_nvtmsg_data(NVTRET_ENTER_MENU, 0));
hidde_Network_Selection_page();
ProfileFocused = ProfileSelected;
break;
case LV_USER_KEY_RIGHT:
case LV_KEY_ENTER:
@ -645,6 +685,7 @@ void Option_Network_Selection_Key(lv_obj_t* obj, uint32_t key)
Countdown = 0;
network_select_task = lv_task_create(network_select_task_cb, 1000, LV_TASK_PRIO_MID, (void*)obj);
}
isFirst = 0;
}
break;
default:

View File

@ -300,8 +300,15 @@ static void LV_MenuCommonOption_UpdateContent(TM_MENU *pMenu)
}
else
{
extern int ReadFile;
printf("[LV_MenuCommonOption_UpdateContent]MESSAGE_ITEM_TRUE\n");
lv_obj_set_hidden(container_main_menu_scr_uiflowmenucommonoption, true);
if(pItem->ItemId == IDM_NETWORK_SELECTION && ReadFile == 1)
{
printf("=======================================================================================\n");
lv_obj_set_hidden(container_main_menu_scr_uiflowmenucommonoption, false);
}
return;
}
#endif
@ -950,6 +957,10 @@ static void LV_MenuOption_OnOpen(lv_obj_t* obj, TM_MENU *data)
lv_plugin_menu_set_item_state(menu_option, 1, LV_PLUGIN_MENU_ITEM_STATE_DISABLED);
}
}
if (IDM_NETWORK_SELECTION == pItem->ItemId)
{
return;
}
lv_plugin_menu_select_item(menu_option, SelOption);
}

View File

@ -1558,6 +1558,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
#endif
sf_lpa_get_esim_iccid(simIccidTmp);
printf("[%s:%d]GET SimIccidV: %s, SimIccidA: %s\n", __FUNCTION__, __LINE__, simIccidTmp[0], simIccidTmp[1]);
snprintf((char *)pCustomerParam->SimIccidV, sizeof(pCustomerParam->SimIccidV), (char *)simIccidTmp[0]);
snprintf((char *)pCustomerParam->SimIccidA, sizeof(pCustomerParam->SimIccidA), (char *)simIccidTmp[1]);