[8.2.2][fix]解决多次到站的问题

This commit is contained in:
chenfufeng
2025-09-23 13:28:28 +08:00
parent e15368a45a
commit 885cd907b3
3 changed files with 13 additions and 2 deletions

View File

@@ -72,13 +72,20 @@ object LineManager : CallerBase<ILineCallback>() {
/**
* 起始站点
*/
@Volatile
private var startStation: BusStationBean? = null
/**
* 结束站点
*/
@Volatile
private var endStation: BusStationBean? = null
/**
* 上次到站的siteId
*/
@Volatile
var lastArrivedSiteId = -1
/**
* 和[autopilotId]相关 默认为true
@@ -155,7 +162,8 @@ object LineManager : CallerBase<ILineCallback>() {
private val mMapLocationListener = object : IMoGoChassisLocationGCJ02Listener {
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
if (null == mogoLocation) return
getStations { start, end ->
getStations { _, end ->
if (end.siteId == lastArrivedSiteId) return@getStations
val startLon = end.gcjLon
val startLat = end.gcjLat
val distance = CoordinateUtils.calculateLineDistance(