Merge #642 into sdk602patch0626 from refs/changes/642/head 647/target/1
author袁清梦 <3449750381@qq.com>
Mon, 5 Aug 2024 03:08:05 +0000 (03:08 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Mon, 5 Aug 2024 03:08:05 +0000 (03:08 +0000)
Code review from 袁清梦

* refs/changes/642/head: (2 commits squashed)

  - 屏蔽血氧监测过程中的数值显示

  - Merge branch &#39;sdk602patch0626&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626

Signed-off-by: Caisking <3449750381@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/642
code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodDetectionView.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/src/BloodOxygenModel.cpp
code/sdk/application/wearable/fd230app/nativeui/heartrate/src/HeartModel.cpp

index 30f21b1..fecabbc 100644 (file)
@@ -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);
index 1a66445..81baa1e 100644 (file)
@@ -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);
 
         /* -------------------------------------------------------------------------- */
index f72d9fe..73ee6de 100644 (file)
@@ -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_)
         {
index 04355da..438cea6 100644 (file)
@@ -595,7 +595,7 @@ namespace OHOS
             // 检查当前心率是否高于或低于阈值\r
             uint16_t ThresholdState = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_HEARTRATE_MAX_MIN);\r
 \r
-            if (ThresholdState == 0 && currentheart < ThresholdValue)\r
+            if (ThresholdState == 0 && currentheart < ThresholdValue && currentheart != 0)\r
             {\r
                 // 当前心率低于阈值\r
                 heartresult_ = HeartResult::LOW_RESULT;\r