return result;
}
- std::string DebugOutputViewEventListener::get_runtime_status_t(void)
+ std::string DebugOutputViewEventListener::get_runtime_status_t()
{
- std::string result;
+ std::string result = "enter_safemode:" + std::to_string(uapi_dev_runtime_get_safemode_flag()) + " ";
+ result += "in_silent_mode: ";
+ result += "in_lowpower_mode: ";
+ result += "stepcount: ";
+ result += "vibmod:" + std::to_string(uapi_dev_runtime_get_vibmod()) + " ";
+ result += "current_dial_name:" + std::string(uapi_dev_runtime_get_dialname()) + " ";
+ result += "time_hour_show_model:" + std::to_string(uapi_dev_runtime_get_time_hour_show_model()) + " ";
+ result += "sleep_monitoring_status:" + std::to_string(uapi_dev_runtime_get_sleep_monitoring_status()) + " ";
+ result += "sleep_status:" + std::to_string(uapi_dev_runtime_get_sleep_status()) + " ";
+ result += "nap_status:" + std::to_string(uapi_dev_runtime_get_nap_status()) + " ";
+ result += "nap_monitoring_status:" + std::to_string(uapi_dev_runtime_get_nap_monitoring_status()) + " ";
+ result += "sedentary_status:" + std::to_string(uapi_dev_runtime_get_sedentary_status()) + " ";
+ result += "drinkremind_status:" + std::to_string(uapi_dev_runtime_get_drinkremind_status()) + " ";
+ result += "train_status:" + std::to_string(uapi_dev_runtime_get_train_status()) + " ";
+ result += "saveele_status:" + std::to_string(uapi_dev_runtime_get_saveele_status()) + " ";
+ result += "lock_status:" + std::to_string(uapi_dev_runtime_get_lock_status()) + " ";
+ result += "motion_recognition_status:" + std::to_string(uapi_dev_runtime_get_motion_recognition_status()) + " ";
+ result += "sleep_mode_flag:" + std::to_string(uapi_sleep_mode_flag_get()) + " ";
+ result += "absolute_static_state:" + std::to_string(uapi_dev_runtime_get_absolute_static_status()) + " ";
+ result += "checkres_status:" + std::to_string(uapi_dev_runtime_get_checkres_status()) + " ";
+ result += "repair_download_status:" + std::to_string(uapi_dev_runtime_get_repair_download_status()) + " ";
+ result += "hrs_passivity_status:" + std::to_string(uapi_dev_runtime_get_hrs_passivity_flag()) + " ";
+ result += "mmc_status:" + std::to_string(uapi_dev_runtime_get_mmc_status_flag()) + " ";
+ result += "rwlock_status:" + std::to_string(uapi_dev_runtime_get_rwlock_status()) + " ";
+ result += "lock_flag_training:" + std::to_string(uapi_dev_runtime_get_train_storage_status()) + " ";
+ result += "lock_flag_heartrate:" + std::to_string(uapi_dev_runtime_get_heartrate_storage_status()) + " ";
+ result += "lock_flag_blood:" + std::to_string(uapi_dev_runtime_get_bloodoxygen_storage_status()) + " ";
+ result += "lock_flag_sleep:" + std::to_string(uapi_dev_runtime_get_sleep_storage_status());
+
return result;
}
else
{
DebugOutputItemView *debugOutputItemView = static_cast<DebugOutputItemView *>(&view);
- int viewIndex = debugOutputItemView->GetViewIndex();
+ viewIndex = debugOutputItemView->GetViewIndex();
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "viewIndex:%d", viewIndex);
ChangeView(0, 1);
- if (debugOutputLabel == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "debugOutputLabel is nullptr");
- return false;
- }
SetCurViewIndex(viewIndex);
}
+ if (debugOutputLabel == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "debugOutputLabel is nullptr");
+ return false;
+ }
std::string str;
switch (viewIndex)
{
default:
break;
}
-
if (debugOutputLabelButton)
{
- debugOutputLabelButton->SetHeight(debugOutputLabel->GetY() + debugOutputLabel->GetHeight() + 20);
+ debugOutputLabelButton->SetY(debugOutputLabel->GetY() + debugOutputLabel->GetHeight() + 20);
debugOutputLabelButton->Invalidate();
}
debugOutputLabel->Invalidate();
return true;
}
+ void DebugOutputViewEventListener::DestroyTempView(int16_t hideView)
+ {
+ if (hideView == 1)
+ {
+ DebugGroupView->Remove(DebugScrollView[hideView]);
+ if (DebugScrollView[hideView] != nullptr)
+ {
+ DebugScrollView[hideView]->RemoveAll();
+
+ delete debugOutputLabel;
+ debugOutputLabel = nullptr;
+
+ delete debugOutputLabelButton;
+ debugOutputLabelButton = nullptr;
+
+ delete DebugScrollView[1];
+ DebugScrollView[1] = nullptr;
+ }
+ }
+ }
+
void DebugOutputViewEventListener::ChangeView(int16_t hideView, int16_t showView)
{
if (!CheckViewParam(hideView, showView))
DebugScrollView[hideView]->SetVisible(false);
ClickFunc(showView);
DebugScrollView[showView]->SetVisible(true);
+ DestroyTempView(hideView);
RootView::GetInstance()->Invalidate();
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hideView:%d -> showView:%d success!!", hideView, showView);
}
delete DebugScrollView[0];
DebugScrollView[0] = nullptr;
}
- if (DebugScrollView[1] != nullptr)
- {
- DebugScrollView[1]->RemoveAll();
-
- delete debugOutputLabel;
- debugOutputLabel = nullptr;
-
- delete debugOutputLabelButton;
- debugOutputLabelButton = nullptr;
-
- delete DebugScrollView[1];
- DebugScrollView[1] = nullptr;
- }
RootView::GetInstance()->Remove(DebugGroupView);
delete DebugGroupView;
DebugGroupView = nullptr;