调试窗口增加更新接口 1100/1 1100/head
authorCaisking <3449750381@qq.com>
Fri, 4 Oct 2024 10:28:19 +0000 (18:28 +0800)
committerCaisking <3449750381@qq.com>
Fri, 4 Oct 2024 10:28:19 +0000 (18:28 +0800)
code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp
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 73f48e1..0aae50d 100644 (file)
@@ -600,7 +600,7 @@ namespace OHOS
     LOS_Msleep(200);
     do_custom_fileoperate_service_check_msg(
         CUSTOM_FILEOPERATE_MSG_TYPE_NAPDATA_READ, nullptr, 0);
-    LOS_MSleep(200);
+    LOS_Msleep(200);
     {
       WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
                     "ReadSleepData sleepStr %u  wakeStr %u sleep_total_time %d",
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);