From: Caisking Date: Fri, 30 Jan 2026 03:23:05 +0000 (+0800) Subject: 修复运动识别不会开启传感器 X-Git-Url: http://git.snicker.com.cn/css/html/static/gitweb.css?a=commitdiff_plain;h=1b12944166c158cdd93ea1dd7515eba478614077;p=mirrors%2FFD230.git 修复运动识别不会开启传感器 --- diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp index fdb904d7d..96e3bfc21 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingModel.cpp @@ -1806,8 +1806,23 @@ bool TraingModel::GetMomentum() { ExerciseClass type = GetSportId(); // 开启对应的运动 TraingCardPresenter::GetInstance()->OpenSensor(type); - // 设置为手表开启运动 - SetSportOpenWay(false); + + TraingCardPresenter::GetInstance()->ControlSensor(ExerciseState::Start); + TraingModel::GetInstance()->SetSportOpenWay(false); // 运动识别由手表开启,非用户点击 + //开启心率 + TraingModel::GetInstance()->start_training_heart(); + // 仅需要GPS的运动才开启GPS定时器(与TraingNomalPresenter::OnStart一致) + if (TraingModel::GetInstance()->IsNeedGPS(TraingModel::GetInstance()->GetSportEvent())) { + #if defined(SUPPORT_GNSS) + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "该运动需要GPS,开启gps定时器,频率:2秒/点"); + TraingModel::GetInstance()->gnss_start_timer(2 * 1000); // 2秒一个GPS点 + #endif + } else { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "该运动不需要GPS,不开启GPS定时器"); + } + // 快捷训练都属于健身类 + // 运动识别,跑步,走路,骑行,划船机,椭圆机,都属于健身类 + SetSportType(Exercisetype::FITNESS); } /* -------------------------------------------------------------------------- */