在时间更新model进行状态监控
authorCaisking <Casiking@zhihuishixun.com>
Sat, 20 Sep 2025 07:51:57 +0000 (15:51 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Sat, 20 Sep 2025 07:51:57 +0000 (15:51 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/include/ThunderBirdPresenter.h
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdModel.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdPresenter.cpp

index 329bcb6..81a12aa 100644 (file)
@@ -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<ThunderBirdMainView>,
                                      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};
index ab8cfc9..f9712d6 100644 (file)
@@ -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 <sys/time.h>
  #include <service/graphic_service.h>
          ThunderBirdModel::GetInstance()->timer_callback_proc();
          ThunderBirdMainView::GetInstance()->updateSignalDisplay();
          ThunderBirdMainView::GetInstance()->UpdateBatteryProcess();
+         //状态监控
+         if(ThunderBirdPresenter::GetInstance() != nullptr)
+         {
+            ThunderBirdPresenter::GetInstance()->timer_callback_toui_proc();
+         }
      }
      /*
       * @brief 回调函数
 
      
  
- /*
-         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、事项提醒
+    */ 
 
 
  }
index f4e0d41..94d9872 100644 (file)
@@ -122,7 +122,7 @@ namespace OHOS
         }
     }
 
-    void ThunderBirdPresenter::Notify()
+    void ThunderBirdPresenter::timer_callback_toui_proc()
     {
 #ifdef CUSTOM_UTILS
        if(custom_get_factory_test_flag())