From d440efea4ece937c27c5bb32a5088eb842c4da81 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Mon, 28 Oct 2024 17:03:30 +0800 Subject: [PATCH] =?utf8?q?=E8=AE=AD=E7=BB=83=EF=BC=9A=E4=BC=98=E5=8C=96?= =?utf8?q?=E8=AE=AD=E7=BB=83=E8=BF=87=E7=A8=8B=E4=B8=AD=E6=95=B0=E6=8D=AE?= =?utf8?q?=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../wearable/fd230app/nativeui/traing/src/TraingModel.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp index 61d41fc45..d0316be2d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingModel.cpp @@ -1498,9 +1498,6 @@ std::string TraingModel::DisplayMotionDuration() { if (g_motionTimes > 0) { sportdata->duration = g_motionTimes; // 设置训练时长 - // 检查并发送实时数据 - SendLiveDataIfNecessary(); - // 每分钟进行配速和心率数据存储 StoreDataIfMinutePassed(); } @@ -1513,7 +1510,7 @@ void TraingModel::SendLiveDataIfNecessary() { // 检查自动获取的配置 if (user_autoget) { // 发送实时数据 - if (sportdata->duration % user_freq == 0) { + if (g_motionTimes % user_freq == 0) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SendLiveData is OK\r\n"); SendLiveData(); // 发送实时数据 } @@ -1539,6 +1536,8 @@ extern "C" { /* 定时器回调函数 */ void TraingTimerCallback() { g_motionTimes++; + // 检查并发送实时数据 + OHOS::TraingModel::GetInstance()->SendLiveDataIfNecessary(); #if 0 TraingCardPresenter *gTraingCardPresenter = TraingCardPresenter::GetInstance(); if (gTraingCardPresenter == nullptr) -- 2.17.1