1.校准界面,输入血压界面 1838/1 1838/head 1839/target/1 1840/target/1 1841/target/1
authorxue <2144439972@qq.com>
Mon, 16 Jun 2025 04:24:01 +0000 (12:24 +0800)
committerxue <2144439972@qq.com>
Mon, 16 Jun 2025 04:24:01 +0000 (12:24 +0800)
29 files changed:
code/sdk/application/wearable/fd230app/CMakeLists.txt
code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPMainView.h
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPModel.h
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPUnderCalibrationView.h
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPValueView.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPCalibrationView.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPMainPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPMainView.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPModel.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPUnderCalibrationView.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPValueView.cpp [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/file.bin
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/file_tmp.bin
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/D.bin [deleted file]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/J1.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/J2.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/J3.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/Q.bin [deleted file]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/W.bin [deleted file]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/calibration_background.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/bp_beijing.bin with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/calibration_remind.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/Y.bin with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/decrease_button.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/R.bin with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/error.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/E.bin with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/increase_button.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/R1.bin with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/measuring.bin [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/posture.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/B.bin with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/right.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/E-1.bin with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/warning.bin [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/C.bin with 100% similarity]

index a3b1abd..fbe7e9b 100644 (file)
@@ -227,6 +227,7 @@ set(SOURCES
     #BloodPressure
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodpressure/src/BPCalibrationView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodpressure/src/BPUnderCalibrationView.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodpressure/src/BPValueView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodpressure/src/BPMainView.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodpressure/src/BPMainPresenter.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/bloodpressure/src/BPModel.cpp
index ed405c8..84c8c5c 100644 (file)
 /*血压校准*/
 #include "bloodpressure/include/BPMainView.h"
 #include "bloodpressure/include/BPMainPresenter.h"
-/*è¡\80å\8e\8bæ ¡å\87\86*/
+/*è¡\80å\8e\8bæ£\80æµ\8b*/
 #include "bloodpressure/include/BPDetectionPresenter.h"
 #include "bloodpressure/include/BPDetectionView.h"
 /*心率监测*/
index 51bfc1a..4e17b0e 100644 (file)
@@ -8,12 +8,14 @@
 #include "components/ui_view_group.h"
 #include "bloodpressure/include/BPCalibrationView.h"
 #include "bloodpressure/include/BPUnderCalibrationView.h"
+#include "bloodpressure/include/BPValueView.h"
 namespace OHOS
 {
     typedef enum : uint8_t
     {
         BPCALIBRATIONVIEW = 0, // 主界面
         BPUNDERCALIBRATIONVIEW,     // BP校准界面
+        BPVALUEVIEW,     // 血压输入界面
         MAX_BPVIEW,
     } BPVIEWID;
 
@@ -31,6 +33,7 @@ namespace OHOS
 
         bool ChangeBPCalibrationView(int16_t);
         bool ChangeBPUnderCalibrationView(int16_t);
+        bool ChangeBPValueView(int16_t);
 
         bool ClickFunc(int16_t interface);
         void ChangeView(int16_t hideView, int16_t showView);
@@ -38,6 +41,7 @@ namespace OHOS
     private:
         BPCalibrationView *p_BPCalibrationView{nullptr};
         BPUnderCalibrationView *p_BPUnderCalibrationView{nullptr};
+        BPValueView *g_pBPValueView{nullptr};
 
     private:
         void DeInit();
index 5f0f910..0e10aab 100644 (file)
@@ -61,6 +61,11 @@ namespace OHOS
         void ClearDisplayData();
         void CleanAllData();
 
+         // 定时器管理
+        void BP_StartTimer(uint32_t interval = 1000);
+        void BP_StopTimer(void);
+
+
     private:
         uint16_t displayspo2;
         uint16_t currentspo2;
diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPValueView.h b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPValueView.h
new file mode 100644 (file)
index 0000000..7c45eff
--- /dev/null
@@ -0,0 +1,46 @@
+
+#ifndef BP_VALUE_VIEW_H
+#define BP_VALUE_VIEW_H
+
+#include "components/ui_label.h"
+#include "components/ui_label_ext.h"
+#include "components/ui_button.h"
+#include "components/ui_label_button.h"
+#include "components/ui_view_group.h"
+#include "components/ui_scroll_view.h"
+#include "components/ui_label_button_ext.h"
+namespace OHOS
+{
+
+    class BPValueView
+    {
+    public:
+        BPValueView();
+        ~BPValueView();
+        static BPValueView *GetInstance();
+        UIViewGroup * BPValueInit();
+        void DeInit();
+        bool AddButton();
+        bool InitLable();
+        bool Initbackground();
+        static int16_t SBP;
+        static int16_t DBP;
+
+        void UpSPO2Text(void);
+
+    private:
+        UIImageView *background = nullptr;
+        UILabelExt *titleLabel = nullptr;
+        UILabelExt *SBPLabel = nullptr;
+        UILabelExt *DBPLabel = nullptr;
+        UILabelButton *valuecheckButton{nullptr};
+        UIImageView *SBPLeft{nullptr};
+        UIImageView *SBPRight{nullptr};
+        UIImageView *DBPLeft{nullptr};
+        UIImageView *DBPRight{nullptr};
+
+        UIViewGroup *group{nullptr};
+    };
+}
+
+#endif // 血压主界面
\ No newline at end of file
index c8b5156..dfef024 100644 (file)
@@ -14,7 +14,7 @@
 namespace OHOS
 {
     static BPCalibrationView *g_pBPCalibrationView{nullptr};
-    static const char *BPBACKPATH = "/user/res/BP/bp_beijing.bin";
+    static const char *BPBACKPATH = "/user/res/BPCalibration/calibration_background.bin";
     BPCalibrationView::BPCalibrationView()
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPCalibrationView::BPCalibrationView");
index cdec01d..219d87d 100644 (file)
@@ -10,6 +10,7 @@
 #include "BPModel.h"
 
 #include "bloodpressure/include/BPDetectionView.h"
+#include "bloodpressure/include/BPUnderCalibrationView.h"
 #include "bloodpressure/include/BPMainView.h"
 
 #include "components/ui_label.h"
@@ -140,6 +141,40 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CLICK_BP");
             BPMainView::GetInstance()->ChangeView(BPCALIBRATIONVIEW,BPUNDERCALIBRATIONVIEW);
            
+        }
+         if (strcmp(view.GetViewId(), "value_check") == 0)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "value_check");
+            
+           
+        }
+         if (strcmp(view.GetViewId(), "SBPLeft") == 0)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SBPLeft_BP");
+           
+            BPValueView::SBP--;
+           
+        }
+         if (strcmp(view.GetViewId(),"SBPRight") == 0)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SBPRight");
+           
+            BPValueView::SBP++;
+           
+        }
+         if (strcmp(view.GetViewId(),"DBPLeft") == 0)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DBPLeft");
+            
+            BPValueView::DBP--;
+           
+        }
+         if (strcmp(view.GetViewId(),"DBPRight") == 0)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DBPRight");
+           
+            BPValueView::DBP++;
+           
         }
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPPresenter::OnClick");
         return true;
