[routing]
[fix]
[站点设置]
This commit is contained in:
yangyakun
2025-07-11 18:49:18 +08:00
parent c3c8ec57e0
commit c66c4739a9
3 changed files with 39 additions and 25 deletions

View File

@@ -54,8 +54,8 @@ class TaskRunningAdapter(
val line = mData[currentPosition]
holder.actvStationName.text = line.name
val startStationIndex = TaskRunningModel.currentIndex
if (startStationIndex > 0) {
CallerLogger.d(TAG, "位置:$currentPosition 当前站${mData[startStationIndex]} ")
if (startStationIndex >= 0) {
CallerLogger.d(TAG, "位置:$currentPosition ${TaskRunningModel.currentIndex} 当前站${mData[startStationIndex]} ")
}
if (currentPosition < startStationIndex) {
@@ -122,7 +122,7 @@ class TaskRunningAdapter(
holder.middleStationBg.visibility = View.GONE
holder.startStationBg.visibility = View.GONE
holder.endStationBg.visibility = View.VISIBLE
if (startStationIndex == itemCount - 1) {
if (startStationIndex == itemCount - 2) {
if (line.isLeaving) {
holder.endStationBg.setBackgroundResource(R.color.common_4DFFFFFF)
holder.itemView.setBackgroundResource(R.drawable.bus_task_current_station_bg)
@@ -198,10 +198,10 @@ class TaskRunningAdapter(
val index = (currentPosition - startStationIndex - 1) * 100
val startFraction = (dex + index) / totalHeight
val endFraction = (dex + index + 100) / totalHeight
CallerLogger.d(
TAG,
"位置:$currentPosition 当前站${startStationIndex} 开始百分比:${startFraction} 结束百分比:${endFraction}"
)
// CallerLogger.d(
// TAG,
// "位置:$currentPosition 当前站${startStationIndex} 开始百分比:${startFraction} 结束百分比:${endFraction}"
// )
val startColorTemp =
argbEvaluator.evaluate(startFraction, startColor, endColor) as Int
val endColorTemp =

View File

@@ -75,6 +75,12 @@ class TaskRunningModel : ViewModel() {
this.currentGrayId = data.taskId
this.stationList = data.stationList
currentIndex = 0
this.stationList?.let {
val startStationNext = it[currentIndex]
val endStation = it[currentIndex + 1]
CallerLogger.d(TAG,"setNewData index:${currentIndex} ${startStationNext.name} -- ${endStation.name}")
LineManager.setStartAndEndStation(startStationNext, endStation)
}
MogoStatusManager.getInstance().setTaxiUnmanedDriverLineRoutingPerformTask(TAG, true)
//添加到站监听
OchAutoPilotStatusListenerManager.addListener(TAG, mMogoAutopilotStatusListener)
@@ -128,7 +134,7 @@ class TaskRunningModel : ViewModel() {
startStation.isLeaving = true
arrivedStation = true
startStation.drivingStatus = 2
LineManager.setStartAndEndStation(startStation, endStation)
CallerLogger.d(TAG,"setNewData index:${currentIndex} ${startStation.name}---${endStation.name}")
this.viewCallback?.notifyItemChange(currentIndex)
this.viewCallback?.showArriverStationAndCompleteTask()
if (CallerAutoPilotStatusListenerManager.getState() == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
@@ -141,6 +147,29 @@ class TaskRunningModel : ViewModel() {
}
fun arriveStation() {
stationList?.let {
val startStation = it[currentIndex]
startStation.isLeaving = false
arrivedStation = false
startStation.drivingStatus = 1
if (currentIndex + 2 >= it.size) {
this.viewCallback?.showCompleteTask()
}else {
currentIndex += 1
val startStationNext = it[currentIndex]
val endStation = it[currentIndex + 1]
CallerLogger.d(TAG, "setNewData index:${currentIndex} ${startStationNext.name}----${endStation.name}")
LineManager.setStartAndEndStation(startStationNext, endStation)
}
}
BizLoopManager.runInMainThread{
this.viewCallback?.onArrivedStation()
}
}
interface SwtichLineViewCallback {
// 到站
fun onArrivedStation()
@@ -161,21 +190,6 @@ class TaskRunningModel : ViewModel() {
fun clearData()
}
fun arriveStation() {
stationList?.let {
val startStation = it[currentIndex]
startStation.isLeaving = false
arrivedStation = false
startStation.drivingStatus = 1
}
currentIndex += 1
LineManager.setStartAndEndStation(null,null)
BizLoopManager.runInMainThread{
this.viewCallback?.onArrivedStation()
}
}
/**
* 结束灰度任务
*/

View File

@@ -81,7 +81,7 @@ class TaskRunningView : ConstraintLayout, TaskRunningModel.SwtichLineViewCallbac
// 滑动出发
aciv_task_leave_station_slide_bg.setSlideListener(object : CommonSlideView.SlideListener {
override fun slideEnd() {
if (TaskRunningModel.currentIndex == mAdapter.mData.size-1) {
if (TaskRunningModel.currentIndex == mAdapter.mData.size-2) {
aciv_task_leave_station_slide_bg.setTextValue("单程结束")
aciv_task_leave_station_slide_bg.reset()
viewModel?.data?.taskId?.let {
@@ -195,7 +195,7 @@ class TaskRunningView : ConstraintLayout, TaskRunningModel.SwtichLineViewCallbac
showLeaveStationView()
loading_arrive_station.visibility = GONE
notifyItemChange(0)
if (TaskRunningModel.currentIndex == mAdapter.mData.size-1) {
if (TaskRunningModel.currentIndex == mAdapter.mData.size-2) {
aciv_task_leave_station_slide_bg.setTextValue("单程结束")
} else {
aciv_task_leave_station_slide_bg.setTextValue("滑动出发")