From bf342485317f24b470ec64a59f6c341e1f8fff7d Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Mon, 29 Jan 2024 21:02:29 +0800 Subject: [PATCH] =?UTF-8?q?sendtype=20=E9=95=BF=E6=8C=89=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E9=94=AE=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIFlowMenuCommonItem/MenuSend.c | 77 +++++++++++++++++++ .../UIFlowMenuCommonItem/MenuSend.h | 3 +- .../UIFlowMenuCommonOptionEventCallback.c | 5 ++ 3 files changed, 84 insertions(+), 1 deletion(-) diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.c index 4dc26a99a..ff7298137 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.c @@ -853,3 +853,80 @@ void Option_send_time_Key(lv_obj_t* obj, uint32_t key) } } +void Option_send_time_Key_Long_Press(lv_obj_t* obj, uint32_t key) +{ + unsigned short settingIndex = gPageNum * 2; + + printf("key:%d\n",key); + + switch(key) + { + case LV_USER_KEY_NEXT: + printf("\033[33m[Option_send_time_Key]s\033[0m\n"); + if(gMatrixIndex == 0) + { + if(gSendTime[settingIndex + 0].Hour > 0 && gSendTime[settingIndex + 0].Hour <= 23) + gSendTime[settingIndex + 0].Hour--; + else + gSendTime[settingIndex + 0].Hour = 23; + } + else if(gMatrixIndex == 2) + { + if(gSendTime[settingIndex + 0].Min > 0 && gSendTime[settingIndex + 0].Min <= 59) + gSendTime[settingIndex + 0].Min--; + else + gSendTime[settingIndex + 0].Min = 59; + } + else if(gMatrixIndex == 4) + { + if(gSendTime[settingIndex + 1].Hour > 0 && gSendTime[settingIndex + 1].Hour <= 23) + gSendTime[settingIndex + 1].Hour--; + else + gSendTime[settingIndex + 1].Hour = 23; + } + else if(gMatrixIndex == 6) + { + if(gSendTime[settingIndex + 1].Min > 0 && gSendTime[settingIndex + 1].Min <= 59) + gSendTime[settingIndex + 1].Min--; + else + gSendTime[settingIndex + 1].Min = 59; + } + update_send_time_msg(obj); + break; + case LV_USER_KEY_PREV: + printf("\033[33m[Option_send_time_Key]w\033[0m\n"); + if(gMatrixIndex == 0) + { + if(gSendTime[settingIndex + 0].Hour >= 23) + gSendTime[settingIndex + 0].Hour = 0; + else + gSendTime[settingIndex + 0].Hour++; + } + else if(gMatrixIndex == 2) + { + if(gSendTime[settingIndex + 0].Min >= 59) + gSendTime[settingIndex + 0].Min = 0; + else + gSendTime[settingIndex + 0].Min++; + } + else if(gMatrixIndex == 4) + { + if(gSendTime[settingIndex + 1].Hour >= 23) + gSendTime[settingIndex + 1].Hour = 0; + else + gSendTime[settingIndex + 1].Hour++; + } + else if(gMatrixIndex == 6) + { + if(gSendTime[settingIndex + 1].Min >= 59) + gSendTime[settingIndex + 1].Min = 0; + else + gSendTime[settingIndex + 1].Min++; + } + update_send_time_msg(obj); + break; + default: + break; + } +} + diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.h b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.h index 32bc62a96..4bb7aa3ab 100644 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.h +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonItem/MenuSend.h @@ -18,7 +18,8 @@ extern void show_send_time_page(lv_obj_t* obj, const int sendType); extern void hidde_send_time_page(void); extern void Option_MaxNum_Key(lv_obj_t* obj, uint32_t key); -void Option_MaxNum_Key_Long_Press(lv_obj_t* obj, uint32_t key); +extern void Option_MaxNum_Key_Long_Press(lv_obj_t* obj, uint32_t key); extern void Option_send_time_Key(lv_obj_t* obj, uint32_t key); +extern void Option_send_time_Key_Long_Press(lv_obj_t* obj, uint32_t key); #endif diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonOption/UIFlowMenuCommonOptionEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonOption/UIFlowMenuCommonOptionEventCallback.c index b6768d57c..940e243dd 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonOption/UIFlowMenuCommonOptionEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowMenuCommonOption/UIFlowMenuCommonOptionEventCallback.c @@ -1755,6 +1755,11 @@ void UIFlowMenuCommonOptionEventCallback(lv_obj_t* obj, lv_event_t event) if(KeyPressingTimeMs > 1 * 1000) Option_MaxNum_Key_Long_Press(obj, *key); break; + case IDM_SEND_TYPE: + KeyPressingTimeMs += LONG_PRESS_INTERVAL; + if(KeyPressingTimeMs > 1 * 1000) + Option_send_time_Key_Long_Press(obj, *key); + break; default: break; }