增加结果分析界面
authorxue <2144439972@qq.com>
Tue, 17 Jun 2025 11:59:56 +0000 (19:59 +0800)
committerxue <2144439972@qq.com>
Tue, 17 Jun 2025 11:59:56 +0000 (19:59 +0800)
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPResultAnalysisView.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPMainPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPResultAnalysisView.cpp [new file with mode: 0644]

diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPResultAnalysisView.h b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPResultAnalysisView.h
new file mode 100644 (file)
index 0000000..76eb50d
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef BP_RESULTANALYSIS_VIEW_H
+#define BP_RESULTANALYSIS_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 BPResultAnalysisView
+    {
+    public:
+        BPResultAnalysisView();
+        ~BPResultAnalysisView();
+        static BPResultAnalysisView *GetInstance();
+        UIViewGroup * BPResultAnalysisInit();
+        void DeInit();
+        bool InitLable();
+        bool Initbackground();
+
+    private:
+        UIImageView *background = nullptr;
+        UILabelExt *calibrationLabel = nullptr;
+        UILabelExt *mindLabel = nullptr;
+        UIViewGroup *group{nullptr};
+    };
+}
+
+#endif // 结果分析界面
\ No newline at end of file
index b044b0a..9442e00 100644 (file)
@@ -153,7 +153,7 @@ namespace OHOS
 
             BPValueView::SBP--;
         }
-        if (strcmp(view.GetViewId(), "SBPRight") == 0)
+         if (strcmp(view.GetViewId(),"SBPRight") == 0)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SBPRight");
 
diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPResultAnalysisView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPResultAnalysisView.cpp
new file mode 100644 (file)
index 0000000..ce4776b
--- /dev/null
@@ -0,0 +1,109 @@
+/***
+ * @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/BPResultAnalysisView.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/BPResultAnalysisView.h"
+namespace OHOS
+{
+    static BPResultAnalysisView *g_pBPResultAnalysisView{nullptr};
+    static const char *BPBACKPATH = "/user/res/BPResultAnalysis/result_background.bin";
+    BPResultAnalysisView::BPResultAnalysisView()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPResultAnalysisView::BPResultAnalysisView");
+        g_pBPResultAnalysisView = this;
+    }
+    BPResultAnalysisView::~BPResultAnalysisView()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BPResultAnalysisView::~BPResultAnalysisView");
+        DeInit();
+        g_pBPResultAnalysisView = nullptr;
+    }
+    BPResultAnalysisView *BPResultAnalysisView::GetInstance()
+    {
+        return g_pBPResultAnalysisView;
+    }
+    void BPResultAnalysisView::DeInit()
+    {
+        if(group)
+        {
+            group->RemoveAll();
+            delete group;
+            group = nullptr;
+        }
+        if (background != nullptr)
+        {
+            delete background;
+            background = nullptr;
+        }
+        if (calibrationLabel != nullptr)
+        {
+            delete calibrationLabel;
+            calibrationLabel = nullptr;
+        }
+    }
+
+    /***
+     * @description:
+     * @return 初始化标签是否成功
+     */
+    bool BPResultAnalysisView::InitLable()
+    {
+        
+        InitLabel(calibrationLabel, 73, 40, 300, 45, "calibration", "结果分析中", DEFAULT_VECTOR_FONT_FILENAME, 40);
+        InitLabel(mindLabel,63, 278, 360, 35, "mindLabel", "分析中请勿退出,过程中尽量保持静止,呼吸均匀平衡", DEFAULT_VECTOR_FONT_FILENAME, 40);
+        mindLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
+        mindLabel->SetTextColor(Color::Red());
+        /*初始化检测时间*/
+        group->Add(calibrationLabel);
+        group->Add(mindLabel);
+
+        return true;
+    }
+    /***
+     * @description:
+     * @return 初始化背景是否成功
+     */
+    bool BPResultAnalysisView::Initbackground()
+    {
+        background = new UIImageView();
+        background->SetPosition(0, 0, 466, 466);
+        background->SetSrc(BPBACKPATH);
+        group->Add(background);
+        return true;
+    }
+    /***
+     * @description:
+     * @return 是否初始化成功
+     */
+    UIViewGroup *BPResultAnalysisView::BPResultAnalysisInit()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bool BPResultAnalysisView::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;
+        };
+        return group;
+    }
+    
+}