[8.3.0]BUS增加到站不停车

This commit is contained in:
xuxinchao
2025-12-10 20:57:19 +08:00
parent c438305242
commit c1d84c4aa7
5 changed files with 37 additions and 9 deletions

View File

@@ -69,6 +69,9 @@ object LineModel {
// 当前站点
@JvmStatic
var startStationIndex: Int = 0 //A->B 此处值是A站点索引
//下一站点
@JvmStatic
var nextStationIndex: Int = 0
@JvmStatic
fun init() {

View File

@@ -485,10 +485,16 @@ object OrderModel {
ThirdDeviceData.arriveStation()
d(TAG, "arrivedStation onComplete")
LineModel.stationList?.let {
LineModel.startStationIndex +=1
//此处始发站应为上段路程的终点站
LineModel.startStationIndex = LineModel.nextStationIndex
val startStation = LineManager.getStations().second
if(LineModel.startStationIndex +1< it.size){
val endStation = it[LineModel.startStationIndex +1]
//遍历当前路段起始点之后的数组,第一个正常停靠点即为该段终点
val subStationList = it.subList(LineModel.startStationIndex+1,it.size)
val endStation = subStationList.firstOrNull {bean->
bean.tag != 2 }
LineModel.nextStationIndex = it.indexOf(endStation)
// val endStation = stationlist[LineModel.startStationIndex + 1]
LineManager.setStartAndEndStation(startStation,endStation)
LineModel.callEyeMap(5)
}
@@ -501,10 +507,16 @@ object OrderModel {
ThirdDeviceData.arriveStation()
d(TAG, "arrivedStation onComplete")
LineModel.stationList?.let {
LineModel.startStationIndex +=1
//此处始发站应为上段路程的终点站
LineModel.startStationIndex = LineModel.nextStationIndex
val startStation = LineManager.getStations().second
if(LineModel.startStationIndex +1< it.size){
val endStation = it[LineModel.startStationIndex +1]
//遍历当前路段起始点之后的数组,第一个正常停靠点即为该段终点
val subStationList = it.subList(LineModel.startStationIndex+1,it.size)
val endStation = subStationList.firstOrNull {bean->
bean.tag != 2 }
LineModel.nextStationIndex = it.indexOf(endStation)
// val endStation = stationlist[LineModel.startStationIndex + 1]
LineManager.setStartAndEndStation(startStation,endStation)
LineModel.callEyeMap(6)
}

View File

@@ -127,7 +127,12 @@ class NormalRepository: ILineRepository {
LineModel.stationList?.let { stationlist->
val startStation = stationlist[LineModel.startStationIndex]
if (LineModel.startStationIndex < stationlist.size-1) {
val endStation = stationlist[LineModel.startStationIndex + 1]
//遍历当前路段起始点之后的数组,第一个正常停靠点即为该段终点
val subStationList = stationlist.subList(LineModel.startStationIndex+1,stationlist.size)
val endStation = subStationList.firstOrNull {bean->
bean.tag != 2 }
// val endStation = stationlist[LineModel.startStationIndex + 1]
LineModel.nextStationIndex = stationlist.indexOf(endStation)
LineManager.setStartAndEndStation(startStation,endStation)
LineModel.callEyeMap(7)
}

View File

@@ -111,7 +111,12 @@ class WeaknetRepository : ILineRepository {
LineModel.stationList?.let { stationlist->
val startStation = stationlist[LineModel.startStationIndex]
if (LineModel.startStationIndex < stationlist.size-1) {
val endStation = stationlist[LineModel.startStationIndex + 1]
//遍历当前路段起始点之后的数组,第一个正常停靠点即为该段终点
val subStationList = stationlist.subList(LineModel.startStationIndex+1,stationlist.size)
val endStation = subStationList.firstOrNull {bean->
bean.tag != 2 }
LineModel.nextStationIndex = stationlist.indexOf(endStation)
// val endStation = stationlist[LineModel.startStationIndex + 1]
LineManager.setStartAndEndStation(startStation,endStation)
LineModel.callEyeMap(8)
}
@@ -349,6 +354,9 @@ class WeaknetRepository : ILineRepository {
return TaskDb.startTask(shiftsId,taskId, lineId, lineName)
}
/**
* 滑动出发
*/
override fun leaveStation(
seq: Int,
siteId: Long,

View File

@@ -66,7 +66,7 @@ class TaskRunningAdapter(
val line = mData[currentPosition]
holder.actvStationName.text = line.name
holder.actvWriteOffCount.setSiteId(line.siteId)
val startStationIndex = LineModel.startStationIndex
val startStationIndex = LineModel.startStationIndex //当前站点
if (startStationIndex > 0) {
CallerLogger.d(TAG, "位置:$currentPosition 当前站${mData[startStationIndex]} ")
}
@@ -249,8 +249,8 @@ class TaskRunningAdapter(
}
}
}
if (currentPosition == startStationIndex + 1) {
val preLine = mData[currentPosition - 1]
if (currentPosition == LineModel.nextStationIndex) {
val preLine = mData[startStationIndex]
if (preLine.isLeaving) {
holder.itemView.setBackgroundResource(R.drawable.bus_task_current_station_bg)
} else {