From: Caisking Date: Fri, 10 Oct 2025 09:33:20 +0000 (+0800) Subject: 修复自由运动不会进行心率检测 X-Git-Tag: V1.0.9_20251128_194606_LN~212^2~39 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=bc79cbe834f82c45f5a3bbe433a2a9d3e15795f9;p=mirrors%2FFD230.git 修复自由运动不会进行心率检测 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp index 451183906..fe7f65606 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp @@ -47,7 +47,11 @@ namespace OHOS void TraingNomalPresenter::OnStart() { - TraingModel::GetInstance()->gnss_start_timer(1000); + //判断是否是需要GPS的运动 + if(TraingModel::GetInstance()->IsNeedGPS(TraingModel::GetInstance()->GetSportEvent()) == true) + { + TraingModel::GetInstance()->gnss_start_timer(1000); + } Presenter::OnStart(); } @@ -81,7 +85,7 @@ namespace OHOS // 关闭gps与心率 TraingModel::GetInstance()->stop_heart_gps(); // 关闭gps定时器 - TraingModel::GetInstance()->gnss_start_timer(); + TraingModel::GetInstance()->gnss_stop_timer(); } } bool TraingNomalPresenter::OnDrag(UIView &view, const DragEvent &event) diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp index 451183906..d435d1d70 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp @@ -47,7 +47,11 @@ namespace OHOS void TraingNomalPresenter::OnStart() { - TraingModel::GetInstance()->gnss_start_timer(1000); + //判断是否是需要GPS的运动 + if(TraingModel::GetInstance()->IsNeedGPS(TraingModel::GetInstance()->GetSportEvent()) == true) + { + TraingModel::GetInstance()->gnss_start_timer(1000); + } Presenter::OnStart(); } @@ -81,7 +85,7 @@ namespace OHOS // 关闭gps与心率 TraingModel::GetInstance()->stop_heart_gps(); // 关闭gps定时器 - TraingModel::GetInstance()->gnss_start_timer(); + TraingModel::GetInstance()->gnss_stop_timer(); } } bool TraingNomalPresenter::OnDrag(UIView &view, const DragEvent &event) diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp index 451183906..fe7f65606 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/traing/src/TraingNomalPresenter.cpp @@ -47,7 +47,11 @@ namespace OHOS void TraingNomalPresenter::OnStart() { - TraingModel::GetInstance()->gnss_start_timer(1000); + //判断是否是需要GPS的运动 + if(TraingModel::GetInstance()->IsNeedGPS(TraingModel::GetInstance()->GetSportEvent()) == true) + { + TraingModel::GetInstance()->gnss_start_timer(1000); + } Presenter::OnStart(); } @@ -81,7 +85,7 @@ namespace OHOS // 关闭gps与心率 TraingModel::GetInstance()->stop_heart_gps(); // 关闭gps定时器 - TraingModel::GetInstance()->gnss_start_timer(); + TraingModel::GetInstance()->gnss_stop_timer(); } } bool TraingNomalPresenter::OnDrag(UIView &view, const DragEvent &event)