From: xue <2144439972@qq.com> Date: Thu, 10 Jul 2025 05:49:12 +0000 (+0800) Subject: 修复测量存储数据显示错误bug X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=1d1a2b63188a46279cba3edc3b169ab9db91e9d6;p=mirrors%2FFD230.git 修复测量存储数据显示错误bug --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectEndView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectEndView.cpp index 039825900..fc24f69cd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectEndView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectEndView.cpp @@ -117,10 +117,14 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DBPText or SBPText or timeLabel is null"); return; } - //获取时间更新时间 - std::string timeStr = BPModel::GetInstance()->GetCurrentTimeStr(); + + /*获取上次测量的数据*/ + BPModel::GetInstance()->GetLastData(); + uint32_t time = BPModel::GetInstance()->GetLastData().timestamp; + std::string timeStr = BPModel::GetInstance()->GetDoubleLineCurrentTimeStr(time); timeLabel->SetText(timeStr.c_str()); - //获取上一次检测数据 ? 待定 + DBPText->SetText(std::to_string(BPModel::GetInstance()->GetLastData().last_check_dbp_value).c_str()); + SBPText->SetText(std::to_string(BPModel::GetInstance()->GetLastData().last_check_sbp_value).c_str()); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectFirstView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectFirstView.cpp index 20c49bff9..0656e70ce 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectFirstView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectFirstView.cpp @@ -110,18 +110,13 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DBPText or SBPText or timeLabel is null"); return; } - // 获取上一次检测数据 ? 待定 - // LAST_CHECK_DATA data; - // if (BPModel::GetInstance()->get_last_check_bp_data(data)) - // { - // // 获取时间更新时间 - // uint64_t timeStr = data.timestamp; - // std::string dbpValue = std::to_string(data.last_check_dbp_value); - // std::string sbpValue = std::to_string(data.last_check_sbp_value); - // timeLabel->SetText(BPModel::GetInstance()->GetCurrentTimeStr(data.timestamp).c_str()); - // DBPText->SetText(dbpValue.c_str()); - // SBPText->SetText(sbpValue.c_str()); - // } + /*获取上次测量的数据*/ + BPModel::GetInstance()->GetLastData(); + uint32_t time = BPModel::GetInstance()->GetLastData().timestamp; + std::string timeStr = BPModel::GetInstance()->GetDoubleLineCurrentTimeStr(time); + timeLabel->SetText(timeStr.c_str()); + DBPText->SetText(std::to_string(BPModel::GetInstance()->GetLastData().last_check_dbp_value).c_str()); + SBPText->SetText(std::to_string(BPModel::GetInstance()->GetLastData().last_check_sbp_value).c_str()); } void BPDetectFirstView::WriteMapToPointArrays(const std::map> &bpMap) diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectionView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectionView.cpp index 5a320bcc6..830af361f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectionView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/detection/BPDetectionView.cpp @@ -101,7 +101,9 @@ namespace OHOS container_->SetDraggable(true); container_->SetTouchable(true); container_->SetOnDragListener(presenter_); - + + BPModel::GetInstance()->LoadBP(BP_STORAGE_TYPE::TODAY_DATA); //加载今日测量数据 + BPModel::GetInstance()->LoadBP(BP_STORAGE_TYPE::LAST_MEASURE_DATA); //加载上次测量数据 // 切换到第一个界面 ChangeView(MAX_BPDECETVIEW, MAIN_BPVIEW);