From: luozheng <1732036298@qq.com> Date: Mon, 4 Nov 2024 10:43:40 +0000 (+0800) Subject: debug界面添加显示亮屏时长和长亮屏状态页面 X-Git-Tag: fd230_release_V1.3.102~29^2~58 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=acf34335e88de3f809fd4a78b1536c753b494e48;p=mirrors%2FFD230.git debug界面添加显示亮屏时长和长亮屏状态页面 --- 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 8eec1dd59..24b95eae0 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 @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-10-02 14:12:12 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-10-19 15:52:33 + * @LastEditTime: 2024-11-04 17:36:14 * @FilePath: /FD230/code/sdk/application/wearable/service/msg_center/include/notify/debug_output_notification.h */ #ifndef DEBUG_OUTPUT_NOTIFICATION_H @@ -44,6 +44,7 @@ namespace OHOS std::string get_nextday_log(void); std::string get_heart_rate(void); std::string get_popup_windows_log(void); + std::string get_system_screen_time(void); private: DebugOutputViewEventListener(); 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 0da23904b..3914017b2 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 @@ -55,7 +55,7 @@ #include #include #include - +#include "displaybrightness/include/DisplayBrightnessModel.h" namespace OHOS { /**************************************************************************************************** */ @@ -143,6 +143,8 @@ namespace OHOS debugOutputItemInfo[index++] = {index, "heart_rate_data"}; // 弹窗日志 debugOutputItemInfo[index++] = {index, "popup_windows_log"}; + //当前系统亮屏时长 + debugOutputItemInfo[index++] = {index, "current_screen_time"}; usedLen = index; /* -------------------------------- Add data -------------------------------- */ for (uint8_t i = 0; i < usedLen; i++) @@ -540,6 +542,18 @@ namespace OHOS return str.str(); // 返回拼接后的字符串 } + std::string DebugOutputViewEventListener::get_system_screen_time(void) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DebugOutputViewEventListener::get_system_screen_time"); + + std::ostringstream str; + str << "当前系统亮屏时长:"; + std::string timestr = std::to_string(DisplayBrightnessModel::GetInstance()->GetScreenDurationTime() / 1000)+ "秒"; + str<<"["<SetTouchable(true); DebugScrollView[0]->SetThrowDrag(true); DebugScrollView[0]->SetScrollBlankSize(70); - DebugScrollView[0]->SetReboundSize(30); + // DebugScrollView[0]->SetReboundSize(30); DebugGroupView->Add(DebugScrollView[0]); /* -------------------------------------------------------------------------- */ if (debugOutputAdapter == nullptr) @@ -917,12 +934,13 @@ namespace OHOS return nullptr; } } - debugOutputList->SetPosition(0, 120, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + debugOutputList->SetPosition(0, 120, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION - 120); debugOutputList->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000); + debugOutputList->SetThrowDrag(true); debugOutputList->EnableAutoAlign(true); // 设置此列表的自动对齐状态。当滚动停止时,子视图被选中,其位置自动与预设位置对齐 - debugOutputList->SetThrowDrag(true); // 设置手指抬起屏幕后是否继续滚动。 - debugOutputList->SetMaxScrollDistance(1000); // 设置手指抬起屏幕后的最大滚动距离。 - debugOutputList->SetSwipeACCLevel(200); /*设置手指抬起屏幕后的补偿距离。*/ + // debugOutputList->SetThrowDrag(true); // 设置手指抬起屏幕后是否继续滚动。 + // debugOutputList->SetMaxScrollDistance(1000); // 设置手指抬起屏幕后的最大滚动距离。 + // debugOutputList->SetSwipeACCLevel(200); /*设置手指抬起屏幕后的补偿距离。*/ debugOutputList->SetAdapter(debugOutputAdapter); debugOutputList->RefreshList(); // debugOutputList->SetReboundSize(30); @@ -947,7 +965,8 @@ namespace OHOS debugOutputbleServiceLabelButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, 30); debugOutputbleServiceLabelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff000000, UIButton::PRESSED); debugOutputbleServiceLabelButton->SetOnClickListener(clickListener); - DebugScrollView[0]->Add(debugOutputbleServiceLabelButton); + debugOutputbleServiceLabelButton->SetVisible(false); + // DebugScrollView[0]->Add(debugOutputbleServiceLabelButton); /* -------------------------------------------------------------------------- */ NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(FreeDebugOutputMainView); /* -------------------------------------------------------------------------- */