[8.1.0]cherry-pick临时分支代码
This commit is contained in:
@@ -41,35 +41,35 @@ class HomeViewModel : ViewModel(), BridgeListener, OrderListener {
|
||||
|
||||
override fun onTrajectoryHaveData(haveTrajectoryInfos: Boolean) {
|
||||
this.haveTrajectoryInfos = haveTrajectoryInfos
|
||||
// checkScreenChange()
|
||||
checkScreenChange()
|
||||
}
|
||||
|
||||
override fun onPredictionHavaData(havePredictionInfos: Boolean) {
|
||||
this.havePredictionInfos = havePredictionInfos
|
||||
// checkScreenChange()
|
||||
checkScreenChange()
|
||||
}
|
||||
|
||||
override fun onCurrentOrderStatusChanged(order: BaseOrderBean?) {
|
||||
this.order = order
|
||||
// checkScreenChange()
|
||||
checkScreenChange()
|
||||
}
|
||||
|
||||
fun checkScreenChange(){
|
||||
// CallerLogger.d(TAG,"havePredictionInfos:${havePredictionInfos}--haveTrajectoryInfos:${haveTrajectoryInfos}--order:${order}")
|
||||
// if(order!=null&&havePredictionInfos&&havePredictionInfos){
|
||||
// FunctionBuildConfig.isDrawDecIdentifyData = true
|
||||
// FunctionBuildConfig.isDrawPreIdentifyData = true
|
||||
// // 展示三联屏
|
||||
// BizLoopManager.runInMainThread{
|
||||
// this.viewCallback?.showThreeScreen()
|
||||
// }
|
||||
// }else{
|
||||
// FunctionBuildConfig.isDrawDecIdentifyData = false
|
||||
// FunctionBuildConfig.isDrawPreIdentifyData = false
|
||||
// // 展示二联屏幕
|
||||
// BizLoopManager.runInMainThread{
|
||||
// this.viewCallback?.showTwoScreen()
|
||||
// }
|
||||
// }
|
||||
CallerLogger.d(TAG,"havePredictionInfos:${havePredictionInfos}--haveTrajectoryInfos:${haveTrajectoryInfos}--order:${order}")
|
||||
if(order!=null&&havePredictionInfos&&havePredictionInfos){
|
||||
FunctionBuildConfig.isDrawDecIdentifyData = true
|
||||
FunctionBuildConfig.isDrawPreIdentifyData = true
|
||||
// 展示三联屏
|
||||
BizLoopManager.runInMainThread{
|
||||
this.viewCallback?.showThreeScreen()
|
||||
}
|
||||
}else{
|
||||
FunctionBuildConfig.isDrawDecIdentifyData = false
|
||||
FunctionBuildConfig.isDrawPreIdentifyData = false
|
||||
// 展示二联屏幕
|
||||
BizLoopManager.runInMainThread{
|
||||
this.viewCallback?.showTwoScreen()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: ly.count.android.plugins.UploadSymbolsPlugin
|
||||
|
||||
apply from: rootProject.file('gradle/bytex/bytex.gradle')
|
||||
//apply from: rootProject.file('gradle/bytex/bytex.gradle')
|
||||
|
||||
Properties properties = new Properties()
|
||||
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
@@ -9,8 +8,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.PredictionOverlayDrawer
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.PredictionOverlayDrawer2
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.PredictionOverlayDrawer3
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getLocationHeading
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getWgs84Lat
|
||||
@@ -19,8 +16,9 @@ import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.MogoMap.Companion.mapInstance
|
||||
import com.mogo.map.identify.MogoIdentifyManager
|
||||
import com.mogo.map.utils.LocationUtils
|
||||
import com.zhjt.mogo.adas.data.Adas.TrackedObjectClassID
|
||||
import com.zhjt.mogo.adas.data.Adas.TrackedObjectType
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
@@ -37,6 +35,21 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber,
|
||||
|
||||
private val TAG = "MapIdentifySubscriber"
|
||||
|
||||
private val typeMap: HashMap<TrackedObjectType, TrackedObjectClassID> by lazy {
|
||||
hashMapOf<TrackedObjectType, TrackedObjectClassID>().apply {
|
||||
put(TrackedObjectType.TYPE_PEDESTRIAN, TrackedObjectClassID.Person)
|
||||
put(TrackedObjectType.TYPE_MOTOR, TrackedObjectClassID.MotorCycle)
|
||||
put(TrackedObjectType.TYPE_BICYCLE, TrackedObjectClassID.Bicycle)
|
||||
put(TrackedObjectType.TYPE_CAR, TrackedObjectClassID.Car)
|
||||
put(TrackedObjectType.TYPE_TRUCK, TrackedObjectClassID.Truck)
|
||||
put(TrackedObjectType.TYPE_BUS, TrackedObjectClassID.Bus)
|
||||
put(TrackedObjectType.TYPE_WARNINGTRIANGLE, TrackedObjectClassID.WarningTriangle)
|
||||
put(TrackedObjectType.TYPE_ROADWORK_OCCUPY_0501, TrackedObjectClassID.RoadWork_occupy_0501)
|
||||
put(TrackedObjectType.TYPE_ROADWORK_BREAK_0502, TrackedObjectClassID.RoadWork_break_0502)
|
||||
put(TrackedObjectType.TYPE_ROAD_CONGESTION, TrackedObjectClassID.ROAD_CONGESTION)
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
onCrate()
|
||||
}
|
||||
@@ -102,24 +115,24 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber,
|
||||
probability1 = preObj.predictionTrajectoryList[0].predictionProbability
|
||||
probability2 = preObj.predictionTrajectoryList[1].predictionProbability
|
||||
CallerAutopilotIdentifyListenerManager.invokeProbabilityChanged(probability1, probability2)
|
||||
if (probability1 >= probability2) {
|
||||
MogoIdentifyManager.getInstance().updateGps(location1!!, MogoMap.SMALL_PRED_MAP)
|
||||
largeType = 2
|
||||
} else {
|
||||
MogoIdentifyManager.getInstance().updateGps(location2!!, MogoMap.SMALL_PRED_MAP)
|
||||
largeType = 3
|
||||
}
|
||||
PredictionOverlayDrawer2.getInstance().drawPredictionList(carPoiList1, getLocationHeading(), false, 2, largeType)
|
||||
PredictionOverlayDrawer3.getInstance().drawPredictionList(carPoiList2, getLocationHeading(), false, 3, largeType)
|
||||
MogoIdentifyManager.getInstance().updateGps(location1!!, MogoMap.SMALL_PRED_MAP2)
|
||||
MogoIdentifyManager.getInstance().updateGps(location2!!, MogoMap.SMALL_PRED_MAP3)
|
||||
// if (probability1 >= probability2) {
|
||||
//// MogoIdentifyManager.getInstance().updateGps(location1!!, MogoMap.SMALL_PRED_MAP)
|
||||
// largeType = 2
|
||||
// } else {
|
||||
//// MogoIdentifyManager.getInstance().updateGps(location2!!, MogoMap.SMALL_PRED_MAP)
|
||||
// largeType = 3
|
||||
// }
|
||||
// PredictionOverlayDrawer2.getInstance().drawPredictionList(carPoiList1, getLocationHeading(), false, 2, largeType)
|
||||
// PredictionOverlayDrawer3.getInstance().drawPredictionList(carPoiList2, getLocationHeading(), false, 3, largeType)
|
||||
// MogoIdentifyManager.getInstance().updateGps(location1!!, MogoMap.SMALL_PRED_MAP2)
|
||||
// MogoIdentifyManager.getInstance().updateGps(location2!!, MogoMap.SMALL_PRED_MAP3)
|
||||
} else {
|
||||
if (preObj.predictionTrajectoryList.isNullOrEmpty() || mogoMap == null) return@forEach
|
||||
if (preObj.predictionTrajectoryList.isNullOrEmpty() || isUnKnownType(preObj.classtype) || mogoMap == null) return@forEach
|
||||
point = preObj.predictionTrajectoryList[0].trajectoryPointsList[0]
|
||||
arr = mogoMap.switchData(point.x, point.y, false)
|
||||
arr?.let { lonLatArr ->
|
||||
val distance = com.mogo.eagle.core.utilcode.util.LocationUtils.getDistance(getWgs84Lat(), getWgs84Lon(), lonLatArr[1], lonLatArr[0])
|
||||
if (distance > 25) return@forEach
|
||||
if (distance > 30) return@forEach
|
||||
}
|
||||
preObj.predictionTrajectoryList[0].trajectoryPointsList.forEachIndexed { index, point ->
|
||||
if (index > 9 && index % 2 == 0) {// 步长为2,减少点
|
||||
@@ -140,6 +153,12 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber,
|
||||
}
|
||||
}
|
||||
|
||||
private fun isUnKnownType(classType: Int): Boolean {
|
||||
val type: TrackedObjectType = TrackedObjectType.forNumber(classType) ?: return true
|
||||
var classID: TrackedObjectClassID? = typeMap[type] ?: return true
|
||||
return false
|
||||
}
|
||||
|
||||
fun renderAiCloudResult(cloudData: List<SocketDownData.CloudRoadDataProto>, mapInstance:String = MogoMap.DEFAULT) {
|
||||
try {
|
||||
ThreadUtils.getSinglePool().execute {
|
||||
|
||||
@@ -140,15 +140,15 @@ public class PredictionOverlayDrawer {
|
||||
if (mPolylineOptions == null) {
|
||||
builder = new Polyline.Options.Builder("pred_overlay", Level.GUIDE_ROUTE_LINE)
|
||||
.setUseGps(true)
|
||||
.setWidth(5)
|
||||
.setWidth(4)
|
||||
.setIsGradient(true);
|
||||
} else {
|
||||
builder = mPolylineOptions.builder();
|
||||
}
|
||||
builder.color(Color.rgb(196, 196, 196));
|
||||
builder.setIsGradient(false);
|
||||
builder.color(Color.argb(102,48,163,255));
|
||||
builder.setIsGradient(true);
|
||||
builder.setLightOn(false);
|
||||
builder.setIsDottedLine(false);
|
||||
builder.setIsDottedLine(true);
|
||||
builder.isShowArrow(false);
|
||||
builder.points(pps);
|
||||
builder.setVisible(true);
|
||||
|
||||
@@ -116,6 +116,6 @@ class PredictionMap2View(context: Context, attrs: AttributeSet) : MogoMapView(co
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
// 跟新地图控件
|
||||
// setExtraGPSData(gnssInfo)
|
||||
setExtraGPSData(gnssInfo)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ class PredictionMap3View(context: Context, attrs: AttributeSet) : MogoMapView(co
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
// 跟新地图控件
|
||||
// setExtraGPSData(gnssInfo)
|
||||
setExtraGPSData(gnssInfo)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ class PredictionMapView(context: Context, attrs: AttributeSet) : MogoMapView(con
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
// 跟新地图控件
|
||||
// setExtraGPSData(gnssInfo)
|
||||
setExtraGPSData(gnssInfo)
|
||||
if (System.currentTimeMillis() - lastTime >= 5000) {
|
||||
// 预测给的UTM坐标数据没有带上度带信息,根据定位计算度带
|
||||
mapInstance.getMogoMap(MogoMap.DEFAULT)?.switchData(gnssInfo.longitude, gnssInfo.latitude, true)
|
||||
|
||||
Reference in New Issue
Block a user