From b7acc0332051df1c07c16d675fa2f4e6e30c5cbe Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Thu, 11 Jul 2024 10:01:46 +0000 Subject: [PATCH] Merge #502 into sdk602patch0626 from refs/changes/502/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/502/head: (13 commits squashed) - Ai语音修改,遗留Label闪屏和字数过长后段不显示问题, 与蓝鹊app联调经常发送了语音没有返回内容 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 添加applist的足球显示样式 - 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 - 1.AI模型选择界面 完成 2.添加适配ai模型界面的字体,图片 3.ai语音界面Model修改,现在停止录音会有2秒等待时间 - 解决录音Slice中录音列表获取日期导致的内存泄漏问题 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - ai大模型UI完成需适配接口 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 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/502 --- .../wearable/fd230app/CMakeLists.txt | 5 + .../nativelauncher/include/AppViewIDs.h | 1 + .../nativelauncher/include/NativeLauncher.h | 1 + .../nativelauncher/src/NativeLauncher.cpp | 18 +- .../nativeui/aimodels/include/AiModelsModel.h | 38 ++ .../aimodels/include/AiModelsPresenter.h | 52 +++ .../nativeui/aimodels/include/AiModelsView.h | 120 ++++++ .../nativeui/aimodels/src/AiModelsModel.cpp | 63 +++ .../aimodels/src/AiModelsPresenter.cpp | 154 +++++++ .../nativeui/aimodels/src/AiModelsView.cpp | 383 ++++++++++++++++++ .../nativeui/aivoice/include/AiVoiceModel.h | 4 +- .../nativeui/aivoice/src/AiVoiceModel.cpp | 45 +- .../nativeui/aivoice/src/AiVoicePresenter.cpp | 6 +- .../language/Language_xml/input_list_en.txt | 6 +- .../language/Language_xml/input_list_zh.txt | 6 +- .../language/Language_xml/language_en.xml | 4 + .../language/Language_xml/language_ja.xml | 240 ----------- .../language/Language_xml/language_zh.xml | 4 + .../fd230app/nativeui/language/font/en.lang | Bin 9900 -> 9944 bytes .../fd230app/nativeui/language/font/ja.lang | Bin 7354 -> 7374 bytes .../language/font/ui_resource_string.h | 8 +- .../fd230app/nativeui/language/font/zh.lang | Bin 8980 -> 9029 bytes .../nativeui/main/src/MainPresenterSample.cpp | 39 +- .../nativeui/main/src/PullUpDownView.cpp | 2 +- .../rebootdevice/include/RebootModel.h | 10 +- .../nativeui/rebootdevice/src/RebootModel.cpp | 127 ++++-- .../nativeui/record/include/RecordingModel.h | 5 +- .../nativeui/record/src/RecordingModel.cpp | 17 +- .../AIVoice/aimodels/aimode_lschatgpt_on.bin | 3 + .../user/res/AIVoice/aimodels/aimodels_bg.bin | 3 + .../AIVoice/aimodels/aimodels_chatgpt_off.bin | 3 + .../res/AIVoice/aimodels/aimodels_doubao.bin | 3 + .../res/AIVoice/aimodels/aimodels_kimi.bin | 3 + .../res/AIVoice/aimodels/aimodels_select.bin | 3 + .../AIVoice/aimodels/aimodels_title_bg.bin | 3 + .../AIVoice/aimodels/aimodels_wenxinyiyan.bin | 3 + .../fd230/fs/user/res/font/en.lang | Bin 9900 -> 9944 bytes .../fd230/fs/user/res/font/ja.lang | Bin 7354 -> 7374 bytes .../fs/user/res/font/ui_resource_string.h | 8 +- .../fd230/fs/user/res/font/zh.lang | Bin 8980 -> 9029 bytes 40 files changed, 1064 insertions(+), 326 deletions(-) create mode 100644 code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsModel.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsPresenter.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsView.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsModel.cpp create mode 100644 code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsPresenter.cpp create mode 100644 code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsView.cpp delete mode 100644 code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_ja.xml create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimode_lschatgpt_on.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_bg.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_chatgpt_off.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_doubao.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_kimi.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_select.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_title_bg.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_wenxinyiyan.bin diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index 6953c7092..10c9c0cad 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -401,6 +401,11 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/aivoice/src/AivoiceChatContentListAdapter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/aivoice/src/AivoiceReturnResultTextView.cpp + #Ai Models + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/aimodels/src/AiModelsModel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/aimodels/src/AiModelsView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/aimodels/src/AiModelsPresenter.cpp + #声音与震动 ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/soundandvibration/src/SoundAndVibrationView.cpp diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h index a9b255ad2..0d8f7d124 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h @@ -65,6 +65,7 @@ typedef enum : uint16_t VIEW_RESPIRATORY_TRAINING, // 呼吸训练 VIEW_THEME_STYLE, // 主题样式 VIEW_AI_VOICE, // AI Voice(人工智能语音) + VIEW_AI_MODELS, // AI模型选择界面 VIEW_SET_DESKTOP, // 显示方式 VIEW_RECORD, /* ----------------------------------------------------------------------------- */ diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h index a5503e367..92e03607e 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h @@ -63,6 +63,7 @@ namespace OHOS void InitRespiratoryTrainingSlice(void); void InitThemeStyleSlice(void); void InitAiVoiceSlice(void); + void InitAiModelsSlice(void); /* --------------------------------界面------------------------------------ */ void InitRotateSlice(void); void InitBloodSlice(void); diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 3b9c2386b..e7b0622f4 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -197,6 +197,9 @@ #include "aivoice/include/AiVoicePresenter.h" #include "aivoice/include/AiVoiceView.h" + +#include "aimodels/include/AiModelsPresenter.h" +#include "aimodels/include/AiModelsView.h" /* -------------------------------------------------------------------------- */ #include "traing/include/TraingView.h" #include "traing/include/TraingPresenter.h" @@ -293,6 +296,7 @@ namespace OHOS {VIEW_RESPIRATORY_TRAINING, &NativeLauncher::InitRespiratoryTrainingSlice}, // 呼吸训练界面 {VIEW_THEME_STYLE, &NativeLauncher::InitThemeStyleSlice}, // 主题样式界面 {VIEW_AI_VOICE, &NativeLauncher::InitAiVoiceSlice}, // Ai Voice(人工智能语音) + {VIEW_AI_MODELS, &NativeLauncher::InitAiModelsSlice}, // Ai Models(Ai模型选择界面) // {VIEW_SECONDARY_FUNCTION, &NativeLauncher::InitSecondaryFunction}, // {VIEW_FAST_TRAINING, &NativeLauncher::InitFastTrainingSlice}, @@ -434,7 +438,7 @@ namespace OHOS ScreenModels::GetInstance()->PreLoadAppimages(); // NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN); // 注册按键事件 - RebootModel::GetInstance()->RegisterKeyEvents(); + RebootModel::GetInstance()->RegisterAllKeyEvents(); // 开机检测充电状态 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get_charge_stat is %d", get_charge_stat()); @@ -1279,6 +1283,18 @@ namespace OHOS } NativeAbility::GetInstance().AddSliceProxy(VIEW_AI_VOICE, AiVoice); } + + /*Ai模型选择界面*/ + void NativeLauncher::InitAiModelsSlice(void) + { + SliceProxy *AiModels = new AbilitySliceProxy; + if (AiModels == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModels"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_AI_MODELS, AiModels); + } /* -------------------------------------------------------------------------- */ void NativeLauncher::InitSetDesktopSlice(void) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsModel.h b/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsModel.h new file mode 100644 index 000000000..00d64daa9 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsModel.h @@ -0,0 +1,38 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-07-08 09:39:31 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-07-10 21:20:02 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsModel.h + */ + +#ifndef AI_MODELS_MODEL_H +#define AI_MODELS_MODEL_H + +#include +#include "string" + +namespace OHOS +{ + class AiModelsModel + { + public: + static AiModelsModel &GetInstance(void); + int GetSelectAiModel(void); + void SetSelectAiModel(int index); + bool ChangeAiModel(void); + int GetAiModelTextId(void); + void SetAiModelTextId(int textId); + + private: + AiModelsModel(); + ~AiModelsModel(); + AiModelsModel(const AiModelsModel &) = delete; + AiModelsModel &operator=(const AiModelsModel &) = delete; + + int selectAiModel; // 选择的ai模型 + int textId; + }; +} + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsPresenter.h new file mode 100644 index 000000000..dda863529 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsPresenter.h @@ -0,0 +1,52 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-07-08 09:39:10 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-07-10 10:21:57 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsPresenter.h + */ + +#ifndef AI_MODELS_PRESENTER_H +#define AI_MODELS_PRESENTER_H + +#include "Presenter.h" +#include "View.h" +#include "aimodels/include/AiModelsModel.h" + +namespace OHOS +{ + class AiModelsView; + class AiModelsModel; + class AiModelsPresenter : public Presenter, + public UIView::OnClickListener, + public UIView::OnDragListener, + public RootView::OnKeyActListener + { + public: + AiModelsPresenter(); + virtual ~AiModelsPresenter(); + static AiModelsPresenter *GetInstance(); + + /*获取选择的ai模型*/ + int16_t GetSelectAiModel(void); + /*单击func key切换ai模型*/ + void ChangeAiModel(void); + void SetAiModelTextId(int16_t id); + + void OnStart() override; + void OnResume() override; + void OnPause() override; + void OnStop() override; + + private: + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + bool OnDragEnd(UIView &view, const DragEvent &event) override; + bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件 + + AiModelsModel *model; + bool X_DRAG_FLAG{false}; + }; +} + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsView.h b/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsView.h new file mode 100644 index 000000000..3643e0278 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsView.h @@ -0,0 +1,120 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-07-08 09:38:50 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-07-10 10:11:28 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aimodels/include/AiModelsView.h + */ + +#ifndef AI_MODELS_VIEW_H +#define AI_MODELS_VIEW_H + +#include "BaseView.h" +#include "View.h" +#include "components/ui_view_group.h" +#include "components/ui_button.h" +#include "components/ui_scroll_view.h" +#include "components/ui_image_view.h" +#include "components/ui_label_ext.h" +#include "language/font/ui_resource_string.h" +#include +namespace OHOS +{ +#define AIMODELS_IMAGE_PATH "/user/res/AIVoice/aimodels" + typedef enum : uint8_t + { + AIMODES_DOUBAO = 0, /*豆包*/ + AIMODES_WENXINYIYAN, /*wenxinyiyan*/ + AIMODES_KIMI, /*kimi*/ + AIMODES_CHATGPT, /*chatgpt*/ + AIMODES_MAX_NUM, + } aimodels; + + static constexpr char *AIMODES_DOUBAO_BUTTONVIEWID = "doubao_button"; + static constexpr char *AIMODES_WENXINYIYAN_BUTTONVIEWID = "wenxinyiyan_button"; + static constexpr char *AIMODES_KIMI_BUTTONVIEWID = "kimi_button"; + static constexpr char *AIMODES_CHATGPT_BUTTONVIEWID = "chatgpt_button"; + + static constexpr char *AiModels_Bg = AIMODELS_IMAGE_PATH "/aimodels_bg.bin"; /*整个模型背景*/ + static constexpr char *AiModels_title_Bg = AIMODELS_IMAGE_PATH "/aimodels_title_bg.bin"; /*标题背景*/ + static constexpr char *AiModels_select = AIMODELS_IMAGE_PATH "/aimodels_select.bin"; /*模型选中状态*/ + static constexpr char *AiModelsImagePath[AIMODES_MAX_NUM] = { + AIMODELS_IMAGE_PATH "/aimodels_doubao.bin", /*豆包*/ + AIMODELS_IMAGE_PATH "/aimodels_wenxinyiyan.bin", /*文心一言*/ + AIMODELS_IMAGE_PATH "/aimodels_kimi.bin", /*Kimi*/ + AIMODELS_IMAGE_PATH "/aimode_lschatgpt_on.bin", /*ChatGPT*/ + }; + + static constexpr char *AiModelsButtonViewId[AIMODES_MAX_NUM] = { + AIMODES_DOUBAO_BUTTONVIEWID, /*豆包*/ + AIMODES_WENXINYIYAN_BUTTONVIEWID, /*文心一言*/ + AIMODES_KIMI_BUTTONVIEWID, /*Kimi*/ + AIMODES_CHATGPT_BUTTONVIEWID, /*ChatGPT*/ + }; + + class AiModelsPresenter; + class AiModelsView : public View + { + public: + struct LabelConfig + { + int16_t left; + int16_t top; + int16_t width; + int16_t height; + int16_t fontSize; + int16_t lineHeigh; + uint16_t textId; + uint8_t lineBreakMode; + }; + + struct ImageConfig + { + int16_t x; + int16_t y; + int16_t w; + int16_t h; + const char *src; + }; + + struct ButtonConfig + { + int16_t x; + int16_t y; + int16_t w; + int16_t h; + const char *viewId; + }; + + AiModelsView(); + ~AiModelsView(); + static AiModelsView *GetInstance(void); + void UpdateAiModelsSelectStateAndTitleId(); + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + UILabelExt *AiModelsViewLabelInit(const LabelConfig &labelconfig); + UIImageView *AiModelsViewImageViewInit(const ImageConfig &imageconfig); + UIButton *AiModelsViewButtonInit(const ButtonConfig &buttonconfig); + bool CreateAiModelsViewLabel(void); + bool CreateAiModelsViewImageView(void); + bool CreateAiModelsViewButton(void); + bool CreateAiModelsScrollView(void); + void CreateAiModelsView(void); + void ClearAll(void); + + UIScrollView *AiModelsScrollView{nullptr}; + UIImageView *AiModelsBackGroundImage{nullptr}; + UIImageView *AiModelsTitleBackGroundImage{nullptr}; + UILabelExt *AiModelsTitle{nullptr}; // au模型标题 + UIButton *AiModelsButtons[AIMODES_MAX_NUM]{nullptr}; + UIImageView *AiModelsImages[AIMODES_MAX_NUM]{nullptr}; + static const int AimodelsTextId[AIMODES_MAX_NUM]; + bool viewInitStatus{false}; + }; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsModel.cpp new file mode 100644 index 000000000..52c9c4997 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsModel.cpp @@ -0,0 +1,63 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-07-08 09:39:58 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-07-10 21:20:06 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsModel.cpp + */ + +#include "aimodels/include/AiModelsModel.h" +#include "aimodels/include/AiModelsPresenter.h" +#include "wearable_log.h" + +namespace OHOS +{ + AiModelsModel::AiModelsModel() {} + + AiModelsModel::~AiModelsModel() {} + + AiModelsModel &AiModelsModel::GetInstance() + { + static AiModelsModel instance; + return instance; + } + + /*获取选择的ai模型*/ + int AiModelsModel::GetSelectAiModel(void) + { + return selectAiModel; + } + + // 设置选择的ai模型 + void AiModelsModel::SetSelectAiModel(int index) + { + selectAiModel = index; + } + + /*单击func key切换ai模型*/ + bool AiModelsModel::ChangeAiModel(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsModel::ChangeAiModel"); + AiModelsPresenter *aiModelsPresenter = AiModelsPresenter::GetInstance(); + if (aiModelsPresenter == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsModel::ChangeAiModel - AiModelsPresenter instance is nullptr"); + return false; + } + aiModelsPresenter->ChangeAiModel(); + return true; + } + + /*获取已选择的ai模型的textid*/ + int AiModelsModel::GetAiModelTextId(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsModel::GetAiModelTextId - textId = %d", textId); + return textId; + } + + void AiModelsModel::SetAiModelTextId(int id) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsModel::SetAiModelTextId - id = %d", id); + textId = id; + } +} diff --git a/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsPresenter.cpp new file mode 100644 index 000000000..545549c92 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsPresenter.cpp @@ -0,0 +1,154 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-06-20 15:11:17 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-07-10 10:22:18 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiModelsPresenter.cpp + */ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "common/key_code.h" +#include +#include "UiConfig.h" +#include "aimodels/include/AiModelsPresenter.h" +#include "aimodels/include/AiModelsView.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static AiModelsPresenter *g_pAiModelsPresenter = nullptr; + + AiModelsPresenter::AiModelsPresenter() + { + model = &AiModelsModel::GetInstance(); + g_pAiModelsPresenter = this; + } + + AiModelsPresenter::~AiModelsPresenter() + { + g_pAiModelsPresenter = nullptr; + } + + AiModelsPresenter *AiModelsPresenter::GetInstance() + { + return g_pAiModelsPresenter; + } + + int16_t AiModelsPresenter::GetSelectAiModel(void) + { + return model->GetSelectAiModel(); + } + + void AiModelsPresenter::ChangeAiModel(void) + { + int index = GetSelectAiModel() + 1; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::index = %d", index); + if (index >= AIMODES_MAX_NUM) + { + index = AIMODES_DOUBAO; + } + model->SetSelectAiModel(index); + view_->UpdateAiModelsSelectStateAndTitleId(); + } + + void AiModelsPresenter::SetAiModelTextId(int16_t id) + { + model->SetAiModelTextId(id); + } + + // 启动时执行的逻辑 + void AiModelsPresenter::OnStart() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::OnStart"); + Presenter::OnStart(); + } + + // 页面已经展示后的调用逻辑 + void AiModelsPresenter::OnResume(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::OnResume"); + Presenter::OnResume(); + if (view_ == nullptr) + { + return; + } + } + + // 页面准备切换到后台前执行的逻辑 + void AiModelsPresenter::OnPause(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::OnPause"); + Presenter::OnPause(); + } + + // 页面完全置于后台时的逻辑。 + void AiModelsPresenter::OnStop(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::OnStop"); + Presenter::OnStop(); + } + + bool AiModelsPresenter::OnClick(UIView &view, const ClickEvent &event) + { + UNUSED(event); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::OnClick"); + std::string viewId = view.GetViewId(); + // 定义视图ID与文本ID的映射关系 + std::map viewIdToTextId = { + {AIMODES_DOUBAO_BUTTONVIEWID, AIMODES_DOUBAO}, + {AIMODES_WENXINYIYAN_BUTTONVIEWID, AIMODES_WENXINYIYAN}, + {AIMODES_KIMI_BUTTONVIEWID, AIMODES_KIMI}, + {AIMODES_CHATGPT_BUTTONVIEWID, AIMODES_CHATGPT}}; + + // 根据视图ID设置文本ID + auto it = viewIdToTextId.find(viewId); + if (it != viewIdToTextId.end()) + { + model->SetSelectAiModel(it->second); + } + if (model->GetSelectAiModel() == it->second) // 点击重复ai模型不执行更新 + { + view_->UpdateAiModelsSelectStateAndTitleId(); + } + + return true; + } + + bool AiModelsPresenter::OnDrag(UIView &view, const DragEvent &event) + { + UNUSED(view); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::OnDrag"); + if ((event.GetDeltaX() > X_DRAG_OFFSET) && (event.GetDeltaX() > (DOUBLES * MATH_ABS(event.GetDeltaY())))) // 拖动过程中判断是否是水平滑动 + { + AiModelsPresenter::X_DRAG_FLAG = true; + } + return true; + } + + bool AiModelsPresenter::OnDragEnd(UIView &view, const DragEvent &event) + { + UNUSED(view); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::OnDragEnd"); + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT && AiModelsPresenter::X_DRAG_FLAG) + { + NativeAbility::GetInstance().Back(); + AiModelsPresenter::X_DRAG_FLAG = false; + } + return true; + } + + bool AiModelsPresenter::OnKeyAct(UIView &view, const KeyEvent &event) // 增加按键事件 + { + UNUSED(view); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsPresenter::OnKeyAct"); + uint16_t keyID = event.GetKeyId(); + uint16_t keyState = event.GetState(); + // 如果是power键,且是亮屏状态,按键释放就返回上一级 + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) + { + NativeAbility::GetInstance().Back(); + } + return true; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsView.cpp b/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsView.cpp new file mode 100644 index 000000000..89db66818 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/aimodels/src/AiModelsView.cpp @@ -0,0 +1,383 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-05-07 11:25:58 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-07-10 10:24:57 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/AiModels/src/AiModelsView.cpp + */ +#include "aimodels/include/AiModelsPresenter.h" +#include "aimodels/include/AiModelsView.h" +#include "wearable_log.h" + +namespace OHOS +{ + const int AiModelsView::AimodelsTextId[AIMODES_MAX_NUM] = {STR_AIMODELS_DOUBAO, STR_AIMODES_WENXINYIYAN, STR_AIMODES_KIMI, STR_AIMODES_CHATGPT}; + static AiModelsView *g_pAiModelsView{nullptr}; + AiModelsView::AiModelsView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsView::AiModelsView"); + g_pAiModelsView = this; + } + + AiModelsView::~AiModelsView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsView::~AiModelsView"); + g_pAiModelsView = nullptr; + } + + AiModelsView *AiModelsView::GetInstance() + { + if (!g_pAiModelsView) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsView::GetInstance - Instance not initialized!"); + } + return g_pAiModelsView; + } + + /*更新模型选中状态和title的textid*/ + void AiModelsView::UpdateAiModelsSelectStateAndTitleId() + { + int index = presenter_->GetSelectAiModel(); + int textId = AimodelsTextId[index]; + presenter_->SetAiModelTextId(textId); + if (AiModelsTitle != nullptr) + { + AiModelsTitle->SetTextId(textId); + AiModelsTitle->ForceResetText(); + } + // 更新模型选中状态的函数中的循环优化 + for (int i = 0; i < AIMODES_MAX_NUM; ++i) + { + if (AiModelsImages[i] != nullptr) + { + bool shouldBeVisible = (index == i); + if (AiModelsImages[i]) + { + AiModelsImages[i]->SetVisible(shouldBeVisible); + } + } + } + } + + void AiModelsView::ClearAll(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::ClearAll"); + if (viewInitStatus) + { + if (container_ != nullptr) + { + container_->Remove(AiModelsScrollView); + if (AiModelsScrollView != nullptr) + { + AiModelsScrollView->RemoveAll(); + + if (AiModelsBackGroundImage != nullptr) + { + delete AiModelsBackGroundImage; + AiModelsBackGroundImage = nullptr; + } + + if (AiModelsTitleBackGroundImage != nullptr) + { + delete AiModelsTitleBackGroundImage; + AiModelsTitleBackGroundImage = nullptr; + } + + if (AiModelsTitle != nullptr) + { + delete AiModelsTitle; + AiModelsTitle = nullptr; + } + + for (int i = 0; i < AIMODES_MAX_NUM; i++) + { + if (AiModelsButtons[i] != nullptr) + { + delete AiModelsButtons[i]; + AiModelsButtons[i] = nullptr; + } + + if (AiModelsImages[i] != nullptr) + { + delete AiModelsImages[i]; + AiModelsImages[i] = nullptr; + } + } + + delete AiModelsScrollView; + AiModelsScrollView = nullptr; + } + + delete container_; + container_ = nullptr; + } + } + } + + UILabelExt *AiModelsView::AiModelsViewLabelInit(const LabelConfig &labelconfig) + { + UILabelExt *label = new UILabelExt(); + if (label == nullptr) + { + return nullptr; + } + label->SetPosition(labelconfig.left, labelconfig.top, labelconfig.width, labelconfig.height); + label->SetStyle(STYLE_TEXT_FONT, labelconfig.fontSize); + label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh); + label->SetTextId(labelconfig.textId); + label->SetLineBreakMode(labelconfig.lineBreakMode); + label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label->SetRollSpeed(70); + label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize); + return label; + } + + UIImageView *AiModelsView::AiModelsViewImageViewInit(const ImageConfig &imageconfig) + { + UIImageView *Image = new UIImageView(); + if (Image == nullptr) + { + return nullptr; + } + Image->SetPosition(imageconfig.x, imageconfig.y, imageconfig.w, imageconfig.h); + Image->SetSrc(imageconfig.src); + Image->SetStyle(STYLE_BORDER_RADIUS, 100); + Image->SetAutoEnable(false); + Image->SetResizeMode(UIImageView::FILL); + return Image; + } + + UIButton *AiModelsView::AiModelsViewButtonInit(const ButtonConfig &buttonconfig) + { + UIButton *button = new UIButton(); + if (button == nullptr) + { + return nullptr; + } + button->SetPosition(buttonconfig.x, buttonconfig.y, buttonconfig.w, buttonconfig.h); + button->SetViewId(buttonconfig.viewId); + button->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + button->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffffffff, UIButton::PRESSED); + button->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED); + button->SetOnClickListener(presenter_); + + return button; + } + + bool AiModelsView::CreateAiModelsViewLabel(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::CreateAiModelsViewLabel"); + LabelConfig labelConfig = { + .left = 83, + .top = 50, + .width = 300, + .height = 35, + .fontSize = 30, + .lineHeigh = 35, + .textId = 0, + .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, + }; + AiModelsTitle = AiModelsViewLabelInit(labelConfig); + if (AiModelsTitle == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsTitle new fail!"); + return false; + } + + return true; + } + + bool AiModelsView::CreateAiModelsViewImageView(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::CreateAiModelsViewImageView"); + ImageConfig imagecinfig = { + .x = 63, + .y = 63, + .w = 340, + .h = 340, + .src = AiModels_Bg, + }; + AiModelsBackGroundImage = AiModelsViewImageViewInit(imagecinfig); + if (AiModelsBackGroundImage == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsView::AiModelsBackGroundImage is nullptr!!"); + return false; + } + /* -------------------------------------------------------------------------- */ + imagecinfig = { + .x = 149, + .y = 38, + .w = 168, + .h = 79, + .src = AiModels_title_Bg, + }; + AiModelsTitleBackGroundImage = AiModelsViewImageViewInit(imagecinfig); + if (AiModelsTitleBackGroundImage == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsView::AiModelsTitleBackGroundImage is nullptr!!"); + return false; + } + /* -------------------------------------------------------------------------- */ + imagecinfig.w = 36; + imagecinfig.h = 36; + imagecinfig.src = AiModels_select; + for (uint8_t i = 0; i < AIMODES_MAX_NUM; i++) + { + if (i % 2 == 0) + { + imagecinfig.x = 187; + } + else + { + imagecinfig.x = 307; + } + + if (i < 2) + { + imagecinfig.y = 187; + } + else + { + imagecinfig.y = 307; + } + + AiModelsImages[i] = AiModelsViewImageViewInit(imagecinfig); + if (AiModelsImages[i] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsImages[%d] new fail!", i); + return false; + } + } + + return true; + } + + bool AiModelsView::CreateAiModelsViewButton(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::CreateAiModelsViewButton"); + + ButtonConfig buttonconfig; + buttonconfig.w = 120; + buttonconfig.h = 120; + for (uint8_t i = 0; i < AIMODES_MAX_NUM; i++) + { + if (i % 2 == 0) + { + buttonconfig.x = 113; + } + else + { + buttonconfig.x = 233; + } + + if (i < 2) + { + buttonconfig.y = 113; + } + else + { + buttonconfig.y = 233; + } + buttonconfig.viewId = AiModelsButtonViewId[i]; + AiModelsButtons[i] = AiModelsViewButtonInit(buttonconfig); + if (AiModelsButtons[i] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsButtons[%d] new fail!", i); + return false; + } + AiModelsButtons[i]->SetImageSrc(AiModelsImagePath[i], AiModelsImagePath[i]); + } + + return true; + } + + bool AiModelsView::CreateAiModelsScrollView(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::CreateAiModelsScrollView"); + AiModelsScrollView = new UIScrollView(); + if (AiModelsScrollView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsView::CreateAiModelsScrollView new fail!"); + return false; + } + AiModelsScrollView->SetPosition(0, 0, 466, 466); + AiModelsScrollView->SetTouchable(true); + AiModelsScrollView->SetDraggable(true); + + return true; + } + + /*创建Ai模型视图*/ + void AiModelsView::CreateAiModelsView(void) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::CreateAiModelsView"); + if (!CreateAiModelsScrollView() || !CreateAiModelsViewLabel() || + !CreateAiModelsViewImageView() || !CreateAiModelsViewButton()) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiModelsView::CreateAiModelsView fail!"); + return; + } + + UpdateAiModelsSelectStateAndTitleId(); + + AiModelsScrollView->Add(AiModelsBackGroundImage); + AiModelsScrollView->Add(AiModelsTitleBackGroundImage); + AiModelsScrollView->Add(AiModelsTitle); + for (int8_t i = 0; i < AIMODES_MAX_NUM; i++) + { + AiModelsScrollView->Add(AiModelsButtons[i]); + AiModelsScrollView->Add(AiModelsImages[i]); + } + container_->Add(AiModelsScrollView); + } + + void AiModelsView::OnStart() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::OnStart"); + View::OnStart(); + SetContainerView(new UIViewGroup()); + if (GetContainer() == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetContainerView fail!!"); + return; + } + container_->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + container_->SetOnDragListener(presenter_); + container_->SetTouchable(true); + container_->SetDraggable(true); + + if (!viewInitStatus) + { + CreateAiModelsView(); + viewInitStatus = true; + } + + RootView::GetInstance()->SetOnKeyActListener(presenter_); + + return; + } + void AiModelsView::OnSetUpView() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::OnSetUpView"); + View::OnSetUpView(); + Draw(); + return; + } + + void AiModelsView::OnTearDownView() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::OnTearDownView"); + View::OnTearDownView(); + return; + } + + void AiModelsView::OnStop() + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AiModelsView::OnStop"); + View::OnStop(); + RootView::GetInstance()->ClearOnKeyActListener(); + ClearAll(); + return; + } +} \ No newline at end of file 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 48722f414..724b7356c 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-07-04 18:31:22 + * @LastEditTime: 2024-07-11 14:35:27 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h */ #ifndef AI_VOICE_MODEL_H @@ -62,7 +62,7 @@ namespace OHOS void StopListenAndRecordingUserQuestion(void); // 定时器管理 - void AIVoice_StartTimer(uint32_t interval = 1000); + void AIVoice_StartTimer(uint32_t interval = 2000); void AIVoice_StopTimer(void); private: 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 7f333331b..711ffe43b 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-07-05 20:34:32 + * @LastEditTime: 2024-07-11 14:36:14 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp */ #include "aivoice/include/AiVoiceModel.h" @@ -26,7 +26,7 @@ namespace OHOS { // 声明定时器变量 static osTimerId_t g_timer = NULL; - static constexpr uint16_t THIRTY_TIME = 30; // 30秒超时 + static constexpr uint16_t THIRTY_TIME = 32; static int Time = THIRTY_TIME; AiVoiceModel::AiVoiceModel() {} @@ -305,7 +305,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetChatContentListCount() - 1 = %d,line = %d", GetChatContentListCount() - 1, __LINE__); // 将更新后的 AI 回答内容添加到列表 adapter->GetChatContentItem().push_back(chatTtems[GetChatContentListCount() - 1]); - p_AivoiceReturnResultTextView->GetChatContentList()->RefreshList(); + p_AivoiceReturnResultTextView->GetChatContentList()->RefreshList(); } else { @@ -334,7 +334,7 @@ namespace OHOS usleep(50000); // 延时等待创建完成,0.05秒 } /* -------------------------------------------------------------------------- */ - userQuestionStr = str; + userQuestionStr += str; /* -------------------------------------------------------------------------- */ if (!UpdateUserQuestionStr()) { @@ -489,29 +489,38 @@ namespace OHOS static void AIVoice_TimerCallbackProc(int data) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AIVoice_TimerCallbackProc,Time = %d", Time); - Time -= 1; - AiVoiceView *view_ = AiVoiceView::GetInstance(); - if (view_ == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::GetInstance fail!!"); - return; - } - - AiVoicePresenter *p_AiVoicePresenter = AiVoicePresenter::GetInstance(); - if (p_AiVoicePresenter == nullptr) + Time -= 2; + if (Time == 30) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::GetInstance fail!!"); - return; + AiVoiceModel::GetInstance().CheckFileAndSendAIIsReady(); } - if (Time < 0) // 如果思考时间超时30s,进入连接超时界面 { + AiVoiceView *view_ = AiVoiceView::GetInstance(); + if (view_ == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoiceView::GetInstance fail!!"); + AiVoiceModel::GetInstance().AIVoice_StopTimer(); + return; + } + AiVoicePresenter *p_AiVoicePresenter = AiVoicePresenter::GetInstance(); + if (p_AiVoicePresenter == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::GetInstance fail!!"); + AiVoiceModel::GetInstance().AIVoice_StopTimer(); + return; + } + bool flag = false; if ((view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID) != nullptr) && (view_->GetAiVoiceScrollView(AIVOICE_THINKING_VIEWID)->IsVisible())) { p_AiVoicePresenter->ChangeViewAndLogicOperator(AIVOICE_THINKING_VIEWID, AIVOICE_CONNECT_TIMEOUT_VIEWID); + flag = true; + } + if (!flag) + { + AiVoiceModel::GetInstance().AIVoice_StopTimer(); } - AiVoiceModel::GetInstance().AIVoice_StopTimer(); } return; 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 7c9d4155d..ff12fa1fb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -1,8 +1,8 @@ /* * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-20 15:11:17 - * @LastEditors: SnickerSun snickersun@163.com - * @LastEditTime: 2024-07-05 10:35:34 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-07-09 18:27:33 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoicePresenter.cpp */ #include "AppViewIDs.h" @@ -224,7 +224,7 @@ namespace OHOS if (showView == AIVOICE_THINKING_VIEWID) // 聆听中->思考中界面 { // osal_msleep(500); - model->CheckFileAndSendAIIsReady(); + //model->CheckFileAndSendAIIsReady(); model->AIVoice_StartTimer(); } else if (showView == AIVOICE_STARTCHAT_VIEWID) // 聆听中->开始对话界面:(右滑不想录音了) diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt index 4bad2f5cd..bd842a677 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt @@ -468,4 +468,8 @@ STR_THINKING$Thinking STR_CANCEL$Cancel STR_CONNECT_TIMEOUT$Connection Timeout STR_PLEASE_RESTART_CHAT$Please restart the conversation -STR_CONTINUE_CHAT$Continue the conversation \ No newline at end of file +STR_CONTINUE_CHAT$Continue the conversation +STR_AIMODELS_DOUBAO$Cici +STR_AIMODES_WENXINYIYAN$ERNIE Bot +STR_AIMODES_KIMI$Kimi +STR_AIMODES_CHATGPT$ChatGPT \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt index 7b009119f..407425a50 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt @@ -468,4 +468,8 @@ STR_THINKING$正在思考... STR_CANCEL$取消 STR_CONNECT_TIMEOUT$连接超时 STR_PLEASE_RESTART_CHAT$请重新开始对话 -STR_CONTINUE_CHAT$继续对话 \ No newline at end of file +STR_CONTINUE_CHAT$继续对话 +STR_AIMODELS_DOUBAO$豆包 +STR_AIMODES_WENXINYIYAN$文心一言 +STR_AIMODES_KIMI$Kimi +STR_AIMODES_CHATGPT$ChatGPT \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml index 1335d7bcf..be26e19d4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml @@ -470,4 +470,8 @@ + + + + diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_ja.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_ja.xml deleted file mode 100644 index b539e5fba..000000000 --- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_ja.xml +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml index 90181b94e..0ea317fce 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml @@ -470,4 +470,8 @@ + + + + diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang index 8551ced933c792b3d676ce2350cf039ad17d5407..a242fedb92864bf92dfa4b3af58531aa2f36695a 100644 GIT binary patch delta 78 zcmZ4Ed&5^$q3gayY90d$xV=#{mYvs1o`Jz0h&_SWZ*xAot-OqLW^yKjYmlF(tAbO0 T34?cLZYG0sMq-J3KnMc>uw4=j delta 35 fcmccNyT(`a)??q@sd)@2;QB_{jvs#?J|2 diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/ja.lang index fe08bbc2acf69e636f1a6be4b1e15c42b4898101..3532e338d2520eaaa2fb77c8796aca8d6658293e 100644 GIT binary patch delta 54 wcmdmGdCpSwmbAg`tV9MB@OGoqou)7qcz aZ+^0);l+vu2Jg(=Oa|wS#1i*_5C#AcCLCk{ delta 35 fcmX@=HpNY}c!KwGetTimeLabel()->SetText(timeStr); + if (PullUpDownView::GetInstance() != nullptr) + PullUpDownView::GetInstance()->GetTimeLabel()->SetText(timeStr); free(timeStr); } @@ -486,11 +487,14 @@ namespace OHOS } } - PullUpDownView::GetInstance()->GetProgress()->SetImage(progressImageSrc, nullptr); - PullUpDownView::GetInstance()->GetProgress()->SetValue(value); - PullUpDownView::GetInstance()->GetDateLabel()->SetText(dateStr); - PullUpDownView::GetInstance()->GetTimeLabel()->SetText(timeStr); - PullUpDownView::GetInstance()->GetWeekLabel()->SetText(weekStr); + if (PullUpDownView::GetInstance() != nullptr) + { + PullUpDownView::GetInstance()->GetProgress()->SetImage(progressImageSrc, progressImageSrc); + PullUpDownView::GetInstance()->GetProgress()->SetValue(value); + PullUpDownView::GetInstance()->GetDateLabel()->SetText(dateStr); + PullUpDownView::GetInstance()->GetTimeLabel()->SetText(timeStr); + PullUpDownView::GetInstance()->GetWeekLabel()->SetText(weekStr); + } // 释放动态分配的内存 free(dateStr); @@ -506,8 +510,8 @@ namespace OHOS /* -------------------------------------------------------------------------- */ // 声明定时器变量 static osTimerId_t g_timer = NULL; - static uint8_t UPDATETIME = 2; - uint8_t MainPresenterSample::g_PullUpDownTimes = UPDATETIME; // 2秒 + static uint8_t UPDATETIME = 2; // 2秒 + uint8_t MainPresenterSample::g_PullUpDownTimes = UPDATETIME; /*定时器到期时的处理*/ static void PullUpDown_TimerCallbackProc(int data) @@ -518,8 +522,23 @@ namespace OHOS if (MainPresenterSample::g_PullUpDownTimes <= 0) { MainPresenterSample::g_PullUpDownTimes = UPDATETIME; // - MainPresenterSample::GetInstance()->UpdataTime(); - PullUpDownView::GetInstance()->UpdateSignalStrengthStatusAndBatteryPosition(); + if (MainPresenterSample::GetInstance() != nullptr) + { + MainPresenterSample::GetInstance()->UpdataTime(); + } + else + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainPresenterSample::GetInstance fail!!"); + } + + if (PullUpDownView::GetInstance() != nullptr) + { + PullUpDownView::GetInstance()->UpdateSignalStrengthStatusAndBatteryPosition(); + } + else + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetInstance fail!!"); + } } if (uapi_get_screen_state() == 1) // 息屏停止更新数据 diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp index efe0ab750..fad5688a7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp @@ -594,7 +594,7 @@ namespace OHOS // progress->SetValue(value); const char *progressImageSrc = "/user/res/Battery/Battery_Normal.bin"; - progress->SetImage(progressImageSrc, nullptr); + progress->SetImage(progressImageSrc, progressImageSrc); progress->SetBackgroundStyle(STYLE_BACKGROUND_OPA, 0x00); progress->SetBackgroundStyle(STYLE_TEXT_COLOR, 0xff000000); progress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/include/RebootModel.h b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/include/RebootModel.h index 90c7ecdc6..4606d9fba 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/include/RebootModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/include/RebootModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-06-12 11:44:04 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-13 19:09:49 + * @LastEditTime: 2024-07-10 21:13:23 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/include/RebootModel.h * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%A */ @@ -28,9 +28,11 @@ public: void SetSelectViewId(int16_t value); bool GetExitsView(void); void SetExitsView(bool value); - bool RegisterLongPressEvents(void); - bool RegisterDoubleClickEvents(void); - void RegisterKeyEvents(void); + bool RegisterPowerKeyLongPressEvent(void); + bool RegisterPowerKeyDoubleClickEvent(void); + bool RegisterFuncKeyClickEvent(void); + bool RegisterFuncKeyDoubleClickEvent(void); + void RegisterAllKeyEvents(void); private: RebootModel(); int16_t selectView{0}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootModel.cpp index b083cd02c..bc113aa6e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-28 11:50:42 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-14 18:42:57 + * @LastEditTime: 2024-07-11 14:41:49 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/rebootdevice/src/RebootModel.cpp */ @@ -13,6 +13,7 @@ #include #include #include "power_display_service.h" +#include "aimodels/include/AiModelsModel.h" namespace OHOS { RebootModel::RebootModel() {} @@ -55,76 +56,128 @@ namespace OHOS } #endif - /* - * @brief 长按四秒关机回调函数 - */ - static void OnKeyLongPress4s_Callback(void) + static void HandlePowerKeyLongPress(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnKeyLongPress4s_Callback"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HandlePowerKeyLongPress"); const power_display_svr_api_t *display_api = power_display_svr_get_api(); + if (!display_api) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "power_display_svr_get_api returned nullptr"); + return; + } + if (display_api->get_screen_state() != SCREEN_ON) { display_api->turn_on_screen(); } + // 切换到关机/重启卡片 NativeAbility::GetInstance().ChangeSlice(VIEW_SHUTDOWN_OR_REBOOT); - - return; } - /* - * @brief 注册长按监听事件 - * @return 注册成功返回true,反之返回false - */ - bool RebootModel::RegisterLongPressEvents(void) + /*注册电源键的长按事件*/ + bool RebootModel::RegisterPowerKeyLongPressEvent(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RebootModel::RegisterLongPressEvents"); - int32_t ret = uapi_button_register_event_cb(OnKeyLongPress4s_Callback, BUTTON_PWR_LONGPRESS_3S); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootModel::RegisterPowerKeyLongPressEvent"); + int32_t ret = uapi_button_register_event_cb(HandlePowerKeyLongPress, BUTTON_PWR_LONGPRESS_3S); if (ret != ERRCODE_SUCC) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Register LongPress Events err,ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Register PowerKey LongPress Event error, ret = %d", ret); return false; } return true; } - /* - * @brief 双击事件回调函数 - */ - static void OnKeyDoubleClick_Callback(void) + static void HandlePowerKeyDoubleClick(void) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandlePowerKeyDoubleClick"); + // Handle PowerKey DoubleClick logic here + } + + /*注册电源键的双击事件*/ + bool RebootModel::RegisterPowerKeyDoubleClickEvent(void) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RebootModel::RegisterPowerKeyDoubleClickEvent"); + // Register PowerKey DoubleClick event here + return true; + } + + static void HandleFuncKeyOnClick(void) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnKeyDoubleClick_Callback"); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HandleFuncKeyOnClick"); + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + if (!display_api) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "power_display_svr_get_api returned nullptr"); + return; + } + if (display_api->get_screen_state() == SCREEN_ON) { - // 切换到主题样式界面 - NativeAbility::GetInstance().EnterSlice(VIEW_THEME_STYLE); - //NativeAbility::GetInstance().ChangeSlice(VIEW_SET_DESKTOP); + AiModelsModel &aiModelsModel = AiModelsModel::GetInstance(); + if (!aiModelsModel.ChangeAiModel()) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to change AI model"); + } + } + else + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Screen is not on, skipping AI model change"); } + } + + /*注册功能键的单击事件*/ + bool RebootModel::RegisterFuncKeyClickEvent(void) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RebootModel::RegisterFuncKeyClickEvent"); + int32_t ret = uapi_button_register_event_cb(HandleFuncKeyOnClick, BUTTON1_CLICKUP); + if (ret != ERRCODE_SUCC) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Register FuncKey Click Event error, ret = %d", ret); + return false; + } + return true; + } - return; + static void HandleFuncKeyDoubleClick(void) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HandleFuncKeyDoubleClick"); + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + if (!display_api) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "power_display_svr_get_api returned nullptr"); + return; + } + if (display_api->get_screen_state() == SCREEN_ON) + { + // 切换到显示方式界面 + NativeAbility::GetInstance().EnterSlice(VIEW_AI_MODELS); + } + else + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Screen is not on, skipping Slice change"); + } } - /* - * @brief 注册双击事件 - * @return 注册成功返回true,反之返回false - */ - bool RebootModel::RegisterDoubleClickEvents(void) + /*注册功能键双击事件*/ + bool RebootModel::RegisterFuncKeyDoubleClickEvent(void) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RebootModel::RegisterDoubleClickEvents"); - int32_t ret = uapi_button_register_event_cb(OnKeyDoubleClick_Callback, BUTTON1_CLICKUP_2); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RebootModel::RegisterFuncKeyDoubleClickEvent"); + int32_t ret = uapi_button_register_event_cb(HandleFuncKeyDoubleClick, BUTTON1_CLICKUP_2); if (ret != ERRCODE_SUCC) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Register DoubleClick Events err,ret = %d", ret); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Register FuncKey DoubleClick Event error, ret = %d", ret); return false; } return true; } - // 注册按键事件 - void RebootModel::RegisterKeyEvents(void) + void RebootModel::RegisterAllKeyEvents(void) { - RegisterLongPressEvents(); - RegisterDoubleClickEvents(); + RegisterPowerKeyDoubleClickEvent(); + RegisterPowerKeyLongPressEvent(); + RegisterFuncKeyClickEvent(); + RegisterFuncKeyDoubleClickEvent(); } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordingModel.h b/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordingModel.h index e482a5022..4034edb3a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordingModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordingModel.h @@ -81,7 +81,8 @@ namespace OHOS void Recording_StartTimer(uint32_t interval); void Recording_StopTimer(void); char *DisplayRecordDuration(void); - const char * GetRecordDirectory() const; + const char *GetRecordDirectory() const; + private: RecordingModel(); RecordingModel(const RecordingModel &) = delete; @@ -110,7 +111,7 @@ namespace OHOS std::vector Recordings; // 存放录音信息的动态数组 std::string recordDuration; // 录音时长 int index; // 保存被点击录音的下标 - std::string yyyymmhhh_date; // 保存年月日时间 + char *yyyymmhhh_date; // 保存年月日时间 std::string TotalRecordDuration; // 保存录音的总时长 std::string RecordingTimeAndDuration; // 录音日期和录音时长 }; diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp index b96dfa169..f726b4e6c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp @@ -501,7 +501,20 @@ namespace OHOS void RecordingModel::InitRecordingListItem(void) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RecordingModel::InitRecordingListItem"); - yyyymmhhh_date = uapi_get_local_yyyymmdd_date(); // 获取日期 + // 获取日期 + char *yyyymmhhh_date_new = uapi_get_local_yyyymmdd_date(); + if (yyyymmhhh_date_new == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to get local date"); + return; // 或者进行适当的错误处理 + } + // 释放之前分配的日期字符串内存(如果之前有) + if (yyyymmhhh_date != nullptr) + { + free(yyyymmhhh_date); + } + // 更新日期字符串成员 + yyyymmhhh_date = yyyymmhhh_date_new; RecordingMp3FileCount = 0; if (!fileNames.empty()) { @@ -522,7 +535,7 @@ namespace OHOS // 对 Recordings 数组进行操作 for (int i = 0; i < RecordingMp3FileCount; i++) { - Recordings.push_back({i, fileNames[i].c_str(), "09:51", yyyymmhhh_date.c_str()}); + Recordings.push_back({i, fileNames[i].c_str(), "09:51", yyyymmhhh_date}); } } } diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimode_lschatgpt_on.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimode_lschatgpt_on.bin new file mode 100644 index 000000000..95c04b9a3 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimode_lschatgpt_on.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa5149094c14526b56913b4267664319b80efaaa2c25b502efbc040bfcfe823e +size 9624 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_bg.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_bg.bin new file mode 100644 index 000000000..1275fbc03 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_bg.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88c0f9a3719468cfab7a7396d43edaba4a1ce2b313e0e1f95833f0ef0032f52b +size 77544 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_chatgpt_off.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_chatgpt_off.bin new file mode 100644 index 000000000..9f76ce300 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_chatgpt_off.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b091fbb1ad5c7188b4a2e0348fedc8a97cc37b446068021db7ab5bc2144dad8 +size 9624 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_doubao.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_doubao.bin new file mode 100644 index 000000000..92b54e01d --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_doubao.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1b1d55d2cdecc4310e0c1ac70cd87d3fb72da284d54b61a82dc2c7abac22e2c +size 9624 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_kimi.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_kimi.bin new file mode 100644 index 000000000..f121c8f06 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_kimi.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2edeb79f68820099d597ccfbeabd81466a2e5dec856792fa6cdc5cc5e3130e41 +size 9624 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_select.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_select.bin new file mode 100644 index 000000000..56851a5e4 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_select.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f08808b0413214c93e9f596a4bbfd7103ec7b2f592c5aba308792951969ee07f +size 888 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_title_bg.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_title_bg.bin new file mode 100644 index 000000000..a68ef869d --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_title_bg.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2d49375658ab31058d0190983d0594d9b3492dcc4ceca3db889e6a17def56a7 +size 8984 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_wenxinyiyan.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_wenxinyiyan.bin new file mode 100644 index 000000000..dc5b77eca --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodels_wenxinyiyan.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d3243a22c2a00ee51eecd8e04e2549a0b16d933026dd6fe1fa119d29fa03f4b +size 9624 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang index 8551ced933c792b3d676ce2350cf039ad17d5407..a242fedb92864bf92dfa4b3af58531aa2f36695a 100644 GIT binary patch delta 78 zcmZ4Ed&5^$q3gayY90d$xV=#{mYvs1o`Jz0h&_SWZ*xAot-OqLW^yKjYmlF(tAbO0 T34?cLZYG0sMq-J3KnMc>uw4=j delta 35 fcmccNyT(`a)??q@sd)@2;QB_{jvs#?J|2 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ja.lang index fe08bbc2acf69e636f1a6be4b1e15c42b4898101..3532e338d2520eaaa2fb77c8796aca8d6658293e 100644 GIT binary patch delta 54 wcmdmGdCpSwmbAg`tV9MB@OGoqou)7qcz aZ+^0);l+vu2Jg(=Oa|wS#1i*_5C#AcCLCk{ delta 35 fcmX@=HpNY}c!Kw