index 8c3948e..77a2656 100644 (file)
@@ -51,6 +51,16 @@ namespace OHOS
             delete p_BPCalibrationView;
             p_BPCalibrationView = nullptr;
         }
+        if (p_BPUnderCalibrationView)
+        {
+            delete p_BPUnderCalibrationView;
+            p_BPUnderCalibrationView = nullptr;
+        }
+        if (g_pBPValueView)
+        {
+            delete g_pBPValueView;
+            g_pBPValueView = nullptr;
+        }
     }
 
     void BPMainView::OnStart()
@@ -141,6 +151,25 @@ namespace OHOS
         return true;
     }
 
+     bool BPMainView::ChangeBPValueView(int16_t thisView)
+    {
+        // 检查视图是否已初始化
+        if (group[thisView] == nullptr)
+        {
+            WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodPressureView::BPValueView");
+             g_pBPValueView = new BPValueView();
+            if (g_pBPValueView == nullptr)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodPressureView:: new scrollView[%d] fail", thisView);
+                return false;
+            }
+            // 初始化视图并添加到视图组
+            group[thisView] = g_pBPValueView->BPValueInit();
+            container_->Add(group[thisView]);
+        }
+        return true;
+    }
+
     /**
      * 视图映射结构体 - 将视图ID映射到对应的视图切换函数
      */
