From: xue <2144439972@qq.com> Date: Tue, 17 Jun 2025 11:59:56 +0000 (+0800) Subject: 增加结果分析界面 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=3fab2e35d84f505766b9077bac8f1d43802e4cfc;p=mirrors%2FFD230.git 增加结果分析界面 --- 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 index 000000000..76eb50d3d --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/include/BPResultAnalysisView.h @@ -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 diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPMainPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPMainPresenter.cpp index b044b0ab0..9442e00f2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPMainPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPMainPresenter.cpp @@ -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 index 000000000..ce4776b71 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodpressure/src/BPResultAnalysisView.cpp @@ -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; + } + +}