From 6e19b45697eacaebf83ecf28d01815e435fb3b8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Fri, 4 Oct 2024 10:30:12 +0000 Subject: [PATCH] Merge #1100 into sdk602patch0626 from refs/changes/1100/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 调试窗口增加更新接口 * refs/changes/1100/head: (1 commits squashed) - 调试窗口增加更新接口 Signed-off-by: Caisking <3449750381@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1100 --- .../debug_output_notification.h | 1 + .../debug_output_notification.cpp | 49 ++++++++++++++++--- 2 files changed, 43 insertions(+), 7 deletions(-) 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