gengxin
author@CHENG <2393524978@qq.com>
Fri, 14 Jun 2024 08:25:58 +0000 (16:25 +0800)
committer@CHENG <2393524978@qq.com>
Fri, 14 Jun 2024 08:25:58 +0000 (16:25 +0800)
2.sdk/project/Z5_WL_K7/gui/lv_watch/resource/png/primary_function/ICON_AIGC_ASSISTANT.png [new file with mode: 0644]
2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.c
2.sdk/sdk/gui/lv_watch/framework/message/mmi_msg_zhsx.h
2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.c
2.sdk/sdk/gui/lv_watch/framework/message/watch_msg_handle.h
2.sdk/sdk/gui/lv_watch/lv_apps/primary_menu/primary_menu_data.c
2.sdk/sdk/gui/lv_watch/lv_watch_res.h
2.sdk/sdk/gui/lv_watch/mmi_sundry/mmi_sundry.c

diff --git a/2.sdk/project/Z5_WL_K7/gui/lv_watch/resource/png/primary_function/ICON_AIGC_ASSISTANT.png b/2.sdk/project/Z5_WL_K7/gui/lv_watch/resource/png/primary_function/ICON_AIGC_ASSISTANT.png
new file mode 100644 (file)
index 0000000..9f513b3
Binary files /dev/null and b/2.sdk/project/Z5_WL_K7/gui/lv_watch/resource/png/primary_function/ICON_AIGC_ASSISTANT.png differ
index 6b1a692..a515b91 100644 (file)
@@ -236,6 +236,19 @@ void mmi_ui_msg_action_hengai_bp_measure_result(bool state, uint16_t bp_value_hi
 }
 #endif
 
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+void mmi_ui_msg_action_aigc_recv_trans_text_stop(void)
+{
+       mmi_ui_msg_action_no_para_msg(MMI_MSG_AIGC_RECV_TRANS_TEXT_STOP);
+}
+
+void mmi_ui_msg_action_aigc_recv_chat_text_stop(void)
+{
+       mmi_ui_msg_action_no_para_msg(MMI_MSG_AIGC_RECV_CHAT_TEXT_STOP);
+}
+#endif
+
+
 
 #if 0
 
index 72155a9..2f9d2ac 100644 (file)
@@ -89,6 +89,12 @@ void mmi_ui_msg_action_ai_talk_incoming(void);
 void mmi_ui_msg_action_hengai_bp_calibrate_result(bool state);
 void mmi_ui_msg_action_hengai_bp_measure_result(bool state, uint16_t bp_value_high, uint16_t bp_value_low);
 #endif
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+void mmi_ui_msg_action_aigc_recv_trans_text_stop(void);
+void mmi_ui_msg_action_aigc_recv_chat_text_stop(void);
+#endif
+
+
 void mmi_ui_falldown(void);
 
 
index 8590402..e46cff1 100644 (file)
@@ -467,6 +467,15 @@ void watch_ui_message_handle(uint16_t msgid, void * msg)
                        mmi_ui_msg_update_low_battery_screen(flag);
                        break;
 
+       #ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+               case MMI_MSG_AIGC_RECV_TRANS_TEXT_STOP:
+                       mmi_ui_msg_update_aigc_recv_trans_text_stop();
+                       break;
+
+               case MMI_MSG_AIGC_RECV_CHAT_TEXT_STOP:
+                       mmi_ui_msg_update_aigc_recv_chat_text_stop();
+                       break;
+       #endif
 
                        
        #endif
index e40df3e..226a3d6 100644 (file)
@@ -138,6 +138,10 @@ enum
        MMI_MSG_HENGAI_BP_MEASURE_RESULT,
 #endif
        MMI_MSG_LOW_BATTERY_SCREEN,
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+       MMI_MSG_AIGC_RECV_TRANS_TEXT_STOP,
+       MMI_MSG_AIGC_RECV_CHAT_TEXT_STOP,
+#endif
        
        
 #endif
index 45eba48..115a480 100644 (file)
@@ -42,6 +42,9 @@ static watch_app_info_t s_main_menu_four_grid[] =
        { ICON_WECHAT, WATCH_TEXT_ID_WECHAT, wechat_create_event_cb },
 #endif
 
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+       { ICON_AIGC_ASSISTANT, WATCH_TEXT_ID_AIGC_ASSISTANT, mmi_aigc_create_event_cb },
+#endif
 #if USE_LV_WATCH_CAMERA != 0
        { ICON_CAMERA, WATCH_TEXT_ID_CAMERA, camera_create_btn_event_cb },
        { ICON_ALBUM, WATCH_TEXT_ID_ALBUM, album_create_event_cb },
index 9a9e742..7d483f0 100644 (file)
@@ -228,6 +228,9 @@ LV_IMG_DECLARE(img_poweron_logo);
 #define ICON_ALIPAY             "R:/png/primary_function/icon_alipay.png"
 #define ICON_SMS_MSG            "R:/png/primary_function/icon_sms.png"
 #define ICON_PHONEBOOK          "R:/png/primary_function/ICON_PHONEBOOK.png"
+#ifdef __MMI_CUSTOM_AIGC_SUPPORT__
+#define ICON_AIGC_ASSISTANT          "R:/png/primary_function/ICON_AIGC_ASSISTANT.png"
+#endif
 #ifdef __MMI_CUSTOM_BEI_KE_RUI_SHENG__
 #define ICON_AI_TALK          "R:/png/primary_function/ICON_AI_TALK.png"
 #endif
@@ -1056,8 +1059,10 @@ LV_IMG_DECLARE(img_poweron_logo);
 #define ICON_AIGC_RECORD_BUTTON_PRESSED           "R:/png/mmi_aigc/ICON_AIGC_RECORD_BUTTON_PRESSED.png"
 #define ICON_AIGC_PROMPT           "R:/png/mmi_aigc/ICON_AIGC_PROMPT.png"
 #define ICON_AIGC_DEFAULT           "R:/png/mmi_aigc/ICON_AIGC_DEFAULT.png"
-#define ICON_AIGC_THINKING           "R:/png/mmi_aigc/ICON_AIGC_THINKING.png"
+//#define ICON_AIGC_THINKING           "R:/png/mmi_aigc/ICON_AIGC_THINKING.png"
 #define ICON_AIGC_CANCEL_BUTTON           "R:/png/mmi_aigc/ICON_AIGC_CANCEL_BUTTON.png"
+#define ANIM_AIGC_LISTENING           "R:/png/mmi_aigc/ANIM_AIGC_LISTENING.gif"
+#define ANIM_AIGC_THINKING           "R:/png/mmi_aigc/ANIM_AIGC_THINKING.gif"
 #endif
 
 
index c7a2b94..81be1d5 100644 (file)
@@ -164,8 +164,6 @@ void mmi_watch_reboot_aciton(void)
 
 
 static TIMER_ID s_watch_search_timer_id = NULL;
-static TIMER_ID s_watch_falldwon_id = NULL;
-
 
 void mmi_watch_search_timer_stop(void)
 {
@@ -176,16 +174,6 @@ void mmi_watch_search_timer_stop(void)
        }
 }
 
-void mmi_falldwon_timer_stop(void)
-{
-       if(NULL != s_watch_falldwon_id)
-       {
-               Hal_Timer_Stop(s_watch_falldwon_id);
-               s_watch_falldwon_id = NULL;
-       }
-}
-
-
 static void mmi_watch_search_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
 {
        SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: priority=%d\n", __FUNCTION__, __LINE__, priority);
@@ -200,42 +188,17 @@ static void mmi_watch_search_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
     }
 }
 
-static void mmi_falldwon_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
-{
-       SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: priority=%d\n", __FUNCTION__, __LINE__, priority);
-       
-    if(AUDIO_CTRL_PRIORITY_9 == priority) 
-       {
-
-    } 
-       else if(AUDIO_CTRL_PRIORITY_9 > priority) 
-       {
-               mmi_falldwon_destroy();
-    }
-}
-
 void mmi_watch_search_timeout_cb(void * para)
 {
        mmi_watch_search_screen_destroy();
 }
 
-void mmi_falldwon_timeout_cb(void * para)
-{
-       mmi_falldwon_destroy();
-}
-
 void mmi_watch_search_timer_start(void)
 {
        mmi_watch_search_timer_stop();
        s_watch_search_timer_id = Hal_Timer_Start(MMI_WATCH_SEARCH_DURATION, mmi_watch_search_timeout_cb, NULL, false);
 }
 
-void mmi_falldwon_timer_start(void)
-{
-       mmi_falldwon_timer_stop();
-       s_watch_falldwon_id = Hal_Timer_Start(MMI_WATCH_SEARCH_DURATION, mmi_falldwon_timeout_cb, NULL, false);
-}
-
 void mmi_watch_search_screen_destroy(void)
 {
        SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
@@ -260,61 +223,186 @@ void mmi_watch_search_screen_destroy(void)
     //watch_wakeup_time_reset();
 }
 
+void mmi_watch_search_screen_event_cb(lv_obj_t * obj, lv_event_t e)
+{      
+    if(LV_EVENT_CLICKED == e)
+       {
+               mmi_watch_search_screen_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING);
+    }
+}
 
-void mmi_falldwon_destroy(void)
+lv_obj_t * mmi_watch_server_search_screen_create(lv_obj_t * activity_obj)
 {
        SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
        
-    //lv_watch_search_ext_t * ext = lv_obj_get_ext_attr(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING));
+       lv_watch_png_cache_all_free();
+    if(NULL == activity_obj) 
+       {
+        lv_watch_activity_ext_t activity_ext = {0};
+
+        activity_ext.actId = ACT_ID_WATCH_SEARCHING;
+        activity_ext.create = (lv_watch_activity_create_f_t)mmi_watch_server_search_screen_create;
+        activity_ext.prepare_destory = mmi_watch_search_screen_destroy;
+        activity_obj = lv_watch_creat_activity_obj(&activity_ext);
+        if(NULL == activity_obj)
+            return NULL;
+    }
+
+    lv_obj_t * obj = lv_watch_obj_create(activity_obj);
+    LV_ASSERT_MEM(obj);
        
-       mmi_falldwon_timer_stop();
+       lv_watch_search_ext_t * searching_ext = lv_obj_allocate_ext_attr(obj, sizeof(lv_watch_search_ext_t));
 
-       Hal_NFFS_File_Play_End();
-    Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_SEARCH);
-       Hal_Vibrator_Play_End();
+       lv_obj_t * cont = lv_cont_create(obj, NULL);
+       lv_obj_set_size(cont, lv_obj_get_width(obj), lv_obj_get_height(obj));
+       lv_obj_align(cont, obj, LV_ALIGN_CENTER, 0, 0);
+       lv_obj_set_style_local_bg_color(cont, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0, 0, 0)); // LV_COLOR_BLACK
+       lv_obj_set_click(cont, true);
+       lv_obj_set_event_cb(cont, mmi_watch_search_screen_event_cb);    
+       //lv_obj_add_protect(cont, LV_PROTECT_PRESS_LOST);
+
+       lv_obj_t * label = lv_label_create(cont, NULL);
+#ifdef USE_LV_WATCH_UI_466_466
+       lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font40);
+#else
+       lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20);
+#endif
+       lv_label_set_text_id(label, WATCH_TEXT_ID_SERVER_SEARCH_PROMPT); //lv_lang_get_text(WATCH_TEXT_ID_SERVER_SEARCH_PROMPT)
+       lv_obj_align(label, cont, LV_ALIGN_CENTER, 0, 0);
+
+       //prompt
+    if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback))
+    {
+               uint8_t volume = 0;
+       #ifdef __MMI_USER_PROFILE_SUPPORT__
+               volume = mmi_user_profile_current_mode_remind_volume_get();
+       #else
+               volume = query_current_volume();
+       #endif
+        Hal_NFFS_File_Play_Repeat(AUDIO_WATCH_SEARCH, volume); // HAL_AUDIO_SPK_LEVEL_MAX);
+    }
+       if(true == mmi_watch_vibrate_is_permitted())
+       {
+               Hal_Vibrator_Play_Repeat();
+       }
        
-       lv_watch_png_cache_all_free();
-       //lv_obj_del_async(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING));
-    lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_WATCH_FALLDWON);
-    if(activity_obj)
+       mmi_watch_search_timer_start();
+
+       watch_set_suspend_enable(false, ACT_ID_WATCH_SEARCHING, 0);
+       
+       return obj;
+}
+
+void mmi_ui_msg_update_watch_server_search(void)
+{
+       mmi_watch_server_search_screen_create(NULL);    
+}
+
+void mmi_watch_searching_aciton(void)
+{
+       SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+       
+    if(true == mmi_active_screen_is_prohibit_interrupted()
+               #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
+               || true == mmi_watch_is_in_do_not_disturb_time()
+               #endif
+               )
        {
-        lv_obj_del(activity_obj);
-    }
+               return ;
+       }
 
-       watch_set_suspend_enable(true, ACT_ID_WATCH_FALLDWON, 0);
-    //watch_wakeup_time_reset();
+#ifdef __MMI_WECHAT_SUPPORT__
+       if(true == wechat_screen_is_prohibit_interrupted())
+       {
+               return;
+       }
+#endif
+
+       if(NULL != lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING))
+       {
+               return ;
+       }
+
+       // ui
+    mmi_watch_wake_up();
+       mmi_ui_msg_action_watch_searching();
 }
 
 
-void mmi_watch_search_screen_event_cb(lv_obj_t * obj, lv_event_t e)
-{      
-    if(LV_EVENT_CLICKED == e)
+static TIMER_ID s_watch_falldwon_id = NULL;
+
+void mmi_falldwon_timer_stop(void)
+{
+       if(NULL != s_watch_falldwon_id)
        {
-               mmi_watch_search_screen_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING);
+               Hal_Timer_Stop(s_watch_falldwon_id);
+               s_watch_falldwon_id = NULL;
+       }
+}
+
+static void mmi_falldwon_audio_ctrl_callback(AUDIO_CTRL_PRIORITY priority)
+{
+       SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: priority=%d\n", __FUNCTION__, __LINE__, priority);
+       
+    if(AUDIO_CTRL_PRIORITY_9 == priority) 
+       {
+
+    } 
+       else if(AUDIO_CTRL_PRIORITY_9 > priority) 
+       {
+               mmi_falldwon_destroy();
     }
 }
 
+void mmi_falldwon_timeout_cb(void * para)
+{
+       mmi_falldwon_OK_event_cb(NULL,LV_EVENT_CLICKED);
+}
+
+void mmi_falldwon_timer_start(void)
+{
+       mmi_falldwon_timer_stop();
+       s_watch_falldwon_id = Hal_Timer_Start(10*1000, mmi_falldwon_timeout_cb, NULL, false);
+}
+
+void mmi_falldwon_destroy(void)
+{
+       SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+       
+       mmi_falldwon_timer_stop();
+
+       Hal_NFFS_File_Play_End();
+    Hal_Audio_Manage_End_Ind(AUDIO_CTRL_PRIORITY_9);
+       Hal_Vibrator_Play_End();
+       
+       lv_watch_png_cache_all_free();
+
+       watch_set_suspend_enable(true, ACT_ID_WATCH_FALLDWON, 0);
+}
+
 void mmi_falldwon_event_cb(lv_obj_t * obj, lv_event_t e)
 {      
     if(LV_EVENT_CLICKED == e)
        {
-
-               mmi_falldwon_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING);
+               mmi_falldwon_destroy();
+               //lv_obj_del_async(lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING));
+               lv_obj_t * activity_obj = lv_watch_get_activity_obj(ACT_ID_WATCH_FALLDWON);
+               if(activity_obj)
+               {
+                       lv_obj_del(activity_obj);
+               }
     }
 }
 
-
 void mmi_falldwon_OK_event_cb(lv_obj_t * obj, lv_event_t e)
 {      
     if(LV_EVENT_CLICKED == e)
        {
                mmi_protocol_action_fall_down();
-               mmi_falldwon_destroy(); // lv_watch_del_interface(ACT_ID_WATCH_SEARCHING);
+               mmi_falldwon_event_cb(NULL,LV_EVENT_CLICKED);
     }
 }
 
