void SleepModel::ReInitData()
{
+ //更新睡眠目标
+ set_sleep_goal();
+
uint32_t sleep_fall_asleep_timestamp = 0;
uint32_t sleep_wake_up_timestamp = 0;
uint32_t nap_fall_asleep_timestamp = 0;
std::string SleepModel::GetUpdateSleepTime()
{
sleep_time_str.clear();
- // // 获取睡眠最新时间
+ // 获取睡眠最新时间
// sleep_update_time = get_sleep_update_timestamp();
- // // 获取时间戳
- // update_time_info(sleep_update_time, sleep_time_str);
+ sleep_update_time = 0;
+ // 获取时间戳
+ update_time_info(sleep_update_time, sleep_time_str);
return sleep_time_str;
}
// 校验时间更新
notify_hour -= 1; // 小时减1
}
// 确保小时数正确
- notify_hour =
- (notify_hour < 0)
- ? 23
- : notify_hour; // 处理从0点前SLEPPNOTIFY分钟的情况,变为前一天的23点40分
+ notify_hour = (notify_hour < 0) ? 23 : notify_hour; // 处理从0点前SLEPPNOTIFY分钟的情况,变为前一天的23点40分
// 格式化提醒时间字符串
std::ostringstream notifyoss;
notifyoss << std::setfill('0') << std::setw(2) << notify_hour << ":"