From 8ada741a5d62db142083ab64ef3b2e4990672199 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 4 Feb 2026 11:31:28 +0800 Subject: [PATCH] =?utf8?q?=E6=AF=8F=E6=97=A5=E7=9B=AE=E6=A0=87=E7=95=8C?= =?utf8?q?=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/goal/include/Maingoalpresenter.h | 2 - .../nativeui/goal/src/Maingoalpresenter.cpp | 18 +---- .../nativeapp/nativeui/goal/src/goalmodel.cpp | 1 + .../nativeapp/nativeui/goal/src/goalother.cpp | 78 +++++++------------ .../nativeapp/nativeui/goal/src/goalview.cpp | 46 +++-------- .../sdk/zhihui/drivers/cywee/dml/cywee_data.c | 3 +- 6 files changed, 45 insertions(+), 103 deletions(-) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/include/Maingoalpresenter.h b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/include/Maingoalpresenter.h index 3de088561..6f1d87057 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/include/Maingoalpresenter.h +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/include/Maingoalpresenter.h @@ -37,9 +37,7 @@ namespace OHOS virtual ~MaingoalPresenter(); void OnStart() override; - void OnPause() override; void OnResume() override; - void OnStop() override; static MaingoalPresenter *GetInstance(); diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/Maingoalpresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/Maingoalpresenter.cpp index a3de49e39..73a3f3300 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/Maingoalpresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/Maingoalpresenter.cpp @@ -40,20 +40,11 @@ namespace OHOS MaingoalPresenter *MaingoalPresenter::GetInstance() { - return g_pMainWeatherPresenter; } void MaingoalPresenter::OnStart() { - - Presenter::OnStart(); - } - - void MaingoalPresenter::OnPause(void) - { - - Presenter::OnPause(); } void MaingoalPresenter::OnResume(void) @@ -61,11 +52,6 @@ namespace OHOS RootView::GetInstance()->SetOnKeyActListener(this); } - void MaingoalPresenter::OnStop(void) - { - Presenter::OnStop(); - } - bool MaingoalPresenter::OnDrag(UIView &view, const DragEvent &event) { UNUSED(view); @@ -113,12 +99,12 @@ namespace OHOS void MaingoalPresenter::OnSwipe(UISwipeView &view) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainWeatherPresenter::OnSwipe,current tab index = %d", view.GetCurrentPage()); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainWeatherPresenter::OnSwipe,current tab index = %d", view.GetCurrentPage()); } void GoalControlViewOnSwipeListener::OnSwipe(UISwipeView &view) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GoalControlViewOnSwipeListener::OnSwipe,current tab index = %d", view.GetCurrentPage()); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GoalControlViewOnSwipeListener::OnSwipe,current tab index = %d", view.GetCurrentPage()); return; } } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalmodel.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalmodel.cpp index 5415189fb..9eb81bbd1 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalmodel.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalmodel.cpp @@ -162,6 +162,7 @@ namespace OHOS distancenewstr=temp_str; + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "GoalModel::getdistancenew:%s", distancenewstr.c_str()); return distancenewstr; } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalother.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalother.cpp index 51cae63b6..6d388370a 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalother.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalother.cpp @@ -194,9 +194,8 @@ namespace OHOS if (transverseline_1 == nullptr) { transverseline_1 = new UIImageView(); } - transverseline_1->SetPosition(0, 169); // widget's left position and top position - transverseline_1->Resize(466, 2); // widget's width and height - transverseline_1->SetViewId("image1");// Set style + transverseline_1->SetPosition(0, 169); + transverseline_1->Resize(466, 2); transverseline_1->SetStyle(STYLE_BACKGROUND_COLOR, 0xff333333); transverseline_1->SetStyle(STYLE_BACKGROUND_OPA, 0xff); transverseline_1->SetVisible(true); @@ -205,9 +204,8 @@ namespace OHOS if (transverseline_2 == nullptr) { transverseline_2 = new UIImageView(); } - transverseline_2->SetPosition(232, 191); // widget's left position and top position - transverseline_2->Resize(2, 82); // widget's width and height - transverseline_2->SetViewId("image2");// Set style + transverseline_2->SetPosition(232, 191); + transverseline_2->Resize(2, 82); transverseline_2->SetStyle(STYLE_BACKGROUND_COLOR, 0xff333333); transverseline_2->SetStyle(STYLE_BACKGROUND_OPA, 0xff); transverseline_2->SetVisible(true); @@ -216,9 +214,8 @@ namespace OHOS if (verticalline == nullptr) { verticalline = new UIImageView(); } - verticalline->SetPosition(0, 296); // widget's left position and top position - verticalline->Resize(466, 2); // widget's width and height - verticalline->SetViewId("image1");// Set style + verticalline->SetPosition(0, 296); + verticalline->Resize(466, 2); verticalline->SetStyle(STYLE_BACKGROUND_COLOR, 0xff333333); verticalline->SetStyle(STYLE_BACKGROUND_OPA, 0xff); verticalline->SetVisible(true); @@ -228,12 +225,10 @@ namespace OHOS if (mileagegoalTitle == nullptr) { mileagegoalTitle = new UILabelExt(); } - mileagegoalTitle->SetPosition(113, 61); // widget's left position and top position - mileagegoalTitle->Resize(240, 35); // widget's width and height - mileagegoalTitle->SetViewId("label1");// Set style + mileagegoalTitle->SetPosition(113, 61); + mileagegoalTitle->Resize(240, 35); mileagegoalTitle->SetStyle(STYLE_TEXT_FONT, 30); - // Set additional property // mileagegoalTitle->SetText("里程(KM)"); mileagegoalTitle->SetTextId(STR_MILEAGE); mileagegoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); @@ -245,12 +240,10 @@ namespace OHOS if (fatburninggoalTitle == nullptr) { fatburninggoalTitle = new UILabelExt(); } - fatburninggoalTitle->SetPosition(8, 188); // widget's left position and top position - fatburninggoalTitle->Resize(200, 35); // widget's width and height - fatburninggoalTitle->SetViewId("label1");// Set style + fatburninggoalTitle->SetPosition(8, 188); + fatburninggoalTitle->Resize(200, 35); fatburninggoalTitle->SetStyle(STYLE_TEXT_FONT, 30); - // Set additional property // fatburninggoalTitle->SetText("燃脂时间"); fatburninggoalTitle->SetTextId(STR_FAT_BURNING_TIME); fatburninggoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); @@ -262,11 +255,9 @@ namespace OHOS if (standgoalTitle == nullptr) { standgoalTitle = new UILabelExt(); } - standgoalTitle->SetPosition(257, 188); // widget's left position and top position - standgoalTitle->Resize(200, 35); // widget's width and height - standgoalTitle->SetViewId("label1");// Set style + standgoalTitle->SetPosition(257, 188); + standgoalTitle->Resize(200, 35); standgoalTitle->SetStyle(STYLE_TEXT_FONT, 30); - // Set additional property // standgoalTitle->SetText("站立次数"); standgoalTitle->SetTextId(STR_NUMBER_OF_STANDS); standgoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); @@ -278,9 +269,8 @@ namespace OHOS if (caloriegoalTitle == nullptr) { caloriegoalTitle = new UILabelExt(); } - caloriegoalTitle->SetPosition(53, 317); // widget's left position and top position - caloriegoalTitle->Resize(360, 35); // widget's width and height - caloriegoalTitle->SetViewId("label1");// Set style + caloriegoalTitle->SetPosition(53, 317); + caloriegoalTitle->Resize(360, 35); caloriegoalTitle->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property // caloriegoalTitle->SetText("消耗卡路里"); @@ -295,9 +285,8 @@ namespace OHOS if (mileagenowdataLabel == nullptr) { mileagenowdataLabel = new UILabel(); } - mileagenowdataLabel->SetPosition(163-20+10, 87); // widget's left position and top position - mileagenowdataLabel->Resize(75, 60); // widget's width and height - mileagenowdataLabel->SetViewId("label2");// Set style + mileagenowdataLabel->SetPosition(163-20+10, 87); + mileagenowdataLabel->Resize(75, 60); mileagenowdataLabel->SetStyle(STYLE_TEXT_FONT, 40); // Set additional property @@ -313,9 +302,8 @@ namespace OHOS if (mileagegoaldataLabel == nullptr) { mileagegoaldataLabel = new UILabel(); } - mileagegoaldataLabel->SetPosition(243-20+10, 86); // widget's left position and top position - mileagegoaldataLabel->Resize(82, 60); // widget's width and height - mileagegoaldataLabel->SetViewId("label2");// Set style + mileagegoaldataLabel->SetPosition(243-20+10, 86); + mileagegoaldataLabel->Resize(82, 60); mileagegoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40); // Set additional property @@ -331,9 +319,8 @@ namespace OHOS if (fatburningnowdataLabel == nullptr) { fatburningnowdataLabel = new UILabel(); } - fatburningnowdataLabel->SetPosition(47-20-10, 223); // widget's left position and top position - fatburningnowdataLabel->Resize(75, 60); // widget's width and height - fatburningnowdataLabel->SetViewId("label2");// Set style + fatburningnowdataLabel->SetPosition(47-20-10, 223); + fatburningnowdataLabel->Resize(75, 60); fatburningnowdataLabel->SetStyle(STYLE_TEXT_FONT, 40); // Set additional property @@ -348,9 +335,8 @@ namespace OHOS if (fatburninggoaldataLabel == nullptr) { fatburninggoaldataLabel = new UILabel(); } - fatburninggoaldataLabel->SetPosition(128-20-10, 223); // widget's left position and top position - fatburninggoaldataLabel->Resize(82, 60); // widget's width and height - fatburninggoaldataLabel->SetViewId("label2");// Set style + fatburninggoaldataLabel->SetPosition(128-20-10, 223); + fatburninggoaldataLabel->Resize(82, 60); fatburninggoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40); // Set additional property @@ -365,9 +351,8 @@ namespace OHOS if (standnowdataLabel == nullptr) { standnowdataLabel = new UILabel(); } - standnowdataLabel->SetPosition(47+200+10, 223); // widget's left position and top position - standnowdataLabel->Resize(75, 60); // widget's width and height - standnowdataLabel->SetViewId("label2");// Set style + standnowdataLabel->SetPosition(47+200+10, 223); + standnowdataLabel->Resize(75, 60); standnowdataLabel->SetStyle(STYLE_TEXT_FONT, 40); // Set additional property @@ -383,9 +368,8 @@ namespace OHOS if (standgoaldataLabel == nullptr) { standgoaldataLabel = new UILabel(); } - standgoaldataLabel->SetPosition(128+200+10, 223); // widget's left position and top position - standgoaldataLabel->Resize(82, 60); // widget's width and height - standgoaldataLabel->SetViewId("label2");// Set style + standgoaldataLabel->SetPosition(128+200+10, 223); + standgoaldataLabel->Resize(82, 60); standgoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40); // Set additional property @@ -400,9 +384,8 @@ namespace OHOS if (calorienowdataLabel == nullptr) { calorienowdataLabel = new UILabel(); } - calorienowdataLabel->SetPosition(163-20-10, 353); // widget's left position and top position - calorienowdataLabel->Resize(75, 60); // widget's width and height - calorienowdataLabel->SetViewId("label2");// Set style + calorienowdataLabel->SetPosition(163-20-10, 353); + calorienowdataLabel->Resize(75, 60); calorienowdataLabel->SetStyle(STYLE_TEXT_FONT, 40); // Set additional property @@ -417,9 +400,8 @@ namespace OHOS if (caloriegoaldataLabel == nullptr) { caloriegoaldataLabel = new UILabel(); } - caloriegoaldataLabel->SetPosition(243-20-10, 353); // widget's left position and top position - caloriegoaldataLabel->Resize(82+40, 60); // widget's width and height - caloriegoaldataLabel->SetViewId("label2");// Set style + caloriegoaldataLabel->SetPosition(243-20-10, 353); + caloriegoaldataLabel->Resize(82+40, 60); caloriegoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40); // Set additional property diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalview.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalview.cpp index 567270687..4de01b2c1 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalview.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/goal/src/goalview.cpp @@ -150,12 +150,10 @@ namespace OHOS if (goalTitle == nullptr) { goalTitle = new UILabelExt(); } - goalTitle->SetPosition(83, 50); // widget's left position and top position - goalTitle->Resize(300, 35); // widget's width and height - goalTitle->SetViewId("label1");// Set style + goalTitle->SetPosition(83, 50); + goalTitle->Resize(300, 35); goalTitle->SetStyle(STYLE_TEXT_FONT, 30); - // Set additional property // goalTitle->SetText("今日步数"); goalTitle->SetTextId(STR_STEPS_OF_THE_DAY); goalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); @@ -169,13 +167,9 @@ namespace OHOS if (nowstepLabel == nullptr) { nowstepLabel = new UILabelExt(); } - nowstepLabel->SetPosition(121-40, 201); // widget's left position and top position - nowstepLabel->Resize(223+80, 94); // widget's width and height - nowstepLabel->SetViewId("nowstepLabel");// Set style + nowstepLabel->SetPosition(121-40, 201); + nowstepLabel->Resize(223+80, 94); nowstepLabel->SetStyle(STYLE_TEXT_FONT, 80); - - // Set additional property - nowstepLabel->SetText(GoalModel::GetInstance().getstepnew().c_str());//); nowstepLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); //nowstepLabel->SetTextColor(0x4FC34C); @@ -189,12 +183,9 @@ namespace OHOS if (goalstepLabel == nullptr) { goalstepLabel = new UILabelExt(); } - goalstepLabel->SetPosition(157, 297); // widget's left position and top position - goalstepLabel->Resize(152, 47); // widget's width and height - goalstepLabel->SetViewId("goalstepLabel");// Set style + goalstepLabel->SetPosition(157, 297); + goalstepLabel->Resize(152, 47); goalstepLabel->SetStyle(STYLE_TEXT_FONT, 40); - - // Set additional property goalstepLabel->SetText(GoalModel::GetInstance().getstepGoal().c_str()); goalstepLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); goalstepLabel->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff)); @@ -204,39 +195,22 @@ namespace OHOS /*----------------------------------------------------------------------------- */ - - // Add ImageView to App if (circleProgressimage == nullptr) { circleProgressimage = new UIImageView(); } - circleProgressimage->SetPosition(28, 80-5); // widget's left position and top position - circleProgressimage->Resize(100, 100); // widget's width and height - circleProgressimage->SetViewId("image5");// Set style - - + circleProgressimage->SetPosition(28, 80-5); + circleProgressimage->Resize(100, 100); char* image5imagesPath = "/user/res/step/step_b.bin"; ImageInfo *info= ImageCacheManager::GetInstance().LoadSingleRes(image5imagesPath); circleProgressimage->SetSrc(info); - - // Add to rootView - circleProgressimage->SetVisible(true); - if(circleProgressimage!=NULL) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "circleProgressimage"); - } - if (circleProgress1_ == nullptr) { circleProgress1_ = new UICircleProgress(); } - circleProgress1_->SetPosition(0, -5); // widget's left position and top position - circleProgress1_->Resize(466, 466); // widget's width and height - circleProgress1_->SetViewId("circleProgress1");// Set style + circleProgress1_->SetPosition(0, -5); + circleProgress1_->Resize(466, 466); circleProgress1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00); - - // Set additional property - // Set BackgroundStyle circleProgress1_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, 0xff000000); circleProgress1_->SetBackgroundStyle(STYLE_BACKGROUND_OPA, 0x00); circleProgress1_->SetBackgroundStyle(STYLE_LINE_HEIGHT, 200); diff --git a/code/sdk/zhihui/drivers/cywee/dml/cywee_data.c b/code/sdk/zhihui/drivers/cywee/dml/cywee_data.c index 8a89aadb2..19e299ef4 100644 --- a/code/sdk/zhihui/drivers/cywee/dml/cywee_data.c +++ b/code/sdk/zhihui/drivers/cywee/dml/cywee_data.c @@ -769,8 +769,9 @@ int32_t cywee_get_now_hour_data(void*value, uint8_t type) case DISTANCE: f_data= cywee_get_sport_data_float(HISTORY_DISTANCE) + cywee_get_sport_data_float(NEW_DISTANCE); - printf("cywee_get_now_hour_data DISTANCE %f %f %f %f\n",cywee_get_sport_data_float(HISTORY_DISTANCE),cywee_get_sport_data_float(NEW_DISTANCE),cywee_get_sport_data_float(HISTORY_DISTANCE_),f_data); + // printf("cywee_get_now_hour_data DISTANCE %f %f %f %f\n",cywee_get_sport_data_float(HISTORY_DISTANCE),cywee_get_sport_data_float(NEW_DISTANCE),cywee_get_sport_data_float(HISTORY_DISTANCE_),f_data); f_data=f_data/1000.0-cywee_get_sport_data_float(HISTORY_DISTANCE_); + // printf("cywee_get_now_hour_data DISTANCE %f\n",f_data); if(f_data<0) return 0; memcpy_s(value,4,&f_data,4); -- 2.17.1