From: hcj <1224667075@qq.com> Date: Thu, 24 Oct 2024 06:36:44 +0000 (+0800) Subject: 修改目标达成窗口 X-Git-Tag: fd230_release_V1.3.102~193^2~1^2~3 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=8086f8c29e8ba09f5e8153b06cf3db2b8406d707;p=mirrors%2FFD230.git 修改目标达成窗口 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp index 8f1584059..ad5a45064 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalmodel.cpp @@ -11,7 +11,7 @@ #include "ActivityModel.h" #include "ConfigModel.h" #include "cywee_hal.h" - +#include "goal_notification.h" namespace OHOS { @@ -25,6 +25,12 @@ 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); diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index 653ca3b79..321ffbf37 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -1355,7 +1355,7 @@ void ble_set_sleep_remind(msg_get_sleep_param_info_t data) 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); @@ -1969,7 +1969,6 @@ void set_goal_stepcount(uint32_t step) 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) @@ -1978,7 +1977,7 @@ 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) @@ -2082,6 +2081,9 @@ void set_goal_other_notification(uint8_t data) OHOS::set_Is_shouw_falg(1,OHOS::GOAL_DISTANCE); } + + SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); + return; } @@ -2093,6 +2095,8 @@ void set_goal_step_notification(uint8_t data) { OHOS::set_Is_shouw_falg(1,OHOS::GOAL_STEP); } + + SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); return; } diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index 7330aad0d..2d58e3e6c 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -2049,11 +2049,15 @@ void SetsleepSetParamCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalD { msg_get_sleep_param_info_t sleep_info; sleep_info.schedule = data[0]; - sleep_info.bedtime_hour= data[1]; - sleep_info.bedtime_min= data[2]; - sleep_info.waketime_hour= data[3]; - sleep_info.waketime_min= data[4]; - sleep_info.bedtime_alarm= data[5]; + if(len>=6) + { + sleep_info.bedtime_hour= data[1]; + sleep_info.bedtime_min= data[2]; + sleep_info.waketime_hour= data[3]; + sleep_info.waketime_min= data[4]; + sleep_info.bedtime_alarm= data[5]; + } + ble_set_sleep_remind(sleep_info); sendBuf[17] = 1; diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp index 8e1960a10..880c9bc04 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/goal_notification.cpp @@ -34,7 +34,7 @@ namespace OHOS 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/"; @@ -100,10 +100,65 @@ namespace OHOS 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: @@ -123,58 +178,34 @@ namespace OHOS } } - // 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: