[6.2.4]merge

This commit is contained in:
zhongchao
2023-12-14 15:28:45 +08:00
73 changed files with 563 additions and 620 deletions

View File

@@ -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)
}
}

View File

@@ -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) {
}
}
}

View File

@@ -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]

View File

@@ -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;
}

View File

@@ -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()
}
}

View File

@@ -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))
}

View File

@@ -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)

View File

@@ -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();

View File

@@ -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)) {

View File

@@ -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("服务异常,请稍后重试")
})
}

View File

@@ -828,7 +828,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
* @param rsi 数据
*/
@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]
@@ -848,7 +848,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
* @param parkingViolation 违停 ---包含 静态障碍车
*/
@ChainLog(
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
nodeAliasCode = ChainConstant.CHAIN_CODE_V2X_MSG,
paramIndexes = [0]

View File

@@ -407,4 +407,8 @@ class DevaToolsProvider : IDevaToolsProvider {
override fun block(): IMoGoBlockProvider? = block
override fun usage(): IMoGoCpuUsageProvider? = usage
override fun setNetworkMode(isDebug: Boolean) {
WeakNetworkStrategy.setDebug(isDebug)
}
}

View File

@@ -4,10 +4,10 @@ import android.content.Context
import com.mogo.commons.constants.HostConst
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarInfo
import com.mogo.eagle.core.data.deva.bindingcar.BindingCarRequest
import com.mogo.eagle.core.data.deva.bindingcar.ModifyBindingcarInfo
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog
@@ -74,8 +74,19 @@ class BindingCarNetWorkManager private constructor() {
.subscribe(object : Observer<BindingCarInfo> {
override fun onSubscribe(d: Disposable) {}
override fun onNext(info: BindingCarInfo) {
if (info != null && info.getData() != null) {
bindLog(mapOf("bindResult" to true,"carType" to getDefaultId(),"msg" to info))
if (info?.getData() != null) {
if ((info.code != 0 && info.code != 200)) {
bindLog(mapOf("bindResult" to false, "msg" to info.toString()))
return
}
bindLog(
mapOf(
"bindResult" to true,
"carType" to getDefaultId(),
"msg" to info
)
)
SharedPrefsMgr.getInstance(context).putString(
SharedPrefsConstants.CAR_INFO,
GsonUtils.toJson(info.getData())
@@ -87,15 +98,22 @@ class BindingCarNetWorkManager private constructor() {
}
updateCarVrIconRes(info.getData().brandId)
} else {
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, "")
e(SceneConstant.M_DEVA + TAG, "getBindingCarInfo data = null ---getDefaultId() : ${getDefaultId()} ")
SharedPrefsMgr.getInstance(context)
.putString(SharedPrefsConstants.CAR_INFO, "")
e(
SceneConstant.M_DEVA + TAG,
"getBindingCarInfo data = null ---getDefaultId() : ${getDefaultId()} "
)
}
}
override fun onError(e: Throwable) {
SharedPrefsMgr.getInstance(context).putString(SharedPrefsConstants.CAR_INFO, "")
bindLog(mapOf("bindResult" to false,"msg" to e.toString()))
e(SceneConstant.M_DEVA + TAG, "getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message + "---getDefaultId() : ${getDefaultId()}")
bindLog(mapOf("bindResult" to false, "msg" to e.toString()))
e(
SceneConstant.M_DEVA + TAG,
"getBindingCarInfo onError e = " + e.toString() + "---e.getMessage = " + e.message + "---getDefaultId() : ${getDefaultId()}"
)
}
override fun onComplete() {}
@@ -131,14 +149,18 @@ class BindingCarNetWorkManager private constructor() {
override fun onSubscribe(d: Disposable) {}
override fun onNext(info: ModifyBindingcarInfo) {
if (info != null) {
if ((info.code != 0 && info.code != 200)) {
bindLog(mapOf("bindingStatus" to false, "bindMsg" to info.toString()))
return
}
callBack.invoke(info)
bindLog(mapOf("bindingStatus" to true,"bindMsg" to info))
bindLog(mapOf("bindingStatus" to true, "bindMsg" to info))
updateCarVrIconRes(info.data.brandId)
}
}
override fun onError(e: Throwable) {
bindLog(mapOf("bindingStatus" to false,"bindMsg" to e.toString()))
bindLog(mapOf("bindingStatus" to false, "bindMsg" to e.toString()))
}
override fun onComplete() {}
@@ -147,7 +169,7 @@ class BindingCarNetWorkManager private constructor() {
private fun updateCarVrIconRes(brandId: String?) {
d(SceneConstant.M_DEVA + TAG, "CarModelChange : ${DebugConfig.isCarModelChange()}")
if(!DebugConfig.isCarModelChange()){
if (!DebugConfig.isCarModelChange()) {
return
}
if (brandId == null || brandId.isEmpty()) {
@@ -188,7 +210,7 @@ class BindingCarNetWorkManager private constructor() {
nodeAliasCode = ChainConstant.CHAIN_CODE_BINDING_CAR,
paramIndexes = [0]
)
private fun bindLog(msg:Map<String,Any>){
private fun bindLog(msg: Map<String, Any>) {
d(SceneConstant.M_DEVA + TAG, "bindLog : $msg")
}

View File

@@ -253,14 +253,6 @@ internal class OverViewImpl(ctx: Context) : IFlow<OverViewStatus>(ctx),
}
}
/**
* 工控机连接状态
*/
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
}
override fun onDestroy() {
super.onDestroy()
// CallerDevaToolsListenerManager.removeListener(TAG)

View File

@@ -1,7 +1,6 @@
package com.zhjt.mogo_core_function_devatools.status.flow.rtk
import android.content.Context
import android.util.Log
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
@@ -66,7 +65,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
check?.takeIf { it.isActive }?.cancel()
isOldVersion.set(false)
val info = status.healthInfoList?.find { "localization".equals(it.name, true) }
Log.d(TAG, "info: $info")
CallerLogger.d("$M_DEVA$TAG", "info: $info")
if (info != null) {
healthInfo.set(info)
send(RTKStatus(getDesc(), getCode()))
@@ -77,7 +76,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
check?.takeIf { it.isActive }?.cancel()
isOldVersion.set(false)
val info = statusInf.healthInfoList?.find { "localization".equals(it.name, true) }
Log.d(TAG, "info: $info")
CallerLogger.d("$M_DEVA$TAG", "info: $info")
if (info != null) {
healthInfo.set(info)
send(RTKStatus(getDesc(), getCode()))

View File

@@ -74,8 +74,6 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_ADAS_TRAFFIC_LIGHT)
fwBuildMap[ChainConstant.CHAIN_TYPE_ANR_LEAK] =
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_ANR)
fwBuildMap[ChainConstant.CHAIN_TYPE_V2X] =
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_V2X)
fwBuildMap[ChainConstant.CHAIN_TYPE_WEAK_NETWORK] =
FwBuild(true, -1, pkgName + ChainConstant.CHAIN_LINK_LOG_RECORD_WEAK_NETWORK)
fwBuildMap[ChainConstant.CHAIN_TYPE_OCH] =
@@ -98,8 +96,6 @@ class TraceManager : IMoGoCloudListener, IMoGoAutopilotCarConfigListener {
ChainLogParam(true, "红绿灯Union数据")
traceInfoCache[ChainConstant.CHAIN_TYPE_ANR_LEAK] =
ChainLogParam(true, "ANR Record")
traceInfoCache[ChainConstant.CHAIN_TYPE_V2X] =
ChainLogParam(true, "V2X(V2N/V2I)")
traceInfoCache[ChainConstant.CHAIN_TYPE_WEAK_NETWORK] =
ChainLogParam(true, "WeakNetWork Record")

View File

@@ -15,7 +15,7 @@ object WeakNetworkStrategy {
private const val TAG = "WeakNetworkStrategy"
// 记录到链路日志中的时间间隔
private const val OUTPUT_TIME_INTERVAL = 15000
private const val OUTPUT_TIME_INTERVAL = 2500
private const val WEAK_HTTP_RTT = 1300
@@ -23,6 +23,8 @@ object WeakNetworkStrategy {
private var lastOutputTime = 0L
private var isDebug = false
private val lock by lazy {
ReentrantReadWriteLock()
}
@@ -53,6 +55,10 @@ object WeakNetworkStrategy {
})
}
fun setDebug(isDebug: Boolean) {
this.isDebug = isDebug
}
fun stopListen() {
setListener(null)
}
@@ -63,10 +69,13 @@ object WeakNetworkStrategy {
try {
val currentTime = System.currentTimeMillis()
if (currentTime - lastOutputTime > OUTPUT_TIME_INTERVAL) {
if (isDebug) {
invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
}
if (timeStamp >= WEAK_HTTP_RTT) {
ToastUtils.showShort("当前网络质量差!")
} else if (timeStamp in 300 until WEAK_HTTP_RTT) {
invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
// invokeWeakResult("url为:$url, 耗时为:$timeStamp${if (isFail) " 连接失败!" else ""}")
SdtManager.startActiveCheck()
}
lastOutputTime = currentTime

View File

@@ -11,6 +11,7 @@ import android.os.Build
import android.os.Process
import android.text.Html
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.annotation.RequiresApi
@@ -21,6 +22,7 @@ import androidx.core.view.MenuCompat
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import chassis.Chassis
import com.mogo.cloud.network.cronet.NetworkQualityListener
import com.mogo.cloud.network.cronet.QuicConfig
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
@@ -86,6 +88,7 @@ import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.MogoData.Companion.mogoMapData
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import com.zhjt.service.chain.ChainLog
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import kotlinx.coroutines.*
import mogo.telematics.pad.MessagePad
@@ -773,7 +776,35 @@ internal class DebugSettingView @JvmOverloads constructor(
FunctionBuildConfig.isObuWarningFusionUnion = isChecked
}
tbCronet.setOnCheckedChangeListener { _, isChecked ->
if (!isChecked) {
CallerDevaToolsManager.setNetworkMode(true)
}
QuicConfig.setEnable(context, isChecked)
QuicConfig.setNetworkListener(object : NetworkQualityListener {
override fun onLatencyObservation(rttMs: Int, url: String?) {
invokeCronetResult("****** Cronet Request Completed, the latency is $rttMs ms;url is $url")
}
override fun onFailed(error: String?, url: String?) {
invokeCronetResult("****** Cronet Request onFailed, error is $error;url is $url")
}
override fun onCanceled(url: String?) {
invokeCronetResult("****** Cronet Request onFailed, url is: $url")
}
override fun onRttObservation(rttMs: Int, whenMs: Long, source: Int) {
invokeCronetResult("rttMs is:$rttMs ms,source is:$source")
}
override fun onThroughputObservation(
throughputKbps: Int,
whenMs: Long,
source: Int
) {
invokeCronetResult("downstream throughput is:$throughputKbps,source is:$source")
}
})
}
//重启工控机所有节点
@@ -2310,4 +2341,13 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
@ChainLog(
linkChainLog = ChainConstant.CHAIN_TYPE_WEAK_NETWORK,
linkCode = ChainConstant.CHAIN_SOURCE_WEAK_NETWORK,
nodeAliasCode = ChainConstant.CHAIN_CODE_RECORD_WEAK_NETWORK,
paramIndexes = [0]
)
private fun invokeCronetResult(json: String) {
Log.d("CronetNetwork", json)
}
}

View File

@@ -1,6 +1,9 @@
package com.mogo.eagle.core.function.hmi.ui.utils
import com.mogo.eagle.core.data.deva.chain.ChainCommon
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.zhjt.service.chain.ChainLog
@@ -9,14 +12,34 @@ class HmiActionLog {
companion object {
fun hmiAction(data: Any, data1: Any, param: Boolean = false) {
CallerLogger.d(M_HMI + data.toString(), 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_STATUS,
linkCode = ChainConstant.CHAIN_SOURCE_HMI,
nodeAliasCode = ChainConstant.CHAIN_CODE_HMI_ACTIONS,
paramIndexes = [0, 1]
)
fun hmiAction(data: Any, data1: Any) {
CallerLogger.d(M_HMI + data.toString(), data1)
private fun realAction(data: Any, data1: Any) {
}
@ChainLog(
linkChainLog = ChainConstant.CHAIN_TYPE_STATUS,
linkCode = ChainConstant.CHAIN_SOURCE_HMI,
nodeAliasCode = ChainConstant.CHAIN_CODE_HMI_ACTIONS,
paramIndexes = [0, 1, 2]
)
private fun realParamAction(data: Any, data1: Any, chainCommon: ChainCommon) {
}
}

View File

@@ -6,7 +6,6 @@ import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.animation.LinearInterpolator
import android.widget.ImageView
@@ -22,6 +21,9 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
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.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
@@ -74,9 +76,9 @@ class ParallelDriveView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
initView()
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerParallelDrivingListenerManager.addListener(TAG, this)
CallerParallelDrivingActionsListenerManager.addListener(TAG, this)
CallerAutoPilotStatusListenerManager.addListener("$M_HMI$TAG", this)
CallerParallelDrivingListenerManager.addListener("$M_HMI$TAG", this)
CallerParallelDrivingActionsListenerManager.addListener("$M_HMI$TAG", this)
}
private fun initView() {
@@ -88,7 +90,7 @@ class ParallelDriveView @JvmOverloads constructor(
when (state) {
0 -> {
state = APP_REQUESTING
Log.d(TAG, "Click-开始请求平行驾驶")
HmiActionLog.hmiAction(TAG,"Click-开始请求平行驾驶")
updateUI(APP_REQUESTING)
reqParaDrive()
listener?.onReqClick()
@@ -96,18 +98,18 @@ class ParallelDriveView @JvmOverloads constructor(
APP_REQUESTING -> {
cancelParaDrive()
Log.d(TAG, "Click-请求已取消")
HmiActionLog.hmiAction(TAG,"Click-请求已取消")
ToastUtils.showShort("请求已取消!")
checkAvailableAndUpdateUI()
}
AD_REQUESTING -> {
Log.d(TAG, "Click-自动驾驶正在请求平行驾驶")
HmiActionLog.hmiAction(TAG,"Click-自动驾驶正在请求平行驾驶")
ToastUtils.showShort("自动驾驶正在请求平行驾驶")
}
UNAVAILABLE -> {
Log.d(TAG, "Click-请P档驻车并松开油门刹车后请求")
HmiActionLog.hmiAction(TAG,"Click-请P档驻车并松开油门刹车后请求")
ToastUtils.showShort("请P档驻车并松开油门刹车后请求")
}
}
@@ -124,7 +126,6 @@ class ParallelDriveView @JvmOverloads constructor(
when (state) {
7 -> {
isAutoDriving = false
Log.d(TAG, "onAutopilotStatusResponse-7")
ThreadUtils.runOnUiThread({
this.state = PARALLEL_DRIVING
updateUI(PARALLEL_DRIVING)
@@ -133,7 +134,6 @@ class ParallelDriveView @JvmOverloads constructor(
2 -> {
isAutoDriving = true
Log.d(TAG, "onAutopilotStatusResponse-2")
if (this.autopilotState == 7) {
ThreadUtils.runOnUiThread({
checkAvailableAndUpdateUI()
@@ -143,7 +143,6 @@ class ParallelDriveView @JvmOverloads constructor(
else -> {
isAutoDriving = false
Log.d(TAG, "onAutopilotStatusResponse-else")
if (this.autopilotState == 7) {
ThreadUtils.runOnUiThread({
checkAvailableAndUpdateUI()
@@ -158,14 +157,14 @@ class ParallelDriveView @JvmOverloads constructor(
isParallelDrivingAbility: Boolean
) {
if (!isParallelDrivingAbility) {
Log.d(TAG, "onParallelDrivingAbility-UNAVAILABLE")
CallerLogger.d("$M_HMI$TAG", "onParallelDrivingAbility-UNAVAILABLE")
ThreadUtils.runOnUiThread({
if (state == PARALLEL_DRIVING) return@runOnUiThread
state = UNAVAILABLE
updateUI(UNAVAILABLE)
}, ThreadUtils.MODE.QUEUE)
} else {
Log.d(TAG, "onParallelDrivingAbility-AVAILABLE")
CallerLogger.d("$M_HMI$TAG", "onParallelDrivingAbility-AVAILABLE")
ThreadUtils.runOnUiThread({
if (state == PARALLEL_DRIVING) return@runOnUiThread
state = 0
@@ -176,8 +175,8 @@ class ParallelDriveView @JvmOverloads constructor(
override fun onParallelDrivingResp(parallelTaskProcessNotice: ParallelTaskProcessNoticeOuterClass.ParallelTaskProcessNotice?) {
parallelTaskProcessNotice?.let {
CallerLogger.d("$M_HMI$TAG", "onParallelDrivingResp-code:${it.code}")
ThreadUtils.runOnUiThread({
Log.d(TAG, "onParallelDrivingResp-code:${it.code}")
when (it.code) {
"START_SYNC" -> {// 同步中
state = SYNCHRONIZING
@@ -452,9 +451,9 @@ class ParallelDriveView @JvmOverloads constructor(
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerAutoPilotStatusListenerManager.removeListener(TAG)
CallerParallelDrivingListenerManager.removeListener(TAG)
CallerParallelDrivingActionsListenerManager.removeListener(TAG)
CallerAutoPilotStatusListenerManager.removeListener("$M_HMI$TAG")
CallerParallelDrivingListenerManager.removeListener("$M_HMI$TAG")
CallerParallelDrivingActionsListenerManager.removeListener("$M_HMI$TAG")
}
interface ClickEventListener {

View File

@@ -96,7 +96,6 @@ class SteeringWheelView : ConstraintLayout, IMoGoChassisSteeringStateListener,
object : IMoGoAutopilotStatusListener {
override fun onAutopilotStatusResponse(state: Int) {
ThreadUtils.runOnUiThread {
d("$M_BUS_P$TAG", "state = %s", state)
if (autopilotIV != null) {
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
if (!isBus(FunctionBuildConfig.appIdentityMode)) {

View File

@@ -136,10 +136,7 @@ class SystemVersionView @JvmOverloads constructor(
}
ivHDCache.setOnClickListener {
hmiAction(
"$M_HMI$TAG",
"HD map view click , isHDCached:$isHDCached , lon:${getChassisLocationWGS84().longitude} , lat:${getChassisLocationWGS84().latitude}"
)
hmiAction("$M_HMI$TAG", mapOf("isHDCached" to isHDCached))
if (isHDCached) {// 已缓存
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
} else {// 未缓存

View File

@@ -41,7 +41,6 @@ import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.function.main.modules.MogoModulesManager
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
@@ -59,10 +58,6 @@ import java.io.File
/**
* @author congtaowang
* @since 2019-12-23
*
*
* 描述:加载各个模块
*/
open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
@@ -76,7 +71,8 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
private var isFirst = false
private var mConnAdapter: ConnInfoAdapter? = null
private val dataList: List<AutopilotStatusInfo> = ArrayList()
private var mLastStatus = 0x00
// private var mLastStatus = 0x00
private var mLastStatus = 0x01
private var isFloatingLayerHidden = false
override fun getLayoutId(): Int {
@@ -327,11 +323,11 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
MogoStatusManager.getInstance().setMainPageIsBackgroundStatus(TAG, true)
}
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
UiThreadHandler.post {
val status = autoPilotStatusInfo.ipcConnStatus
if (mLastStatus != status) {
val statusInfo = autoPilotStatusInfo.clone()
if(mLastStatus != status){
val statusInfo = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().clone()
rvConnectInfo.post { updateConnectInfoView(statusInfo) }
mLastStatus = status
}

View File

@@ -2372,7 +2372,7 @@
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启QUIC协议(服务器暂不支持)"
android:textOff="开启QUIC协议(目前QA环境可用)"
android:textOn="关闭QUIC协议"
android:textSize="@dimen/dp_24" />
</LinearLayout>

View File

@@ -1,284 +0,0 @@
package com.mogo.eagle.core.function.smp;
import android.content.Context;
import android.graphics.BitmapFactory;
import com.amap.api.maps.AMap;
import com.amap.api.maps.CameraUpdateFactory;
import com.amap.api.maps.TextureMapView;
import com.amap.api.maps.model.BitmapDescriptor;
import com.amap.api.maps.model.BitmapDescriptorFactory;
import com.amap.api.maps.model.CameraPosition;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.Marker;
import com.amap.api.maps.model.MarkerOptions;
import com.amap.api.maps.model.Polyline;
import com.autonavi.amap.mapcore.IPoint;
import com.mogo.eagle.core.function.map.R;
import java.util.concurrent.ScheduledExecutorService;
/**
* 包名: com.amap.api.navi.core
* <p>
* 创建时间2018/3/1
* 项目名称AndroidNavigationSDK
*
* @author guibao.ggb
* @email guibao.ggb@alibaba-inc.com
* <p>
* 类说明自车位置管理Overlay类
*/
public class CarOverlay {
protected static final int CAR_MOVE_ANIMATION_PERIOD = 50;
protected int carMoveAnimationFrameNum = 2;
protected boolean mIsLock = true;
protected IPoint mapAnchorBackup = null;
protected double dXOffStep;
protected double dYOffStep;
protected float dAngleOffStep;
protected int currentFrameIndex;
protected float angleStart = 0;
protected boolean isMoveStarted = false;
protected float newAngle = 0;
protected BitmapDescriptor carDescriptor = null;
protected BitmapDescriptor fourCornersDescriptor = null;
protected Marker carMarker;
protected Marker directionMarker;
protected AMap mAmap = null;
protected TextureMapView mapView;
protected boolean isDirectionVisible = true;
protected LatLng endLatLng = null;
protected Polyline leaderLine = null;
protected final int DISTANCE_OFFSET = 150;// 默认 500 偏差
// API 默认 1800 UI 默认 360
protected int angleModValue = 1800;
private ScheduledExecutorService executorService;
public CarOverlay(Context context, TextureMapView mapView) {
this.mapView = mapView;
// fourCornersDescriptor = BitmapDescriptorFactory.fromBitmap(BitmapFactory
// .decodeResource(context.getResources(),
// R.drawable.module_small_map_navi_direction));
carDescriptor = BitmapDescriptorFactory.fromBitmap(BitmapFactory
.decodeResource(context.getResources(),
R.drawable.module_small_map_view_my_location_logo));
angleModValue = 1800;
}
/**
* 设置自车状态
*
* @param lock true 锁车 false 非锁车
*/
public void setLock(boolean lock) {
mIsLock = lock;
if (carMarker == null) {
return;
}
if (mAmap == null) {
return;
}
if (directionMarker == null) {
return;
}
carMarker.setFlat(true);
directionMarker.setGeoPoint(carMarker.getGeoPoint());
carMarker.setGeoPoint(carMarker.getGeoPoint());
carMarker.setRotateAngle(carMarker.getRotateAngle());
if (mIsLock) {
CameraPosition cameraPosition = new CameraPosition.Builder().target(carMarker.getPosition()).bearing(newAngle).tilt(0).zoom(16).build();
mAmap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
}
}
public void reset() {
if (carMarker != null) {
carMarker.remove();
}
if (directionMarker != null) {
directionMarker.remove();
}
if (leaderLine != null) {
leaderLine.remove();
}
leaderLine = null;
carMarker = null;
directionMarker = null;
if (executorService != null) {
if (!executorService.isShutdown()) {
executorService.shutdown();
}
isMoveStarted = false;
executorService = null;
}
}
/**
* 绘制自车
*
* @param aMap
* @param mLatLng
* @param bearing
*/
public void draw(AMap aMap, LatLng mLatLng, float bearing) {
if (aMap == null || mLatLng == null || carDescriptor == null) {
return;
}
mAmap = aMap;
try {
if (carMarker == null) {
carMarker = aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f).setFlat(true).icon(carDescriptor).position(mLatLng));
}
if (directionMarker == null) {
directionMarker = aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f).setFlat(true).icon(fourCornersDescriptor).position(mLatLng));
directionMarker.setVisible(isDirectionVisible);
}
carMarker.setVisible(true);
newAngle = bearing;
IPoint resultGeoPnt = IPoint.obtain();
// resultGeoPnt = NaviUtil.lonlat2Geo(mLatLng.latitude, mLatLng.longitude, 20);
updateCarPosition(resultGeoPnt);
resultGeoPnt.recycle();
} catch (Throwable e) {
e.printStackTrace();
}
}
private void updateCarPosition(IPoint p) {
carMarker.setGeoPoint(p);
carMarker.setFlat(true);
carMarker.setRotateAngle(360 - newAngle);
if (directionMarker != null) {
directionMarker.setGeoPoint(p);
}
if (mIsLock) {
CameraPosition cameraPosition = new CameraPosition.Builder().target(carMarker.getPosition()).bearing(newAngle).tilt(0).zoom(16).build();
mAmap.moveCamera(CameraUpdateFactory.changeBearingGeoCenter(newAngle, p));
}
}
public void setEndPoi(LatLng latlng) {
endLatLng = latlng;
}
/**
* 释放自车资源
*/
public void destroy() {
if (carMarker != null) {
carMarker.remove();
carMarker = null;
}
if (directionMarker != null) {
directionMarker.remove();
directionMarker = null;
}
carDescriptor = null;
if (executorService != null && !executorService.isShutdown()) {
executorService.shutdown();
isMoveStarted = false;
executorService = null;
}
}
private void calculateCarSmoothMoveOffset(IPoint newCenter, float newAngle) {
if (carMarker == null) {
return;
}
IPoint currentAnchorGeoPoint = carMarker.getGeoPoint();
if (currentAnchorGeoPoint == null || currentAnchorGeoPoint.x == 0 || currentAnchorGeoPoint.y == 0) {
currentAnchorGeoPoint = newCenter;
}
currentFrameIndex = 0;
mapAnchorBackup = currentAnchorGeoPoint;
dXOffStep = (newCenter.x - currentAnchorGeoPoint.x) / carMoveAnimationFrameNum;
dYOffStep = (newCenter.y - currentAnchorGeoPoint.y) / carMoveAnimationFrameNum;
// 获取当前的旋转角度
angleStart = carMarker.getRotateAngle();
boolean isFirst = false;
if (Float.compare(angleStart, newAngle) == 0) {
isFirst = true;
} else {
angleStart = 360 - angleStart;
}
// 校正旋转角度问题
float dAngleDelta = newAngle - angleStart;
if (isFirst) {
dAngleDelta = 0;
}
if (dAngleDelta > 180) {
dAngleDelta = dAngleDelta - 360;
}
else if (dAngleDelta < -180) {
dAngleDelta = dAngleDelta + 360;
}
dAngleOffStep = dAngleDelta / carMoveAnimationFrameNum;
isMoveStarted = true;
}
// protected void startSmoothMoveTimer() {
// if (executorService == null) {
// executorService = new ScheduledThreadPoolExecutor(1, new BasicThreadFactory.Builder().namingPattern("caroverlay-schedule-pool-%d").daemon(true).build());
//
// executorService.scheduleAtFixedRate(new Runnable() {
// long currentSeconds;
// @Override
// public void run() {
// try{
// currentSeconds = System.currentTimeMillis();
// mapSmoothMoveTimerTick();
// } catch(Throwable e){
// e.printStackTrace();
// }
// }
// }, 0, CAR_MOVE_ANIMATION_PERIOD, TimeUnit.MILLISECONDS);
// }
// }
private void mapSmoothMoveTimerTick() {
if (!isMoveStarted) {
return;
}
if (carMarker == null) {
return;
}
if (mAmap == null) {
return;
}
try {
IPoint p = carMarker.getGeoPoint();
double newX, newY;
if (currentFrameIndex++ < carMoveAnimationFrameNum) {
newX = mapAnchorBackup.x + dXOffStep * currentFrameIndex;
newY = mapAnchorBackup.y + dYOffStep * currentFrameIndex;
newAngle = angleStart + dAngleOffStep * currentFrameIndex;
newAngle %= angleModValue;
if (newX != 0 || newY != 0) {
p = new IPoint((int)newX, (int)newY);
}
updateCarPosition(p);
}
} catch (Throwable e) {
e.printStackTrace();
}
}
}