[bugfix]
[bus 轨迹计算]
This commit is contained in:
yangyakun
2023-09-05 17:38:10 +08:00
parent b16028eb32
commit e53a1739c2
2 changed files with 12 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ object DebugDataDispatch {
when (type) {
globalPathMock -> {
sourceFilePath?.let {
loadRawPoints(ROOT_PATH+it,it)
loadRawPoints(ROOT_PATH+it)
}
}
locationMock -> {
@@ -112,7 +112,7 @@ object DebugDataDispatch {
}
}
fun loadRawPoints(path:String,name:String) {
fun loadRawPoints(path:String) {
val inputStream = FileInputStream(path)
val reader = BufferedReader(InputStreamReader(inputStream))
val jsonStr = StringBuilder()
@@ -137,7 +137,8 @@ object DebugDataDispatch {
newBuilder.addWayPoints(locationBuilder)
}
try {
newBuilder.lineId = name.toLong()
val file = File(path)
newBuilder.lineId = file.name.toLong()
} catch (e: Exception) {
e.printStackTrace()
}

View File

@@ -179,7 +179,14 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{
}
}else{
resetStation()
cleanRoutePoints()
if (this.lineId == 0L || this.lineId == null) {
// 兼容老MAP 不返回轨迹id lineID
}else {
if (this.lineId != lineId) {// bus 切换站点不会切线路
cleanRoutePoints()
TrajectoryCache.deleteCatcheFile()
}
}
stationDistance.clear()
}
this.endStationInfo.stationPoint = endStationInfo