From e2fa0f52927ff56da0e560f5a31d06bf2ad0ee6f Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Sat, 3 Aug 2024 17:09:21 +0800 Subject: [PATCH] =?utf8?q?=E5=B1=8F=E8=94=BD=E8=A1=80=E6=B0=A7=E7=9B=91?= =?utf8?q?=E6=B5=8B=E8=BF=87=E7=A8=8B=E4=B8=AD=E7=9A=84=E6=95=B0=E5=80=BC?= =?utf8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../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