From ffc746fecd4a3a1d61f916a0f36c7648351a8ffc Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 23 Nov 2023 12:21:49 +0800 Subject: [PATCH] =?UTF-8?q?[6.2.0]=20[shuttle-p]=20[=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E5=92=8C=E7=BB=93=E6=9D=9F=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E5=9B=BE=E7=89=87]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presenter/PM2DrivingPresenter.kt | 15 +++++++++---- .../passenger/ui/PM2DrivingInfoFragment.kt | 22 +++++++++++++++---- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/OCH/shuttle/passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt b/OCH/shuttle/passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt index 78c7fb65b6..54986df014 100644 --- a/OCH/shuttle/passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt +++ b/OCH/shuttle/passenger/src/m2/java/com/mogo/och/bus/passenger/presenter/PM2DrivingPresenter.kt @@ -3,10 +3,7 @@ package com.mogo.och.bus.passenger.presenter import androidx.lifecycle.LifecycleOwner import com.amap.api.maps.model.LatLng import com.mogo.commons.mvp.Presenter -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.util.ThreadUtils -import com.mogo.och.bus.passenger.bean.PM2Station import com.mogo.och.bus.passenger.callback.AutoPilotStatusCallback import com.mogo.och.bus.passenger.callback.DrivingInfoCallback import com.mogo.och.bus.passenger.model.PM2ADASModel @@ -86,10 +83,20 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) : val stationsList = mutableListOf() val stationsListPass = mutableListOf() + var startStation: LatLng? = null + var endStation: LatLng? = null for (i in stations.indices){ val station = stations[i] val latLng = LatLng(station.gcjLat,station.gcjLon) + if(i==0){ + startStation = latLng + continue + } + if(i==stations.size-1){ + endStation = latLng + continue + } if(station.drivingStatus==1){//行驶信息,0初始值;1已经过;2当前站;3未到站 stationsListPass.add(latLng) }else if(station.drivingStatus==2){ @@ -105,7 +112,7 @@ class PM2DrivingPresenter(view: PM2DrivingInfoFragment?) : } ThreadUtils.runOnUiThread { - mView?.updateLineStations(stationsList,stationsListPass) + mView?.updateLineStations(stationsList,stationsListPass,startStation,endStation) } PM2ADASModel.INSTANCE.updateHDMapStations(stations) } diff --git a/OCH/shuttle/passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt b/OCH/shuttle/passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt index eb258c976d..cac0e2f22a 100644 --- a/OCH/shuttle/passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt +++ b/OCH/shuttle/passenger/src/m2/java/com/mogo/och/bus/passenger/ui/PM2DrivingInfoFragment.kt @@ -6,12 +6,12 @@ import android.os.Bundle import android.view.View import androidx.core.content.ContextCompat import com.amap.api.maps.model.LatLng +import com.mogo.commons.AbsMogoApplication import com.mogo.commons.mvp.MvpFragment import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView import com.mogo.eagle.core.function.view.SiteMarkerBean import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider import com.mogo.och.bus.passenger.R -import com.mogo.och.bus.passenger.bean.PM2Station import com.mogo.och.bus.passenger.presenter.PM2DrivingPresenter import com.mogo.och.common.module.utils.DateTimeUtil.* import com.mogo.och.common.module.utils.NumberFormatUtil @@ -28,6 +28,11 @@ import kotlin.math.roundToInt class PM2DrivingInfoFragment : MvpFragment() { + val stationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.m2_map_staton_icon) + val stationPassIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.m2_map_staton_arrived_icon) + val startStationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.m2_map_start_icon) + val endStationIcon = BitmapFactory.decodeResource(AbsMogoApplication.getApp().resources, R.drawable.m2_map_end_icon) + /** * 改变自动驾驶状态 * @@ -180,17 +185,26 @@ class PM2DrivingInfoFragment : } } - fun updateLineStations(stations: MutableList,stationsPass: MutableList){ + fun updateLineStations( + stations: MutableList, + stationsPass: MutableList, + startStation: LatLng?, + endStation: LatLng? + ){ overMapView?.let { val stationsList: MutableList = mutableListOf() - val stationIcon = BitmapFactory.decodeResource(resources, R.drawable.m2_map_staton_icon) - val stationPassIcon = BitmapFactory.decodeResource(resources, R.drawable.m2_map_staton_arrived_icon) + startStation?.let { start-> + stationsList.add(SiteMarkerBean(start,startStationIcon,0.5f,0.5f)) + } for (stationsPass in stationsPass) { stationsList.add(SiteMarkerBean(stationsPass,stationPassIcon,0.5f,0.5f)) } for (stationsPass in stations) { stationsList.add(SiteMarkerBean(stationsPass,stationIcon,0.5f,0.5f)) } + endStation?.let {end-> + stationsList.add(SiteMarkerBean(end,endStationIcon,0.5f,0.5f)) + } it.drawSiteMarkers(stationsList) } }