[DebugView]Debug入口切换视角实现

This commit is contained in:
renwj
2022-02-24 12:24:39 +08:00
parent ce4378dc13
commit 60a8a73ec3
3 changed files with 63 additions and 4 deletions

View File

@@ -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 =