From 3374398026fc326e08a41d0d283dcf846fea4f1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=83=A1=E4=BC=A0=E5=86=9B?= <1224667075@qq.com> Date: Wed, 16 Oct 2024 13:35:03 +0000 Subject: [PATCH] Merge #1200 into sdk602patch0911 from refs/changes/1200/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 胡传军 * refs/changes/1200/head: (2 commits squashed) - 修改获取站立次数 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0911 Signed-off-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1200 --- .../wearable/fd230app/nativeui/goal/include/goalmodel.h | 2 ++ .../wearable/fd230app/nativeui/goal/src/goalmodel.cpp | 8 +++++--- .../service/msg_center/src/msg_center_customer.cpp | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/include/goalmodel.h b/code/sdk/application/wearable/fd230app/nativeui/goal/include/goalmodel.h index 6719cc73d..2c99a7186 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/include/goalmodel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/include/goalmodel.h @@ -67,6 +67,8 @@ namespace OHOS uint32_t calories=0; uint32_t stand=0; + uint32_t standdata_now=0; + uint8_t step_goal_show=0; uint8_t other_goal_show=0; diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp index a4fc28001..8f1584059 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp @@ -33,6 +33,8 @@ namespace OHOS fat=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION); calories=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES); stand=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES); + + standdata_now=get_now_stand_count(); } @@ -147,11 +149,11 @@ namespace OHOS bool GoalModel::is_goal_stand_done() { - int standdata_now = get_now_stand_count(); + int standdata_now_ = standdata_now+get_stand_falg(); int standdata_goal = stand; - if(standdata_now>=standdata_goal) + if(standdata_now_>=standdata_goal) return true; else return false; @@ -194,7 +196,7 @@ namespace OHOS char standnewstr[20]; char *GoalModel::getstandnew() { - int standdata = get_now_stand_count(); + int standdata = standdata_now+get_stand_falg(); memset((void *)standnewstr, 0, 20); sprintf_s(standnewstr, 20, "%d", standdata); diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index d7b623d8e..cdfac10fd 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -73,6 +73,7 @@ #include "main/include/PullUpDownView.h" #include "player/include/PlayersModelC.h" +#include "ui_service.h" #define DIALDATASET 1 //#include "Systemupgrade.h" namespace OHOS { @@ -361,7 +362,14 @@ void MsgCenterNotifyONtimeProc(const Topic topic, Request* req) WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "保存每小时步数"); step_history_save(); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "保存每小时站立数据"); + if(get_stand_falg()) + { stand_history_save(); + SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); + } + + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "保存每小时卡路里数据"); calories_history_save(); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "保存每小时距离数据"); -- 2.17.1