From 7057b0daef486ec97efac8bcb98d0a0defac1924 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Fri, 11 Oct 2024 17:47:21 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E6=AF=8F=E6=97=A5=E7=9B=AE?= =?utf8?q?=E6=A0=87model=EF=BC=8C=E4=B8=8D=E5=86=8D=E5=A4=9A=E6=AC=A1?= =?utf8?q?=E8=AF=BB=E5=8F=96config=EF=BC=88=E8=A1=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../msg_center/src/msg_center_customer.cpp | 17 +++++---- .../src/notify/goal_notification.cpp | 35 +++++++++++++++++-- 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 79fb96eba..0b3241acf 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -418,9 +418,9 @@ void MsgCenterNotifystepProc(const Topic topic, Request* req) goal_type=GOAL_STEP; if(get_Is_shouw_falg(goal_type)) { - if(0==ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEP)) + if(OHOS::GoalModel::GetInstance().get_step_goal_show()) { - CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); + CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); } } } @@ -430,7 +430,7 @@ void MsgCenterNotifystepProc(const Topic topic, Request* req) goal_type=GOAL_DISTANCE; if(get_Is_shouw_falg(goal_type)) { - if(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_OTHER)) + if(OHOS::GoalModel::GetInstance().get_other_goal_show()) { CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); } @@ -443,7 +443,7 @@ void MsgCenterNotifystepProc(const Topic topic, Request* req) goal_type=GOAL_FAT; if(get_Is_shouw_falg(goal_type)) { - if(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_OTHER)) + if(OHOS::GoalModel::GetInstance().get_other_goal_show()) { CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); } @@ -455,7 +455,7 @@ void MsgCenterNotifystepProc(const Topic topic, Request* req) goal_type=GOAL_STAND; if(get_Is_shouw_falg(goal_type)) { - if(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_OTHER)) + if(OHOS::GoalModel::GetInstance().get_other_goal_show()) { CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); } @@ -467,7 +467,7 @@ void MsgCenterNotifystepProc(const Topic topic, Request* req) goal_type=GOAL_CALOREIE; if(get_Is_shouw_falg(goal_type)) { - if(ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_OTHER)) + if(OHOS::GoalModel::GetInstance().get_other_goal_show()) { CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1); } @@ -656,6 +656,11 @@ void MsgCenterNotifyNextDayProc(const Topic topic, Request *req) std::bind(&OHOS::BloodOxygenModel::CleanAllData, OHOS::BloodOxygenModel::GetInstance())); /* --------------------------------- 每日目标相关 --------------------------------- */ // 午夜清除运动数据 + for(int i=1;i<6;i++) + { + set_Is_shouw_falg(1,i); + } + do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA, NULL); printf("******nextday is end******\r\n"); #endif 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 49a4610cd..8c58a5476 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 @@ -33,7 +33,7 @@ namespace OHOS static UILabelButtonExt *buttonok_ = nullptr; static UIImageAnimatorView *imageAnimator{nullptr}; static const ImageInfo **winimageInfos; - static ImageAnimatorInfo *winimageAnimatorInfo{nullptr}; + static ImageAnimatorInfo winimageAnimatorInfo[94]{0}; static std::string winbasePath = "/user/res/Training/training_GIF/win/"; void Freegoalview(void) @@ -118,6 +118,37 @@ 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) { @@ -165,7 +196,7 @@ namespace OHOS break; case GOAL_FAT: tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION); - tagString=std::to_string(tag)+"minute"; + tagString=std::to_string(tag)+"min"; break; case GOAL_STAND: tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES); -- 2.17.1