From 60a8a73ec33b7c33c0f688461501a29b86bd9c76 Mon Sep 17 00:00:00 2001 From: renwj Date: Thu, 24 Feb 2022 12:24:39 +0800 Subject: [PATCH] =?UTF-8?q?[DebugView]Debug=E5=85=A5=E5=8F=A3=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E8=A7=86=E8=A7=92=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/setting/DebugSettingView.kt | 38 ++++++++++++++++++- .../mogo/map/impl/custom/AMapViewWrapper.java | 9 +++++ .../map/uicontroller/VisualAngleMode.java | 20 +++++++++- 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 8b193bf213..7cce805b60 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -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 = diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index 1f747a7c0d..1d92b4c8cb 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -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"); } diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/VisualAngleMode.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/VisualAngleMode.java index 3d6462fab2..2d76d530f1 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/VisualAngleMode.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/VisualAngleMode.java @@ -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;