From 8788d21fec80a06bdc13edf544d3322256253a9e Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Fri, 4 Oct 2024 18:28:19 +0800 Subject: [PATCH] =?utf8?q?=E8=B0=83=E8=AF=95=E7=AA=97=E5=8F=A3=E5=A2=9E?= =?utf8?q?=E5=8A=A0=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/sleep/src/SleepModel.cpp | 2 +- .../debug_output_notification.h | 1 + .../debug_output_notification.cpp | 49 ++++++++++++++++--- 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp index 73f48e149..0aae50d43 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp @@ -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", diff --git a/code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h b/code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h index 6f9a6e843..df164c7fd 100644 --- a/code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h +++ b/code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification/debug_output_notification.h @@ -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); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp index 134522814..9d3025d41 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/debug_output_notification/debug_output_notification.cpp @@ -14,6 +14,32 @@ #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 +#include +#include +#include +#include +#include +#include +#include +#include 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); -- 2.17.1