From ef46d7922941636c519d4210c95c0af1e96d5491 Mon Sep 17 00:00:00 2001 From: xiaojiazhu Date: Wed, 13 Dec 2023 18:58:54 +0800 Subject: [PATCH] Improve Enter work mode tips. --- .../UIFlowClose/UIFlowCloseEventCallback.c | 1 + .../UIFlowPhoto/UIFlowPhotoEventCallback.c | 5 +-- .../UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c | 38 ++++++++++++++++--- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c index 68ad34aa6..2d64deba0 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.c @@ -39,6 +39,7 @@ static void task_update_timer_cb(lv_task_t* task) closing_index ++; if (time_ms == 0) { + printf("task_update_timer_cb gPowerOff = %d\n", gPowerOff); Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, gPowerOff); if(update_timer){ lv_task_del(update_timer); diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c index f6ee00397..931e2c928 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPhoto/UIFlowPhotoEventCallback.c @@ -47,9 +47,9 @@ static CHAR g_cSelftimerCntStr[8] = {0}; static lv_group_t* gp = NULL; static lv_task_t* task_selftimer = NULL; static lv_task_t* update_icons_timer = NULL; -#define GO_TO_WORK_MODE_TIME 57 +#define GO_TO_WORK_MODE_TIME 59 #define PASSWORD_GO_TO_WORK_MODE_TIME_S 62 -#define MENU_GO_TO_WORK_MODE_TIME_S 27 +#define MENU_GO_TO_WORK_MODE_TIME_S 29 static unsigned int ShutDownTime = GO_TO_WORK_MODE_TIME; static lv_task_t* task_qview = NULL; @@ -1913,7 +1913,6 @@ static void UIFlowPhoto_Key(lv_obj_t* obj, uint32_t key) case LV_USER_KEY_RIGHT: { //SF_WIFI_STATUS_E status = sf_get_wifi_status(); - ShutDownTime = MENU_GO_TO_WORK_MODE_TIME_S; if(TRUE == sf_get_send_statu()) { printf("\r\n[%s] line:%d %d running\n", __FUNCTION__, __LINE__,key); diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c index 8c0e10504..4304f879b 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgEventCallback.c @@ -41,26 +41,46 @@ static void task_msgbox_timer_cb(lv_task_t* task) UINT16 autoOffTime = sf_get_auto_off_time(); const lv_plugin_string_t* string = lv_plugin_get_string(msgID); - autoClose = autoClose - 1000; if (0 == autoClose || autoOffTime <= 10) { lv_task_del(msgbox_timer); msgbox_timer = NULL; if (msgbox) { - lv_msgbox_start_auto_close(msgbox, 0); + printf("msg box close delay 1000.\n"); + lv_msgbox_start_auto_close(msgbox, 1000); } if (0 == autoClose) { - OpenClosingScreen(DISPLAY_FINAL_SHOW_POWER_OFF); + // OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF); + #define DO_NOT_SHOW_POWER_OFF 0 + Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); } return; } + autoClose = autoClose - 1000; if(string){ snprintf(buf, BUF_LENGTH, "%s\n\n%ds\r\n", string->ptr, autoClose/1000); // lv_msgbox_set_text(msgbox, buf); lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "%s", buf); } + if (0 == autoClose || autoOffTime <= 10) + { + // lv_task_del(msgbox_timer); + // msgbox_timer = NULL; + // if (msgbox) + // { + // printf("msg box close delay 1000.\n"); + // lv_msgbox_start_auto_close(msgbox, 1000); + // } + // if (0 == autoClose) + // { + // // OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF); + // #define DO_NOT_SHOW_POWER_OFF 0 + // Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); + // } + return; + } } // update_icons(); return; @@ -109,6 +129,9 @@ void UIFlowWrnMsgAPI_Open_StringID(lv_plugin_res_id id, uint16_t auto_close_time { lv_plugin_msgbox_set_text(msgbox, id); } + if(auto_close_time_ms){ + lv_msgbox_start_auto_close(msgbox, auto_close_time_ms); + } // if(LV_PLUGIN_STRING_ID_STRING_UPGRADING == msgID) // { @@ -128,6 +151,9 @@ void UIFlowWrnMsgAPI_Open_StringID(lv_plugin_res_id id, uint16_t auto_close_time { snprintf(buf, BUF_LENGTH, "%s\n\n%ds\r\n", tmpstr1->ptr, autoClose/1000); lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "%s", buf); + if(auto_close_time_ms){ + lv_msgbox_start_auto_close(msgbox, auto_close_time_ms + 1000 * 2); + } } else if (LV_PLUGIN_STRING_ID_STRING_UPGRADING == msgID) { lv_label_set_text_fmt(label_msg_scr_uiflowwrnmsg, "Upgrading...\nCamera will automatically restart after upgrade complete"); @@ -161,9 +187,9 @@ void UIFlowWrnMsgAPI_Open_StringID(lv_plugin_res_id id, uint16_t auto_close_time } - if(auto_close_time_ms){ - lv_msgbox_start_auto_close(msgbox, auto_close_time_ms); - } + // if(auto_close_time_ms){ + // lv_msgbox_start_auto_close(msgbox, auto_close_time_ms); + // } set_indev_keypad_group(msgbox); if(msgbox_timer == NULL){