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")