[shuttle-p]
[开始站点和结束站点单独图片]
This commit is contained in:
yangyakun
2023-11-23 12:21:49 +08:00
parent d79dc479e7
commit ffc746fecd
2 changed files with 29 additions and 8 deletions

View File

@@ -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<LatLng>()
val stationsListPass = mutableListOf<LatLng>()
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)
}

View File

@@ -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<PM2DrivingInfoFragment?, PM2DrivingPresenter?>() {
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<LatLng>,stationsPass: MutableList<LatLng>){
fun updateLineStations(
stations: MutableList<LatLng>,
stationsPass: MutableList<LatLng>,
startStation: LatLng?,
endStation: LatLng?
){
overMapView?.let {
val stationsList: MutableList<SiteMarkerBean> = 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)
}
}