[DebugView]Debug入口切换视角实现
This commit is contained in:
@@ -36,11 +36,20 @@ import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MODE_CLOSE_SIGHT
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import java.util.*
|
||||
|
||||
@@ -76,6 +85,12 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
// 全局路径规划点个数
|
||||
private var mRouteInfoSize = 0
|
||||
|
||||
private val mapUiController by lazy {
|
||||
MogoApisHandler.getInstance().apis?.mapServiceApi?.mapUIController
|
||||
}
|
||||
|
||||
private var lastVisualAngleMode: VisualAngleMode? = null
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_debug_setting, this, true)
|
||||
initView()
|
||||
@@ -205,10 +220,29 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
changesight_top_btn.setOnClickListener {
|
||||
CallerHDMapManager.setMapDAngle(0);
|
||||
lastVisualAngleMode = mapUiController?.currentMapVisualAngle
|
||||
|
||||
changesight_top_btn.onClick {
|
||||
mapUiController?.changeMapVisualAngle(MAP_STYLE_VR_ANGLE_TOP, null)
|
||||
}
|
||||
|
||||
changesight_back_btn?.onClick {
|
||||
mapUiController?.changeMapVisualAngle(MAP_STYLE_VR_ANGLE_300, null)
|
||||
}
|
||||
|
||||
changesight_cross_btn?.onClick {
|
||||
mapUiController?.changeMapVisualAngle(MAP_STYLE_VR_ANGLE_CROSS, null)
|
||||
}
|
||||
|
||||
changesight_far_btn?.onClick {
|
||||
mapUiController?.changeMapVisualAngle(MODE_LONG_SIGHT, null)
|
||||
}
|
||||
|
||||
reset_changesight?.onClick {
|
||||
lastVisualAngleMode?.let {
|
||||
mapUiController?.changeMapVisualAngle(it, null)
|
||||
}
|
||||
}
|
||||
|
||||
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString()
|
||||
tvAutopilotInfo.text =
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.mogo.map.impl.custom;
|
||||
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_CLOSE_SIGHT;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT;
|
||||
@@ -766,6 +769,12 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return MODE_MEDIUM_SIGHT;
|
||||
case 2:
|
||||
return MODE_LONG_SIGHT;
|
||||
case 3:
|
||||
return MAP_STYLE_VR_ANGLE_300;
|
||||
case 4:
|
||||
return MAP_STYLE_VR_ANGLE_TOP;
|
||||
case 5:
|
||||
return MAP_STYLE_VR_ANGLE_CROSS;
|
||||
default:
|
||||
throw new IllegalStateException("mode is unCorrect");
|
||||
}
|
||||
|
||||
@@ -15,9 +15,25 @@ public enum VisualAngleMode implements IMogoMapVisualAngle {
|
||||
/**
|
||||
* 视距远景
|
||||
*/
|
||||
MODE_LONG_SIGHT(2);
|
||||
MODE_LONG_SIGHT(2),
|
||||
|
||||
private int code;
|
||||
/**
|
||||
* 后方来车300视角
|
||||
*/
|
||||
MAP_STYLE_VR_ANGLE_300(3),
|
||||
|
||||
/**
|
||||
* 顶视角
|
||||
*/
|
||||
MAP_STYLE_VR_ANGLE_TOP(4),
|
||||
|
||||
/**
|
||||
* 十字路口视角
|
||||
*/
|
||||
MAP_STYLE_VR_ANGLE_CROSS(5);
|
||||
|
||||
|
||||
private final int code;
|
||||
|
||||
VisualAngleMode(int code) {
|
||||
this.code = code;
|
||||
|
||||
Reference in New Issue
Block a user