AI界面,继续对话按钮加回准备就绪指令
authorluozheng <1732036298@qq.com>
Wed, 12 Mar 2025 03:25:01 +0000 (11:25 +0800)
committerluozheng <1732036298@qq.com>
Wed, 12 Mar 2025 03:25:01 +0000 (11:25 +0800)
code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp

index 027fc8c..ed34b51 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-20 15:14:43
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-12-05 15:06:19
+ * @LastEditTime: 2025-03-12 11:10:53
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h
  */
 #ifndef AI_VOICE_MODEL_H
@@ -80,6 +80,8 @@ namespace OHOS
 
         // 文件检查和AI状态管理
         void CheckFileAndSendAIIsReady();
+        //发送AI已经就绪(继续对话时候使用)
+        void sendAIIsReady();
 
         // AI录音路径管理
         std::string GetAIAudioPath(void);
index 651ec72..e758141 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-20 15:14:50
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2025-03-07 10:14:18
+ * @LastEditTime: 2025-03-12 11:10:39
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
  */
 #include "aivoice/include/AiVoiceModel.h"
@@ -603,6 +603,20 @@ namespace OHOS
         }
     }
 
+    void AiVoiceModel::sendAIIsReady()
+    {
+        auto it = selectAiModelToTextId.find(GetSelectAiModel());
+        if (it != selectAiModelToTextId.end())
+        {
+            // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "filesize = %ld,SelectAiModel = %d", size, it->second.second);
+            if(get_ble_interval() >= BLE_CONNECT_INTERVAL_SLOW)
+            {
+                uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH);
+            }
+            send_AI_is_ready(it->second.second);
+        }
+    }
+
     void AiVoiceModel::StatusResume(void)
     {
         Time = THIRTY_TIME;
index e302afa..a9961c1 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-06-20 15:11:17
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2025-03-11 15:33:56
+ * @LastEditTime: 2025-03-12 10:45:44
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp
  */
 #include "AppViewIDs.h"
@@ -320,6 +320,7 @@ namespace OHOS
             {
                 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CancelCurAIChat");
                 AiVoiceModel::GetInstance().CancelCurAIChat();
+                AiVoiceModel::GetInstance().sendAIIsReady();
                 PlayersModel::GetInstance()->HandPausePhoneMusic(); // 暂停手机音乐
                 PlayersModel::GetInstance()->PlayerPause();         // 暂停手机音乐
             }