From 94fc9709e78660f2d8eb7961a3caa25f91e3394e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Mon, 5 Aug 2024 03:08:05 +0000 Subject: [PATCH] Merge #642 into sdk602patch0626 from refs/changes/642/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 袁清梦 * refs/changes/642/head: (2 commits squashed) - 屏蔽血氧监测过程中的数值显示 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 Signed-off-by: Caisking <3449750381@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/642 --- .../bloodoxygen/src/BloodDetectionPresenter.cpp | 13 ++++++------- .../nativeui/bloodoxygen/src/BloodDetectionView.cpp | 10 +++++----- .../nativeui/bloodoxygen/src/BloodOxygenModel.cpp | 4 ++-- .../fd230app/nativeui/heartrate/src/HeartModel.cpp | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionPresenter.cpp index 30f21b135..fecabbc16 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionPresenter.cpp @@ -27,14 +27,14 @@ namespace OHOS { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodDetectionPresenter::BloodDetectionPresenter"); g_pBloodDetectionPresenter = this; - display_time = DisplayBrightnessModel::GetInstance()->GetScreenDurationTime(); - display_api->set_screen_auto_off_timeout(300 * 1000); // 设置常亮 + + display_api->set_screen_set_keepon_timeout(-1); // 设置常亮 ResetTickTimer(); } BloodDetectionPresenter::~BloodDetectionPresenter() { - display_api->set_screen_auto_off_timeout(display_time); // 恢复 + display_api->set_screen_set_keepon_timeout(0); // 恢复 g_pBloodDetectionPresenter = nullptr; } BloodDetectionPresenter *BloodDetectionPresenter::GetInstance() @@ -76,7 +76,7 @@ namespace OHOS { NavigateBack(); } - return false; + return true; } bool BloodDetectionPresenter::OnClick(UIView &view, const ClickEvent &event) @@ -91,10 +91,9 @@ namespace OHOS void BloodDetectionPresenter::OnTickEvent() { // 更新显示血氧数据 - BloodDetectionView::GetInstance()->UpShowBloodText(); + // BloodDetectionView::GetInstance()->UpShowBloodText(); 屏蔽动态显示实时数据 uint64_t current_time = osKernelGetTick2ms(); - // printf("current_time diff: %d\r\n", (current_time - startTime)); - if ((startTime != 0) && (current_time - startTime > BLOOD_KEEP_TIME)) + if ((startTime != 0) && (current_time - startTime >= BLOOD_KEEP_TIME)) { // 超时处理 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "检测结果: 超时处理 BLOOD_KEEP_TIME: %lld", current_time - startTime); diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionView.cpp index 1a664456a..81baa1e81 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionView.cpp @@ -17,8 +17,8 @@ namespace OHOS { // 动态刷新设置 static constexpr uint16_t IMAGE_SIZE = 180; - static constexpr uint16_t IMAGE_POSITION_Y = 134; - static constexpr uint16_t IMAGE_POSITION_X = 150; + static constexpr uint16_t IMAGE_POSITION_Y = 143; + static constexpr uint16_t IMAGE_POSITION_X = 143; static constexpr uint16_t DETECTION_IMAGE_ANIMATORVIEW_SIZE = 20; static constexpr uint16_t DETECTION_IMAGE_ANIMATORVIEW_SPEED = 40; @@ -109,11 +109,11 @@ namespace OHOS /* -------------------------------------------------------------------------- */ /*初始化血氧值label*/ - InitUILabel(Spo2Text, 83, 83, 300, 300, "bloodtext", "--", GILROY_BOLD_FONT, 140); - container_->Add(Spo2Text); + // InitUILabel(Spo2Text, 83, 83, 300, 300, "bloodtext", "--", GILROY_BOLD_FONT, 140); + // container_->Add(Spo2Text); /* -------------------------------------------------------------------------- */ - InitButtonExt(testButton, 118, 336, 230, 80, STOPCHECK, STR_CHECKSTOP, 30); + InitButtonExt(testButton, 93, 330, 280, 90, STOPCHECK, STR_CHECKSTOP, 30); container_->Add(testButton); /* -------------------------------------------------------------------------- */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenModel.cpp index f72d9fe21..73ee6def2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenModel.cpp @@ -142,13 +142,13 @@ namespace OHOS uint16_t MiniBlood = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_OXYGEN_THRESHOLD_VALUE); // 检查当前血氧值并设置结果 - if (currentspo2 < MiniBlood) + if (currentspo2 < MiniBlood && currentspo2 != 0) { // 测量结果小于最小血氧值 bloodresult_ = BloodResult::LOW_RESULT; WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "检测结果: 低结果情况, currentspo2 = %d, MiniBlood = %d", currentspo2, MiniBlood); } - + // 根据结果进行处理 switch (bloodresult_) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp index 04355da03..438cea677 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp @@ -595,7 +595,7 @@ namespace OHOS // 检查当前心率是否高于或低于阈值 uint16_t ThresholdState = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_HEARTRATE_MAX_MIN); - if (ThresholdState == 0 && currentheart < ThresholdValue) + if (ThresholdState == 0 && currentheart < ThresholdValue && currentheart != 0) { // 当前心率低于阈值 heartresult_ = HeartResult::LOW_RESULT; -- 2.17.1