}\r
broadcastApi->PublishTopic((IUnknown *)broadcastApi, &request);\r
broadcastApi->Release((IUnknown *)broadcastApi);\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ChargerEventPublish end!!");\r
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmEventPublish end!!");\r
\r
return;\r
}\r
#ifdef SUPPORT_BLE_SERVICE
//unused(req);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyBindProc Bind!");
- // const power_display_svr_api_t *display_api = power_display_svr_get_api();
- // if (display_api->get_screen_state() != SCREEN_ON)
- // {
- // display_api->turn_on_screen();
- // }
+ const power_display_svr_api_t *display_api = power_display_svr_get_api();
+ if (display_api->get_screen_state() != SCREEN_ON)
+ {
+ display_api->turn_on_screen();
+ }
uint8_t* data=(uint8_t*)req->data;
/* 安全:固定上限 + 显式终止 */
const size_t kMaxDevName = 64;
//运动目标通知
void MsgCenterNotifyGoalShowViewProc(const Topic topic, Request* req)
{
- unused(req);
- if (CheckPriority(topic))
- {
- uint8_t* data=(uint8_t*)req->data;
- if(get_Is_show_flag(data[0]))
- {
- set_goal_flag_view(data[0]);
- set_Is_show_flag(0,data[0]);
-
- const power_display_svr_api_t *display_api = power_display_svr_get_api();
-
- uapi_set_screen_on_api();
-
- NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
- NotificationManager::GetInstance()->ShowNotify(ShowGoalNotify, static_cast<uint16_t>(topic), true);
- }
- }
+ unused(req);
+ WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyGoalShowViewProc目标达成 !");
+ if (CheckPriority(topic))
+ {
+ uint8_t* data=(uint8_t*)req->data;
+ if(get_Is_show_flag(data[0]))
+ {
+ set_goal_flag_view(data[0]);
+ set_Is_show_flag(0,data[0]);
+
+ const power_display_svr_api_t *display_api = power_display_svr_get_api();
+ uapi_set_screen_on_api();
+
+ NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
+ NotificationManager::GetInstance()->ShowNotify(ShowGoalNotify, static_cast<uint16_t>(topic), true);
+ }
+ }
}
//喝水提醒通知
void MsgCenterNotifyDrinkReminderProc(const Topic topic, Request *req)
#include "components/ui_label.h"
#include "components/ui_label_ext.h"
#include "components/ui_label_button_ext.h"
+#include "components/ui_image_view.h"
#include "osal_timer.h"
#include "cmsis_os2.h"
#include "NativeAbility.h"
static const ImageInfo **winimageInfos{nullptr};
static ImageAnimatorInfo *winimageAnimatorInfo{nullptr};
static std::string winbasePath = "/user/res/Training/training_GIF/win/";
+ static UIImageView *image_goalview = nullptr;
static osTimerId_t GoalviewShow_timer = NULL;
delete[] winimageAnimatorInfo;
winimageAnimatorInfo = nullptr;
}
+ if (image_goalview)
+ {
+ delete image_goalview;
+ image_goalview = nullptr;
+ }
if (GoalviewShow_timer)
{
osTimerStop(GoalviewShow_timer);
break;
case GOAL_STEP:
tag = ConfigModel::GetInstance()->get_configData_int(ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT);
- ;
tagString = std::to_string(tag) + "steps";
break;
default:
labeltag->SetTextColor(Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff));
labeltag->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
// 初始化图片数组以及动画
- winimageInfos = CreateImageInfoArray(winbasePath.c_str(), 94);
- winimageAnimatorInfo = new ImageAnimatorInfo[94];
- InitImageAnimatorSource(imageAnimator, winimageAnimatorInfo, winimageInfos,
- 94, 173, 100, 120, 120, "imageAnimator1", 10);
- imageAnimator->Start();
+ // winimageInfos = CreateImageInfoArray(winbasePath.c_str(), 94);
+ // winimageAnimatorInfo = new ImageAnimatorInfo[94];
+ // InitImageAnimatorSource(imageAnimator, winimageAnimatorInfo, winimageInfos,
+ // 94, 173, 100, 120, 120, "imageAnimator1", 10);
+ // imageAnimator->Start();
+
+ if(image_goalview == nullptr)
+ {
+ image_goalview = new UIImageView();
+ image_goalview->SetPosition(173,100,120, 120);
+ image_goalview->SetSrc("/user/res/Training/training_GIF/win/10.bin");
+ }
+
}
static uint8_t GoalviewShowCallBack_FALG = 0;
getView->Add(labelpre);
getView->Add(buttonok_);
getView->Add(labeltag);
- getView->Add(imageAnimator);
+ // getView->Add(imageAnimator);
+ getView->Add(image_goalview);
NotificationManager::GetInstance()->RegisterNotifyCleanupFunction(Freegoalview);
}
else
return ERRCODE_SUCC;
}
+/**
+ * @brief AT^GOALSHOW - Show goal view
+ * Usage: AT^GOALSHOW
+ */
+static uint32_t custom_goal_show(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+{
+ UNUSED(strCommonCmd);
+ // 解析参数(如果提供)
+ uint8_t type_2 = 0;
+ if (para != NULL && paraLen > 0) {
+ type_2 = (uint8_t)atoi((char *)para);
+ }
+ CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&type_2,1);
+ return ERRCODE_SUCC;
+}
+
static const at_cmd_table_t g_custom_utils_cmd[] = {
{ (char *)"AT^CUSTOM_SN", custom_utils_setsn, (char *)"123456789ABCDEF2345678" },
{ (char *)"AT^CUSTOM_SN_REQ", custom_utils_getsn, (char *)" " },
/* SPI1 init/deinit test AT commands */
{ (char *)"AT^SPIINIT", custom_spi_init_test, (char *)" " },
{ (char *)"AT^SPIDEINIT", custom_spi_deinit_test, (char *)" " },
+
+ { (char *)"AT^GOALSHOW", custom_goal_show, (char *)" " },
};
}
broadcastApi->Release((IUnknown *)broadcastApi);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ChargerEventPublish end!!");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CustomEventPublish end!!");
// // 释放内存
// free(publishData);