@@ -153,6 +182,7 @@ namespace OHOS
     static const BPViewMapper ViewMapper[] = {
         {BPCALIBRATIONVIEW, &BPMainView::ChangeBPCalibrationView},
         {BPUNDERCALIBRATIONVIEW, &BPMainView::ChangeBPUnderCalibrationView},
+        {BPVALUEVIEW, &BPMainView::ChangeBPValueView},
     };
 
     bool BPMainView::ClickFunc(int16_t interface)
index 421c956..9381dbc 100644 (file)
@@ -6,6 +6,10 @@
 #include "heart_blood/health_service/health_service.h"
 #include "custom_utils.h"
 
+#include <cmsis_os2.h>
+#include <cmsis_os.h>
+#include <service/graphic_service.h>
+
 extern "C" errcode_t uapi_get_timestamp_ms(uint32_t *tm);
 
 #include "custom_utils.h"
@@ -24,6 +28,9 @@ extern "C" errcode_t uapi_get_timestamp_ms(uint32_t *tm);
 #define MAX_DISVALID_SPO2_COUNT 100
 namespace OHOS
 {
+    static osTimerId_t g_timer = nullptr;
+    static int Time = 30;
+
     /**
      * @brief Constructor for the BPModel class.
      */
@@ -301,4 +308,88 @@ namespace OHOS
            // BPMainView::GetInstance()->UpSPO2Text();
         }
     }
+        /* -------------------------------------------------------------------------- */
+    /*定时器到期时的处理*/
+    static void BP_TimerCallbackProc(int data)
+    {
+        // 等待完成的定时器
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BP_TimerCallbackProc,Time = %d", Time);
+        if (Time < 0) // 如果校准超时30s,进入完成界面
+        {
+            BPModel::GetInstance()->BP_StopTimer();
+            BPMainView::GetInstance()->ChangeView(BPUNDERCALIBRATIONVIEW,BPVALUEVIEW);
+        }
+        return;
+    }
+
+    /*
+     * @brief 回调函数
+     */
+    static void BP_TimerCallback(int data)
+    {
+        Time -= 1;
+        GraphicService::GetInstance()->PostGraphicEvent(std::bind(BP_TimerCallbackProc, data));
+    }
+
+    /*
+     *  @brief 开启定时器函数
+     *  @param interval 时间间隔,单位ms
+     */
+    void BPModel::BP_StartTimer(uint32_t interval)
+    {
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BPModel::BP_StartTimer");
+        /* -------------------------- 1.检查定时器是否已经存在,如果存在则返回 ------------------------- */
+        if (g_timer != nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Timer already exists!!");
+            return;
+        }
+
+        /* --------------------------------- 2.创建定时器 -------------------------------- */
+        g_timer = osTimerNew((osTimerFunc_t)BP_TimerCallback, osTimerPeriodic, nullptr, nullptr);
+        // 检查定时器创建是否成功
+        if (g_timer == nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Timer create failed!!");
+            return;
+        }
+
+        /* ----------------------------- 3.将毫秒转换为系统时钟节拍数 ---------------------------- */
+        int tick = osMs2Tick(interval);
+
+        /* --------------------------------- 4.启动定时器 -------------------------------- */
+        osStatus_t ret = osTimerStart(g_timer, tick);
+        /* -------------------- 5.检查定时器启动是否成功,如果启动失败,删除定时器并置为 nullptr -------------------- */
+        if (ret != osOK)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "osTimerDelete failed, ret = %lx!!", ret);
+            if (g_timer != nullptr)
+            {
+                ret = osTimerDelete(g_timer);
+            }
+            g_timer = nullptr;
+            return;
+        }
+    }
+
+    /*
+     * @brief 停止定时器
+     */
+    void BPModel::BP_StopTimer(void)
+    {
+        // 检查定时器是否存在
+        if (g_timer != nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPModel::BP_StopTimer");
+            osTimerStop(g_timer);
+            // 删除定时器并置为 nullptr
+            osStatus_t ret = osTimerDelete(g_timer);
+            if (ret != osOK)
+            {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "osTimerDelete failed, ret = %lx!!", ret);
+            }
+            g_timer = nullptr;
+            Time = 30;
+        }
+    }
 }
index 5b80ca0..38e9c06 100644 (file)
 #include "uicomponents/UIComponents.h"
 #include "bloodpressure/include/BPMainPresenter.h"
 #include "bloodpressure/include/BPUnderCalibrationView.h"
