[Fix]优化下绿灯通行提示的策略
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user