From d27d65433488da8127db8d1750b4a7f874513ab1 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 2 Dec 2021 16:57:30 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=E5=8E=BB=E6=8E=89=E7=BA=A2=E7=BB=BF?= =?UTF-8?q?=E7=81=AF=E8=AF=AF=E5=B7=AE=E6=97=B6=E9=97=B4=E7=9A=84=E8=BF=87?= =?UTF-8?q?=E6=B8=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../redlightwarning/RedLightWarningManager.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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 964be8caf0..d8d1f500ba 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 @@ -115,13 +115,13 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, when { trafficLightStatus.isRed() -> { Logger.d(TAG, "=====当前为红灯=====") - // 到达路口时红灯还没走完(由于多个数据有偏差,红灯预警延长1s,绿灯提示延长3s,多报出错不如少报且准) + // 到达路口时红灯还没走完(由于多个数据有偏差,红灯预警延长1s,绿灯提示条件延长1.5s,多报出错不如少报且准) if (arriveTime <= remainTime + 1) { redLightWarning() - } else if (arriveTime > remainTime + trafficLightResult.flashYellow + 3) {// 到达时红、黄灯都走完 + } else if (arriveTime > remainTime + trafficLightResult.flashYellow + 1.5) {// 到达时红、黄灯都走完 // 单位Km/h,当前为红灯,推荐速度越慢越容易绿灯通过,且要满足[10,50] val originRemainSpeed = - floor(distance / (remainTime + trafficLightResult.flashYellow + 3) * 3.6).toInt() + floor(distance / (remainTime + trafficLightResult.flashYellow + 1.5) * 3.6).toInt() when { originRemainSpeed > 50 -> greenLightWarning("10到50") originRemainSpeed in 10..50 -> greenLightWarning("10到$originRemainSpeed") @@ -130,12 +130,12 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, } trafficLightStatus.isYellow() -> { Logger.d(TAG, "=====当前为黄灯=====") - // 到达路口时黄灯还没走完(由于多个数据有偏差,红灯预警延长1s,绿灯提示延长3s,多报出错不如少报且准) + // 到达路口时黄灯还没走完(由于多个数据有偏差,红灯预警延长1s,绿灯提示延长1.5s,多报出错不如少报且准) if (arriveTime <= remainTime + 1) { redLightWarning() - } else if (arriveTime > remainTime + 3) { + } else if (arriveTime > remainTime + 1.5) { // 单位Km/h,当前为黄灯,推荐速度越慢越容易绿灯通过,且要满足[10,50] - val originRemainSpeed = floor(distance / (remainTime + 3) * 3.6).toInt() + val originRemainSpeed = floor(distance / (remainTime + 1.5) * 3.6).toInt() when { originRemainSpeed > 50 -> greenLightWarning("10到50") originRemainSpeed in 10..50 -> greenLightWarning("10到$originRemainSpeed") @@ -147,9 +147,9 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, // 到达路口时绿灯已经走完(由于多个数据有偏差,多报出错不如少报且准,绿灯时间减少一点) if (arriveTime >= remainTime - 1) { redLightWarning() - } else if (arriveTime < remainTime - 3) { + } else if (arriveTime < remainTime - 1.5) { // 单位Km/h,当前为绿灯,推荐速度越快越容易绿灯通过,且要满足[10,50] - val originRemainSpeed = ceil(distance / (remainTime - 3) * 3.6).toInt() + val originRemainSpeed = ceil(distance / (remainTime - 1.5) * 3.6).toInt() when { originRemainSpeed < 10 -> greenLightWarning("10到50") originRemainSpeed in 10..50 -> greenLightWarning("${originRemainSpeed}到50")