+#include "bloodpressure/include/BPModel.h"
+
 namespace OHOS
 {
     static BPUnderCalibrationView *g_pBPUnderCalibrationView{nullptr};
-    static const char *BPBACKPATH = "/user/res/BP/bp_beijing.bin";
+    static const char *BPBACKPATH = "/user/res/BPCalibration/calibration_background.bin";
     BPUnderCalibrationView::BPUnderCalibrationView()
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPUnderCalibrationView::BPUnderCalibrationView");
@@ -94,10 +96,10 @@ namespace OHOS
     {
         
         InitLabel(calibrationLabel, 83, 32, 300, 40, "calibration", "校准中...", DEFAULT_VECTOR_FONT_FILENAME, 35);
-        InitLabel(remindLabel, 53, 270, 360, 35, "remind", "首轮校准中,过程中尽量保持静止,呼吸均匀平衡", DEFAULT_VECTOR_FONT_FILENAME, 30);
+        InitLabel(remindLabel, 63, 278, 360, 35, "remind", "首轮校准中,过程中尽量保持静止,呼吸均匀平衡", DEFAULT_VECTOR_FONT_FILENAME, 30);
         remindLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
         remindLabel->SetTextColor(Color::Red());
-        InitLabel(timeLabel, 120, 340, 300, 35, "timeLabel", "秒", DEFAULT_VECTOR_FONT_FILENAME, 30);
+        InitLabel(timeLabel, 140, 400, 300, 35, "timeLabel", "秒", DEFAULT_VECTOR_FONT_FILENAME, 30);
         
         group->Add(calibrationLabel);
         group->Add(remindLabel);
@@ -114,6 +116,17 @@ namespace OHOS
         background = new UIImageView();
         background->SetPosition(0, 0, 466, 466);
         background->SetSrc(BPBACKPATH);
+
+        background = new UIImageView();
+        background->SetPosition(0, 0, 466, 466);
+        background->SetSrc(BPBACKPATH);
+
+        background = new UIImageView();
+        background->SetPosition(0, 0, 466, 466);
+        background->SetSrc(BPBACKPATH);
+
+
+
         group->Add(background);
         return true;
     }
@@ -142,6 +155,7 @@ namespace OHOS
               return nullptr;
         };
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bool BPUnderCalibrationView::InitView()");
+        BPModel::GetInstance()-> BP_StartTimer(1000);
 
         return group;
     }
diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPValueView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPValueView.cpp
new file mode 100644 (file)
index 0000000..a4ce6b7
--- /dev/null
@@ -0,0 +1,244 @@
+/***
+ * @Date: 2024-04-15 10:55:58
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-07-31 14:36:25
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230/nativeapp/nativeui/bloodpressure/src/BPValueView.cpp
+ */
+
+#include "ui_resource_image.h"
+#include "UiConfig.h"
+#include "wearable_log.h"
+#include "uicomponents/UIComponents.h"
+#include "bloodpressure/include/BPMainPresenter.h"
+#include "bloodpressure/include/BPValueView.h"
+namespace OHOS
+{
+    static BPValueView *g_pBPValueView{nullptr};
+    static const char *BPBACKPATH = "/user/res/BPCalibration/calibration_background.bin";
+    static const char *LEFTPATH = "/user/res/BPCalibration/decrease_button.bin";
+    static const char *RIGHTPATH = "/user/res/BPCalibration/increase_button.bin";
+    int16_t BPValueView::SBP=120;
+    int16_t BPValueView::DBP=120;
+    
+
+    BPValueView::BPValueView()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPValueView::BPValueView");
+        g_pBPValueView = this;
+    }
+    BPValueView::~BPValueView()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPValueView::~BPValueView");
+        DeInit();
+        g_pBPValueView = nullptr;
+    }
+    BPValueView *BPValueView::GetInstance()
+    {
+        return g_pBPValueView;
+    }
+    void BPValueView::DeInit()
+    {
+        if(group)
+        {
+            group->RemoveAll();
+            delete group;
+            group = nullptr;
+        }
+        if (background != nullptr)
+        {
+            delete background;
+            background = nullptr;
+        }
+        if (titleLabel != nullptr)
+        {
+            delete titleLabel;
+            titleLabel = nullptr;
+        }
+        if (SBPLabel != nullptr)
+        {
+            delete SBPLabel;
+            SBPLabel = nullptr;
+        }
+        if (DBPLabel != nullptr)
+        {
+            delete DBPLabel;
+            DBPLabel = nullptr;
+        }
+        if (valuecheckButton != nullptr)
+        {
+            delete valuecheckButton;
+            valuecheckButton = nullptr;
+        }
+         if (SBPLeft != nullptr)
+        {
+            delete SBPLeft;
+            SBPLeft = nullptr;
+        }
+         if (SBPRight != nullptr)
+        {
+            delete SBPRight;
+            SBPRight = nullptr;
+        }
+         if (DBPLeft != nullptr)
+        {
+            delete DBPLeft;
+            DBPLeft = nullptr;
+        }
+         if (DBPRight != nullptr)
+        {
+            delete DBPRight;
+            DBPRight = nullptr;
+        }
+    }
+    /* -------------------------------------------------------------------------- */
+    void BPValueView::UpSPO2Text()
+    {
+        // // if (bloodLabel == nullptr || timeLabel == nullptr)
+        // // return;
+
+        // // 更新血氧数据
+        // uint16_t spo2 = BPModel::GetInstance()->GetSPO2data();
+        // if (spo2 != 0) // 判断是否为默认数据
+        // {
+        //     // 更新数据
+        //     std::string bloodpressureStr = std::to_string(spo2) + "%";
+        //     // bloodLabel->SetText(bloodpressureStr.c_str());
+
+        //     // 获取时间差
+        //     uint32_t time = BPMainPresenter::GetInstance()->GetCurrentTime();
+        //     uint32_t check_time = BPModel::GetInstance()->GetCheckTime();
+        //     int time_diff = BPMainPresenter::GetInstance()->GetTDOA(time, check_time);
+
+        //     if (time_diff == 0)
+        //     {
+        //         timeLabel->SetTextId(STR_CHECKNEW);
+        //     }
+        //     else if (time_diff <= 60)
+        //     {
+        //         UpdateLabel(timeLabel, time_diff, STR_CHECKTIME);
+        //     }
+        //     else
+        //     {
+        //         timeLabel->SetTextId(STR_CHECKLONG);
+        //     }
+        // }
+        // else
+        // {
+        // }
+    }
+    /* -------------------------------------------------------------------------- */
+    /***
+     * @description:
+     * @return 添加按键是否成功
+     */
+    bool BPValueView::AddButton()
+    {
+        InitLabelButton(valuecheckButton, 125, 365, 217, 63, "checkButton", "确认", 35);
+        valuecheckButton->SetViewId("value_check");
+        valuecheckButton->SetStyle(STYLE_BACKGROUND_COLOR, 0x19191919); // 设置按键颜色
+        valuecheckButton->SetTextColor(Color::Red());
+        // 设置按键监听
+        UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::BPMainPresenter::GetInstance();
+        valuecheckButton->SetOnClickListener(clickListener);
+
+        group->Add(valuecheckButton);
+        return true;
+    }
+    /***
+     * @description:
+     * @return 初始化标签是否成功
+     */
+    bool BPValueView::InitLable()
+    {
+        
+        InitLabel(titleLabel, 109, 38, 239, 35, "title", "血压校准", DEFAULT_VECTOR_FONT_FILENAME, 35);
+        InitLabel(SBPLabel, 63, 163, 85, 29, "SBP", "收缩压", DEFAULT_VECTOR_FONT_FILENAME, 30);
+        InitLabel(DBPLabel, 63, 282, 85, 29, "DBP", "舒张压", DEFAULT_VECTOR_FONT_FILENAME, 30);
+        /*初始化检测时间*/
+        group->Add(titleLabel);
+        group->Add(SBPLabel);
+        group->Add(DBPLabel);
+
+        return true;
+    }
+    /***
+     * @description:
+     * @return 初始化背景是否成功
+     */
+    bool BPValueView::Initbackground()
+    {
+        background = new UIImageView();
+        background->SetPosition(0, 0, 466, 466);
+        background->SetSrc(BPBACKPATH);
+
+        SBPLeft = new UIImageView();
+        SBPLeft->SetPosition(199, 160, 31, 35);
+        SBPLeft->SetSrc(LEFTPATH);
+        SBPLeft->SetViewId("SBPLeft");
+        UIView::OnClickListener *clickListener_SBPLeft = (UIView::OnClickListener *)OHOS::BPMainPresenter::GetInstance();
+        SBPLeft->SetOnClickListener(clickListener_SBPLeft);
+
+        SBPRight = new UIImageView();
+        SBPRight->SetPosition(385, 160, 31, 35);
+        SBPRight->SetSrc(RIGHTPATH);        
+        SBPRight->SetViewId("SBPRight");   
+        UIView::OnClickListener *clickListener_SBPRight = (UIView::OnClickListener *)OHOS::BPMainPresenter::GetInstance();
+        SBPRight->SetOnClickListener(clickListener_SBPRight);             
+
+        DBPLeft = new UIImageView();
+        DBPLeft->SetPosition(199, 278, 31, 35);   
+        DBPLeft->SetSrc(LEFTPATH);         
+        DBPLeft->SetViewId("DBPLeft");      
+        UIView::OnClickListener *clickListener_DBPLeft = (UIView::OnClickListener *)OHOS::BPMainPresenter::GetInstance();
+        DBPLeft->SetOnClickListener(clickListener_DBPLeft);
+
+        DBPRight = new UIImageView();
+        DBPRight->SetPosition(385, 278, 31, 35); 
+        DBPRight->SetSrc(RIGHTPATH);    
+        DBPRight->SetViewId("DBPRight");
+        UIView::OnClickListener *clickListener_DBPRight = (UIView::OnClickListener *)OHOS::BPMainPresenter::GetInstance();
+        DBPRight->SetOnClickListener(clickListener_DBPRight);
+
+        group->Add(background);
+        group->Add(SBPLeft);
+        group->Add(SBPRight);
+        group->Add(DBPLeft);
+        group->Add(DBPRight);
+        return true;
+    }
+    /***
+     * @description:
+     * @return 是否初始化成功
+     */
+    UIViewGroup *BPValueView::BPValueInit()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bool BPValueView::InitView()");
+        group = new UIViewGroup();
+        if (group == nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmPopUpView::group null!");
+            return nullptr;
+        }
+        group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+        if (!Initbackground())
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Initbackground error!");
+              return nullptr;
+        };
+        if (!InitLable())
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLable error!");
+              return nullptr;
+        };
+        if (!AddButton())
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AddButton error!");
+              return nullptr;
+        };
+        SBP=120;
+        DBP=120;
+        
+        return group;
+    }
+    
+}
index de65c42..3c4b1da 100644 (file)
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:a317e355903aa113ed57ca69838e97c5e6edf1f9cbe9b22b0f7e91de60c9ad53
-size 43963392
+oid sha256:b4b062f8fda932bc3f2211903f4cc764d1067eabe272a4e69955fa53cedcb94d
+size 44569536
index 2ab92f1..7e8b67d 100644 (file)
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:7e383c66b84c89fb165eba71148fec946526964e9469ed0c4b7d679d057480dc
-size 43963392
+oid sha256:f5b822a85dd37d84637b1a3990a6d46f9a6fbd9d0159bde988f4e2498b3e70c2
+size 44569536
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/D.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/D.bin
deleted file mode 100644 (file)
index ee87694..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:2ad95b790da87a16e8f1af72aa90e3a404b84dc302fadb8e87c78f2c9771d875
-size 51192
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/J1.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/J1.bin
new file mode 100644 (file)
index 0000000..1bd7470
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b30fdc9e6e15f7576ca7b20be8513c95773d5db7573c2330619dd7353446cec2
+size 24600
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/J2.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/J2.bin
new file mode 100644 (file)
index 0000000..8f3eacd
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:92a26bd84905cd3ce0c91f0513f79da62c3642c0cc6d8339f9500411968cccd5
+size 24600
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/J3.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/J3.bin
new file mode 100644 (file)
index 0000000..1b9759e
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b881d6aa34320b620f4a3c2f723ee6d0fd571db50b357f300f649c81a3e5d3cc
+size 24600
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/Q.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/Q.bin
deleted file mode 100644 (file)
index 056a7fa..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ec564dfdc5fd5780f259ecd5def9de4afdde2e640303a534722f3b28730f9e3d
-size 37464
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/W.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/W.bin
deleted file mode 100644 (file)
index 5b1cd60..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5c371066564c59695cf2bd253af59a0be1d59edd0c723c690cb5948198dc7ac2
-size 107352
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/measuring.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/w9/fs/user/res/BPCalibration/measuring.bin
new file mode 100644 (file)
index 0000000..f7656de
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b8f4f54f48eca0b415961c9fe13cfbda8133d63521efdbb9799d28c5b1d967f2
+size 3384