From b1ea9d069c28cf65a99f6401a0709a3315bc8ac3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Wed, 21 Aug 2024 03:50:58 +0000 Subject: [PATCH] Merge #750 into sdk602patch0626 from refs/changes/750/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/750/head: (21 commits squashed) - 1. 优化连接中的gif动画,由原来的20帧修改为现在的20帧 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 修改连接动画为60帧 - 添加手机同步歌曲到手表,手表音乐列表同步刷新。 - 音乐列表刷新机制优化在每次切换到音乐列表刷新一次,list高度会根据歌曲数量自适应 - 显示方式界面添加弧形列表样式,并添加对应资源 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 倒计时界面配置多国语言 - 1.运动识别弹窗根据弹窗汇总设置显示时长为10s,并添加震动 2.修复开始按钮的视图Id - 倒计时界面优化修改 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 倒计时优化修改 - 倒计时配置多国语言 - APPlist应用顺序按照KUMI已经重新排列,放入设置中的四个Slice暂未屏蔽等之后加入后再屏蔽 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 1.音乐播放器在切换通道时添加主动连接和断开手机a2dp功能 2.播放器添加连接动画,手表连接手机音乐超时时间设置为5s - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - AI语音添加取消当前AI对话功能 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/750 --- .../fd230app/nativeui/aivoice/include/AiVoiceModel.h | 3 ++- .../fd230app/nativeui/aivoice/src/AiVoiceModel.cpp | 12 +++++++++++- .../fd230app/nativeui/aivoice/src/AiVoiceView.cpp | 8 ++++++-- .../service/ble_service/bleservice/bleEvent.c | 7 +++++++ .../service/ble_service/bleservice/bleEvent.h | 2 ++ 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h index a84d3832c..3ab0a1e2b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:14:43 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-09 19:57:52 + * @LastEditTime: 2024-08-21 11:34:53 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h */ #ifndef AI_VOICE_MODEL_H @@ -42,6 +42,7 @@ namespace OHOS bool GetAiVoiceConnectStatus(void); void SetAiVoiceConnectStatus(bool state); void QuerySelectedAiModelIsConnect(); + void CancelCurAIChat(void); // 聊天内容管理 bool InitchatContentItems(void); 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 f4ad06685..9bcf22468 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-08-09 20:27:41 + * @LastEditTime: 2024-08-21 11:35:44 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp */ #include "aivoice/include/AiVoiceModel.h" @@ -166,6 +166,12 @@ namespace OHOS } } + /*取消当前AI对话*/ + void AiVoiceModel::CancelCurAIChat(void) + { + cancel_AI_cur_chat(); + } + /*列表数量*/ uint8_t AiVoiceModel::GetChatContentListCount(void) { @@ -336,6 +342,10 @@ namespace OHOS { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::UpdateAiAnswerStr"); + /* -------------------------------------------------------------------------- */ + ScreenTurnOn(5 * 1000); // 有消息来就亮屏5秒 + /* -------------------------------------------------------------------------- */ + int index = GetChatContentListCount() - 1; if (index < 0 || index >= MaxChatContentListCount) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp index 78d04530c..46d504d6f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-05-07 11:25:58 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-08-17 10:51:03 + * @LastEditTime: 2024-08-21 11:43:04 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp */ #include "aivoice/include/AiVoicePresenter.h" @@ -513,6 +513,10 @@ namespace OHOS { container_->Add(AiVoiceScrollView[thisView]); } + if (AiVoiceModel::GetInstance().GetAiVoiceConnectStatus()) + { + AiVoiceModel::GetInstance().CancelCurAIChat(); + } return true; } @@ -821,7 +825,7 @@ namespace OHOS // SetComponentVisibility(chatLabel, isAiModeChatGpt); // SetComponentVisibility(apiKeysButton, isAiModeChatGpt); // SetComponentVisibility(apiKeysLabel, isAiModeChatGpt); - SetComponentVisibility(upImage,isAiModeChatGpt); + SetComponentVisibility(upImage, isAiModeChatGpt); // SetComponentVisibility(startChatLabel, !isAiModeChatGpt); SetComponentVisibility(startChatButton, !isAiModeChatGpt); diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index b1a352783..74cb9bdcc 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -486,6 +486,13 @@ void inquire_AI_is_ready(uint8_t type) send_big_data(0, (char *)&type, 1, 1, 1, 1, 0x06, 5); } +void cancel_AI_cur_chat(void) +{ + + printf("取消当前AI对话\r\n"); + uint8_t data=1; + send_big_data(0, (char *)&data, 1, 1, 1, 1, 0x07, 5); +} //发送ble数据 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 d229fd919..b00cfb920 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h @@ -795,6 +795,8 @@ void send_AI_is_ready(uint8_t type); void inquire_AI_is_ready(uint8_t type); +void cancel_AI_cur_chat(void); + void GetCurDataCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totaldata,uint8_t crcvalue); bool get_ctkd_flag(void); -- 2.17.1