[6.2.4] union v2x and init trace file and extends trace of common param
This commit is contained in:
@@ -113,7 +113,7 @@ class DispatchAutoPilotManager private constructor() :
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_DISPATCH_RECEIVE,
|
||||
paramIndexes = [0]
|
||||
@@ -140,7 +140,7 @@ class DispatchAutoPilotManager private constructor() :
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_DISPATCH_START,
|
||||
paramIndexes = [-1]
|
||||
@@ -348,7 +348,7 @@ class DispatchAutoPilotManager private constructor() :
|
||||
AIAssist.getInstance(mContext).speakTTSVoice("云调度完成,车辆已到达${it.endLocAddress}")
|
||||
}
|
||||
}else{
|
||||
V2XBizTrace.onAck(M_BIZ + TAG, mapOf("arriveErrorMsg" to "不在到站距离范围内", "ArriveAtStation" to arrivalNotification, "distanceFromSelf" to distanceFromSelf))
|
||||
V2XBizTrace.onAck(M_BIZ + TAG, mapOf("arriveErrorMsg" to "不在到站距离范围内", "ArriveAtStation" to arrivalNotification, "distanceFromSelf" to distanceFromSelf), true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +1,45 @@
|
||||
package com.mogo.eagle.function.biz.v2x
|
||||
|
||||
import android.util.*
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainCommon
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
|
||||
class V2XBizTrace {
|
||||
|
||||
companion object {
|
||||
|
||||
fun onAck(data: Any, data1: Any, param: Boolean = false) {
|
||||
Log.d("V2X", "tag:$data, msg: $data1")
|
||||
if (param) {
|
||||
val cal = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val lineId = CallerAutoPilotStatusListenerManager.getLineId()
|
||||
realParamAction(data, data1, ChainCommon(cal.latitude, cal.longitude, lineId))
|
||||
} else {
|
||||
realAction(data, data1)
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
|
||||
paramIndexes = [0, 1]
|
||||
)
|
||||
fun onAck(data: Any, data1: Any) {
|
||||
Log.d("V2X", "tag:$data, msg: $data1")
|
||||
private fun realAction(data: Any, data1: Any) {
|
||||
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
|
||||
paramIndexes = [0, 1, 2]
|
||||
)
|
||||
private fun realParamAction(data: Any, data1: Any, chainCommon: ChainCommon) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ 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_V2X
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_STATUS
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew.Companion.isRoadEvent
|
||||
@@ -115,7 +115,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
||||
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
||||
V2XBizTrace.onAck("巡航处理 handlerMessage v2XMessageEntity", " $v2XMessageEntity")
|
||||
}else{
|
||||
V2XBizTrace.onAck("事件未触发,巡航处理", mapOf("roadEvent" to v2XRoadEventEntity, "distance" to distance))
|
||||
V2XBizTrace.onAck("事件未触发,巡航处理", mapOf("roadEvent" to v2XRoadEventEntity, "distance" to distance), true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
||||
* V2XEvent事件回调
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_V2X,
|
||||
linkChainLog = CHAIN_TYPE_STATUS,
|
||||
linkCode = CHAIN_SOURCE_CLOUD,
|
||||
nodeAliasCode = CHAIN_CODE_V2X_MSG,
|
||||
paramIndexes = [0]
|
||||
@@ -173,18 +173,18 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
|
||||
if (!AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !FunctionBuildConfig.v2nMainSwitch || !FunctionBuildConfig.isNewV2NData) {
|
||||
handleRoadMarkerEvent(event.data.toRoadMarker())
|
||||
}else{
|
||||
V2XBizTrace.onAck("事件未触发,被开关拦截",mapOf("roadEvent" to event, "v2nMainSwitch" to FunctionBuildConfig.v2nMainSwitch,"isNewV2NData" to FunctionBuildConfig.isNewV2NData))
|
||||
V2XBizTrace.onAck("事件未触发,被开关拦截",mapOf("roadEvent" to event, "v2nMainSwitch" to FunctionBuildConfig.v2nMainSwitch,"isNewV2NData" to FunctionBuildConfig.isNewV2NData), true)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
V2XBizTrace.onAck("事件未触发,不识别的新事件",mapOf("roadEvent" to event))
|
||||
V2XBizTrace.onAck("事件未触发,不识别的新事件",mapOf("roadEvent" to event), true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_V2X,
|
||||
linkChainLog = CHAIN_TYPE_STATUS,
|
||||
linkCode = CHAIN_SOURCE_ADAS,
|
||||
nodeAliasCode = CHAIN_CODE_V2X_MSG,
|
||||
paramIndexes = [0]
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.mogo.eagle.function.biz.v2x.v2n.alarm;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BIZ;
|
||||
|
||||
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.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.eagle.function.biz.v2x.V2XBizTrace;
|
||||
|
||||
@@ -39,7 +41,7 @@ public class V2XAlarmServer {
|
||||
CopyOnWriteArrayList<V2XRoadEventEntity> v2XRoadEventEntityList,
|
||||
MogoLocation currentLocation) {
|
||||
try {
|
||||
Logger.d(TAG, "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
|
||||
CallerLogger.d(M_BIZ + TAG, "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
|
||||
if (!showedEvents.isEmpty()) {
|
||||
Iterator<V2XRoadEventEntity> iterator = showedEvents.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -56,18 +58,18 @@ public class V2XAlarmServer {
|
||||
}
|
||||
}
|
||||
}
|
||||
Logger.d(TAG, "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
|
||||
CallerLogger.d(M_BIZ + TAG, "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
|
||||
if (currentLocation != null && v2XRoadEventEntityList != null) {
|
||||
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
|
||||
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
|
||||
// 0、道路事件必须有朝向,角度>=0;
|
||||
//Logger.d(TAG, "entity:" + v2XRoadEventEntity.getLocation());
|
||||
//CallerLogger.d(M_BIZ + TAG, "entity:" + v2XRoadEventEntity.getLocation());
|
||||
if (v2XRoadEventEntity.getLocation().getAngle() >= 0) {
|
||||
// 计算车辆距离指定气泡的距离
|
||||
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
|
||||
// 1、判断是否到达了触发距离,20 ~ 500,
|
||||
double distance = v2XRoadEventEntity.getDistance();
|
||||
Logger.d(TAG, "distance:" + distance + ",poiType:" + v2XRoadEventEntity.getPoiType());
|
||||
CallerLogger.d(M_BIZ + TAG, "distance:" + distance + ",poiType:" + v2XRoadEventEntity.getPoiType());
|
||||
if (distance <= 500) {
|
||||
if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
|
||||
if (distance > 25) {
|
||||
@@ -78,7 +80,7 @@ public class V2XAlarmServer {
|
||||
double carBearing = currentLocation.getHeading();
|
||||
double eventBearing = eventLocation.getAngle();
|
||||
double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing);
|
||||
Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
|
||||
CallerLogger.d(M_BIZ + TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
|
||||
if (diffAngle <= 30) {
|
||||
// 3、计算当前车辆行驶方向与事件位置之间夹角《20度,保证道路事件在车辆前方
|
||||
double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
@@ -89,31 +91,31 @@ public class V2XAlarmServer {
|
||||
(int) currentLocation.getHeading()
|
||||
);
|
||||
|
||||
Logger.d(TAG, "eventAngle:" + eventAngle);
|
||||
CallerLogger.d(M_BIZ + TAG, "eventAngle:" + eventAngle);
|
||||
if (0 <= eventAngle && eventAngle <= 25) {
|
||||
if (showedEvents.contains(v2XRoadEventEntity)) {
|
||||
return null;
|
||||
}
|
||||
Logger.d(TAG, "showed---");
|
||||
CallerLogger.d(M_BIZ + TAG, "showed---");
|
||||
showedEvents.add(v2XRoadEventEntity);
|
||||
return v2XRoadEventEntity;
|
||||
}
|
||||
}else{
|
||||
HashMap map = new HashMap<String,Double>();
|
||||
map.put("diffAngle",diffAngle);
|
||||
V2XBizTrace.Companion.onAck("事件未触发,未达到触发角度",map);
|
||||
V2XBizTrace.Companion.onAck("事件未触发,未达到触发角度",map,true);
|
||||
}
|
||||
}else{
|
||||
HashMap map = new HashMap<String,Double>();
|
||||
map.put("distance",distance);
|
||||
V2XBizTrace.Companion.onAck("事件未触发,未达到触发距离",map);
|
||||
V2XBizTrace.Companion.onAck("事件未触发,未达到触发距离",map,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Logger.w(TAG, "error: " + e.getMessage());
|
||||
CallerLogger.w(M_BIZ + TAG, "error: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
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.util.DeviceUtils
|
||||
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.V2XPoiLoader
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
@@ -102,7 +104,7 @@ internal class V2XRefreshModel {
|
||||
CallerLogger.d(SceneConstant.M_V2X + TAG, "请求成功,size为:${it.result?.v2XEventList?.size}")
|
||||
return@map it.result?.v2XEventList
|
||||
} else {
|
||||
CallerLogger.d(SceneConstant.M_V2X + TAG, "请求失败,code为:${it.code}")
|
||||
V2XBizTrace.onAck("${SceneConstant.M_V2X}$TAG", mapOf("v2xEventsSummaryError" to it.code), true)
|
||||
return@map ArrayList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,35 @@
|
||||
package com.mogo.eagle.function.biz.v2x.v2n.pnc
|
||||
|
||||
import android.os.*
|
||||
import androidx.core.util.*
|
||||
import com.mogo.eagle.core.data.config.*
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
import android.os.Message
|
||||
import androidx.core.util.Pair
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum.ALERT_WARNING_TOP
|
||||
import com.mogo.eagle.core.data.map.entity.*
|
||||
import com.mogo.eagle.core.data.msgbox.*
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerLocation
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType.V2X
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.angle.scenes.Default
|
||||
import com.mogo.eagle.core.function.angle.scenes.RoadEvent
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.hmi.*
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
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.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.*
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
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
|
||||
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.*
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker.Marker
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.utils.V2XEventAnalyticsManager
|
||||
import mogo.telematics.pad.MessagePad.Header
|
||||
@@ -36,22 +45,28 @@ internal object V2NIdentifyDrawer {
|
||||
private const val TAG = "V2NIdentifyDataSubscriber"
|
||||
|
||||
private const val MSG_WHAT_DRAW_SHIGONE = 0x1010 // 道路施工
|
||||
private const val MSG_WHAT_DRAW_SHIGU = 0x1011 // 交通事故
|
||||
private const val MSG_WHAT_DRAW_YONGDU = 0x1012 // 交通拥堵
|
||||
private const val MSG_WHAT_DRAW_SHIGU = 0x1011 // 交通事故
|
||||
private const val MSG_WHAT_DRAW_YONGDU = 0x1012 // 交通拥堵
|
||||
|
||||
private val callback = Handler.Callback { msg ->
|
||||
if (msg.what == MSG_WHAT_DRAW_SHIGONE || msg.what == MSG_WHAT_DRAW_SHIGU) {
|
||||
val events = msg.obj as? List<*>
|
||||
if (events == null || events.isEmpty()) {
|
||||
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu" to ""))
|
||||
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu" to ""), true)
|
||||
return@Callback true
|
||||
}
|
||||
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
val filtered = events.filterIsInstance(TrackedObject::class.java).filter { itx ->
|
||||
DrivingDirectionUtils.getDegreeOfCar2Poi(car.longitude, car.latitude, itx.longitude, itx.latitude, car.heading.toInt()) < 90
|
||||
DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
car.longitude,
|
||||
car.latitude,
|
||||
itx.longitude,
|
||||
itx.latitude,
|
||||
car.heading.toInt()
|
||||
) < 90
|
||||
}
|
||||
if (filtered.isEmpty()) {
|
||||
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu-filter" to ""))
|
||||
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu-filter" to ""), true)
|
||||
return@Callback true
|
||||
}
|
||||
filtered.forEach { itx ->
|
||||
@@ -60,68 +75,121 @@ internal object V2NIdentifyDrawer {
|
||||
AiRoadMarker().apply {
|
||||
val poiType = getPoiType(itx.type).poiType
|
||||
val polygon = itx.polygonList.map { Pair.create(it.longitude, it.latitude) }
|
||||
marker(Marker(id, poiType, itx.latitude,itx.longitude, itx.heading, polygon, null,
|
||||
marker(Marker(id,
|
||||
poiType,
|
||||
itx.latitude,
|
||||
itx.longitude,
|
||||
itx.heading,
|
||||
polygon,
|
||||
null,
|
||||
V2XRoadEventEntity().also { e ->
|
||||
e.poiType = poiType
|
||||
e.location = MarkerLocation().also { l ->
|
||||
val p = CoordinateTransform.WGS84ToGCJ02(itx.longitude, itx.latitude)
|
||||
l.lon = p[0]
|
||||
l.lat = p[1]
|
||||
l.angle = itx.heading
|
||||
}
|
||||
e.noveltyInfo = MarkerExploreWay().also {
|
||||
it.poiType = poiType
|
||||
it.location = e.location
|
||||
it.polygon = polygon
|
||||
}
|
||||
}), true, isDrawRoadLine(poiType))
|
||||
e.location = MarkerLocation().also { l ->
|
||||
val p = CoordinateTransform.WGS84ToGCJ02(
|
||||
itx.longitude,
|
||||
itx.latitude
|
||||
)
|
||||
l.lon = p[0]
|
||||
l.lat = p[1]
|
||||
l.angle = itx.heading
|
||||
}
|
||||
e.noveltyInfo = MarkerExploreWay().also {
|
||||
it.poiType = poiType
|
||||
it.location = e.location
|
||||
it.polygon = polygon
|
||||
}
|
||||
}), true, isDrawRoadLine(poiType)
|
||||
)
|
||||
|
||||
val distance = CoordinateUtils.calculateLineDistance(itx.longitude, itx.latitude, car.longitude, car.latitude)
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
itx.longitude,
|
||||
itx.latitude,
|
||||
car.longitude,
|
||||
car.latitude
|
||||
)
|
||||
val alertContent = getAlertContent(poiType, distance.toDouble())
|
||||
val ttsContent = getTtsContent(poiType, distance.toDouble())
|
||||
V2XBizTrace.onAck(TAG,"绘制poi事件:$poiType")
|
||||
saveMsgBox(MsgBoxBean(V2X, V2XMsg(poiType, alertContent, ttsContent,CommunicationType.V2N.name)))
|
||||
CallerHmiManager.warningV2X(poiType, alertContent, ttsContent, object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
CallerVisualAngleManager.changeAngle(RoadEvent(itx.longitude, itx.latitude, itx.angle))
|
||||
}
|
||||
V2XBizTrace.onAck(TAG, "绘制poi事件:$poiType")
|
||||
saveMsgBox(
|
||||
MsgBoxBean(
|
||||
V2X,
|
||||
V2XMsg(
|
||||
poiType,
|
||||
alertContent,
|
||||
ttsContent,
|
||||
CommunicationType.V2N.name
|
||||
)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
poiType,
|
||||
alertContent,
|
||||
ttsContent,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
CallerVisualAngleManager.changeAngle(
|
||||
RoadEvent(
|
||||
itx.longitude,
|
||||
itx.latitude,
|
||||
itx.angle
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
}
|
||||
}, ALERT_WARNING_TOP, 10000, false)
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
}
|
||||
},
|
||||
ALERT_WARNING_TOP,
|
||||
10000,
|
||||
false
|
||||
)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(poiType, alertContent, ttsContent,
|
||||
DataSourceType.AICLOUD,CommunicationType.V2N)
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(
|
||||
poiType, alertContent, ttsContent,
|
||||
DataSourceType.AICLOUD, CommunicationType.V2N
|
||||
)
|
||||
}
|
||||
}.receive()
|
||||
}
|
||||
} else if (msg.what == MSG_WHAT_DRAW_YONGDU) {
|
||||
val events = msg.obj as? List<*>
|
||||
if (events == null || events.isEmpty()) {
|
||||
V2XBizTrace.onAck(TAG, mapOf("yongDu" to ""))
|
||||
V2XBizTrace.onAck(TAG, mapOf("yongDu" to ""), true)
|
||||
return@Callback true
|
||||
}
|
||||
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
val filtered = events.filterIsInstance(MogoV2X.RTEData_PB::class.java).filter { itx ->
|
||||
val eventLon = itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 } ?: 0.0
|
||||
val eventLat = itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 } ?: 0.0
|
||||
DrivingDirectionUtils.getDegreeOfCar2Poi(car.longitude, car.latitude, eventLon, eventLat, car.heading.toInt()) < 90
|
||||
val eventLon =
|
||||
itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 }
|
||||
?: 0.0
|
||||
val eventLat =
|
||||
itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 }
|
||||
?: 0.0
|
||||
DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
car.longitude,
|
||||
car.latitude,
|
||||
eventLon,
|
||||
eventLat,
|
||||
car.heading.toInt()
|
||||
) < 90
|
||||
}
|
||||
if (filtered.isEmpty()) {
|
||||
V2XBizTrace.onAck(TAG, mapOf("yongDu-filter" to ""))
|
||||
V2XBizTrace.onAck(TAG, mapOf("yongDu-filter" to ""), true)
|
||||
return@Callback true
|
||||
}
|
||||
filtered.forEach { itx ->
|
||||
val id = itx.rteId.toString()
|
||||
val lon = itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 } ?: 0.0
|
||||
val lat = itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 } ?: 0.0
|
||||
val lon = itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 }
|
||||
?: 0.0
|
||||
val lat = itx.eventPos?.offsetLL?.positionLatLon?.lat?.let { it * 1.0 / 10_000_000 }
|
||||
?: 0.0
|
||||
AiRoadMarker.aiMakers.getOrPut(id) {
|
||||
AiRoadMarker().apply {
|
||||
val poiType = getPoiType(itx.eventType).poiType
|
||||
marker(Marker(id, poiType, lat, lon, car.heading, null, null,
|
||||
marker(Marker(id, poiType, lat, lon, car.heading, null, null,
|
||||
V2XRoadEventEntity().also { e ->
|
||||
e.poiType = poiType
|
||||
e.location = MarkerLocation().also { l ->
|
||||
@@ -135,27 +203,59 @@ internal object V2NIdentifyDrawer {
|
||||
it.location = e.location
|
||||
it.polygon = emptyList()
|
||||
}
|
||||
}), true, isDrawRoadLine(poiType))
|
||||
}), true, isDrawRoadLine(poiType)
|
||||
)
|
||||
|
||||
val distance = CoordinateUtils.calculateLineDistance(lon, lat, car.longitude, car.latitude)
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
lon,
|
||||
lat,
|
||||
car.longitude,
|
||||
car.latitude
|
||||
)
|
||||
val alertContent = getAlertContent(poiType, distance.toDouble())
|
||||
val ttsContent = getTtsContent(poiType, distance.toDouble())
|
||||
V2XBizTrace.onAck(TAG,"绘制poi事件:$poiType")
|
||||
saveMsgBox(MsgBoxBean(V2X, V2XMsg(poiType, alertContent, ttsContent,CommunicationType.V2N.name)))
|
||||
CallerHmiManager.warningV2X(poiType, alertContent, ttsContent, object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
CallerVisualAngleManager.changeAngle(RoadEvent(lon, lat, car.heading))
|
||||
}
|
||||
V2XBizTrace.onAck(TAG, "绘制poi事件:$poiType")
|
||||
saveMsgBox(
|
||||
MsgBoxBean(
|
||||
V2X,
|
||||
V2XMsg(
|
||||
poiType,
|
||||
alertContent,
|
||||
ttsContent,
|
||||
CommunicationType.V2N.name
|
||||
)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
poiType,
|
||||
alertContent,
|
||||
ttsContent,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
CallerVisualAngleManager.changeAngle(
|
||||
RoadEvent(
|
||||
lon,
|
||||
lat,
|
||||
car.heading
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
}
|
||||
}, ALERT_WARNING_TOP, 10000, false)
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
}
|
||||
},
|
||||
ALERT_WARNING_TOP,
|
||||
10000,
|
||||
false
|
||||
)
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(poiType, alertContent, ttsContent,
|
||||
DataSourceType.AICLOUD,CommunicationType.V2N)
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(
|
||||
poiType, alertContent, ttsContent,
|
||||
DataSourceType.AICLOUD, CommunicationType.V2N
|
||||
)
|
||||
}
|
||||
}.receive()
|
||||
}
|
||||
@@ -181,7 +281,7 @@ internal object V2NIdentifyDrawer {
|
||||
}
|
||||
|
||||
private fun getAlertContent(poiType: String, distance: Double): String {
|
||||
return when(poiType) {
|
||||
return when (poiType) {
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType -> {
|
||||
"前方${distance.toInt()}米道路施工"
|
||||
}
|
||||
@@ -201,7 +301,10 @@ internal object V2NIdentifyDrawer {
|
||||
return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType == poiType
|
||||
}
|
||||
|
||||
private fun getPoiType(type: Int): EventTypeEnumNew = if (type == 501 || type == 502) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG else if (type == 13) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU else if (type == 102) EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION else throw AssertionError("error!!!")
|
||||
private fun getPoiType(type: Int): EventTypeEnumNew =
|
||||
if (type == 501 || type == 502) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG else if (type == 13) EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU else if (type == 102) EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION else throw AssertionError(
|
||||
"error!!!"
|
||||
)
|
||||
|
||||
private val handler by lazy {
|
||||
val thread = HandlerThread("v2n_identify_drawer")
|
||||
@@ -225,12 +328,7 @@ internal object V2NIdentifyDrawer {
|
||||
|
||||
override fun onAutopilotV2nCongestionEvent(header: Header, rsi: RSI_PB) {
|
||||
super.onAutopilotV2nCongestionEvent(header, rsi)
|
||||
try {
|
||||
V2XBizTrace.onAck("onAutopilotV2nCongestionEvent", rsi)
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
|
||||
V2XBizTrace.onAck("onAutopilotV2nCongestionEvent", rsi)
|
||||
rsi.rsiFrame?.rtes?.rteDataList?.filter {
|
||||
it.eventType == 102
|
||||
}?.takeIf {
|
||||
@@ -242,7 +340,7 @@ internal object V2NIdentifyDrawer {
|
||||
}
|
||||
|
||||
private fun drawShiGong(events: List<TrackedObject>) {
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
|
||||
handler.removeMessages(MSG_WHAT_DRAW_SHIGONE)
|
||||
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGONE, events))
|
||||
}
|
||||
|
||||
@@ -136,11 +136,11 @@ class AiRoadMarker {
|
||||
return@post
|
||||
}
|
||||
if (l1 == null || l2 == null) {
|
||||
V2XBizTrace.onAck("$TAG -marker-3-line null return ----", "")
|
||||
V2XBizTrace.onAck("$TAG -marker-3-line null return ----", "", true)
|
||||
return@post
|
||||
}
|
||||
if (l1.points.isEmpty() || l2.points.isEmpty()) {
|
||||
V2XBizTrace.onAck("$TAG -marker-3-line points null return ----", "")
|
||||
V2XBizTrace.onAck("$TAG -marker-3-line points null return ----", "", true)
|
||||
return@post
|
||||
}
|
||||
V2XBizTrace.onAck("$TAG -marker-4-l2:", l2)
|
||||
|
||||
@@ -36,10 +36,10 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (overlayManager != null) {
|
||||
if (entity != null) {
|
||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> poiType : ", entity.getPoiType());
|
||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> poiType : ", entity.getPoiType(), false);
|
||||
if (isAiRoadEvent(entity.getPoiType())) {
|
||||
MarkerExploreWay noveltyInfo = entity.getNoveltyInfo();
|
||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> noveltyInfo : ",noveltyInfo.toString());
|
||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> noveltyInfo : ",noveltyInfo.toString(), false);
|
||||
Pair<Double, Double> gpsLocation = noveltyInfo.getGpsLocation();
|
||||
List<Pair<Double, Double>> polygons = noveltyInfo.getPolygon();
|
||||
if (gpsLocation != null && polygons != null) {
|
||||
@@ -57,7 +57,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
|
||||
.set3DMode(true)
|
||||
.icon3DRes(EventTypeEnumNew.getMarker3DRes(entity.getPoiType())).build(),DEFAULT);
|
||||
if (point != null) {
|
||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> --- add Marker type: ", entity.getPoiType());
|
||||
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> --- add Marker type: ", entity.getPoiType(), false);
|
||||
ArrayList<Point> markers = new ArrayList<>();
|
||||
markers.add(point);
|
||||
String id = entity.getLocation().getLon() + "_" + entity.getLocation().getLat();
|
||||
|
||||
@@ -48,7 +48,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
@Override
|
||||
public void init(V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity) {
|
||||
try {
|
||||
V2XBizTrace.Companion.onAck("v2XMessageEntity",v2XMessageEntity);
|
||||
V2XBizTrace.Companion.onAck("v2XMessageEntity",v2XMessageEntity,false);
|
||||
V2XRoadEventEntity v2XRoadEventEntity = v2XMessageEntity.getContent();
|
||||
if (v2XRoadEventEntity != null) {
|
||||
if (!isSameScenario(v2XMessageEntity)) {
|
||||
|
||||
@@ -123,7 +123,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
}
|
||||
|
||||
if (trafficLightResult.currentRoadTrafficLight() == null) {
|
||||
V2XBizTrace.onAck("$M_V2X$TAG", "vip获取到灯态,但没找到对应车道数据 trafficLight:$$trafficLightResult")
|
||||
V2XBizTrace.onAck("$M_V2X$TAG", "vip获取到灯态,但没找到对应车道数据 trafficLight:$$trafficLightResult", true)
|
||||
result = null
|
||||
return
|
||||
}
|
||||
@@ -258,7 +258,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
",crossId:${result?.crossId}" +
|
||||
",bearing:$bearing" +
|
||||
",controlTime:$controlTime"
|
||||
)
|
||||
,true)
|
||||
ToastUtils.showLong("服务异常,请稍后重试")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user