[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(

View File

@@ -266,6 +266,7 @@ object LineModel {
it.value.onCompleteTaskFail()
}
}
LineManager.lastArrivedSiteId = -1
}
override fun onComplete() {
@@ -296,6 +297,7 @@ object LineModel {
"taskId:${currentTask?.taskId}--lineInfo:${LineManager.lineInfos}"
OchChainLogManager.writeChainLog("结束任务", changeInfo)
}
LineManager.lastArrivedSiteId = -1
onComplete()
}
})

View File

@@ -234,7 +234,6 @@ object OrderModel {
d(TAG, "结束当前路线abortTask")
removeTipRunnables()
LineModel.endTask()
}
}
@@ -464,6 +463,7 @@ object OrderModel {
if (isArrivedStation) return@getStations
OchChainLogManager.writeChainLog("触发进站", type)
LineManager.lastArrivedSiteId = end.siteId
isArrivedStation = true
isGoingToNextStation = false
start.drivingStatus = TaskSiteDataBean.drivingStatusPassed
@@ -542,6 +542,7 @@ object OrderModel {
MogoStatusManager.getInstance().setTaxiUnmanedDriverLineRoutingVerifyMode(TAG, false)
CallerSopSettingManager.invokeRoutingListener(false)
MapMakerManager.removeAllMapMarkerByOwner(TAG)
LineManager.lastArrivedSiteId = -1
BusTrajectoryManager.stopTrajReqLoop()
LoginStatusManager.loginOut()
}