else if (GetSelect4gorbt() == AI_SELECT_BT)
{
#ifdef SUPPORT_BLE_SERVICE
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "蓝牙:查询Ai是否就绪");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "蓝牙:查询Ai是否就绪:%d",it->second.second);
inquire_AI_is_ready(it->second.second);
#endif
}
#include <asm/delay.h>
#include <aivoice/include/AiVoiceModelC.h>
#include <los_base.h>
- extern void set_need_tts_reconnect(uint8_t flag);
void remove_4GAI_vote(void)
{
void AiVoicePresenter::OnStart()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStart");
- Presenter<AiVoiceView>::OnStart();
ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);
// 开启一个60s取消长亮屏timer
model->ai_start_screen60s_timer();
void AiVoicePresenter::OnStop(void)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStop start");
- Presenter<AiVoiceView>::OnStop();
ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON);
model->StatusResume();
model->AIVoice_StopTimer();
uapi_stop_all_websocket_servers();
uapi_destroy_all_websocket_servers();
#endif
-
- // dinit_ai_task();
- // ai_cleanup_resources();
uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_SLOW);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStop end");
break;
case AIVOICE_RETURN_RESULT_TEXT_VIEWID:
- // set_need_tts_reconnect(0); // 停止tts重连
AiVoiceModel::GetInstance().ClearQuestionAndAiAnswerStr(); // 清空上次用户问题和Ai回答字符串
AiVoiceModel::GetInstance().SetIsClickable(false);
AiVoiceModel::GetInstance().SetIsLimitDisplayed(false);
AiVoiceModel::GetInstance().start_ai_isready_timer();
break;
case AIVOICE_RETURN_RESULT_TEXT_VIEWID:
- // set_need_tts_reconnect(1); // 开始tts重连
break;
case AIVOICE_LISTENING_VIEWID:
- // set_stop_send_ai_flag(0); // 开始发送AI数据
AiVoiceModel::GetInstance().StartListenAndRecordingUserQuestion();
AiVoiceModel::GetInstance().start_listening_timer();
break;
VolumeProcess->SetKnobStyle(StyleDefault::GetSliderKnobStyle());
VolumeProcess->RequestFocus();
VolumeProcess->SetRotateFactor(5.0);
- // VolumeProcess->SetVisible(false);
+ VolumeProcess->SetVisible(false);
VolumeProcess->SetOnRotateListener(presenter_);
AddViewToRootContainer(VolumeProcess);
}
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView");
if (!CreateAiVoiceScrollView() || !CreateAiVoiceViewImageView() || !CreateAiVoiceViewPicker() ||
- !CreateAiVoiceViewLabel() || !CreateAiVoiceViewButton() || !CreateAiVoiceVoiceView())
+ !CreateAiVoiceViewLabel() || !CreateAiVoiceViewButton())
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView fail!");
return nullptr;
{
SendMsgToUIService(UI_UPDATE_USER_QUESTION_STR, 0, nullptr, 0);
}
+ if(AiVoiceModel::GetInstance().GetSelect4gorbt() == AI_SELECT_4G)
+ {
+ if (VolumeProcess)
+ {
+ VolumeProcess->SetVisible(true);
+ }
+ }
return true;
}
void AiVoiceView::ChangeView(int16_t hideView, int16_t showView)
{
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::ChangeView hideView:%d, showView:%d", hideView, showView);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::ChangeView hideView:%d, showView:%d", hideView, showView);
if (!CheckViewParam(hideView, showView))
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CheckViewParam failed.");
}
else if (AiVoiceModel::AI_RESPONSE_END) // 如果是AI 回应结束
{
- return;
if (errnote.empty()) // 如果没有回应数据
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::GetErrnote is empty!!");
if (!OHOS::AiVoiceModel::GetInstance().GetIsLimitDisplayed()) // 如果ai答案没有显示到极限了,就更新ai答案字符串
{
aiAnswerStr += str;
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "接受字的符串:%s", aiAnswerStr.c_str());
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "接受字的符串:%s", aiAnswerStr.c_str());
SendMsgToUIService(UI_UPDATE_AI_ANSWER_STR, 0, nullptr, 0);
}
}
/*
- * @Author: luozheng 1732036298@qq.com
- * @Date: 2024-05-07 11:25:58
- * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2025-03-06 16:07:08
- * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp
- */
+* @Author: luozheng 1732036298@qq.com
+* @Date: 2024-05-07 11:25:58
+* @LastEditors: luozheng 1732036298@qq.com
+* @LastEditTime: 2025-03-06 16:07:08
+* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp
+*/
#include "aivoice/include/AiVoicePresenter.h"
#include "aivoice/include/AiVoiceView.h"
#include "aivoice/include/AiVoiceModel.h"
VolumeProcess->SetKnobStyle(StyleDefault::GetSliderKnobStyle());
VolumeProcess->RequestFocus();
VolumeProcess->SetRotateFactor(5.0);
- // VolumeProcess->SetVisible(false);
+ VolumeProcess->SetVisible(false);
VolumeProcess->SetOnRotateListener(presenter_);
AddViewToRootContainer(VolumeProcess);
}
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView");
if (!CreateAiVoiceScrollView() || !CreateAiVoiceViewImageView() || !CreateAiVoiceViewPicker() ||
- !CreateAiVoiceViewLabel() || !CreateAiVoiceViewButton() || !CreateAiVoiceVoiceView())
+ !CreateAiVoiceViewLabel() || !CreateAiVoiceViewButton())
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::CreateAiVoiceView fail!");
return nullptr;
{
SendMsgToUIService(UI_UPDATE_USER_QUESTION_STR, 0, nullptr, 0);
}
+ if(AiVoiceModel::GetInstance().GetSelect4gorbt() == AI_SELECT_4G)
+ {
+ if (VolumeProcess)
+ {
+ VolumeProcess->SetVisible(true);
+ }
+ }
return true;
}