From ec187cd2ac7abd5f298c33f39cea5809e9683b0d Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 29 May 2025 09:51:00 +0800 Subject: [PATCH] =?UTF-8?q?[8.0.0]=20[fea]=20[bus=20routing=20=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=BC=A0=E9=80=92]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/runing/other/TaskRunningModel.kt | 7 ++++- .../och/bridge/autopilot/line/LineManager.kt | 30 +++++++++++++------ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningModel.kt b/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningModel.kt index 7f8610fbf5..5d739381cb 100644 --- a/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningModel.kt +++ b/OCH/common/biz/src/main/java/com/mogo/och/biz/routing/ui/runing/other/TaskRunningModel.kt @@ -4,10 +4,11 @@ import androidx.lifecycle.ViewModel import com.mogo.commons.AbsMogoApplication import com.mogo.commons.module.status.MogoStatusManager import com.mogo.eagle.core.data.BaseData +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.och.CallerEagleBaseFunctionCall4OchManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON import com.mogo.eagle.core.utilcode.util.GsonUtils import com.mogo.eagle.core.utilcode.util.NetworkUtils @@ -126,6 +127,10 @@ class TaskRunningModel : ViewModel() { LineManager.setStartAndEndStation(startStation, endStation) this.viewCallback?.notifyItemChange(currentIndex) this.viewCallback?.showArriverStationAndCompleteTask() + if (CallerAutoPilotStatusListenerManager.getState() == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING + ) { + LineManager.startAutopilot() + } } } diff --git a/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/line/LineManager.kt b/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/line/LineManager.kt index 59f594eb3c..1b9ad24c1b 100644 --- a/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/line/LineManager.kt +++ b/OCH/common/bridge/src/main/java/com/mogo/och/bridge/autopilot/line/LineManager.kt @@ -403,8 +403,8 @@ object LineManager : CallerBase() { parameters?.routeName = lineInfo.lineName parameters?.startName = start.name ?: "" parameters?.endName = end.name ?: "" - parameters?.startLatLon = AutoPilotLonLat(start.lat, start.lon) - parameters?.endLatLon = AutoPilotLonLat(end.lat, end.lon) + parameters?.startLatLon = AutoPilotLonLat(start.lat, start.lon,true) + parameters?.endLatLon = AutoPilotLonLat(end.lat, end.lon,true) if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { parameters?.vehicleType = 9 } else { @@ -465,10 +465,10 @@ object LineManager : CallerBase() { parameters.routeName = lineInfos?.lineName?:"" lineInfos?.siteInfos?.let { if(it.size>=0){ - parameters.startLatLon = AutoPilotLonLat(it.first().lat, it.first().lon) - parameters.endLatLon = AutoPilotLonLat(it[1].lat, it[1].lon) + parameters.startLatLon = AutoPilotLonLat(it.first().lat, it.first().lon,true) + parameters.endLatLon = AutoPilotLonLat(it.last().lat, it.last().lon,true) parameters.startName = it.first().name ?: "" - parameters.endName = it[1].name ?: "" + parameters.endName = it.last().name ?: "" } } if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { @@ -497,12 +497,24 @@ object LineManager : CallerBase() { 0L ) } - if(contraiInfo!=null) { - val (wayLatLons, blackLatLons) = contraiInfo!!.getWayBlackLatLons() - parameters.wayLatLons = wayLatLons - parameters.blackLatLons = blackLatLons + + val wayLatLons = mutableListOf() + val blackLatLons = mutableListOf() + lineInfos?.siteInfos?.forEachIndexed { index, site -> + if(index>0){ + val (wayLatLonsSite, blackLatLonsSite) = site.getWayBlackLatLons() + wayLatLons.addAll(wayLatLonsSite) + blackLatLons.addAll(blackLatLonsSite) + if(index!=lineInfos!!.siteInfos.size-1) { + wayLatLons.add(AutoPilotLonLat(site.lat, site.lon, true)) + } + } + } + parameters.wayLatLons = wayLatLons + parameters.blackLatLons = blackLatLons + CallerLogger.d(TAG, "从轨迹获取经停点和禁行点") return parameters