From: Caisking <3449750381@qq.com> Date: Thu, 5 Sep 2024 07:18:59 +0000 (+0800) Subject: nextday进行睡眠数据,心率数据,血氧数据管理更新 X-Git-Tag: release_V1.2.70_20241020_135402~518^2~26 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=52484834aeb16c7928407148eef0d0e81b3a8716;p=mirrors%2FFD230.git nextday进行睡眠数据,心率数据,血氧数据管理更新 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp index 1db41a71f..83d589de2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/sleep/src/SleepModel.cpp @@ -351,6 +351,7 @@ namespace OHOS void SleepModel::UpdateSleepView() { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "睡眠数据更新"); SleepControlView *p_SleepControlView = SleepControlView::GetInstance(); if (p_SleepControlView != nullptr) { 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 e259cdbe6..f8ea3dbfe 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 @@ -493,27 +493,35 @@ static uint8_t fall_asleep_state_num = 0; #endif /*NextDay*/ -void MsgCenterNotifyNextDayProc(const Topic topic, Request* req) +void MsgCenterNotifyNextDayProc(const Topic topic, Request *req) { unused(topic); - unused(req); - + unused(req); AlarmClockModel::GetInstance()->NextDayNotify(); -#ifdef FD230 day_timestamp = 0; - - if(!ConfigModel::GetInstance()->get_configData_int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP)) +#ifdef FD230 + printf("******nextday is begin******\r\n"); + /* ----------------------------------- 睡眠相关 ----------------------------------- */ + if (!ConfigModel::GetInstance()->get_configData_int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP)) { - //未设置睡眠监控 nextday进行清除睡眠数据。 + // 未设置睡眠监控 nextday进行清除睡眠数据。 SleepModel::GetInstance().DeleteSleepData(); + // 通知UI更新 + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::SleepModel::UpdateSleepView, &OHOS::SleepModel::GetInstance())); } - - // 清空当日的心率曲线数据 - HealthService::GetInstance()->ClearHourlyHeartRates(); - HealthService::GetInstance()->SaveDailyHeartRate(); - - //午夜清除运动数据 - do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA,NULL); + /* ---------------------------------- 健康数据相关 ---------------------------------- */ + // 清空当日的心率血氧数据 + HealthService::GetInstance()->CleanHealthData(); + // 通知UI更新 + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::HeartModel::CleanAllData, OHOS::HeartModel::GetInstance())); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::BloodOxygenModel::CleanAllData, OHOS::BloodOxygenModel::GetInstance())); + /* --------------------------------- 每日目标相关 --------------------------------- */ + // 午夜清除运动数据 + do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA, NULL); + printf("******nextday is end******\r\n"); #endif }