-
-
 lv_obj_t * mmi_watch_falldwon_create(lv_obj_t * activity_obj)
 {
        SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
@@ -376,123 +464,25 @@ lv_obj_t * mmi_watch_falldwon_create(lv_obj_t * activity_obj)
     if (AUDIO_CTRL_PRIORITY_9 == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_9, mmi_falldwon_audio_ctrl_callback))
     {
         Hal_NFFS_File_Play_Repeat(AUDIO_FALLDOWN, HAL_AUDIO_SPK_LEVEL_MAX); // query_current_volume()
-    }
-       Hal_Vibrator_Play_Repeat();
-       
-       mmi_falldwon_timer_start();
-
-       watch_set_suspend_enable(false, ACT_ID_WATCH_FALLDWON, 0);
-       
-       return obj;
-}
-
-
-lv_obj_t * mmi_watch_server_search_screen_create(lv_obj_t * activity_obj)
-{
-       SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
-       
-       lv_watch_png_cache_all_free();
-    if(NULL == activity_obj) 
-       {
-        lv_watch_activity_ext_t activity_ext = {0};
-
-        activity_ext.actId = ACT_ID_WATCH_SEARCHING;
-        activity_ext.create = (lv_watch_activity_create_f_t)mmi_watch_server_search_screen_create;
-        activity_ext.prepare_destory = mmi_watch_search_screen_destroy;
-        activity_obj = lv_watch_creat_activity_obj(&activity_ext);
-        if(NULL == activity_obj)
-            return NULL;
-    }
-
-    lv_obj_t * obj = lv_watch_obj_create(activity_obj);
-    LV_ASSERT_MEM(obj);
-       
-       lv_watch_search_ext_t * searching_ext = lv_obj_allocate_ext_attr(obj, sizeof(lv_watch_search_ext_t));
-
-       lv_obj_t * cont = lv_cont_create(obj, NULL);
-       lv_obj_set_size(cont, lv_obj_get_width(obj), lv_obj_get_height(obj));
-       lv_obj_align(cont, obj, LV_ALIGN_CENTER, 0, 0);
-       lv_obj_set_style_local_bg_color(cont, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(0, 0, 0)); // LV_COLOR_BLACK
-       lv_obj_set_click(cont, true);
-       lv_obj_set_event_cb(cont, mmi_watch_search_screen_event_cb);    
-       //lv_obj_add_protect(cont, LV_PROTECT_PRESS_LOST);
-
-       lv_obj_t * label = lv_label_create(cont, NULL);
-#ifdef USE_LV_WATCH_UI_466_466
-       lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font40);
-#else
-       lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20);
-#endif
-       lv_label_set_text_id(label, WATCH_TEXT_ID_SERVER_SEARCH_PROMPT); //lv_lang_get_text(WATCH_TEXT_ID_SERVER_SEARCH_PROMPT)
-       lv_obj_align(label, cont, LV_ALIGN_CENTER, 0, 0);
-
-       //prompt
-    if (AUDIO_CTRL_PRIORITY_SEARCH == Hal_Audio_Manage_Start_Req(AUDIO_CTRL_PRIORITY_SEARCH, mmi_watch_search_audio_ctrl_callback))
-    {
-               uint8_t volume = 0;
-       #ifdef __MMI_USER_PROFILE_SUPPORT__
-               volume = mmi_user_profile_current_mode_remind_volume_get();
-       #else
-               volume = query_current_volume();
-       #endif
-        Hal_NFFS_File_Play_Repeat(AUDIO_WATCH_SEARCH, volume); // HAL_AUDIO_SPK_LEVEL_MAX);
     }
        if(true == mmi_watch_vibrate_is_permitted())
        {
                Hal_Vibrator_Play_Repeat();
        }
        
-       mmi_watch_search_timer_start();
+       mmi_falldwon_timer_start();
 
-       watch_set_suspend_enable(false, ACT_ID_WATCH_SEARCHING, 0);
+       watch_set_suspend_enable(false, ACT_ID_WATCH_FALLDWON, 0);
        
        return obj;
 }
 
-void mmi_ui_msg_update_watch_server_search(void)
-{
-       mmi_watch_server_search_screen_create(NULL);    
-}
-
-
 void mmi_ui_msg_update_falldwon(void)
 {
        if(lv_watch_get_activity_obj(ACT_ID_WATCH_FALLDWON)==NULL)
        {       
-               
                mmi_watch_falldwon_create(NULL);
        }
-       
-}
-
-void mmi_watch_searching_aciton(void)
-{
-       SUNDRY_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
-       
-    if(true == mmi_active_screen_is_prohibit_interrupted()
-               #ifdef __MMI_ZHSX_SUPPORT_DO_NOT_DISTURB__
-               || true == mmi_watch_is_in_do_not_disturb_time()
-               #endif
-               )
-       {
-               return ;
-       }
-
-#ifdef __MMI_WECHAT_SUPPORT__
-       if(true == wechat_screen_is_prohibit_interrupted())
-       {
-               return;
-       }
-#endif
-
-       if(NULL != lv_watch_get_activity_obj(ACT_ID_WATCH_SEARCHING))
-       {
-               return ;
-       }
-
-       // ui
-    mmi_watch_wake_up();
-       mmi_ui_msg_action_watch_searching();
 }