去掉老obu的功能,合并EventTypeEnumNew

This commit is contained in:
lixiaopeng
2023-01-30 17:49:17 +08:00
parent 73ce6b667c
commit fa04ed406e
28 changed files with 156 additions and 1311 deletions

View File

@@ -4,7 +4,7 @@ import android.util.Log
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_GREEN
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
@@ -209,17 +209,17 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
EventTypeEnum.TYPE_USECASE_ID_IVP.content,
EventTypeEnum.TYPE_USECASE_ID_IVP.tts
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts
)
)
)
CallerHmiManager.warningV2X(
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
EventTypeEnum.TYPE_USECASE_ID_IVP.content,
EventTypeEnum.TYPE_USECASE_ID_IVP.tts,
EventTypeEnum.TYPE_USECASE_ID_IVP.poiType,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
null,
true,
5000L
@@ -235,11 +235,11 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
CallerLogger.d("$M_V2X$TAG", "=====绿灯通行预警=====")
ThreadUtils.runOnUiThread {
val content = String.format(
EventTypeEnum.getWarningContent(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
speed
)
val tts = String.format(
EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
speed
)
if (content.isNullOrEmpty() || tts.isNullOrEmpty()) {
@@ -249,17 +249,17 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
content,
tts
)
)
)
CallerHmiManager.warningV2X(
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
content,
tts,
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
null,
true,
5000L

View File

@@ -10,7 +10,7 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_VIP
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2N
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
@@ -209,17 +209,17 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
val light = this.result?.currentRoadTrafficLight()
if (light != null && light.isGreen()) {
showWarning(
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.content,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.tts,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType,
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.content,
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts,
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType
)
} else {
showWarning(
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.content,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.tts,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType,
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.content,
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts,
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType
)
}
return@turnLightToGreen
@@ -228,10 +228,10 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
// 请求变灯失败,根据灯态来提示。 此处灯态未获取到
if (this.result == null || this.result?.currentRoadTrafficLight() == null) {
showWarning(
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试",
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts,
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试",
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts,
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType
)
return@turnLightToGreen
}
@@ -249,10 +249,10 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
"${temp}秒后重试"
}
showWarning(
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + time,
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts,
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + time,
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts,
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType
)
} else {
CallerLogger.d(

View File

@@ -54,7 +54,6 @@ dependencies {
kapt rootProject.ext.dependencies.androidxroomcompiler
implementation rootProject.ext.dependencies.androidxroomktx
implementation rootProject.ext.dependencies.mogoami
implementation rootProject.ext.dependencies.mogoaicloudtelematic
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {

View File

@@ -72,8 +72,6 @@ dependencies {
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
implementation rootProject.ext.dependencies.mogoami
implementation rootProject.ext.dependencies.android_start_up
implementation rootProject.ext.dependencies.cicle_indicator
implementation rootProject.ext.dependencies.koomnative

View File

@@ -4,11 +4,11 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.WaringConst
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
@@ -75,7 +75,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
ttsContent: String?,
tag: String?
) {
if (EventTypeEnum.TYPE_USECASE_ID_IVP.poiType == v2xType.toString()) {
if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) {
CallerHmiManager.showLimitingVelocity(1, 1)
}
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {

View File

@@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.hmi.ui
import android.content.Context
import android.os.Bundle
import android.text.TextUtils
import android.util.*
import android.util.Log
import android.view.View
import android.view.ViewGroup
import android.view.animation.AlphaAnimation
@@ -24,16 +24,12 @@ import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_RTS
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG
@@ -46,16 +42,12 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Turning
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
import com.mogo.eagle.core.function.hmi.ui.bindingcar.ModifyBindingCarDialog
@@ -67,10 +59,10 @@ import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView.Companion.toggleDebugView
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
import com.mogo.eagle.core.function.hmi.ui.widget.*
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.function.main.DisplayEffectsHelper
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -78,17 +70,12 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.reminder.api.IReminder
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import com.zhjt.service_biz.BizConfig
import kotlinx.android.synthetic.main.fragment_hmi.*
import kotlinx.coroutines.*
import record_cache.RecordPanelOuterClass
import java.util.concurrent.atomic.AtomicReference
/**
@@ -326,7 +313,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
activity?.let {
val warningContent = alertContent
?: EventTypeEnum.getWarningContent(v2xType)
?: EventTypeEnumNew.getWarningContent(v2xType)
//占道施工预警
if (v2xType == "10006" || v2xType == "100061") {

View File

@@ -8,7 +8,6 @@ import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.report.ReportEntity
@@ -129,7 +128,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}else{
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}
}
}

View File

@@ -9,7 +9,6 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.report.ReportEntity
@@ -219,7 +218,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Ada
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}else{
holder.ivV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}
}
}

View File

@@ -8,17 +8,15 @@ import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
@@ -101,7 +99,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}else{
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}
}
}

View File

@@ -7,13 +7,11 @@ import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.NoticeFrCloudMsg
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
@@ -93,7 +91,7 @@ class PassengerMsgBoxListAdapter(private val activity: Activity): RecyclerView.A
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}else{
holder.ivPassengerV2XImage.setImageDrawable(activity.resources.getDrawable(
EventTypeEnum.getUpdateIconRes(v2XMsg.type)))
EventTypeEnumNew.getUpdateIconRes(v2XMsg.type)))
}
}
}

View File

@@ -74,7 +74,7 @@ import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import com.zhidao.easysocket.utils.L
//import com.zhidao.easysocket.utils.L
import com.zhjt.mogo_core_function_devatools.env.*
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import mogo.telematics.pad.MessagePad
@@ -1269,7 +1269,7 @@ internal class DebugSettingView @JvmOverloads constructor(
* 设置是否输出OBU日志 true-打印日志false-不打印日志
*/
tbObuLog.setOnCheckedChangeListener { _, isChecked ->
L.setEnableLog(isChecked)
// L.setEnableLog(isChecked)
}
/**

View File

@@ -6,7 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
@@ -56,10 +56,10 @@ class TakeOverView @JvmOverloads constructor(
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_CHASSIS,
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_DISTANCE -> {
CallerHmiManager.warningV2X(
EventTypeEnum.TAKE_OVER_EVENT.poiType,
EventTypeEnum.TAKE_OVER_EVENT.content,
EventTypeEnum.TAKE_OVER_EVENT.tts,
EventTypeEnum.TAKE_OVER_EVENT.poiType,
EventTypeEnumNew.TAKE_OVER_EVENT.poiType,
EventTypeEnumNew.TAKE_OVER_EVENT.content,
EventTypeEnumNew.TAKE_OVER_EVENT.tts,
EventTypeEnumNew.TAKE_OVER_EVENT.poiType,
object : IMoGoWarningStatusListener {
override fun onShow() {
takeOver = true

View File

@@ -34,7 +34,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
import com.mogo.eagle.core.utilcode.util.SPUtils;
import com.zhidao.support.obu.ami.AmiClientManager;
import java.io.File;
import java.lang.reflect.Field;
@@ -203,7 +202,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
*/
private void connectAmiIp() {
String ipAddress = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp().getBaseContext()).getString(MoGoConfig.OBU_IP, "192.168.1.199");
AmiClientManager.getInstance().setObuIp(ipAddress);
// AmiClientManager.getInstance().setObuIp(ipAddress);
}
private void initModules() {

View File

@@ -5,6 +5,7 @@ import android.text.TextUtils;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
import com.mogo.eagle.core.data.map.entity.MarkerNoveltyInfo;
@@ -19,7 +20,6 @@ import com.mogo.map.MogoMarkerManager;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
/**
* @author congtaowang
@@ -81,7 +81,7 @@ public class MarkerDrawer {
Object bindObj = markerShowEntity.getBindObj();
if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) {
String poiType = ((MarkerExploreWay) bindObj).getPoiType();
options.icon3DRes(EventTypeEnum.getMarker3DRes(poiType));
options.icon3DRes(EventTypeEnumNew.getMarker3DRes(poiType));
}
}

View File

@@ -59,7 +59,6 @@ dependencies {
implementation project(':core:mogo-core-function-call')
}
implementation rootProject.ext.dependencies.mogoobuold
implementation rootProject.ext.dependencies.mogoobu
}

View File

@@ -11,6 +11,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.CommonUtils
import com.mogo.support.obu.MogoObuManager
/**
* @author xiaoyuzhou
@@ -54,9 +55,6 @@ class MoGoObuProvider : IMoGoObuProvider {
ipAddress,
CommonUtils.getIpAddressString()
)
//old obu
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { //taxi 司机端和乘客端
val ipAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp)
@@ -66,9 +64,6 @@ class MoGoObuProvider : IMoGoObuProvider {
ipAddress,
CommonUtils.getIpAddressString()
)
//old obu
MogoPrivateObuManager.INSTANCE.init(context, ipAddress)
}
}
}
@@ -95,18 +90,16 @@ class MoGoObuProvider : IMoGoObuProvider {
CommonUtils.getIpAddressString()
)
//连接old obu
MogoPrivateObuManager.INSTANCE.connectObu(it, ipAddress)
}
}
}
override fun disConnect() {
MogoPrivateObuManager.INSTANCE.disConnectObu()
MogoPrivateObuNewManager.INSTANCE.disconnect()
}
override fun isConnected(): Boolean {
return MogoPrivateObuManager.INSTANCE.isConnected()
return MogoObuManager.getInstance().connectStatus == 1
}
}

View File

@@ -88,6 +88,11 @@ class MogoPrivateObuNewManager private constructor() {
return mogoObuListener
}
fun disconnect() {
MogoObuManager.getInstance().disconnect()
}
private val mogoObuListener: OnMogoObuListener = object : OnMogoObuListener() {
/**
* 连接状态的改变
@@ -105,13 +110,6 @@ class MogoPrivateObuNewManager private constructor() {
mObuStatusInfo.obuStatus = true
CallerObuListenerManager.invokeListener(mObuStatusInfo)
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) }
//断开老obu
try {
com.zhidao.support.obu.MogoObuManager.getInstance().disConnect()
} catch (e: Exception) {
e.printStackTrace()
}
}
}

View File

@@ -1,133 +0,0 @@
package com.mogo.eagle.core.function.obu.mogo.utils
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.zhidao.support.obu.constants.ObuConstants
import com.zhidao.support.obu.model.CvxPtcThreatIndInfo
import com.zhidao.support.obu.model.CvxRtiThreatIndInfo
import com.zhidao.support.obu.model.CvxRvInfoIndInfo
import com.zhidao.support.obu.model.CvxV2vThreatIndInfo
/**
* @author xiaoyuzhou
* @date 2021/8/18 2:30 下午
*/
object TrafficDataConvertUtils {
val TAG = "TrafficDataConvertUtils"
/**
* OBU 远车 转换交通元素数据
*/
fun cvxRvInfoIndInfo2TrafficData(info: CvxRvInfoIndInfo): TrafficData? {
if (info.basic_info == null || info.basic_info.position == null) {
CallerLogger.e("$M_OBU$TAG", "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全")
return null
}
val trafficData = TrafficData()
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
trafficData.uuid = info.vehicle_id
trafficData.lat = info.basic_info.position.latitude
trafficData.lon = info.basic_info.position.longitude
trafficData.heading = info.basic_info.heading
trafficData.speed = info.basic_info.speed
return trafficData
}
/**
* OBU RSU道路事件预警信息 转换交通元素数据
*/
fun cvxRtiThreatIndInfo2TrafficData(info: CvxRtiThreatIndInfo): TrafficData? {
// 这里只处理道路施工
if(info.ext_info.rti_type != 0x7){
return null
}
if (info.rti_id == null || info.ext_info == null
|| info.zones_info == null || info.zones_info.first() == null
|| info.zones_info.first().path_points.first() == null
|| info.threat_info == null
) {
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
return null
}
val trafficData = TrafficData()
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG
trafficData.uuid = info.rti_id
trafficData.lat = info.zones_info.first().path_points.first().latitude
trafficData.lon = info.zones_info.first().path_points.first().longitude
trafficData.threatLevel = info.threat_info.threat_level
return trafficData
}
/**
* OBU 预警事件 转换交通元素数据
*/
fun cvxV2vThreatIndInfo2TrafficData(info: CvxV2vThreatIndInfo): TrafficData? {
if (info.basic_info == null || info.basic_info.position == null || info.threat_info == null) {
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
return null
}
val trafficData = TrafficData()
trafficData.uuid = info.vehicle_id
trafficData.lat = info.basic_info.position.latitude
trafficData.lon = info.basic_info.position.longitude
trafficData.heading = info.basic_info.heading
trafficData.speed = info.basic_info.speed
// 判断车辆V2X预警级别调整车辆颜色
trafficData.threatLevel = info.threat_info.threat_level
if (info.threat_info.app_id == ObuConstants.USE_CASE_ID.EVW) {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE
} else {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
}
return trafficData
}
/**
* OBU 弱势交通参与者信息 转换交通元素数据 TODO
*/
fun cvxPtcThreatIndInfo2TrafficData(info: CvxPtcThreatIndInfo): TrafficData? {
if (info.ptc_pos == null || info.threat_info == null) {
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
return null
}
val trafficData = TrafficData()
trafficData.uuid = info.ptc_id
trafficData.lat = info.ptc_pos.latitude
trafficData.lon = info.ptc_pos.longitude
// trafficData.heading = info.ptc_pos.heading
// trafficData.speed = info.ptc_pos.speed
when (info.ptc_type) {
// 未知
0x0 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI
}
// 非机动车
0x1 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO
}
// 行人
0x2 -> {
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE
}
}
// 判断车辆V2X预警级别调整车辆颜色
if (info.threat_info != null) {
trafficData.threatLevel = info.threat_info.threat_level
}
return trafficData
}
}

View File

@@ -1,15 +1,17 @@
package com.mogo.eagle.core.function.v2x.events.alarm;
import android.util.Log;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import io.netty.util.internal.ConcurrentSet;
import android.util.Log;
/**
* @author donghongyu
@@ -64,7 +66,7 @@ public class V2XAlarmServer {
double distance = v2XRoadEventEntity.getDistance();
Log.d("RWJ", "distance:" + distance);
if (distance <= 500) {
if (EventTypeEnum.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
if (distance > 25) {
continue;
}

View File

@@ -10,6 +10,7 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
@@ -26,16 +27,15 @@ import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
import com.mogo.eagle.core.function.v2x.events.marker.V2XMarkerAdapter;
import com.mogo.eagle.core.function.v2x.events.utils.EntityUtilsKt;
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils;
import com.mogo.eagle.core.function.v2x.internal.V2XManager;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerExploreWay;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerLocation;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import com.mogo.eagle.core.function.v2x.internal.V2XManager;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerExploreWay;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerLocation;
import java.util.List;
import java.util.Objects;
@@ -110,7 +110,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
List<V2XMarkerExploreWay> exploreWayList = markerCardResult.getExploreWay();
if (exploreWayList != null) {
for (V2XMarkerExploreWay markerExploreWay : exploreWayList) {
if (EventTypeEnum.isRoadEvent(markerExploreWay.getPoiType())) {
if (EventTypeEnumNew.isRoadEvent(markerExploreWay.getPoiType())) {
V2XMarkerLocation markerLocation = markerExploreWay.getLocation();
// 记录道路事件
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();

View File

@@ -3,9 +3,9 @@ package com.mogo.eagle.core.function.v2x.events.marker;
import android.content.Context;
import android.graphics.Bitmap;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.function.v2x.R;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import com.mogo.eagle.core.function.v2x.events.view.V2XMarkerRoadEventView;
import java.util.ArrayList;
@@ -31,10 +31,10 @@ public class V2XMarkerAdapter {
*/
public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) {
Bitmap bitmap;
if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
if (EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
bitmap = getV2XRoadEventMarkerView(
context,
alarmInfo,
@@ -53,10 +53,10 @@ public class V2XMarkerAdapter {
*/
public static ArrayList<Bitmap> getV2XRoadEventViewGif(Context context, V2XRoadEventEntity alarmInfo) {
ArrayList<Bitmap> bitmapArrayList;
if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
if (EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
bitmapArrayList = getV2XRoadEventOrangeMarkerView(context, alarmInfo);
} else {
bitmapArrayList = getV2XRoadEventRedMarkerView(context, alarmInfo);

View File

@@ -5,10 +5,10 @@ import android.content.Context
import android.graphics.Bitmap
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.function.v2x.R
import com.mogo.eagle.core.utilcode.util.ViewUtils
import com.mogo.eagle.core.data.enums.EventTypeEnum
import kotlinx.android.synthetic.main.view_marker_event_car.view.*
/**
@@ -33,8 +33,8 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
}
fun initView(context: Context, alarmInfo: V2XRoadEventEntity) {
if (alarmInfo.poiType == EventTypeEnum.ALERT_FRONT_CAR.poiType ||
alarmInfo.poiType == EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.poiType
if (alarmInfo.poiType == EventTypeEnumNew.ALERT_FRONT_CAR.poiType ||
alarmInfo.poiType == EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.poiType
) {
LayoutInflater.from(context)
.inflate(R.layout.view_marker_event_car, this)
@@ -46,11 +46,11 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
}
/**
* @see EventTypeEnum
* @see EventTypeEnumNew
*/
private fun updateIcon(alarmInfo: V2XRoadEventEntity) {
// 道路施工、积水、路面结冰、浓雾、事故、拥堵
val iconResId = EventTypeEnum.getUpdateIconRes(alarmInfo.poiType)
val iconResId = EventTypeEnumNew.getUpdateIconRes(alarmInfo.poiType)
if (iconResId != 0) {
ivCar.setImageResource(iconResId)
}