-/***
+/***
* @Date: 2024-08-19 19:20:08
* @LastEditors: Caisking 3449750381@qq.com
* @LastEditTime: 2024-08-30 18:57:30
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-08-03 11:09:56
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-19 16:19:42
+ * @LastEditTime: 2024-08-31 15:11:11
* @FilePath: /xts_origin/FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceConnectingView.h
*/
int16_t width;
int16_t height;
ImageAnimatorInfo *imageInfoArray;
- const char *const *pathsArray;
+ const ImageInfo **pathsArray;
uint8_t numFrames;
int delay;
};
static AiVoiceConnectingView *GetInstance(void);
UIScrollView *CreateAiVoiceConnectingView(void);
UIScrollView *CreateAiVoiceConnectingView(uint8_t);
+
private:
UIImageAnimatorView *connectingImageAnimatorInit(ImageAnimatorConfig &imageanimatorconfig);
UILabelExt *AiVoiceConnectingViewLabelInit(LabelConfig &labelconfig);
UIButton *cancelButton{nullptr};
UIImageAnimatorView *connectingAnimatorView{nullptr};
ImageAnimatorInfo connectingImageInfo[AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES];
- const char **connectingPathsArray{nullptr};
+ const ImageInfo **connectingPathsArray{nullptr};
};
}
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 15:14:43
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 17:45:47
+ * @LastEditTime: 2024-08-31 16:14:37
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h
*/
#ifndef AI_VOICE_MODEL_H
static AiVoiceModel &GetInstance(void); // 获取单例实例
bool ChangeToReturnResultTextView(void);
bool ChangeToAIVoiceListeningView(bool value);
+ bool ChangeToAIVoiceConnectTimeoutView();
void FunctionKeyOnClickToChangeAIModel(void);
// 初始化和状态管理
bool CreateIfNotExists();
void SetAiVoiceConnectStatus(bool state);
void QuerySelectedAiModelIsConnect();
void CancelCurAIChat(void);
+ int GetAIResponseType(void);
+ std::string GetErrnote(void);
+ void SetCurView(int16_t viewNum);
+ int GetCurView(void);
// 聊天内容管理
bool InitchatContentItems(void);
std::map<int, std::pair<int, int>> selectAiModelToTextId; // pair的参数类型<模型的textid,查询模型是否可用id>
bool AiVoiceConnectStatus{false}; //与AI模型的连接状态
uint8_t AIResponseType;
+ std::string errnote; //错误信息
+ int16_t curView{0};
};
}
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 14:44:22
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-09 19:52:53
+ * @LastEditTime: 2024-08-31 16:13:42
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoicePresenter.h
*/
#ifndef AI_VOICE_PRESENTER_H
bool JumpToReturnResultTextView(void);
bool ChangeToAIVoiceListeningView(bool val);
+ bool ChangeToAIVoiceConnectTimeoutView();
bool ChangeViewAndLogicOperator(int16_t hideView, int16_t showView);
void FunctionKeyOnClickToChangeAIModel(void);
void DragLeftToRightChangeAIModel(void);
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-22 16:46:26
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-06-22 17:00:33
+ * @LastEditTime: 2024-08-31 16:14:01
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AivoiceConnectTimeoutView.h
*/
~AivoiceConnectTimeoutView();
static AivoiceConnectTimeoutView *GetInstance(void);
UIScrollView *CreateAivoiceConnectTimeoutView(void);
-
+ void UpdateTitleTextId(int textId);
+ void UpdateNoteText();
private:
void ClearAll(void);
UILabelExt *AivoiceConnectTimeoutLabelInit(LabelConfig &labelconfig);
UIScrollView *scrollView{nullptr};
UILabelExt *title{nullptr};
UIImageView *attentionImage{nullptr};
- UILabelExt *label[2]{nullptr};
+ UILabelExt *NoteLabel{nullptr};
UILabelExt *ensure{nullptr};
UIButton *ensureButton{nullptr};
};
-/***
+/***
* @Date: 2024-06-26 16:59:51
* @LastEditors: Caisking 3449750381@qq.com
* @LastEditTime: 2024-08-30 18:57:36
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-22 16:46:26
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-06-25 15:39:07
+ * @LastEditTime: 2024-08-31 14:56:06
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AivoiceListeningView.h
*/
int16_t y;
int16_t width;
int16_t height;
- ImageAnimatorInfo* imageInfoArray;
- const char* const* pathsArray;
+ ImageAnimatorInfo *imageInfoArray;
+ const ImageInfo **pathsArray;
uint8_t numFrames;
int delay;
};
UIButton *finishSpeakButton{nullptr};
UIImageAnimatorView *AiVoiceListeningImageAnimatorView{nullptr};
ImageAnimatorInfo AiVoiceListeningImageInfo[AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES];
- const char **AiVoiceListeningPathsArray{nullptr};
+ const ImageInfo **AiVoiceListeningPathsArray{nullptr};
};
}
#endif
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-22 16:46:26
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-07-31 11:33:33
+ * @LastEditTime: 2024-08-31 15:08:52
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AivoiceThinkingView.h
*/
int16_t width;
int16_t height;
ImageAnimatorInfo *imageInfoArray;
- const char *const *pathsArray;
+ const ImageInfo **pathsArray;
uint8_t numFrames;
int delay;
};
UIButton *cancelThinkButton{nullptr};
UIImageAnimatorView *AiVoiceThinkingImageAnimatorView{nullptr};
ImageAnimatorInfo AiVoiceThinkingImageInfo[AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES];
- const char **AiVoiceThinkingPathsArray{nullptr};
+ const ImageInfo **AiVoiceThinkingPathsArray{nullptr};
};
}
#endif
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-08-03 11:10:08
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-19 16:41:43
+ * @LastEditTime: 2024-08-31 15:11:39
* @FilePath: /xts_origin/FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceConnectingView.cpp
*/
#include "aivoice/include/AiVoiceConnectingView.h"
connectingAnimatorView->Stop();
delete connectingAnimatorView;
connectingAnimatorView = nullptr;
- FreeImagePathsArray(connectingPathsArray, AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ FreeImageInfoArray(connectingPathsArray, AIVoiceListeningImagePaths, AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+
}
if (cancelLabel)
{
for (uint8_t i = 0; i < imageanimatorconfig.numFrames; i++)
{
- // imageanimatorconfig.imageInfoArray[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(imageanimatorconfig.pathsArray[i]);
- // imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_IMAGE_INFO;
- imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageInfo = (imageanimatorconfig.pathsArray[i]);
+ imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_IMAGE_INFO;
+ // imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
+ // imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
imageanimatorconfig.imageInfoArray[i].pos.x = imageanimatorconfig.x;
imageanimatorconfig.imageInfoArray[i].pos.y = imageanimatorconfig.y;
imageanimatorconfig.imageInfoArray[i].width = imageanimatorconfig.width;
bool AiVoiceConnectingView::CreateAivoiceConnectingImageAnimator(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceConnectingView::CreateAivoiceConnectingImageAnimator");
- connectingPathsArray = CreateImagePathsArray(AIVoiceListeningImagePaths, AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ connectingPathsArray = CreateImageInfoArray(AIVoiceListeningImagePaths, AIVOICE_CONNECTING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (connectingPathsArray == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceConnectingView::connectingPathsArray is nullptr!!");
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 15:14:50
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 17:46:07
+ * @LastEditTime: 2024-08-31 16:13:29
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp
*/
#include "aivoice/include/AiVoiceModel.h"
return instance;
}
+ // 跳转到返回结果界面
bool AiVoiceModel::ChangeToReturnResultTextView(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::ChangeToReturnResultTextView");
return true;
}
+ // 切换到AI回应错误界面
+ bool AiVoiceModel::ChangeToAIVoiceConnectTimeoutView()
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::ChangeToAIVoiceConnectTimeoutView");
+ AiVoicePresenter *Aipresenter_ = AiVoicePresenter::GetInstance();
+ if (Aipresenter_ == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::GetInstance() fail!!");
+ return false;
+ }
+ Aipresenter_->ChangeToAIVoiceConnectTimeoutView();
+ return true;
+ }
+
+ // 功能键切换模型
void AiVoiceModel::FunctionKeyOnClickToChangeAIModel(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::FunctionKeyOnClickToChangeAIModel");
}
}
- /*取消当前AI对话*/
+ /*取消当前AI对话*/
void AiVoiceModel::CancelCurAIChat(void)
{
cancel_AI_cur_chat();
}
+ int AiVoiceModel::GetAIResponseType(void)
+ {
+ return AIResponseType;
+ }
+
+ std::string AiVoiceModel::GetErrnote(void)
+ {
+ return errnote;
+ }
+
+ /*设置当前哪个子视图是可见的*/
+ void AiVoiceModel::SetCurView(int16_t viewNum)
+ {
+ curView = viewNum;
+ }
+
+ /*获取当前哪个子视图是可见的*/
+ int AiVoiceModel::GetCurView(void)
+ {
+ return curView;
+ }
+
/*列表数量*/
uint8_t AiVoiceModel::GetChatContentListCount(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiVoiceModel::UpdateUserQuestionStr");
RemoveLastTwoItemsOrClear();
+ /* -------------------------------------------------------------------------- */
+ ScreenTurnOn(5 * 1000); // 有消息来就亮屏5秒
+ /* -------------------------------------------------------------------------- */
if (!AddUserQuestionToChatItems())
{
std::string AiVoiceModel::GetAiAnswerStr(void)
{
// aiAnswerStr = "春风化雨,时光荏苒。百年之内,生命如白驹过隙,转瞬即逝。唯有心存善念,用爱化解芥蒂,用智慧建构未来,才是人生的真正意义。让我们携手共进,用每一分时光去关爱他人,用每一滴汗水去创造奇迹,用每一个眼神去传递温暖。让这个世界因我们的存在而变得更加美好。生命短暂,但只要我们怀着虔诚的心,坚韧前行,我们就一定能在有限的时光里留下无限的可能。";
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetAiAnswerStr:%s\n", aiAnswerStr.c_str());
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GetAiAnswerStr:%s", aiAnswerStr.c_str());
return aiAnswerStr;
}
void AiVoiceModel::SetAiAnswerStrStr(std::string str, uint8_t type)
{
- aiAnswerStr += str;
AIResponseType = type;
+ errnote = str;
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AIResponseType = %d,errnote = %s\n", AIResponseType, errnote.c_str());
+ if (AIResponseType == AiVoiceModel::AI_RECORDING_PARSING_ERROR || AIResponseType == AiVoiceModel::AI_RESPONSE_ERROR)
+ {
+ SendMsgToUIService(UI_AI_JUMP_TO_RESPONDERR_VIEW, 0, (void *)errnote.c_str(), errnote.length());
+ ScreenTurnOn(5 * 1000); // 有消息来就亮屏5秒
+ return;
+ }
+ aiAnswerStr += str;
SendMsgToUIService(UI_UPDATE_AI_ANSWER_STR, 0, nullptr, 0);
}
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AIVoice_TimerCallbackProc,AiModelConnectTimeout = %d", AiModelConnectTimeout);
AiModelConnectTimeout--;
- if (AiModelConnectTimeout < 0)
+ if (AiModelConnectTimeout < 0) // 模型连接失败有5秒超时
{
AiVoiceModel::GetInstance().AIVoice_StopTimer();
AiVoiceView *view_ = AiVoiceView::GetInstance();
if (Time == 30)
{
AiVoiceModel::GetInstance().CheckFileAndSendAIIsReady();
+ AiVoiceModel::GetInstance().AIVoice_StopTimer();
+ return;
}
if (Time < 0) // 如果思考时间超时30s,进入连接超时界面
{
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 15:11:17
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 17:46:50
+ * @LastEditTime: 2024-08-31 16:13:34
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp
*/
#include "AppViewIDs.h"
return true;
}
+ bool AiVoicePresenter::ChangeToAIVoiceConnectTimeoutView()
+ {
+ if ((view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID) != nullptr) &&
+ (view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID)->IsVisible()))
+ {
+ ChangeViewAndLogicOperator(AiVoiceModel::GetInstance().GetCurView(), AIVOICE_CONNECT_TIMEOUT_VIEWID);
+ AivoiceConnectTimeoutView *p_AivoiceConnectTimeoutView = AivoiceConnectTimeoutView::GetInstance();
+ if (p_AivoiceConnectTimeoutView)
+ {
+ p_AivoiceConnectTimeoutView->UpdateNoteText();
+ }
+ }
+ return true;
+ }
+
void AiVoicePresenter::FunctionKeyOnClickToChangeAIModel(void)
{
int index = model->GetSelectAiModel() + 1;
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 17:47:15
+ * @LastEditTime: 2024-08-31 14:32:02
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AiVoiceView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
AiVoiceScrollView[showView]->SetVisible(true);
Draw();
DestroyTempView(hideView);
+ AiVoiceModel::GetInstance().SetCurView(showView);
return;
}
{
p_AivoiceMobileDataFailedStartView->UpdateTitleTextId(textId);
}
+ if (p_AivoiceConnectTimeoutView)
+ {
+ p_AivoiceConnectTimeoutView->UpdateTitleTextId(textId);
+ }
}
}
\ No newline at end of file
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-02 15:44:02
+ * @LastEditTime: 2024-08-31 16:13:53
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AivoiceConnectTimeoutView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
#include "aivoice/include/AivoiceConnectTimeoutView.h"
+#include "aivoice/include/AiVoiceModel.h"
#include "wearable_log.h"
#include "ui_resource_string.h"
#include <UiConfig.h>
if (scrollView != nullptr)
{
scrollView->RemoveAll();
-
if (title != nullptr)
{
delete title;
title = nullptr;
}
-
if (attentionImage != nullptr)
{
delete attentionImage;
attentionImage = nullptr;
}
-
- for (int i = 0; i < 2; i++)
+ if (NoteLabel != nullptr)
{
- if (label[i] != nullptr)
- {
- delete label[i];
- label[i] = nullptr;
- }
+ delete NoteLabel;
+ NoteLabel = nullptr;
}
-
if (ensure != nullptr)
{
delete ensure;
ensure = nullptr;
}
-
if (ensureButton != nullptr)
{
delete ensureButton;
ensureButton = nullptr;
}
-
delete scrollView;
scrollView = nullptr;
}
label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh);
label->SetTextId(labelconfig.textId);
label->SetLineBreakMode(labelconfig.lineBreakMode);
- label->SetRollSpeed(70);
label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
label->SetRollSpeed(LABEL_ROLL_SPEED);
.height = 35,
.fontSize = 30,
.lineHeigh = 35,
- .textId = STR_AI_INTELLIGENT_ASSISTANT,
+ .textId = AiVoiceModel::GetInstance().GetAiModelTextId(),
.lineBreakMode = UILabel::LINE_BREAK_OSCILLATION,
};
title = AivoiceConnectTimeoutLabelInit(labelconfig);
return false;
}
/* -------------------------------------------------------------------------- */
- labelconfig.left = 53;
- labelconfig.width = 360;
- int textId[] = {STR_CONNECT_TIMEOUT, STR_PLEASE_RESTART_CHAT};
- for (int i = 0; i < 2; i++)
+ NoteLabel = new UILabelExt();
+ if (NoteLabel == nullptr)
{
- labelconfig.top = 222 + i * labelconfig.height;
- labelconfig.textId = textId[i];
- label[i] = AivoiceConnectTimeoutLabelInit(labelconfig);
- if (label[i] == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AivoiceConnectTimeoutView::label[%d] is nullptr!", i);
- return false;
- }
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "NoteLabel is nullptr!");
+ return false;
}
+ NoteLabel->SetPosition(53, 222, 360, 70);
+ NoteLabel->SetStyle(STYLE_TEXT_FONT, 30);
+ NoteLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
+ NoteLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
+ NoteLabel->SetRollSpeed(70);
+ NoteLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ NoteLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
/* -------------------------------------------------------------------------- */
labelconfig = {
.left = 133,
}
scrollView->Add(title);
scrollView->Add(attentionImage);
- scrollView->Add(label[0]);
- scrollView->Add(label[1]);
+ scrollView->Add(NoteLabel);
scrollView->Add(ensureButton);
scrollView->Add(ensure);
}
return scrollView;
}
+ void AivoiceConnectTimeoutView::UpdateTitleTextId(int textId)
+ {
+ if (title)
+ {
+ title->SetTextId(textId);
+ title->ForceResetText();
+ }
+ }
+
+ // 更新错误信息内容
+ void AivoiceConnectTimeoutView::UpdateNoteText()
+ {
+ if (NoteLabel)
+ {
+ NoteLabel->SetText("");
+ std::string text = AiVoiceModel::GetInstance().GetErrnote();
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "text = %s", text.c_str());
+ NoteLabel->SetText(text.c_str());
+ NoteLabel->Invalidate();
+ }
+ }
}
\ No newline at end of file
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-02 15:44:32
+ * @LastEditTime: 2024-08-31 15:12:44
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AivoiceListeningView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
delete AiVoiceListeningImageAnimatorView;
AiVoiceListeningImageAnimatorView = nullptr;
- FreeImagePathsArray(AiVoiceListeningPathsArray, AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ FreeImageInfoArray(AiVoiceListeningPathsArray, AIVoiceListeningImagePaths, AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
}
if (finishSpeak != nullptr)
for (uint8_t i = 0; i < imageanimatorconfig.numFrames; i++)
{
- // imageanimatorconfig.imageInfoArray[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageInfo = imageanimatorconfig.pathsArray[i];
+ // imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
+ // imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_IMAGE_INFO;
imageanimatorconfig.imageInfoArray[i].pos.x = imageanimatorconfig.x;
imageanimatorconfig.imageInfoArray[i].pos.y = imageanimatorconfig.y;
imageanimatorconfig.imageInfoArray[i].width = imageanimatorconfig.width;
bool AivoiceListeningView::CreateAivoiceListeningImageAnimator(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AivoiceListeningView::CreateAivoiceListeningImageAnimator");
- AiVoiceListeningPathsArray = CreateImagePathsArray(AIVoiceListeningImagePaths, AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ AiVoiceListeningPathsArray = CreateImageInfoArray(AIVoiceListeningImagePaths, AIVOICE_LISTENING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (AiVoiceListeningPathsArray == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AivoiceListeningView::AiVoiceListeningPathsArray is nullptr!!");
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-02 15:44:41
+ * @LastEditTime: 2024-08-31 15:09:13
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiVoice/src/AivoiceThinkingView.cpp
*/
#include "aivoice/include/AiVoicePresenter.h"
delete AiVoiceThinkingImageAnimatorView;
AiVoiceThinkingImageAnimatorView = nullptr;
- FreeImagePathsArray(AiVoiceThinkingPathsArray, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ // FreeImagePathsArray(AiVoiceThinkingPathsArray, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ FreeImageInfoArray(AiVoiceThinkingPathsArray, AIVoiceThinkingImagePaths, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
}
if (cancelThink != nullptr)
for (uint8_t i = 0; i < imageanimatorconfig.numFrames; i++)
{
- // imageanimatorconfig.imageInfoArray[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
- imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageInfo = (imageanimatorconfig.pathsArray[i]);
+ // imageanimatorconfig.imageInfoArray[i].imagePath = (imageanimatorconfig.pathsArray[i]);
+ // imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_FILE_PATH;
+ imageanimatorconfig.imageInfoArray[i].imageType = IMG_SRC_IMAGE_INFO;
imageanimatorconfig.imageInfoArray[i].pos.x = imageanimatorconfig.x;
imageanimatorconfig.imageInfoArray[i].pos.y = imageanimatorconfig.y;
imageanimatorconfig.imageInfoArray[i].width = imageanimatorconfig.width;
bool AivoiceThinkingView::CreateAivoiceThinkingImageAnimator(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AivoiceThinkingView::CreateAivoiceThinkingImageAnimator");
- AiVoiceThinkingPathsArray = CreateImagePathsArray(AIVoiceThinkingImagePaths, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ AiVoiceThinkingPathsArray = CreateImageInfoArray(AIVoiceThinkingImagePaths, AIVOICE_THINKING_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (AiVoiceThinkingPathsArray == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AivoiceThinkingView::AiVoiceThinkingPathsArray is nullptr!!");
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-12 11:44:04
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-29 18:44:06
+ * @LastEditTime: 2024-08-31 14:20:21
* @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h
*/
/*
UI_AI_JUMP_TO_RESULT_VIEW, //跳转到返回结果视图
UI_AI_JUMP_TO_LISTENING_VIEW,//跳转到AI聆听界面
+ UI_AI_JUMP_TO_RESPONDERR_VIEW,//处理跳转AI回应错误界面
UI_UPDATE_USER_QUESTION_STR,//更新用户问题的字符串
UI_UPDATE_AI_ANSWER_STR, //更新AI答案的字符串
UI_HAND_WATCH_FIRST_PAIRED, //手表已配对:给第一次手表启动用配对成功调用
static void HandleUpdateMusicPlayerList(Request *request);
static void HandleAiJumpToResultView(Request *request);
static void HandleAiJumpToListeningMessage(Request *request);
+ static void HandleAiJumpToRespondErrMessage(Request *request);
static void HandleUpdateUserQuestionStr(Request *request);
static void HandleUpdateAIAnswerStr(Request *request);
static void HandleWatchFirstPaired(Request *request);
{UI_HAND_WATCH_FIRST_PAIRED, HandleWatchFirstPaired},
{UI_UPDATE_OBU_MESSAGE, HandleUpdateOBUMessage},
{UI_AI_JUMP_TO_LISTENING_VIEW, HandleAiJumpToListeningMessage},
+ {UI_AI_JUMP_TO_RESPONDERR_VIEW, HandleAiJumpToRespondErrMessage},
{UI_UPDATE_RECORDPROCESS, HandleUpdateRecordProcess},
{UI_UPDATE_PLAYERPROCESS, HandleUpdatePlayerProcess},
std::bind(&OHOS::AiVoiceModel::ChangeToAIVoiceListeningView, &OHOS::AiVoiceModel::GetInstance(), state));
}
+ // 处理更新查询AI模型是否连接成功的状态
+ void HandleAiJumpToRespondErrMessage(Request *request)
+ {
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleAiJumpToRespondErrMessage");
+ GraphicService::GetInstance()->PostGraphicEvent(
+ std::bind(&OHOS::AiVoiceModel::ChangeToAIVoiceConnectTimeoutView, &OHOS::AiVoiceModel::GetInstance()));
+ }
+
//处理更新录音进度条
void HandleUpdateRecordProcess(Request *request)
{