{
static constexpr uint16_t PROGRESS_VALUE_MIN = 0;
static constexpr uint16_t PROGRESS_VALUE_MAX = 10;
+ static int16_t passflag = 0; // 第几次校准成功标志位
static BPMainPresenter *g_pBPMainPresenter;
-
/* -------------------------------------------------------------------------- */
BPMainPresenter::BPMainPresenter()
{
{
return g_pBPMainPresenter;
}
+ void BPMainPresenter::ReSetPassflag()
+ {
+ passflag = 0;
+ }
void BPMainPresenter::OnStart()
{
Presenter<BPMainView>::OnStart();
bool BPMainPresenter::OnClick(UIView &view, const ClickEvent &event)
{
- static int16_t passflag = 0; // 第几次校准成功标志位
+
std::string viewId = view.GetViewId();
std::map<std::string, std::pair<int16_t, int16_t>> viewIdMap = {
}
else
{
- //退出
- //passflag = 0;
+ // 退出
+ // passflag = 0;
}
}
else if (strcmp(view.GetViewId(), "SBPLeft") == 0)
container_->SetTouchable(true);
container_->SetOnDragListener(presenter_);
- if( BPModel::GetInstance()->GetCalibrationFlag() == 0)
- // 切换到第一个界面
- ChangeView(MAX_BPVIEW, BPCALPOSREQVIEW);
- else
- ChangeView(MAX_BPVIEW, BPLASTCALIBRATIONTIME);
+ if (BPModel::GetInstance()->GetCalibrationFlag() == 0)
+ {
+ ChangeView(MAX_BPVIEW, BPCALPOSREQVIEW);// 切换到第一个界面
+ BPMainPresenter::GetInstance()->ReSetPassflag();//重置校准成功按钮标志位
+ }
+
+ else
+ ChangeView(MAX_BPVIEW, BPLASTCALIBRATIONTIME);
// 增加按键监听
RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::BPMainPresenter::GetInstance();
return;
}
-
bool BPMainView::ChangeBPUnderCalibrationView(int16_t thisView)
{
// 检查视图是否已初始化
}
return true;
}
- bool BPMainView::ChangeBPSecUnderCalibrationView(int16_t thisView)
+ bool BPMainView::ChangeBPSecUnderCalibrationView(int16_t thisView)
{
// 检查视图是否已初始化
if (group[thisView] == nullptr)
if (group[thisView] == nullptr)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodPressureView::ChangeBPCalibrationPassView");
- g_pBPCalibrationPassView = new BPCalibrationPassView();
+ g_pBPCalibrationPassView = new BPCalibrationPassView();
if (g_pBPCalibrationPassView == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodPressureView:: new scrollView[%d] fail", thisView);
return true;
}
- bool BPMainView::ChangeBPCalibrationErrorView(int16_t thisView)
+ bool BPMainView::ChangeBPCalibrationErrorView(int16_t thisView)
{
// 检查视图是否已初始化
if (group[thisView] == nullptr)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodPressureView::ChangeBPCalibrationErrorView");
- g_pBPCalibrationErrorView = new BPCalibrationErrorView();
+ g_pBPCalibrationErrorView = new BPCalibrationErrorView();
if (g_pBPCalibrationErrorView == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodPressureView:: new scrollView[%d] fail", thisView);
if (group[thisView] == nullptr)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodPressureView::ChangeBPCalibrationMindView");
- g_pBPCalibrationMindView = new BPCalibrationMindView();
+ g_pBPCalibrationMindView = new BPCalibrationMindView();
if (g_pBPCalibrationMindView == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodPressureView:: new scrollView[%d] fail", thisView);
if (group[thisView] == nullptr)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodPressureView::ChangeBPResultAnalysisView");
- g_pBPResultAnalysisView = new BPResultAnalysisView();
+ g_pBPResultAnalysisView = new BPResultAnalysisView();
if (g_pBPResultAnalysisView == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodPressureView:: new scrollView[%d] fail", thisView);
return true;
}
-
/**
* 视图映射结构体 - 将视图ID映射到对应的视图切换函数
*/
container_->Invalidate();
}
- }
+}