healthState.checkType = BLOOD_CHECK;
healthState.resultStatus = LOW;
healthState.checkResult = MiniBlood;
- // HealthService::GetInstance()->SetHealthCurrent(healthState);
+ HealthService::GetInstance()->SetHealthCurrent(healthState);
//保存异常数据
Blood_Save();
NativeAbility::GetInstance().ChangeSlice(VIEW_CHECK_INVALID);
#include "cywee_service.h"
#endif
-// #include "battery_hal.h"
+#include "battery_hal.h"
#include "health/health_service/health_service.h"
{
if (strcmp(view.GetViewId(), CLICK_BLOOD) == 0)
{
- // // 如果正在充电进入提醒界面
- // if (get_charge_stat())
- // {
- // HealthState highHealthState;
- // highHealthState.checkType = CHARGE;
- // HealthService::GetInstance()->SetHealthCurrent(highHealthState);
- // NativeAbility::GetInstance().ChangeSlice(VIEW_CHECK_INVALID, TransitionType::TRANSITION_BACK_TO_HEXAGONS);
- // }
- // else
- // {
+ // 如果正在充电进入提醒界面
+ if (get_charge_stat())
+ {
+ HealthState highHealthState;
+ highHealthState.checkType = CHARGE;
+ HealthService::GetInstance()->SetHealthCurrent(highHealthState);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_CHECK_INVALID, TransitionType::TRANSITION_BACK_TO_HEXAGONS);
+ }
+ else
+ {
NativeAbility::GetInstance().EnterSlice(VIEW_BLOOD_CHECK, TransitionType::TRANSITION_BACK_TO_HEXAGONS);
- // }
+ }
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodPresenter::OnClick");
return true;
#include "MainModel.h"
#include "MainPresenterSample.h"
#include "SetDialModel.h"
-// #include "battery_hal.h"
+ #include "battery_hal.h"
#include "common/image_cache_manager.h"
#include "components/ui_label.h"
#include "custom_runtime.h"
#include "MainModel.h"
#include "health/health_service/health_service.h"
-// #include "battery_hal.h"
+#include "battery_hal.h"
#include "NativeRegisterManager.h"
if (strcmp(view.GetViewId(), CLICK_BLOOD_RE) == 0)
{
// 检测过程中充电 失败可以弹窗
- // bool isCharging = get_charge_stat(); // 获取充电状态
- bool isCharging = false;
+ bool isCharging = get_charge_stat(); // 获取充电状态
if (isCharging)
{
#include "KeyInputListener.h"
#include "common/key_code.h"
-// #include "battery_hal.h"
+#include "battery_hal.h"
#include "heartrate/include/HeartResultView.h"
}\r
SetAveHeartRateCount(0);\r
// GraphicService::GetInstance()->PostGraphicEvent(\r
- // std::bind(&HeartModel::RefreshHeartRateScreen,\r
- // HeartModel::GetInstance(),\r
- // healthDatas.heartRatePerSec,healthDatas.heartRateRest,\r
- // healthDatas.heartRateMax.y,healthDatas.heartRateMin.y));\r
+ // std::bind(&HeartModel::RefreshHeartRateScreen, HeartModel::GetInstance(),\r
+ // healthDatas.heartRatePerSec, healthDatas.heartRateRest,\r
+ // healthDatas.heartRateMax.y, healthDatas.heartRateMin.y));\r
}\r
\r
HeartModel::HeartModel() {\r
}\r
\r
// GraphicService::GetInstance()->PostGraphicEvent(\r
- // std::bind(&HeartModel::RefreshHeartRateScreen,\r
- // HeartModel::GetInstance(),\r
- // healthDatas.heartRatePerSec,healthDatas.heartRateRest,\r
- // healthDatas.heartRateMax.y,healthDatas.heartRateMin.y));\r
+ // std::bind(&HeartModel::RefreshHeartRateScreen, HeartModel::GetInstance(),\r
+ // healthDatas.heartRatePerSec, healthDatas.heartRateRest,\r
+ // healthDatas.heartRateMax.y, healthDatas.heartRateMin.y));\r
}\r
\r
uint16_t HeartModel::GetAveHeartRateCount(void) { return aveCount; }\r
}\r
\r
if (state == HeartState::End && heartstate == true) {\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HeartState End");\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartState End");\r
//状态数全部清空\r
valid_counter_ = 0;\r
disvalid_counter_ = 0;\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "充电不能检测");\r
return;\r
}\r
-\r
-#ifdef SUPPORT_PPG_SERVICE\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "HeartState Start");\r
+#ifdef SUPPORT_PPG_SERVICE\r
uint8_t md = PPG_SERVICE_CMD_TYPE_DO_PPG_TEST;\r
send_ppg_cmd_msg(md);\r
#endif\r
std::bind(heart_data_callbackProc, data));\r
}\r
void HeartModel::heart_data_timer(uint32_t interval) {\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HeartModel::heart_start_screen60s_timer");\r
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,\r
+ "HeartModel::heart_start_screen60s_timer");\r
if (g_data_timer != nullptr) {\r
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Timer already exists!!");\r
return;\r
}\r
- g_data_timer = osTimerNew((osTimerFunc_t)heart_data_timer_callback, osTimerPeriodic, nullptr, nullptr);\r
+ g_data_timer = osTimerNew((osTimerFunc_t)heart_data_timer_callback,\r
+ osTimerPeriodic, nullptr, nullptr);\r
if (g_data_timer == nullptr) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Timer create failed!!");\r
return;\r
int tick = osMs2Tick(interval);\r
osStatus_t ret = osTimerStart(g_data_timer, tick);\r
if (ret != osOK) {\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "osTimerDelete failed, ret = %lx!!", ret);\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "osTimerDelete failed, ret = %lx!!",\r
+ ret);\r
if (g_data_timer != nullptr) {\r
ret = osTimerDelete(g_data_timer);\r
}\r
#include "cywee_service.h"
#endif
-// #include "battery_hal.h"
+#include "battery_hal.h"
#include "health/health_service/health_service.h"
#include "NativeRegisterManager.h"
if (strcmp(view.GetViewId(), CLICK_HEART) == 0)
{
// 如果正在充电进入提醒界面
- // bool isCharging = get_charge_stat();
- bool isCharging = false;
+ bool isCharging = get_charge_stat();
+ // bool isCharging = false;
if (isCharging)
{
HealthState highHealthState;
#include "heartrate/include/HeartModel.h"
#include "gfx_utils/mem_check.h"
#include "custom_utils.h"
-// #include "traing/training_card/include/Training_CardView.h"
-// #include "dnotdisturb/include/DnotDisturbModel.h"
+#include "traing/training_card/include/Training_CardView.h"
+#include "dnotdisturb/include/DnotDisturbModel.h"
#include "weather/include/WeatherModel.h"
#include "health/health_service/health_service.h"
#include "sleep/include/SleepControlView.h"
#include "sleep/include/SleepCardView.h"
#include "sleep/include/SleepModel.h"
#include "MainModel.h"
-// #include "custom_runtime.h"
-// #include "rebootandshutdown/include/RebootAndShutdownModelC.h"
+#include "custom_runtime.h"
+#include "rebootandshutdown/include/RebootAndShutdownModelC.h"
#if USE_OFFLINE_DIAL
#include "DialViewGroup.h"
return false;
}
- // /*发生点击进入密码锁*/
- // if (uapi_dev_runtime_get_lock_status())
- // {
- // /*进入密码锁*/
- // NativeAbility::GetInstance().ChangeSlice(VIEW_CODED_LOCK);
- // return true;
- // }
+ /*发生点击进入密码锁*/
+ if (uapi_dev_runtime_get_lock_status())
+ {
+ /*进入密码锁*/
+ NativeAbility::GetInstance().ChangeSlice(VIEW_CODED_LOCK);
+ return true;
+ }
if (curViewId == CONNECTEDSTATUSBACKGROUNDBUTTON)
{
MainModel::GetInstance().SetFromSetCardView(true);
MainModel::GetInstance().SetFromCardId(BLOODOXGEN);
// 如果正在充电进入提醒界面
- // if (get_charge_stat())
- // {
- // HealthState highHealthState;
- // highHealthState.checkType = CHARGE;
- // HealthService::GetInstance()->SetHealthCurrent(highHealthState);
- // NativeAbility::GetInstance().ChangeSlice(VIEW_CHECK_INVALID, TransitionType::TRANSITION_ZOOM);
- // }
+ if (get_charge_stat())
+ {
+ HealthState highHealthState;
+ highHealthState.checkType = CHARGE;
+ HealthService::GetInstance()->SetHealthCurrent(highHealthState);
+ NativeAbility::GetInstance().ChangeSlice(VIEW_CHECK_INVALID, TransitionType::TRANSITION_ZOOM);
+ }
}
// 设置卡片管理进入
if (curViewId == MAIN_CLICK_SETCARD)
*/
if (cardId == WATCH_FACE)
{
- // if (uapi_dev_runtime_get_lock_status())
- // {
- // /*进入密码锁*/
- // NativeAbility::GetInstance().ChangeSlice(VIEW_CODED_LOCK);
- // }
- // else
- // {
+ if (uapi_dev_runtime_get_lock_status())
+ {
+ /*进入密码锁*/
+ NativeAbility::GetInstance().ChangeSlice(VIEW_CODED_LOCK);
+ }
+ else
+ {
/*进入表盘设置*/
NativeAbility::GetInstance().ChangeSlice(VIEW_SET_DIAL);
- // }
+ }
}
return true;
}
void MainPresenterSample::SetCircleProgress()
{
- #if 0
+ #if 1
PlayersView *playersView = dynamic_cast<PlayersView *>(view_->GetViewById(MUSIC_PLAYER));
if (playersView == nullptr)
{
break;
case MUSIC_PLAYER:
- // PlayersModel::GetInstance()->SetCircleProgress();
+ PlayersModel::GetInstance()->SetCircleProgress();
break;
case WATCH_FACE:
/*心率卡片*/
void MainPresenterSample::StartHeartRateDetection()
{
- // HeartModel::GetInstance()->Heart_Control(HeartState::End, HeartCheck::PASSIVITY);
+ HeartModel::GetInstance()->Heart_Control(HeartState::End, HeartCheck::PASSIVITY);
#if HEART_RATE_CHECK_TIMEOUT
- HeartModel::GetInstance()->Heart_Control(HeartState::Start,HeartCheck::CARDCHECK);
+ HeartModel::GetInstance()->Heart_Control(HeartState::Start,HeartCheck::CARDCHECK);
#else
- // HeartModel::GetInstance()->Heart_Start(HeartCheck::CARDCHECK);
+ HeartModel::GetInstance()->Heart_Start(HeartCheck::CARDCHECK);
+ // 更新显示值
+ GraphicService::GetInstance()->PostGraphicEvent(std::bind(&HeartModel::RefreshHeartRateScreen, HeartModel::GetInstance()));
#endif
}
/*主表盘*/
/*睡眠*/
void MainPresenterSample::UpdateSleep()
{
- // GraphicService::GetInstance()->PostGraphicEvent(
- // std::bind(&OHOS::SleepModel::UpdateSleepView, &OHOS::SleepModel::GetInstance()));
+ GraphicService::GetInstance()->PostGraphicEvent(
+ std::bind(&OHOS::SleepModel::UpdateSleepView, &OHOS::SleepModel::GetInstance()));
}
/*天气*/
mainSwipeGroup->SetLoopState(false); // 主界面循环
mainSwipeGroup->EnableScreenCap(true); // 主界面截屏滑动
mainSwipeGroup->RegisterSwipeCallback(callback); // 主界面动画回调
- // /*密码锁上锁*/
- // if (uapi_dev_runtime_get_lock_status())
- // {
- // // 回到表盘
- // SwitchToClockPage();
- // // printf("密码锁\r\n");
- // mainClockView->SetIntercept(true);
- // mainSwipeGroup->SetDraggable(false);
- // mainSwipeGroup->SetOnSwipeListener(nullptr);
- // mainSwipeGroup->SetOnClickListener(presenter_);
- // }
- // else
- // {
+ /*密码锁上锁*/
+ if (uapi_dev_runtime_get_lock_status())
+ {
+ // 回到表盘
+ SwitchToClockPage();
+ // printf("密码锁\r\n");
+ mainClockView->SetIntercept(true);
+ mainSwipeGroup->SetDraggable(false);
+ mainSwipeGroup->SetOnSwipeListener(nullptr);
+ mainSwipeGroup->SetOnClickListener(presenter_);
+ }
+ else
+ {
// 判断是否为从主界面前往的其他Slice
if (presenter_->IsFromSetCardView())
{
// 回到表盘
SwitchToClockPage();
}
- // }
+ }
#ifdef XTS_SUPPORT
/* ----------------------------------- XTS ---------------------------------- */
#include "NativeAbility.h"\r
#include "common/key_code.h"\r
#include "cmsis_os.h"\r
-//#include "battery_hal.h"\r
+#include "battery_hal.h"\r
#include "custom_utils.h"\r
#include "saveele/include/SaveBatPresenter.h"\r
#include "saveele/include/SaveBatView.h"\r
#include "bleService.h"\r
#endif\r
\r
-// #include "battery_hal.h"\r
-// extern uint8_t battery_get_voltage(float *voltage);\r
+#include "battery_hal.h"\r
\r
#include "UiConfig.h"\r
\r
#include "bts_le_gap.h"
#include "bts_br_gap.h"
-// #include "battery_hal.h"
+#include "battery_hal.h"
#include "bleService.h"
#include "alipay_feature.h"
#include "stdbool.h"\r
#include "bts_br_gap.h"\r
\r
-// #include "battery_hal.h"\r
+#include "battery_hal.h"\r
\r
#include "bleService.h"\r
#include "alipay_feature.h"\r
\r
#include "bts_le_gap.h"\r
#include "bts_br_gap.h"\r
-// #include "battery_hal.h"\r
+#include "battery_hal.h"\r
#include "bleService.h"\r
#include "alipay_feature.h"\r
#ifdef AILPAY_SUPPORT\r