From 241b6efc2e79157ca3fc7dd23303ccf20d4f4ecb Mon Sep 17 00:00:00 2001 From: Caisking Date: Sat, 20 Sep 2025 15:51:57 +0800 Subject: [PATCH] =?utf8?q?=E5=9C=A8=E6=97=B6=E9=97=B4=E6=9B=B4=E6=96=B0mod?= =?utf8?q?el=E8=BF=9B=E8=A1=8C=E7=8A=B6=E6=80=81=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../include/ThunderBirdPresenter.h | 7 ++-- .../thunderbird/src/ThunderBirdModel.cpp | 34 +++++++++++-------- .../thunderbird/src/ThunderBirdPresenter.cpp | 2 +- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h index 329bcb6d4..81a12aaec 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h @@ -6,7 +6,6 @@ #include "key/KeyInputListener.h" #include "Presenter.h" #include "View.h" -#include "main/ModelListenerSample.h" namespace OHOS { @@ -14,16 +13,12 @@ namespace OHOS class ThunderBirdPresenter : public Presenter, public UIView::OnClickListener, public RootView::OnKeyActListener, - public ModelListenerSample, public UIView::OnDragListener { public: ThunderBirdPresenter(); virtual ~ThunderBirdPresenter(); - void OnTickEvent() override{} - void Notify() override; - void OnStart() override; void OnResume() override; @@ -32,6 +27,8 @@ namespace OHOS // 发布事件函数 void PublishEvent(uint16_t topic, uint8_t *data = nullptr, uint32_t size = 0); + void timer_callback_toui_proc(); + private: bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件 bool X_DRAG_FLAG{false}; diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp index ab8cfc90b..f9712d681 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp @@ -17,6 +17,7 @@ #include "thunderbird/include/ThunderBirdOtaView.h" #include "thunderbird/include/ThunderBirdLullabyView.h" #include "thunderbird/include/ThunderBirdMainView.h" + #include "thunderbird/include/ThunderBirdPresenter.h" #include "wearable_log.h" #include #include @@ -106,6 +107,11 @@ ThunderBirdModel::GetInstance()->timer_callback_proc(); ThunderBirdMainView::GetInstance()->updateSignalDisplay(); ThunderBirdMainView::GetInstance()->UpdateBatteryProcess(); + //状态监控 + if(ThunderBirdPresenter::GetInstance() != nullptr) + { + ThunderBirdPresenter::GetInstance()->timer_callback_toui_proc(); + } } /* * @brief 回调函数 @@ -988,20 +994,20 @@ - /* - 1、新手引导 - 判断是否绑定 返回,0:绑定,1:未绑定;2:没有网络 使用枚举 - 2、对话 - 2.1 录音 - 开始录音接口 - 停止录音接口 - 2.2 发送录音接口 - 2.3 接收回答数据 - 2.4 对话文本获取接口 - 2.5 对话结束接口 - 3、哄睡模式 - 4、事项提醒 - */ + /* + 1、新手引导 + 判断是否绑定 返回,0:绑定,1:未绑定;2:没有网络 使用枚举 + 2、对话 + 2.1 录音 + 开始录音接口 + 停止录音接口 + 2.2 发送录音接口 + 2.3 接收回答数据 + 2.4 对话文本获取接口 + 2.5 对话结束接口 + 3、哄睡模式 + 4、事项提醒 + */ } diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp index f4e0d41e7..94d9872c0 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp @@ -122,7 +122,7 @@ namespace OHOS } } - void ThunderBirdPresenter::Notify() + void ThunderBirdPresenter::timer_callback_toui_proc() { #ifdef CUSTOM_UTILS if(custom_get_factory_test_flag()) -- 2.17.1