[2.13.0-arch-opt] cherry pick evey single file from 2.13.2,plus it's exhausted
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.v2x.events
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Handler
|
||||
@@ -16,6 +17,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.enums.EventTypeHelper
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
@@ -26,11 +28,14 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
|
||||
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.Default
|
||||
@@ -43,6 +48,7 @@ import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_H
|
||||
import com.mogo.eagle.core.function.v2x.events.receiver.SceneBroadcastReceiver
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.toRoadMarker
|
||||
import com.mogo.eagle.core.function.v2x.events.utils.toV2XRoadEventEntity
|
||||
import com.mogo.eagle.core.function.v2x.internal.V2XManager
|
||||
import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback
|
||||
import com.mogo.eagle.core.function.v2x.internal.config.V2XConfig
|
||||
@@ -53,7 +59,6 @@ import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent
|
||||
import com.mogo.eagle.core.function.v2x.road.V2XEventServiceApi
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -71,9 +76,10 @@ import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.launch
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
|
||||
object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, IV2XCallback {
|
||||
object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, IV2XCallback,
|
||||
IMoGoAutopilotIdentifyListener {
|
||||
|
||||
private const val TAG = "V2XEventManager"
|
||||
|
||||
@@ -115,11 +121,13 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
||||
private fun registerListener() {
|
||||
V2XManager.addCallback(this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private fun unRegisterListener() {
|
||||
V2XManager.removeCallback(this)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
mogoMarkersHandler.unregisterMarkerClickListener(CARD_TYPE_ROAD_CONDITION)
|
||||
}
|
||||
|
||||
@@ -196,19 +204,50 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
||||
handleWarningTargetEvent(event.data)
|
||||
}
|
||||
is V2XEvent.RoadAI -> {
|
||||
/*
|
||||
TODO zhongchao 先注掉,编译通过
|
||||
if(FunctionBuildConfig.isV2NFromCar){
|
||||
return
|
||||
}*/
|
||||
}
|
||||
handleRoadMarkerEvent(event.data.toRoadMarker())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
is V2XEvent.RoadEventX -> {
|
||||
handleRoadMarkerEvent(event.data.toRoadMarker())
|
||||
}
|
||||
else -> {
|
||||
Logger.d(TAG, "other event: $event")
|
||||
@SuppressLint("NewApi")
|
||||
override fun onAutopilotIdentifyPlanningObj(planningObjects: List<MessagePad.PlanningObject>?) {
|
||||
super.onAutopilotIdentifyPlanningObj(planningObjects)
|
||||
if(!FunctionBuildConfig.isV2NFromCar){
|
||||
return
|
||||
}
|
||||
planningObjects?.let {
|
||||
if (it.isNotEmpty()) {
|
||||
val first = it.stream()
|
||||
.filter { planningObj: MessagePad.PlanningObject -> planningObj.type >= 1000 }
|
||||
.findFirst()
|
||||
if (first.isPresent) {
|
||||
val poiType = when (first.get().type) {
|
||||
// 1004 -> { //V2N_RSM,静止事件,包括异常停车、异常静止障碍物
|
||||
// }
|
||||
1005 -> { //V2N_RSI,施工事件,包括锥桶或者挡板围城的施工场景,是个多边形包围区域
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType
|
||||
}
|
||||
1007 -> { //三角牌
|
||||
EventTypeEnumNew.FOURS_ACCIDENT_04.poiType
|
||||
}
|
||||
else -> {
|
||||
return
|
||||
}
|
||||
}
|
||||
CallerLogger.d("$M_V2X$TAG", "poiType : $poiType , 触发道路事件")
|
||||
val trackedObj =
|
||||
CallerMapIdentifyManager.getIdentifyObj(first.get().uuid.toString())
|
||||
trackedObj?.let { t ->
|
||||
CallerLogger.d("$M_V2X$TAG", "polygon size : ${(t.polygonList.size)}")
|
||||
val v2XMessageEntity = V2XMessageEntity<V2XRoadEventEntity>()
|
||||
v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING
|
||||
v2XMessageEntity.content = t.toRoadMarker(poiType).toV2XRoadEventEntity()
|
||||
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
|
||||
@@ -64,8 +65,9 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 1 --:\n" + (mMarkerEntity == null ? "null" : mMarkerEntity.toString()));
|
||||
if (mMarkerEntity != null) {
|
||||
CallerLogger.INSTANCE.d(M_V2X + TAG, "----- show --- 2 --:\n" + mMarkerEntity);
|
||||
int v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
|
||||
if (v2xType != 0) {
|
||||
String v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
|
||||
V2XMessageEntity entity = getV2XMessageEntity();
|
||||
if (!v2xType.equals("0")) {
|
||||
if (getAlertContentForFrontWarning(mMarkerEntity).toString() == null
|
||||
|| getAlertContentForFrontWarning(mMarkerEntity).toString().isEmpty()
|
||||
|| mMarkerEntity.getTts() == null || mMarkerEntity.getTts().isEmpty()) {
|
||||
@@ -87,19 +89,19 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
||||
}
|
||||
}
|
||||
|
||||
private int getV2XTypeForFrontWarning(V2XWarningTarget entity) {
|
||||
private String getV2XTypeForFrontWarning(V2XWarningTarget entity) {
|
||||
switch (entity.getType()) {
|
||||
case 1:
|
||||
case 11:
|
||||
entity.setTts("注意行人");
|
||||
return 0X2B0201;
|
||||
return EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.getPoiType();
|
||||
case 2:
|
||||
entity.setTts("注意自行车");
|
||||
case 4:
|
||||
entity.setTts("注意摩托车");
|
||||
return 0X2B0202;
|
||||
return EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.getPoiType();
|
||||
}
|
||||
return 0;
|
||||
return "0";
|
||||
}
|
||||
|
||||
private CharSequence getAlertContentForFrontWarning(V2XWarningTarget entity) {
|
||||
|
||||
Reference in New Issue
Block a user