From fba6e50a49ad8fd1935440e630bff551d416715c Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 5 Mar 2026 17:16:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E7=AB=99=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/och/unmanned/model/LineModel.kt | 9 +++++++++ .../java/com/mogo/och/unmanned/model/OrderModel.kt | 12 +++++++++--- .../och/unmanned/ui/taskrunning/TaskRunningModel.kt | 9 ++++++++- .../och/unmanned/ui/taskrunning/TaskRunningView.kt | 12 +++++++++++- .../res/layout/shuttle_unmanned_task_running.xml | 2 +- .../src/main/res/values-en/strings.xml | 3 ++- .../driver_unmanned/src/main/res/values/strings.xml | 3 ++- 7 files changed, 42 insertions(+), 8 deletions(-) diff --git a/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/model/LineModel.kt b/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/model/LineModel.kt index 3115812443..f97ca277f2 100644 --- a/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/model/LineModel.kt +++ b/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/model/LineModel.kt @@ -209,6 +209,15 @@ object LineModel { } } + fun isPreLastStation(): Boolean? { + return if (stationList.isNullOrEmpty()) { + null + } else { +// startStationIndex == stationList!!.size - 1 + startStationIndex == getLastStationPos(stationList!!)-1 + } + } + private fun getLastStationPos(stationList: MutableList): Int { for (index in stationList.indices.reversed()) { val item = stationList[index] diff --git a/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/model/OrderModel.kt b/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/model/OrderModel.kt index f828bfd92a..111770a8bd 100644 --- a/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/model/OrderModel.kt +++ b/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/model/OrderModel.kt @@ -125,7 +125,7 @@ object OrderModel { private val ochAutopilotStatusListener = object : IOchAutopilotStatusListener { override fun onAutopilotArriveAtStation(arrivedStation: ArrivedStation?) { e(TAG, "行程日志-onAutopilotArriveAtStation arrive") - onArriveAt(arrivedStation, "底盘触发进站") + onArriveAt(arrivedStation, "底盘触发进站",false) } } @@ -143,7 +143,7 @@ object OrderModel { //是否到站的围栏判断 离站状态并且自动驾驶还未触发到站 if (isGoingToNextStation && !isArrivedStation) { OCHThreadPoolManager.getsInstance().locationExecute { - onArriveAt(null, "兜底:距离站点15m内 每秒钟向底盘查询是否到站 底盘返回") + onArriveAt(null, "兜底:距离站点15m内 每秒钟向底盘查询是否到站 底盘返回",false) } } } @@ -451,7 +451,7 @@ object OrderModel { * @param data */ @JvmStatic - fun onArriveAt(data: ArrivedStation?, type: String) { + fun onArriveAt(data: ArrivedStation?, type: String,skipStation:Boolean) { if (LineManager.getStations().second == null) { e(TAG, "行程日志-到站异常,取消后续操作结束") OchChainLogManager.writeChainLog("shuttle弱网", "$type 行程日志-到站异常,取消后续操作结束") @@ -508,6 +508,9 @@ object OrderModel { } LineModel.arrivedStationSuccess() updateBusStatus() + if(skipStation) { + driveToNextStation() + } } override fun onComplete() { @@ -531,6 +534,9 @@ object OrderModel { } LineModel.arrivedStationSuccess() updateBusStatus() + if(skipStation) { + driveToNextStation() + } } override fun onNext(data: Boolean) { diff --git a/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/ui/taskrunning/TaskRunningModel.kt b/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/ui/taskrunning/TaskRunningModel.kt index ae592b2f3b..f684648fd8 100644 --- a/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/ui/taskrunning/TaskRunningModel.kt +++ b/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/ui/taskrunning/TaskRunningModel.kt @@ -55,7 +55,7 @@ class TaskRunningModel : ViewModel(), IBusLinesCallback { } fun arriveStation() { - OrderModel.onArriveAt(null, "页面触发到站") + OrderModel.onArriveAt(null, "页面触发到站",false) } override fun onArriveStationSuccess() { @@ -80,5 +80,12 @@ class TaskRunningModel : ViewModel(), IBusLinesCallback { OrderModel.completeTask(false) } + fun skipStation() { + if (LineModel.isLastStation() == true) { + return + } + OrderModel.onArriveAt(null, "页面挑站触发到站",true) + } + } diff --git a/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/ui/taskrunning/TaskRunningView.kt b/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/ui/taskrunning/TaskRunningView.kt index b534db4a0e..fd64efd0de 100644 --- a/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/ui/taskrunning/TaskRunningView.kt +++ b/OCH/shuttle/driver_unmanned/src/main/java/com/mogo/och/unmanned/ui/taskrunning/TaskRunningView.kt @@ -81,7 +81,12 @@ class TaskRunningView : ConstraintLayout, TaskRunningModel.SwtichLineViewCallbac }) unmanned_actv_arriver_station.onClick { unmanned_loading_arrive_station.visibility = VISIBLE - viewModel?.arriveStation() + if(LineModel.isPreLastStation()==true){ + viewModel?.arriveStation() + }else{ + viewModel?.skipStation() + } + } unmanned_actv_complete_task.onClick { CallerLogger.d(TAG, "启动自驾参数:${LineManager.initAutopilotControlParameters()}") @@ -176,5 +181,10 @@ class TaskRunningView : ConstraintLayout, TaskRunningModel.SwtichLineViewCallbac private fun showArriverStationAndCompleteTask() { unmanned_aciv_task_leave_station_slide_bg.visibility = INVISIBLE unmanned_task_running_layout_btn.visibility = VISIBLE + if(LineModel.isPreLastStation()==true){ + unmanned_actv_arriver_station.text = StringUtils.getString(R.string.unmanned_bus_running_task_arrive_station) + }else{ + unmanned_actv_arriver_station.text = StringUtils.getString(R.string.unmanned_bus_running_task_jump_station) + } } } diff --git a/OCH/shuttle/driver_unmanned/src/main/res/layout/shuttle_unmanned_task_running.xml b/OCH/shuttle/driver_unmanned/src/main/res/layout/shuttle_unmanned_task_running.xml index 86024eaf12..9f771b6641 100644 --- a/OCH/shuttle/driver_unmanned/src/main/res/layout/shuttle_unmanned_task_running.xml +++ b/OCH/shuttle/driver_unmanned/src/main/res/layout/shuttle_unmanned_task_running.xml @@ -89,7 +89,7 @@ android:layout_height="match_parent" android:background="@drawable/unmanned_bus_switch_task_selector" android:gravity="center" - android:text="@string/unmanned_bus_running_task_arrive_station" + android:text="@string/unmanned_bus_running_task_jump_station" android:textColor="@color/unmanned_bus_task_submit_text_color_selector" android:textSize="@dimen/dp_40" app:layout_constraintBottom_toBottomOf="parent" diff --git a/OCH/shuttle/driver_unmanned/src/main/res/values-en/strings.xml b/OCH/shuttle/driver_unmanned/src/main/res/values-en/strings.xml index fdda224718..56780b7c4d 100644 --- a/OCH/shuttle/driver_unmanned/src/main/res/values-en/strings.xml +++ b/OCH/shuttle/driver_unmanned/src/main/res/values-en/strings.xml @@ -1,6 +1,7 @@ Please select task - Skip a Stop + Skip a Stop + Arrived at Stop Complete Confirm Schedule Return diff --git a/OCH/shuttle/driver_unmanned/src/main/res/values/strings.xml b/OCH/shuttle/driver_unmanned/src/main/res/values/strings.xml index 193cab51b8..6feaddaf9c 100644 --- a/OCH/shuttle/driver_unmanned/src/main/res/values/strings.xml +++ b/OCH/shuttle/driver_unmanned/src/main/res/values/strings.xml @@ -1,6 +1,7 @@ 请选择任务 - 跳站 + 跳站 + 到站 结束 确认班次 返回