From: hcj <1224667075@qq.com> Date: Wed, 16 Oct 2024 13:10:00 +0000 (+0800) Subject: 修改获取站立次数 X-Git-Tag: release_V1.2.70_20241020_135402~9^2~15 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=5dfc1a3c9b856290eba39511e115d38b89a718f8;p=mirrors%2FFD230.git 修改获取站立次数 --- 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, "保存每小时距离数据");