修改默认使用obu数据,数据类型修改,

This commit is contained in:
lixiaopeng
2022-09-07 18:37:19 +08:00
parent c5def34a1a
commit f8442908cc
5 changed files with 54 additions and 23 deletions

View File

@@ -34,7 +34,8 @@ class ConfigStartUp : AndroidStartup<Boolean>() {
workingBranchHash = BuildConfig.WORKING_BRANCH_HASH
appBuildTime = BuildConfig.APP_BUILD_TIME
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统1-工控机2-OBU
FunctionBuildConfig.gpsProvider = BuildConfig.GPS_PROVIDER
// FunctionBuildConfig.gpsProvider = BuildConfig.GPS_PROVIDER
FunctionBuildConfig.gpsProvider = 2
// 演示模式,上一次勾选的数据
FunctionBuildConfig.isDemoMode = BuildConfig.IS_DEMO_MODE
// app安装的身份信息

View File

@@ -113,7 +113,7 @@ ext {
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
// mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.33',
mogoobu : 'com.mogo.support.obu:mogo-obu:1.0.0_beta10',
mogoobu : 'com.mogo.support.obu:mogo-obu:1.0.0_beta13',
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.24',
// google

View File

@@ -599,12 +599,14 @@ import java.util.*
playTts: Boolean,
expireTime: Long
) {
Log.d("liyz", "showWarningV2X v2xType = $v2xType --alertContent = $alertContent --ttsContent = $ttsContent --tag = $tag ")
val playTTS = playTts && !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
activity?.let {
val warningContent = alertContent
?: EventTypeEnum.getWarningContent(v2xType)
if (warningContent.isEmpty()) {
CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!")
Log.e("liyz", "Show warningContent is null or empty!")
return
}
val content = mViewNotificationProvider?.getNotificationView() ?: return
@@ -795,7 +797,9 @@ import java.util.*
override fun showWarning(direction: WarningDirectionEnum) {
Log.d(TAG,"showWarning====")
flV2XWarningView?.showWarning(direction)
flicker(flV2XWarningView)
if (flV2XWarningView != null) {
flicker(flV2XWarningView)
}
}
/**

View File

@@ -99,9 +99,15 @@ class MogoPrivateObuNewManager private constructor() {
* HV车辆基础信息 CvxHvCarIndInfo CvxHvInfoIndInfo
*/
override fun onMogoObuHvBasics(p0: MogoObuHvBasicsData?) {
Log.d(TAG, "onMogoObuHvBasics ------ p0 = ${p0.toString()}" + "-----FunctionBuildConfig.gpsProvider = " + FunctionBuildConfig.gpsProvider)
Log.d(
TAG,
"onMogoObuHvBasics ------ p0 = ${p0.toString()}" + "-----FunctionBuildConfig.gpsProvider = " + FunctionBuildConfig.gpsProvider
)
if (p0 != null && p0.vehBasicsMsg != null) {
Log.d(TAG, "lon = ${p0.vehBasicsMsg.longitude} --- lat = ${p0.vehBasicsMsg.latitude} ---speed = ${p0.vehBasicsMsg.speed} ---heading = ${p0.vehBasicsMsg.heading} --acceleration = ${p0.vehBasicsMsg.accFourAxes.accLat} --yawRate = ${p0.vehBasicsMsg.accFourAxes.accYaw}")
Log.d(
TAG,
"onMogoObuHvBasics lon = ${p0.vehBasicsMsg.longitude} --- lat = ${p0.vehBasicsMsg.latitude} ---speed = ${p0.vehBasicsMsg.speed} ---heading = ${p0.vehBasicsMsg.heading} --acceleration = ${p0.vehBasicsMsg.accFourAxes.accLat} --yawRate = ${p0.vehBasicsMsg.accFourAxes.accYaw}"
)
val data = JSONObject()
try {
data.putOpt("lon", p0.vehBasicsMsg.longitude)
@@ -145,7 +151,7 @@ class MogoPrivateObuNewManager private constructor() {
override fun onMogoObuRvWarning(data: MogoObuRvWarningData) {
super.onMogoObuRvWarning(data)
// 更新数据远车数据之前要匹配uuid TODO
// 更新数据远车数据之前要匹配uuid
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let {
TrafficMarkerDrawer.updateITrafficLocationInfo(it)
}
@@ -158,12 +164,13 @@ class MogoPrivateObuNewManager private constructor() {
//预警方位
val direction = getMessageDirection(data.vehBasicsMsg.targetPosition)
//处理预警类型
val appId = data.vehBasicsMsg.id
var appId = "0"
var level = -1
data.warningMsg?.let {
if (data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
level = data.warningMsg.warningData[0].warningLevel
appId = data.warningMsg.warningData[0].warningType.toString()
}
}
@@ -238,7 +245,8 @@ class MogoPrivateObuNewManager private constructor() {
-> {
when (data.warning_Msg[0].eventSerialNum) { //TODO 没有下面分类
904 -> { //车辆逆行
appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE.poiType
appId =
EventTypeEnum.TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE.poiType
}
901 -> { //超速行驶
@@ -256,23 +264,34 @@ class MogoPrivateObuNewManager private constructor() {
412 -> { //异常停车
appId = EventTypeEnum.TYPE_USECASE_ID_ROAD_PARKING.poiType
}
}
alertContent = EventTypeEnum.getWarningContent(appId)
ttsContent = EventTypeEnum.getWarningTts(appId)
}
// 前方拥堵提醒 TODO
// 前方拥堵提醒
EventTypeEnum.TYPE_USECASE_ID_TJW.poiType -> {
ttsContent = EventTypeEnum.getWarningTts(appId)
alertContent = "前方拥堵,减速慢行"
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
"ttsContent = $ttsContent --alertContent = $alertContent"
)
alertContent = if (data.warning_Msg[0].distance.toInt() != 0) {
String.format(
EventTypeEnum.getWarningContent(appId),
data.warning_Msg[0].distance.toInt()
)
} else {
"前方拥堵,减速慢行"
}
}
//限速预警 TODO 参考之前的
}
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
"ttsContent = $ttsContent --alertContent = $alertContent"
)
Log.d(TAG, "appId = $appId ---ttsContent = $ttsContent ---alertContent = $alertContent + --direction = ${direction.direction}" )
when (status) {
// 添加
MogoObuConstants.STATUS.ADD,
@@ -456,7 +475,10 @@ class MogoPrivateObuNewManager private constructor() {
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
"handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status"
)
Log.d(TAG, "handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status")
Log.d(
TAG,
"handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status"
)
var alertContent: String
var ttsContent: String
var changeVisualAngle = false
@@ -542,6 +564,9 @@ class MogoPrivateObuNewManager private constructor() {
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
"appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
)
Log.d(TAG,
"appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction"
)
if (level == 2 || level == 3) {
//显示弹框,语音提示
CallerHmiManager.showWarningV2X(
@@ -639,7 +664,8 @@ class MogoPrivateObuNewManager private constructor() {
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId"
)
Log.d(TAG,
Log.d(
TAG,
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId"
)
// 闯红灯预警

View File

@@ -29,8 +29,8 @@ object TrafficMarkerDrawer {
private var mContext: Context? = null
// 动画持续时间
private val stepTime = 150L
// 动画持续时间 TODO 150
private val stepTime = 50L
// 维护Obu识别的他车集合
private val mTrafficMap = ConcurrentHashMap<String, TrafficData>()
@@ -165,7 +165,7 @@ object TrafficMarkerDrawer {
TAG,
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
)
Log.e("liyz", "drawObuRecognizedDataMarker trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel)
// Log.e("liyz", "drawObuRecognizedDataMarker trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel)
if (trafficData.type != null) {
val resId: Int = trafficData.type.traffic3DIconId
@@ -226,9 +226,9 @@ object TrafficMarkerDrawer {
TAG,
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
)
Log.e("liyz",
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
)
// Log.e("liyz",
// "trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
// )
if (trafficData.type != TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE) {
// 修改颜色