From 278aba7d084dd125a4b50782a95cc3568d1bf2a6 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 19 Oct 2024 18:42:33 +0800 Subject: [PATCH] =?utf8?q?AI=E8=AF=AD=E9=9F=B3=E4=BF=AE=E6=94=B9=EF=BC=9A?= =?utf8?q?=201.=E5=8F=91=E9=80=81=E5=8F=96=E6=B6=88=E5=AF=B9=E8=AF=9D?= =?utf8?q?=E6=8C=87=E4=BB=A4=E6=94=B9=E4=B8=BA=E7=9B=B4=E6=8E=A5=E5=8F=91?= =?utf8?q?=E9=80=81=EF=BC=8C=E5=87=8F=E5=B0=91=E5=87=BA=E7=8E=B0=E4=B8=8A?= =?utf8?q?=E6=AC=A1=E5=AF=B9=E8=AF=9D=E5=86=85=E5=AE=B9=E5=87=BA=E7=8E=B0?= =?utf8?q?=E5=9C=A8=E4=B8=8B=E4=B8=80=E6=AC=A1=E5=AF=B9=E8=AF=9D=E7=9A=84U?= =?utf8?q?I=E6=98=BE=E7=A4=BA=E4=B8=8A=202.=E5=85=B3=E9=97=ADAI=E8=AF=AD?= =?utf8?q?=E9=9F=B3=E5=A4=9A=E4=BD=99=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/aivoice/src/AiVoiceModel.cpp | 5 +++-- .../fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp | 4 ++-- .../aivoice/src/AivoiceChatContentListAdapter.cpp | 8 ++++---- .../wearable/service/ble_service/bleservice/bleEvent.h | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index 82294acd4..d9bd5e891 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:14:50 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-17 15:19:15 + * @LastEditTime: 2024-10-19 18:26:01 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp */ #include "aivoice/include/AiVoiceModel.h" @@ -171,7 +171,8 @@ namespace OHOS /*取消当前AI对话*/ void AiVoiceModel::CancelCurAIChat(void) { - cancel_AI_cur_chat(); + // cancel_AI_cur_chat(); //线程发送取消当前对话 + cancel_AI_cur_chat_();// 直接发送取消当前对话 } int AiVoiceModel::GetAIResponseType(void) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp index dad5bf0b6..e2a438727 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:11:17 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-18 10:58:29 + * @LastEditTime: 2024-10-19 17:39:07 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp */ #include "AppViewIDs.h" @@ -359,8 +359,8 @@ namespace OHOS if (it->first == AIVOICERETURNRESULTTEXT_CONTINUECHAT_BUTTON_VIEW_ID) // 点击继续对话按钮要发取消当前对话指令,避免AI回应中途按继续对话按钮没有取消上一次对话问题 { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CancelCurAIChat"); - PlayersModel::GetInstance()->HandPausePhoneMusci(); // 暂停手机音乐 AiVoiceModel::GetInstance().CancelCurAIChat(); + PlayersModel::GetInstance()->HandPausePhoneMusci(); // 暂停手机音乐 } ChangeViewAndLogicOperator(it->second.first, it->second.second); return true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceChatContentListAdapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceChatContentListAdapter.cpp index 3789381c0..19e8f74a1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceChatContentListAdapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceChatContentListAdapter.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-28 14:27:05 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-16 18:31:00 + * @LastEditTime: 2024-10-19 17:16:50 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/language/src/AivoiceChatContentListAdapter.cpp */ #include "aivoice/include/AivoiceChatContentListAdapter.h" @@ -60,7 +60,7 @@ namespace OHOS const char *Text = text.c_str(); aiAnswerFlag = flag; - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Text = %s,aiAnswerFlag = %d\n", Text, aiAnswerFlag); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Text = %s,aiAnswerFlag = %d\n", Text, aiAnswerFlag); UILabel label; label.SetPosition(53, 100); @@ -72,13 +72,13 @@ namespace OHOS label.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); label.SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 26); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "label.GetHeight = %d,label.GetTextHeight = %d\n", label.GetHeight(), label.GetTextHeight()); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "label.GetHeight = %d,label.GetTextHeight = %d\n", label.GetHeight(), label.GetTextHeight()); itemViewHeight = label.GetTextHeight(); } UIView *AivoiceChatContentListAdapter::GetView(UIView *inView, int16_t index) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AivoiceChatContentListAdapter::GetView,index %d", index); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AivoiceChatContentListAdapter::GetView,index %d", index); // 1.先检查列表数据是否为空,若为空则返回空指针 if (listData.empty()) { diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h index 00184e474..7690271db 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h @@ -820,6 +820,7 @@ bool send_AI_is_ready(uint8_t type); void inquire_AI_is_ready(uint8_t type); void cancel_AI_cur_chat(void); +void cancel_AI_cur_chat_(void); void GetCurDataCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totaldata,uint8_t crcvalue); -- 2.17.1