#include "ActivityModel.h"
#include "ConfigModel.h"
#include "cywee_hal.h"
-
+#include "goal_notification.h"
namespace OHOS
{
void GoalModel::GoalModelInitdata()
{
+ OHOS::set_Is_shouw_falg(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES_TIME),OHOS::GOAL_CALOREIE);
+ OHOS::set_Is_shouw_falg(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES_TIME),OHOS::GOAL_STAND);
+ OHOS::set_Is_shouw_falg(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION_TIME),OHOS::GOAL_FAT);
+ OHOS::set_Is_shouw_falg(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE_TIME),OHOS::GOAL_DISTANCE);
+ OHOS::set_Is_shouw_falg(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT_TIME),OHOS::GOAL_STEP);
+
step_goal_show=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEP);
other_goal_show=ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_OTHER);
OHOS::ConfigModel *p_ConfigModel = OHOS::ConfigModel::GetInstance();
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"开关:%d\r\n",data.schedule);
p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SLEEP,data.schedule);
- if(data.schedule)
+ //if(data.schedule)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"开始时间:%d\r\n",data.bedtime_hour);
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"开始时间:%d\r\n",data.bedtime_min);
OHOS::ConfigModel *p_ConfigModel = OHOS::ConfigModel::GetInstance();
p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT,step);
- SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
return ;
}
void set_goal_caloriescount(uint32_t kcal)
p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES,kcal);
- SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
+
return ;
}
void set_notify_switch(bool on)
OHOS::set_Is_shouw_falg(1,OHOS::GOAL_DISTANCE);
}
+
+ SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
+
return;
}
{
OHOS::set_Is_shouw_falg(1,OHOS::GOAL_STEP);
}
+
+ SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0);
return;
}
static UILabelExt *labelpre = nullptr;
static UILabelButtonExt *buttonok_ = nullptr;
static UIImageAnimatorView *imageAnimator{nullptr};
- static const ImageInfo **winimageInfos;
+ static const ImageInfo **winimageInfos{nullptr};
static ImageAnimatorInfo *winimageAnimatorInfo{nullptr};
static std::string winbasePath = "/user/res/Training/training_GIF/win/";
static uint8_t GOAL_STEP_falg=1;
+ // static uint8_t set_last_show_time(uint8_t type)
+ // {
+
+ // switch (type) {
+ // case GOAL_CALOREIE:
+ // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES);
+ // break;
+ // case GOAL_FAT:
+ // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION);
+ // break;
+ // case GOAL_STAND:
+ // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES);
+ // break;
+ // case GOAL_DISTANCE:
+ // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE);
+ // break;
+ // case GOAL_STEP:
+ // ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT);;
+ // break;
+ // default:
+ // break;
+ // }
+ // }
+
+
+ // static uint8_t get_last_show_time(uint8_t type)
+ // {
+ // uint32_t tagType =flag_goal;
+ // switch (tagType) {
+ // case GOAL_CALOREIE:
+ // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES);
+ // tagString=std::to_string(tag)+"kcal";
+ // break;
+ // case GOAL_FAT:
+ // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION);
+ // tagString=std::to_string(tag)+"min";
+ // break;
+ // case GOAL_STAND:
+ // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES);
+ // tagString=std::to_string(tag)+"times";
+ // break;
+ // case GOAL_DISTANCE:
+ // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE);
+ // tagString=std::to_string(tag)+"km";
+ // break;
+ // case GOAL_STEP:
+ // tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT);;
+ // tagString=std::to_string(tag)+"steps";
+ // break;
+ // default:
+ // break;
+ // }
+ // }
+
uint8_t get_Is_shouw_falg(uint8_t type)
{
switch (type) {
case GOAL_CALOREIE:
+
return GOAL_CALOREIE_falg;
case GOAL_FAT:
}
}
- // static void InitImageAnimatorSource(UIImageAnimatorView *&imageAnimator,
- // ImageAnimatorInfo *&imageAnimatorInfo,
- // const ImageInfo **imageInfo, int numFrames,
- // int left, int top, int width, int height,
- // const char *viewId, int time) {
- // if (imageAnimator == nullptr) {
- // imageAnimator = new UIImageAnimatorView();
- // }
- // imageAnimator->SetPosition(left, top);
- // imageAnimator->Resize(width, height);
- // imageAnimator->SetViewId(viewId);
- // // imageAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
- // imageAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
-
- // // imageAnimatorInfo = new ImageAnimatorInfo[numFrames];
- // for (int i = 0; i < numFrames; i++) {
- // imageAnimatorInfo[i].imageInfo = imageInfo[i];
- // imageAnimatorInfo[i].pos.x = left;
- // imageAnimatorInfo[i].pos.y = top;
- // imageAnimatorInfo[i].width = width;
- // imageAnimatorInfo[i].height = height;
- // imageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO;
- // }
-
- // imageAnimator->SetImageAnimatorSrc(imageAnimatorInfo, numFrames,
- // time); // 200 is the default delay time
- // imageAnimator->SetTimeOfPause(time);
- // imageAnimator->SetRepeat(true);
- // }
-
uint8_t set_Is_shouw_falg(uint8_t flag,uint8_t type)
{
switch (type) {
case GOAL_CALOREIE:
+
GOAL_CALOREIE_falg=flag;
+ ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES_TIME,flag);
break;
case GOAL_FAT:
GOAL_FAT_falg=flag;
+ ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION_TIME,flag);
break;
case GOAL_STAND:
GOAL_STAND_falg=flag;
+ ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES_TIME,flag);
break;
case GOAL_DISTANCE:
GOAL_DISTANCE_falg=flag;
+ ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE_TIME,flag);
break;
case GOAL_STEP:
GOAL_STEP_falg=flag;
+ ConfigModel::GetInstance()->set_condigData_Int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT_TIME,flag);
break;
default: