private:\r
ActivityModel();\r
bool InitStepData(void);\r
- uint32 stepCounter;\r
- uint32 lastSavedValue;\r
+ uint32 stepCounter=0;\r
+ uint32 lastSavedValue=0;\r
int weekToday;\r
};\r
}\r
#include "DialModelCalorie.h"
#include "DialModelDistance.h"
#include "cywee_service.h"
+#include "custom_runtime.h"
+#include "goal/include/goalmodel.h"
+#include "goal/include/goalview.h"
+#include "goal/include/goalother.h"
+#include "goal_notification.h"
+#include "custom_utils.h"
+// #include "goal/include/goalmodel.h"
using namespace std;
#ifdef __cplusplus
}
}
+static uint8_t goal_type=0;
+
static void Notify(void *args, const Topic topic, Request* request)
{
UNUSED(args);
RefreshStepControls(counter, TOPIC_EVENT_STEPDATA_UPDATE);
}
+ #ifdef FD230
+ if(OHOS::GoalView::GetInstance())
+ {
+ OHOS::GoalView::GetInstance()->GoalViewrefresh();
+ }
+ if(OHOS::GoalotherView::GetInstance())
+ {
+ OHOS::GoalotherView::GetInstance()->GoalViewrefresh();
+ }
+
+ if(OHOS::GoalModel::GetInstance().getstepvalue()>=100)
+ {
+
+ goal_type=GOAL_STEP;
+ if(get_Is_shouw_falg(goal_type))
+ {
+ if(OHOS::GoalModel::GetInstance().get_step_goal_show())
+ {
+ CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
+ }
+ }
+ }
+
+ if(OHOS::GoalModel::GetInstance().is_goal_DISTANCE_done())
+ {
+ goal_type=GOAL_DISTANCE;
+ if(get_Is_shouw_falg(goal_type))
+ {
+ if(OHOS::GoalModel::GetInstance().get_other_goal_show())
+ {
+ CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
+ }
+
+ }
+ }
+
+ if(OHOS::GoalModel::GetInstance().is_goal_fatburning_done())
+ {
+ goal_type=GOAL_FAT;
+ if(get_Is_shouw_falg(goal_type))
+ {
+ if(OHOS::GoalModel::GetInstance().get_other_goal_show())
+ {
+ CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
+ }
+ }
+ }
+
+ if(OHOS::GoalModel::GetInstance().is_goal_stand_done())
+ {
+ goal_type=GOAL_STAND;
+ if(get_Is_shouw_falg(goal_type))
+ {
+ if(OHOS::GoalModel::GetInstance().get_other_goal_show())
+ {
+ CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
+ }
+ }
+ }
+
+ if(OHOS::GoalModel::GetInstance().is_goal_calories_done())
+ {
+ goal_type=GOAL_CALOREIE;
+ if(get_Is_shouw_falg(goal_type))
+ {
+ if(OHOS::GoalModel::GetInstance().get_other_goal_show())
+ {
+ CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
+ }
+ }
+ }
+
+#endif
+
if (request->msgId == TOPIC_EVENT_NEXTDAY_UPDATE) {
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "STEP:TOPIC_EVENT_NEXTDAY_UPDATE");
uint8_t GoalModel::getstepvalue()
{
int stepgoal = step;
- int stepdata = OHOS::ActivityModel::GetInstance()->GetStepCounter();
+ int stepdata = get_step_data();//OHOS::ActivityModel::GetInstance()->GetStepCounter();
// WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%d %d %f ",stepdata,stepgoal,((float)stepdata/(float)stepgoal) * 100);
uint8_t value = ((float)stepdata / (float)stepgoal) * 100;
char stepnewstr[20];
char *GoalModel::getstepnew()
{
- int stepdata = OHOS::ActivityModel::GetInstance()->GetStepCounter();
+ int stepdata = get_step_data();
memset((void *)stepnewstr, 0, 20);
sprintf_s(stepnewstr, 20, "%d", stepdata);
return stepnewstr;
}
- static uint8_t goal_type=0;
+
void MsgCenterNotifystepProc(const Topic topic, Request* req)
{
unused(req);
-#ifdef FD230
- if(OHOS::GoalView::GetInstance())
- {
- OHOS::GoalView::GetInstance()->GoalViewrefresh();
- }
- if(OHOS::GoalotherView::GetInstance())
- {
- OHOS::GoalotherView::GetInstance()->GoalViewrefresh();
- }
-
- if(OHOS::GoalModel::GetInstance().getstepvalue()>=100)
- {
-
- goal_type=GOAL_STEP;
- if(get_Is_shouw_falg(goal_type))
- {
- if(OHOS::GoalModel::GetInstance().get_step_goal_show())
- {
- CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
- }
- }
- }
-
- if(OHOS::GoalModel::GetInstance().is_goal_DISTANCE_done())
- {
- goal_type=GOAL_DISTANCE;
- if(get_Is_shouw_falg(goal_type))
- {
- if(OHOS::GoalModel::GetInstance().get_other_goal_show())
- {
- CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
- }
-
- }
- }
-
- if(OHOS::GoalModel::GetInstance().is_goal_fatburning_done())
- {
- goal_type=GOAL_FAT;
- if(get_Is_shouw_falg(goal_type))
- {
- if(OHOS::GoalModel::GetInstance().get_other_goal_show())
- {
- CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
- }
- }
- }
-
- if(OHOS::GoalModel::GetInstance().is_goal_stand_done())
- {
- goal_type=GOAL_STAND;
- if(get_Is_shouw_falg(goal_type))
- {
- if(OHOS::GoalModel::GetInstance().get_other_goal_show())
- {
- CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
- }
- }
- }
- if(OHOS::GoalModel::GetInstance().is_goal_calories_done())
- {
- goal_type=GOAL_CALOREIE;
- if(get_Is_shouw_falg(goal_type))
- {
- if(OHOS::GoalModel::GetInstance().get_other_goal_show())
- {
- CustomEventPublish(TOPIC_EVENT_GOAL_SHOW_VIEW,(uint8_t *)&goal_type,1);
- }
- }
- }
-
-#endif
// The alarm notification is not displayed if the incoming call notification is already being processed
// cywee_save_data();
NotificationManager::GetInstance()->ShowNotify(showSOSNotify, (uint16_t)topic, true);
return;
}
- cat1_call_dial(call_data);
- CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len);
- CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1);
+
+ cat1_call_dial(call_data);
+ CallerLogModel::GetInstance()->SetoperateNumber(call_data,req->len);
+ CallerLogModel::GetInstance()->SetCallSource(CallerLogModel::CallSource::CallSourceCat1);
- cat1_phone_state_change_cb(OPERATE_DIALING);
- NotificationManager::GetInstance()->SetWatchCallStatus(true);
+ cat1_phone_state_change_cb(OPERATE_DIALING);
+ NotificationManager::GetInstance()->SetWatchCallStatus(true);
}
free(call_data);
}