Merge #1100 into sdk602patch0626 from refs/changes/1100/head 1101/target/1
author袁清梦 <3449750381@qq.com>
Fri, 4 Oct 2024 10:30:12 +0000 (10:30 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Fri, 4 Oct 2024 10:30:12 +0000 (10:30 +0000)
调试窗口增加更新接口

* refs/changes/1100/head: (1 commits squashed)

  - 调试窗口增加更新接口

Signed-off-by: Caisking <3449750381@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1100
code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h
code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp

index 6f9a6e8..df164c7 100644 (file)
@@ -32,6 +32,7 @@ namespace OHOS
         void SetCurViewIndex(int16_t viewNum);
         int GetCurViewIndex(void);
         void InitDebugOutputItem();
+        void UpdateView(std::string str);
         std::string get_bt_runtime_status_t(void);
         std::string get_cat1_runtime_status_t(void);
         std::string get_runtime_status_t(void);
index 1345228..9d3025d 100644 (file)
 #include "bluetooth/include/BluetoothModel.h"
 #include "system/include/SystemLogModel.h"
 #include "wearable_log.h"
+#include "AppViewIDs.h"
+#include "NativeAbility.h"
+#include "bleEvent.h"
+#include "broadcast_feature.h"
+#include "broadcast_service.h"
+#include "cat1_ctl.h"
+#include "cat1_server.h"
+#include "custom_runtime.h"
+#include "custom_utils.h"
+#include "graphic_service.h"
+#include "lwip/apps/http_client.h"
+#include "samgr_lite.h"
+#include "tcxo.h"
+#include "thread_adapter.h"
+#include "thread_init.h"
+#include "vibrator_service.h"
+#include "wearable_log.h"
+#include <array>
+#include <cmsis_os2.h>
+#include <cstdint>
+#include <fstream>
+#include <iostream>
+#include <map>
+#include <service/graphic_service.h>
+#include <string>
+#include <vector>
 namespace OHOS
 {
 
@@ -257,22 +283,34 @@ namespace OHOS
         {
         case 1:
             str = get_bt_runtime_status_t();
-            debugOutputLabel->SetText(str.c_str());
             break;
         case 2:
             str = get_cat1_runtime_status_t();
-            debugOutputLabel->SetText(str.c_str());
             break;
         case 3:
             str = get_runtime_status_t();
-            debugOutputLabel->SetText(str.c_str());
             break;
         case 4:
             str = get_system_log();
-            debugOutputLabel->SetText(str.c_str());
             break;
         default:
+            str = "--";
             break;
+        } 
+
+    //    GraphicService::GetInstance()->PostGraphicEvent(std::bind(
+    //     &DebugOutputViewEventListener::UpdateView, DebugOutputViewEventListener::GetInstance(),str));
+
+        return true;
+    }
+
+
+    //获取视图
+   void DebugOutputViewEventListener::UpdateView(std::string str)
+    {
+        if(debugOutputLabel != nullptr)
+        {
+            debugOutputLabel->SetText(str.c_str());
         }
         if (debugOutputLabelButton)
         {
@@ -280,10 +318,7 @@ namespace OHOS
             debugOutputLabelButton->Invalidate();
         }
         debugOutputLabel->Invalidate();
-
-        return true;
     }
-
     bool DebugOutputViewEventListener::OnDrag(UIView &view, const DragEvent &event)
     {
         UNUSED(view);