[8.0.2]规划与决策功能的UI效果进行调整
This commit is contained in:
@@ -119,15 +119,15 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber,
|
||||
PredictionDataManager.getInstance()?.updateData(carPoiList1!!, 0)
|
||||
PredictionDataManager.getInstance()?.updateData(carPoiList2!!, 2)
|
||||
} else {
|
||||
if (preObj.predictionTrajectoryList.isNullOrEmpty() || isUnKnownType(preObj.classtype) || mogoMap == null) return@forEach
|
||||
if (isUnKnownType(preObj.classtype) || preObj.predictionTrajectoryList.isNullOrEmpty() || 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 > 30) return@forEach
|
||||
if (distance > 28) return@forEach
|
||||
}
|
||||
preObj.predictionTrajectoryList[0].trajectoryPointsList.forEachIndexed { index, point ->
|
||||
if (index > 9 && index % 2 == 0) {// 步长为2,减少点
|
||||
if (index in 0..44 && index % 2 == 0) {// 步长为2,减少点
|
||||
arr = mogoMap.switchData(point.x, point.y, false)
|
||||
arr?.let { lonLatArr ->
|
||||
points.add(MogoLatLng(lonLatArr[1], lonLatArr[0]))
|
||||
@@ -146,9 +146,17 @@ 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
|
||||
val type: TrackedObjectType? = TrackedObjectType.forNumber(classType)
|
||||
return when (type) {
|
||||
null, TrackedObjectType.TYPE_UNKNOWN, TrackedObjectType.TYPE_UNKNOWN_SMALL,
|
||||
TrackedObjectType.TYPE_UNKNOWN_BIG, TrackedObjectType.TYPE_UNKNOWN_STATIC,
|
||||
TrackedObjectType.TYPE_UNKNOWN_DYNAMIC, TrackedObjectType.UNRECOGNIZED -> {
|
||||
true
|
||||
}
|
||||
else -> {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun renderAiCloudResult(cloudData: List<SocketDownData.CloudRoadDataProto>, mapInstance:String = MogoMap.DEFAULT) {
|
||||
|
||||
@@ -80,11 +80,12 @@ class PredictionDataManager private constructor() {
|
||||
val lonLatList = ArrayList<android.graphics.Point>()
|
||||
var arr: DoubleArray?
|
||||
var point: android.graphics.Point?
|
||||
list.forEach {
|
||||
arr = mogoMap.switchData(it.x, it.y, false)// UTM转wgs84
|
||||
if (arr == null || arr!!.size < 2) return@forEach
|
||||
list.forEachIndexed { index, poi ->
|
||||
if (index > 45) return@forEachIndexed
|
||||
arr = mogoMap.switchData(poi.x, poi.y, false)// UTM转wgs84
|
||||
if (arr == null || arr!!.size < 2) return@forEachIndexed
|
||||
point = mogoMap.toScreenLocation(arr!![0], arr!![1])// wgs84转屏幕坐标
|
||||
if (point == null) return@forEach
|
||||
if (point == null) return@forEachIndexed
|
||||
lonLatList.add(point!!)
|
||||
Log.d(TAG, "预测数据的屏幕坐标为:(${point!!.x},${point!!.y})")
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.SurfaceHolder
|
||||
import android.view.SurfaceView
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
@@ -57,13 +58,15 @@ class CoordinateAnimationView @JvmOverloads constructor(
|
||||
|
||||
@Volatile
|
||||
private var isRunning = false
|
||||
@Volatile
|
||||
private var isVisible = false
|
||||
private var bezierPath: Path? = null // 贝塞尔曲线路径
|
||||
private var curvePaint: Paint? = null
|
||||
private var carPaint: Paint? = null
|
||||
|
||||
// private var circlePaint: Paint? = null
|
||||
private var visibleRect: RectF? = null // 可见区域
|
||||
private var strokeWidth = 22f
|
||||
private var strokeWidth = 16f
|
||||
|
||||
private var carBitmap: Bitmap? = null
|
||||
|
||||
@@ -155,8 +158,8 @@ class CoordinateAnimationView @JvmOverloads constructor(
|
||||
|
||||
private fun getOriginBitmap(resId: Int, desWidth: Int, desHeight: Int): Bitmap {
|
||||
val bitmap = BitmapFactory.decodeResource(resources, resId)
|
||||
val scaleWidth = (bitmap.width * 1.6).toInt()
|
||||
val scaleHeight = (bitmap.height * 1.6).toInt()
|
||||
val scaleWidth = (bitmap.width * 2)
|
||||
val scaleHeight = (bitmap.height * 2)
|
||||
Log.d(TAG, "$index-Bitmap width:$scaleWidth,height:$scaleHeight")
|
||||
return Bitmap.createScaledBitmap(
|
||||
bitmap, scaleWidth,
|
||||
@@ -177,6 +180,10 @@ class CoordinateAnimationView @JvmOverloads constructor(
|
||||
// return BitmapFactory.decodeResource(resources, resId, options)
|
||||
}
|
||||
|
||||
fun setVisible(isVisible: Boolean) {
|
||||
this.isVisible = isVisible
|
||||
}
|
||||
|
||||
override fun surfaceCreated(holder: SurfaceHolder) {
|
||||
animationThread = AnimationThread()
|
||||
animationThread!!.start()
|
||||
@@ -209,6 +216,14 @@ class CoordinateAnimationView @JvmOverloads constructor(
|
||||
controlPoints = null
|
||||
}
|
||||
|
||||
override fun onVisibilityChanged(changedView: View, visibility: Int) {
|
||||
super.onVisibilityChanged(changedView, visibility)
|
||||
val name = changedView.javaClass.simpleName
|
||||
if (name == TAG || name == "ConstraintLayout") {
|
||||
isVisible = visibility == View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
override fun screenPointsChanged(data: FloatArray, index: Int) {
|
||||
if (index == this.index) {
|
||||
updatePoints(data)
|
||||
@@ -664,21 +679,23 @@ class CoordinateAnimationView @JvmOverloads constructor(
|
||||
lastUpdateTime = System.currentTimeMillis()
|
||||
|
||||
while (isRunning) {
|
||||
canvas = null
|
||||
try {
|
||||
canvas = surfaceHolder!!.lockCanvas()
|
||||
synchronized(surfaceHolder!!) {
|
||||
// 绘制
|
||||
Log.d(TAG, "$index-准备绘制!")
|
||||
// 清屏
|
||||
canvas?.drawColor(Color.rgb(231, 235, 238))
|
||||
drawMovingDashedPath(canvas)
|
||||
drawPath(canvas)
|
||||
drawCar(canvas)
|
||||
}
|
||||
} finally {
|
||||
if (canvas != null) {
|
||||
surfaceHolder!!.unlockCanvasAndPost(canvas)
|
||||
if (isVisible) {
|
||||
canvas = null
|
||||
try {
|
||||
canvas = surfaceHolder!!.lockCanvas()
|
||||
synchronized(surfaceHolder!!) {
|
||||
// 绘制
|
||||
Log.d(TAG, "$index-准备绘制!")
|
||||
// 清屏
|
||||
canvas?.drawColor(Color.rgb(231, 235, 238))
|
||||
drawMovingDashedPath(canvas)
|
||||
drawPath(canvas)
|
||||
drawCar(canvas)
|
||||
}
|
||||
} finally {
|
||||
if (canvas != null) {
|
||||
surfaceHolder!!.unlockCanvasAndPost(canvas)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,30 +6,6 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<!-- <androidx.cardview.widget.CardView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- app:cardBackgroundColor="#D7F1FF"-->
|
||||
<!-- app:cardCornerRadius="20dp"-->
|
||||
<!-- app:cardElevation="0dp"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent">-->
|
||||
|
||||
<!-- <com.mogo.eagle.core.function.view.PredictionMapView-->
|
||||
<!-- android:id="@+id/preDetailView"-->
|
||||
<!-- android:layout_width="756dp"-->
|
||||
<!-- android:layout_height="500dp"-->
|
||||
<!-- android:layout_gravity="center_horizontal|bottom"-->
|
||||
<!-- android:layout_marginBottom="26dp"-->
|
||||
<!-- app:carPosition="6"-->
|
||||
<!-- app:isAutoLocation="false"-->
|
||||
<!-- app:isDisplayAnim="false"-->
|
||||
<!-- app:isWeatherEnable="false"-->
|
||||
<!-- app:styleMode="MAP_STYLE_DAY_VR_AIP"-->
|
||||
<!-- app:vrAngleMode="MAP_STYLE_VR_ANGLE_TOP" />-->
|
||||
|
||||
<!-- </androidx.cardview.widget.CardView>-->
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user