From: Caisking <3449750381@qq.com> Date: Wed, 10 Jan 2024 09:49:48 +0000 (+0800) Subject: 删除测试打印 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=da92d298dd2726d128899a7a5c036bfa3925fba8;p=mirrors%2FFD230.git 删除测试打印 --- diff --git a/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp index dd0c5aa11..393ecdbc6 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/dial/src/Digital_clockView.cpp @@ -152,7 +152,6 @@ namespace OHOS // 增加背景 container_->Add(background); background->SetVisible(true); - PRINT_DEBUG_INFO } /*初始化表盘时钟*/ // Function to create and add an image view @@ -243,7 +242,7 @@ namespace OHOS cJSON *minute_coordinates = cJSON_GetObjectItem(minuteHand, "coordinates"); cJSON *second_coordinates = cJSON_GetObjectItem(secondHand, "coordinates"); const char *handspath = cJSON_GetObjectItem(cjson_json, "handspath")->valuestring; - PRINT_DEBUG_INFO + signed short HOUR_POINT_POSITION_X = static_cast(cJSON_GetObjectItem(hour_coordinates, "HOUR_POINT_POSITION_X")->valueint); signed short HOUR_POINT_POSITION_Y = static_cast(cJSON_GetObjectItem(hour_coordinates, "HOUR_POINT_POSITION_Y")->valueint); signed short HOUR_POINT_CENTER_X = static_cast(cJSON_GetObjectItem(hour_coordinates, "HOUR_POINT_CENTER_X")->valueint); @@ -256,7 +255,7 @@ namespace OHOS signed short SECOND_POINT_POSITION_Y = static_cast(cJSON_GetObjectItem(second_coordinates, "SECOND_POINT_POSITION_Y")->valueint); signed short SECOND_POINT_CENTER_X = static_cast(cJSON_GetObjectItem(second_coordinates, "SECOND_POINT_CENTER_X")->valueint); signed short SECOND_POINT_CENTER_Y = static_cast(cJSON_GetObjectItem(second_coordinates, "SECOND_POINT_CENTER_Y")->valueint); - PRINT_DEBUG_INFO + // Add SweepClock to App if (sweepClock1_ == nullptr) { @@ -272,9 +271,9 @@ namespace OHOS sweepClock1_->SetWorkMode(UISweepClock::WorkMode::NORMAL); Image *sweepClock1HourImage = new Image(); std::string HourImagePath = std::string(handspath) + "hour.bin"; - PRINT_DEBUG_INFO + sweepClock1HourImage->SetSrc(HourImagePath.c_str()); - PRINT_DEBUG_INFO + sweepClock1_->SetHandImage(UISweepClock::HandType::HOUR_HAND, *sweepClock1HourImage, {HOUR_POINT_POSITION_X, HOUR_POINT_POSITION_Y}, {HOUR_POINT_CENTER_X, HOUR_POINT_CENTER_Y}); Image *sweepClock1MinuteImage = new Image(); @@ -318,7 +317,7 @@ namespace OHOS { formattedDate = (day < 10 ? "0" : "") + std::to_string(day); } - PRINT_DEBUG_INFO + // 添加其他显示格式的处理逻辑 return formattedDate; @@ -329,12 +328,12 @@ namespace OHOS cJSON *date = cJSON_GetObjectItem(cjson_json, "date"); cJSON *textdisplay = cJSON_GetObjectItem(date, "textdisplay"); cJSON *coordinates = cJSON_GetObjectItem(textdisplay, "coordinates"); - PRINT_DEBUG_INFO + // const char *font = cJSON_GetObjectItem(textdisplay, "font")->valuestring; int fontsize = cJSON_GetObjectItem(textdisplay, "fontsize")->valueint; int date_left = cJSON_GetObjectItem(coordinates, "left")->valueint; int date_top = cJSON_GetObjectItem(coordinates, "top")->valueint; - PRINT_DEBUG_INFO + // Add Label to App if (dateLable == nullptr) { @@ -343,13 +342,13 @@ namespace OHOS dateLable->SetPosition(date_left, date_top); // widget's left position and top position dateLable->SetViewId("label1"); // Set style dateLable->SetStyle(STYLE_TEXT_FONT, fontsize); - PRINT_DEBUG_INFO + std::string dateStr = "2024-02-09"; std::string displayformat = cJSON_GetObjectItem(textdisplay, "displayformat")->valuestring; // 调用日期格式化函数 std::string formattedDate = FormatDate(dateStr, displayformat); - PRINT_DEBUG_INFO + dateLable->SetText(formattedDate.c_str()); dateLable->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); dateLable->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); @@ -359,7 +358,6 @@ namespace OHOS // Add to rootView container_->Add(dateLable); dateLable->SetVisible(true); - PRINT_DEBUG_INFO }; void Digital_clockView ::Initweek() { @@ -402,7 +400,6 @@ namespace OHOS // Add to rootView container_->Add(weekLable); weekLable->SetVisible(true); - PRINT_DEBUG_INFO }; void Digital_clockView ::Initbattery() { @@ -474,7 +471,6 @@ namespace OHOS progress1callback_ = new myProgressCallback(progress, batteryLable); progress1animator_ = new Animator(progress1callback_, progress, 10000, true); progress1animator_->Start(); - PRINT_DEBUG_INFO }; /* InitView:初始化界面*/ bool Digital_clockView ::InitView() @@ -487,7 +483,7 @@ namespace OHOS { std::string Dialtype = cJSON_GetObjectItem(cjson_json, "Dialtype")->valuestring; Initbackground(); - PRINT_DEBUG_INFO + if (Dialtype == "pointer") { Initpointer(); @@ -501,10 +497,9 @@ namespace OHOS Initbattery(); cJSON_Delete(cjson_json); } - PRINT_DEBUG_INFO Add(container_); - PRINT_DEBUG_INFO + SetCoverable(true); PRINT_DEBUG_INFO return true; @@ -515,7 +510,7 @@ namespace OHOS UIView *view = static_cast(container_)->GetChildrenHead(); while (view != nullptr) { - PRINT_DEBUG_INFO + UIView *tempView = view; view = view->GetNextSibling(); if (tempView->GetParent()) @@ -581,7 +576,6 @@ namespace OHOS } delete container_; container_ = nullptr; - PRINT_DEBUG_INFO } void Digital_clockView::PreLoad(void) @@ -592,8 +586,7 @@ namespace OHOS } } - void Digital_clockView::UnLoad(void) + void Digital_clockView::UnLoad(void) { - } } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp index 155b04c88..21b71039b 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/MainViewSample.cpp @@ -253,7 +253,7 @@ void MainViewSample::OnStop() UICardPage *MainViewSample::InitWatchFacePage(void) { -printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + mainClockView = new MainClockView(); if (mainClockView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainClockView new fail"); @@ -264,7 +264,7 @@ printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); UICardPage *MainViewSample::InitHeartRatePage(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + heartRateView = new HeartRateView(); if (heartRateView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "heartRateView new fail"); @@ -275,7 +275,7 @@ UICardPage *MainViewSample::InitHeartRatePage(void) UICardPage *MainViewSample::InitActivityPage(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + activityWeekView = new ActivityWeekView(); if (activityWeekView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "activityWeekView new fail"); @@ -286,7 +286,7 @@ UICardPage *MainViewSample::InitActivityPage(void) UICardPage *MainViewSample::InitCompassPage(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + compassControlView = new CompassControlView(); if (compassControlView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "compassControlView new fail"); @@ -297,7 +297,7 @@ UICardPage *MainViewSample::InitCompassPage(void) UICardPage *MainViewSample::InitMusicPlayerPage(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + playersView = new PlayersView(); if (playersView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "playersView new fail"); @@ -308,7 +308,7 @@ UICardPage *MainViewSample::InitMusicPlayerPage(void) UICardPage *MainViewSample::InitNewDialPage(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + dialView = new Digital_clockView(); if (dialView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "dialView new fail"); @@ -319,16 +319,16 @@ UICardPage *MainViewSample::InitNewDialPage(void) UICardPage *MainViewSample::CreatePage(int32_t StreamId) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + uint16_t i; UICardPage *view = nullptr; int32_t cardId = ScreenModels::GetInstance()->GetCardPage(StreamId); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CreatePage cardId:%d", cardId); for (i = 0; i < sizeof(PageMapper) / sizeof(PageMapper[0]); i++) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainViewSample::CreatePage PageMapper[i].id=%d, cardId=%d, StreamId=%d", PageMapper[i].id, cardId, StreamId); - printf("MainViewSample::CreatePage PageMapper[i].id=%d, cardId=%d, StreamId=%d\n", PageMapper[i].id, cardId, StreamId); + if (PageMapper[i].id == cardId) { - printf("--%d--\n",PageMapper[i].id); + view = (this->*(PageMapper[i].func))(); WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "CreatePage view:%p", view); return view; @@ -341,19 +341,18 @@ UICardPage *MainViewSample::CreatePage(int32_t StreamId) void MainViewSample::AnimatorStart(int pageIndex) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + if (heartRateView != nullptr && pageIndex == ScreenModels::GetInstance()->GetCardPage(HEART_RATE)) { heartRateView->HeartbeatImageAnimatorStart(); } if ((mainClockView != nullptr && pageIndex == ScreenModels::GetInstance()->GetCardPage(WATCH_FACE)) && - mainSwipeGroup->GetCurrentPageId(UISwipeView::VERTICAL) == 1) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + mainSwipeGroup->GetCurrentPageId(UISwipeView::VERTICAL) == 2) { mainClockView->ClockAnimatorStart(); } - // if (dialView != nullptr && pageIndex == ScreenModels::GetInstance()->GetCardPage(NEW_DAIL)) { - // printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); - // dialView->PreLoad(); - // } + if ((dialView != nullptr && pageIndex == ScreenModels::GetInstance()->GetCardPage(NEW_DAIL)) && + mainSwipeGroup->GetCurrentPageId(UISwipeView::VERTICAL) == 1) { + dialView->PreLoad(); + } } void MainViewSample::AnimatorStop(void) @@ -368,7 +367,7 @@ void MainViewSample::AnimatorStop(void) bool MainViewSample::IsMainView(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + if (mainSwipeGroup->GetCurrentPageId(0) == ScreenModels::GetInstance()->GetCardPage(WATCH_FACE) && mainSwipeGroup->GetCurrentPageId(1) == 1) { // 0: horizontal; 1: vertical return true; diff --git a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp index 0b0bbb306..19b4d6b7f 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/screensetting/src/ScreenModels.cpp @@ -45,7 +45,7 @@ bool ScreenModels::SetUpListCase(void) bool ScreenModels::InitCardConfig(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + if (SetUpListCase() == false) { return false; } @@ -55,7 +55,7 @@ bool ScreenModels::InitCardConfig(void) WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "InitCardConfig2"); struct CardInfo cardInfoData; if (fd < 0) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "InitCardConfig open fail"); fd = open(CARD_CONFIG_PATH, O_RDWR | O_CREAT, S_IRWXU); if (fd < 0) { @@ -81,7 +81,7 @@ bool ScreenModels::InitCardConfig(void) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Init Read GlobalHealthToFile fail"); } listMainView->PushBack(cardInfoData); - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + } close(fd); return true; @@ -91,7 +91,7 @@ bool ScreenModels::InitCardConfig(void) bool ScreenModels::SaveCardConfig(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + int32_t fd = open(CARD_CONFIG_PATH, O_RDWR | O_CREAT, S_IRWXU); if (fd < 0) { close(fd); @@ -107,20 +107,20 @@ bool ScreenModels::SaveCardConfig(void) void ScreenModels::SetCardConfigDefault(void) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + int16_t i; struct CardInfo cardInfoData; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetCardConfigDefault"); for (i = 0; i < MAX_CARD; i++) { cardInfoData.cardId = i; - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + listMainView->PushBack(cardInfoData); } } int16_t ScreenModels::GetCardPage(uint16_t page) { - printf("Function: %s, Line: %d\n", __PRETTY_FUNCTION__, __LINE__); + ListNode *node = listMainView->Begin(); for (uint8_t i = 0; i < page; i++) { if (node->next_ != NULL) {