From 5b1735534b9fdb7521cad5a07b7ee8ae4c56decb Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 30 Nov 2021 16:07:32 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=E4=BC=98=E5=8C=96=E4=B8=8B=E7=BB=BF?= =?UTF-8?q?=E7=81=AF=E9=80=9A=E8=A1=8C=E6=8F=90=E7=A4=BA=E7=9A=84=E7=AD=96?= =?UTF-8?q?=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/v2x/redlightwarning/RedLightWarningManager.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt index a512f5a423..24e5e59f6b 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/redlightwarning/RedLightWarningManager.kt @@ -117,7 +117,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, } else if (arriveTime > remainTime + trafficLightResult.flashYellow + 2) {// 到达时红、黄灯都走完 // 单位Km/h,当前为红灯,推荐速度越慢越容易绿灯通过,且要满足[10,50] val originRemainSpeed = - floor(distance / (remainTime + trafficLightResult.flashYellow) * 3.6).toInt() + floor(distance / (remainTime + trafficLightResult.flashYellow + 2) * 3.6).toInt() when { originRemainSpeed > 50 -> greenLightWarning("10到50") originRemainSpeed in 10..50 -> greenLightWarning("10到$originRemainSpeed") @@ -131,7 +131,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, redLightWarning() } else if (arriveTime > remainTime + 2) { // 单位Km/h,当前为黄灯,推荐速度越慢越容易绿灯通过,且要满足[10,50] - val originRemainSpeed = floor(distance / remainTime * 3.6).toInt() + val originRemainSpeed = floor(distance / (remainTime + 2) * 3.6).toInt() when { originRemainSpeed > 50 -> greenLightWarning("10到50") originRemainSpeed in 10..50 -> greenLightWarning("10到$originRemainSpeed") @@ -145,7 +145,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, redLightWarning() } else if (arriveTime < remainTime - 2) { // 单位Km/h,当前为绿灯,推荐速度越快越容易绿灯通过,且要满足[10,50] - val originRemainSpeed = ceil(distance / remainTime * 3.6).toInt() + val originRemainSpeed = ceil(distance / (remainTime - 2) * 3.6).toInt() when { originRemainSpeed < 10 -> greenLightWarning("10到50") originRemainSpeed in 10..50 -> greenLightWarning("${originRemainSpeed}到50")