[6.2.6][V2N] V2N新需求代码提交
This commit is contained in:
@@ -8,6 +8,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.biz.IMoGoFuncBizProvider
|
||||
import com.mogo.eagle.core.function.api.biz.IMoGoNoticeNetCallBack
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NCarTypeCheck
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.function.biz.dispatch.DispatchAutoPilotManager.Companion.dispatchAutoPilotManager
|
||||
import com.mogo.eagle.function.biz.monitoring.CronTaskManager.Companion.cronTaskManager
|
||||
@@ -117,8 +118,7 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
}
|
||||
|
||||
override fun queryV2XEvents() {
|
||||
if ((AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && (!FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData))
|
||||
|| AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData)) {
|
||||
v2xPoiLoader.queryWholeRoadEvents()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NCarTypeCheck
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.function.biz.v2x.overview.db.OverviewDb
|
||||
@@ -107,8 +107,7 @@ object OverViewDataManager {
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
it?.apply {
|
||||
if ((AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && (!FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData))
|
||||
|| AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData)) {
|
||||
CallerFuncBizListenerManager.invokeV2XEvents(this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import androidx.annotation.*
|
||||
import androidx.localbroadcastmanager.content.*
|
||||
import com.mogo.eagle.core.data.config.*
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_V2X_MSG
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_ADAS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_CLOUD
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_STATUS
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
@@ -17,14 +16,17 @@ import com.mogo.eagle.core.data.enums.WarningDirectionEnum.ALERT_WARNING_TOP
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.data.map.entity.*
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
|
||||
import com.mogo.eagle.core.data.v2x.*
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.api.cloud.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NCarTypeCheck.Companion.verifyCarType
|
||||
import com.mogo.eagle.core.function.call.cloud.*
|
||||
import com.mogo.eagle.core.function.call.hmi.*
|
||||
import com.mogo.eagle.core.function.call.msgbox.*
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
@@ -43,6 +45,7 @@ import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.android.*
|
||||
import mogo.telematics.pad.MessagePad.PlanningObject
|
||||
import mogo.v2x.*
|
||||
import java.nio.charset.Charset
|
||||
import java.util.concurrent.*
|
||||
import java.util.concurrent.atomic.*
|
||||
|
||||
@@ -170,9 +173,21 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
||||
handleRoadMarkerEvent(event.data.toRoadMarker())
|
||||
}
|
||||
is V2XEvent.RoadEventX -> {
|
||||
if (!AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData) {
|
||||
val flag = verifyCarType()
|
||||
Log.d("$M_V2X$TAG", "---- 收到ai云V2N事件 ---:${flag}, ${FunctionBuildConfig.v2nMainSwitch}, ${FunctionBuildConfig.isNewV2NData}")
|
||||
if (flag && (!FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData)) {
|
||||
try {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
Log.d("$M_V2X$TAG", "onAck -> 司机端: 将收到云端事件给到乘客端...")
|
||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_AI_ROAD_DATA_TO_PASSENGER, GsonUtils.toJson(event).toByteArray(Charset.defaultCharset()))
|
||||
} else {
|
||||
Log.d("$M_V2X$TAG", "onAck -> 乘客端: 收到V2N事件...")
|
||||
}
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
handleRoadMarkerEvent(event.data.toRoadMarker())
|
||||
}else{
|
||||
} else{
|
||||
V2XBizTrace.onAck("事件未触发,被开关拦截",mapOf("roadEvent" to event, "v2nMainSwitch" to FunctionBuildConfig.v2nMainSwitch,"isNewV2NData" to FunctionBuildConfig.isNewV2NData), true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NCarTypeCheck
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
|
||||
@@ -317,11 +317,11 @@ internal object V2NIdentifyDrawer {
|
||||
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?) {
|
||||
super.onAutopilotIdentifyDataUpdate(trafficData)
|
||||
val shiGong = trafficData?.filter { it.type == 501 || it.type == 502 }
|
||||
if (shiGong != null && shiGong.isNotEmpty()) {
|
||||
if (!shiGong.isNullOrEmpty()) {
|
||||
drawShiGong(shiGong)
|
||||
}
|
||||
val shiGu = trafficData?.filter { it.type == 13 }
|
||||
if (shiGu != null && shiGu.isNotEmpty()) {
|
||||
if (!shiGu.isNullOrEmpty()) {
|
||||
drawShiGu(shiGu)
|
||||
}
|
||||
}
|
||||
@@ -340,21 +340,21 @@ internal object V2NIdentifyDrawer {
|
||||
}
|
||||
|
||||
private fun drawShiGong(events: List<TrackedObject>) {
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
handler.removeMessages(MSG_WHAT_DRAW_SHIGONE)
|
||||
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGONE, events))
|
||||
}
|
||||
}
|
||||
|
||||
private fun drawShiGu(events: List<TrackedObject>) {
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
handler.removeMessages(MSG_WHAT_DRAW_SHIGU)
|
||||
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGU, events))
|
||||
}
|
||||
}
|
||||
|
||||
private fun drawYongDu(events: List<MogoV2X.RTEData_PB>) {
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
handler.removeMessages(MSG_WHAT_DRAW_YONGDU)
|
||||
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_YONGDU, events))
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class AiRoadMarker {
|
||||
countDown.incrementAndGet()
|
||||
realMark(marker, wrapper, l1, l2, location.heading)
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
wrapper.onRemoved = { id ->
|
||||
aiMakers.remove(id)
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class V2XAiRoadEventMarker {
|
||||
CallerMapUIServiceManager.getOverlayManager()?.removeLine(line.id)
|
||||
}
|
||||
val markers = pair.second
|
||||
if (markers != null && markers.isNotEmpty()) {
|
||||
if (!markers.isNullOrEmpty()) {
|
||||
for (m in markers) {
|
||||
CallerMapUIServiceManager.getOverlayManager()?.removePoint(m.id)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.datacenter.autopilot.telematic
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.ProcessLifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.google.protobuf.TextFormat
|
||||
@@ -11,9 +12,11 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_STATUS
|
||||
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
|
||||
import com.mogo.eagle.core.data.v2x.V2XEvent.RoadEventX
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw
|
||||
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
@@ -32,6 +35,7 @@ import io.netty.channel.Channel
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.nio.charset.Charset
|
||||
|
||||
class TeleMsgHandler : IMsgHandler {
|
||||
|
||||
@@ -58,6 +62,20 @@ class TeleMsgHandler : IMsgHandler {
|
||||
|
||||
override fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel?) {
|
||||
msg?.let {
|
||||
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_DATA_TO_PASSENGER) {
|
||||
try {
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的V2N事件 --- 1 ---")
|
||||
val content = String(it.body, Charset.defaultCharset())
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的V2N事件 --- 2 ---:$content")
|
||||
val data = GsonUtils.fromJson(content, RoadEventX::class.java)
|
||||
Log.d(TAG, "乘客屏收到司机屏转发云端下发的V2N事件 --- 3 ---:$data")
|
||||
CallerCloudListenerManager.invokeSocketAck(data)
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
Log.e(TAG, "乘客屏收到司机屏转发云端下发的V2N事件异常", t)
|
||||
}
|
||||
return
|
||||
}
|
||||
when (it.protocolType) {
|
||||
MogoProtocolMsg.NORMAL_DATA -> {
|
||||
try {
|
||||
|
||||
@@ -604,7 +604,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
* 显示V2X事件的Marker
|
||||
*/
|
||||
private fun showV2XEventMarkers(v2XEventData: List<V2XEventData>?) {
|
||||
if (v2XEventData == null || v2XEventData.isEmpty()) return
|
||||
if (v2XEventData.isNullOrEmpty()) return
|
||||
clearV2XMarkers()
|
||||
val markerOptionsList = ArrayList<MarkerOptions>()
|
||||
for (v2xEvent in v2XEventData) {
|
||||
|
||||
@@ -11,6 +11,7 @@ class TelematicConstant {
|
||||
const val SHOW_TRAFFIC_LIGHT = 101
|
||||
const val HIDE_TRAFFIC_LIGHT = 102
|
||||
const val CONTROL_PASSENGER_DRIVER_MONITOR = 105
|
||||
const val V2N_AI_ROAD_DATA_TO_PASSENGER = 106 // V2N老链路云端下发给司机屏的数据,转发给乘客端
|
||||
|
||||
const val OBU_RUNREDLIGHT_WARNING = 200 //闯红灯预警开关
|
||||
const val OBU_GREENWAVE_WARNING = 201 //绿波通行开关
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoV2XListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager.V2NCarTypeCheck.Companion.verifyCarType
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import mogo.v2x.MogoV2X
|
||||
@@ -18,9 +19,23 @@ object CallerV2XListenerManager : CallerBase<IMoGoV2XListener>() {
|
||||
private var congestionTmp: MogoV2X.RSI_PB? = null
|
||||
private var parkingViolationTmp: MogoV2X.RSM_PB? = null
|
||||
|
||||
class V2NCarTypeCheck {
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun verifyCarType(): Boolean {
|
||||
val appIdentityMode = FunctionBuildConfig.appIdentityMode
|
||||
return AppIdentityModeUtils.isTaxi(appIdentityMode) || //Taxi司乘屏
|
||||
AppIdentityModeUtils.isBus(appIdentityMode) || //公交司乘屏
|
||||
AppIdentityModeUtils.isM2(appIdentityMode) || //B2接驳司乘屏
|
||||
AppIdentityModeUtils.isJL(appIdentityMode) //B1接驳司乘屏
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: IMoGoV2XListener) {
|
||||
if (eventCountTmp >= 0) {
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
if (verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
listener.onV2nGlobalPathEvents(eventCountTmp, constructTmp, triangleTmp, congestionTmp, parkingViolationTmp)
|
||||
}
|
||||
}
|
||||
@@ -37,7 +52,7 @@ object CallerV2XListenerManager : CallerBase<IMoGoV2XListener>() {
|
||||
parkingViolationTmp = parkingViolation
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
if (verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
listener.onV2nGlobalPathEvents(eventCount, construct, triangle, congestion, parkingViolation)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user