From bc79cbe834f82c45f5a3bbe433a2a9d3e15795f9 Mon Sep 17 00:00:00 2001 From: Caisking Date: Fri, 10 Oct 2025 17:33:20 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E7=94=B1=E8=BF=90?= =?utf8?q?=E5=8A=A8=E4=B8=8D=E4=BC=9A=E8=BF=9B=E8=A1=8C=E5=BF=83=E7=8E=87?= =?utf8?q?=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/traing/src/TraingNomalPresenter.cpp | 8 ++++++-- .../nativeui/traing/src/TraingNomalPresenter.cpp | 8 ++++++-- .../nativeui/traing/src/TraingNomalPresenter.cpp | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) 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) -- 2.17.1