二次校准界面
authorxue <2144439972@qq.com>
Tue, 17 Jun 2025 07:06:36 +0000 (15:06 +0800)
committerxue <2144439972@qq.com>
Tue, 17 Jun 2025 07:06:36 +0000 (15:06 +0800)
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPSecUnderCalibrationView.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPSecUnderCalibrationView.cpp [new file with mode: 0644]

diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPSecUnderCalibrationView.h b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPSecUnderCalibrationView.h
new file mode 100644 (file)
index 0000000..71b599c
--- /dev/null
@@ -0,0 +1,40 @@
+
+#ifndef BP_UNDER_SECCALIBRATION_VIEW_H
+#define BP_UNDER_SECCALIBRATION_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 BPSecUnderCalibrationView
+    {
+    public:
+        BPSecUnderCalibrationView();
+        ~BPSecUnderCalibrationView();
+        static BPSecUnderCalibrationView *GetInstance();
+        UIViewGroup * BPSecUnderCalibrationInit();
+        void DeInit();
+        bool AddButton();
+        bool InitLable();
+        bool Initbackground();
+
+       
+
+        void UpSPO2Text(void);
+
+    private:
+        UIImageView *background = nullptr;
+        UILabelExt *calibrationLabel = nullptr;
+        UILabelExt *remindLabel = nullptr;
+        UILabelExt *timeLabel = nullptr;
+        UIViewGroup *group{nullptr};
+    };
+}
+
+#endif // 二次校准界面
\ No newline at end of file
diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPSecUnderCalibrationView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPSecUnderCalibrationView.cpp
new file mode 100644 (file)
index 0000000..3d5562d
--- /dev/null
@@ -0,0 +1,132 @@
+/***
+ * @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/BPSecUnderCalibrationView.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/BPSecUnderCalibrationView.h"
+#include "bloodpressure/include/BPModel.h"
+
+namespace OHOS
+{
+    static BPSecUnderCalibrationView *g_pBPSecUnderCalibrationView{nullptr};
+    static const char *BPBACKPATH = "/user/res/BPCalibration/calibration_background.bin";
+    BPSecUnderCalibrationView::BPSecUnderCalibrationView()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPSecUnderCalibrationView::BPSecUnderCalibrationView");
+        g_pBPSecUnderCalibrationView = this;
+    }
+    BPSecUnderCalibrationView::~BPSecUnderCalibrationView()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPSecUnderCalibrationView::~BPSecUnderCalibrationView");
+        DeInit();
+        g_pBPSecUnderCalibrationView = nullptr;
+    }
+    BPSecUnderCalibrationView *BPSecUnderCalibrationView::GetInstance()
+    {
+        return g_pBPSecUnderCalibrationView;
+    }
+    void BPSecUnderCalibrationView::DeInit()
+    {
+        if(group)
+        {
+            group->RemoveAll();
+            delete group;
+            group = nullptr;
+        }
+        if (background != nullptr)
+        {
+            delete background;
+            background = nullptr;
+        }
+        if (calibrationLabel != nullptr)
+        {
+            delete calibrationLabel;
+            calibrationLabel = nullptr;
+        }
+        BPModel::GetInstance()-> BP_StopTimer();
+    }
+    /* -------------------------------------------------------------------------- */
+    void BPSecUnderCalibrationView::UpSPO2Text()
+    {
+    }
+    /* -------------------------------------------------------------------------- */
+    /***
+     * @description:
+     * @return 初始化标签是否成功
+     */
+    bool BPSecUnderCalibrationView::InitLable()
+    {
+        
+        InitLabel(calibrationLabel, 83, 32, 300, 40, "calibration", "校准中...", DEFAULT_VECTOR_FONT_FILENAME, 35);
+        InitLabel(remindLabel, 63, 278, 360, 35, "remind", "二轮校准中,过程中尽量保持静止,呼吸均匀平衡", DEFAULT_VECTOR_FONT_FILENAME, 30);
+        remindLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
+        remindLabel->SetTextColor(Color::Red());
+        InitLabel(timeLabel, 140, 400, 300, 35, "timeLabel", "秒", DEFAULT_VECTOR_FONT_FILENAME, 30);
+        
+        group->Add(calibrationLabel);
+        group->Add(remindLabel);
+        group->Add(timeLabel);
+
+        return true;
+    }
+    /***
+     * @description:
+     * @return 初始化背景是否成功
+     */
+    bool BPSecUnderCalibrationView::Initbackground()
+    {
+        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;
+    }
+    /***
+     * @description:
+     * @return 是否初始化成功
+     */
+    UIViewGroup *BPSecUnderCalibrationView::BPSecUnderCalibrationInit()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bool BPSecUnderCalibrationView::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;
+        };
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bool BPSecUnderCalibrationView::InitView()");
+        BPModel::GetInstance()-> BP_StartTimer(100);
+
+        return group;
+    }
+    
+}