Merge remote-tracking branch 'origin/dev_MogoAP_eagle-220_211207_8.0.17_merge' into dev_MogoAP_eagle-220_211207_8.0.17_merge

This commit is contained in:
donghongyu
2022-02-24 17:47:38 +08:00
16 changed files with 239 additions and 36 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.*
@@ -55,9 +64,9 @@ class DebugSettingView @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener {
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener {
private val TAG = "DebugSettingView"
@@ -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 =
@@ -355,10 +389,8 @@ class DebugSettingView @JvmOverloads constructor(
tbLogCatch.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerDevaToolsManager.startCatchLog()
SharedPrefsMgr.getInstance(context).putBoolean(MoGoConfig.CATCH_LOG, true)
} else {
CallerDevaToolsManager.stopCatchLog()
SharedPrefsMgr.getInstance(context).putBoolean(MoGoConfig.CATCH_LOG, false)
}
}
CallerDevaToolsListenerManager.registerDevaToolsLogCatchListener(TAG,
@@ -438,15 +470,15 @@ class DebugSettingView @JvmOverloads constructor(
tvAutopilotInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo)
tvCarInfo.text =
"GPS时间${mAutoPilotCarStateInfo?.values?.satelliteTime}\n" +
"自车经纬度:\n${mAutoPilotCarStateInfo?.values?.lon}\n${mAutoPilotCarStateInfo?.values?.lat}\n"
"GPS时间${mAutoPilotCarStateInfo?.values?.satelliteTime}\n" +
"自车经纬度:\n${mAutoPilotCarStateInfo?.values?.lon}\n${mAutoPilotCarStateInfo?.values?.lat}\n"
tvIdentifyInfo.text =
"感知数据个数:${mIdentifyDataSize}"
"感知数据个数:${mIdentifyDataSize}"
tvTrajectoryInfoSize.text =
"引导线点个数:${mTrajectoryInfoSize}"
"引导线点个数:${mTrajectoryInfoSize}"
tvRouteInfoSize.text =
"全局路径规划点个数:${mRouteInfoSize}"
"全局路径规划点个数:${mRouteInfoSize}"
// 用完之后重制为0防止节点回掉突然没数据导致页面显示还是之前的数据情况
mIdentifyDataSize = 0