Merge remote-tracking branch 'origin/feature/feature_mogo_obu' into feature/feature_mogo_obu

This commit is contained in:
董宏宇
2021-08-18 19:44:22 +08:00
4 changed files with 28 additions and 10 deletions

View File

@@ -21,6 +21,7 @@ public class MogoObuConst {
public static String BROADCAST_OBU_LEVEL_EXTRA_KEY = "obuLevel";
//红绿灯标识 0:不可用1红灯2绿灯3黄灯
public static String BROADCAST_LIGHT_LEVEL_EXTRA_KEY = "lightLevel";
//弱势交通 0未知1非机动车2行人
public static String BROADCAST_PTC_INFO_EXTRA_KEY = "ptcInfo";
}

View File

@@ -534,13 +534,6 @@ class MogoPrivateObuManager private constructor() {
alertContent = WarningTypeEnum.getWarningContent(appId)
}
// 前方拥堵提醒,前方XXX米道路拥堵请减速慢行 TODO
WarningTypeEnum.TYPE_USECASE_ID_TJW.useCaseId -> {
ttsContent = WarningTypeEnum.getWarningTts(appId)
ttsContent = String.format(ttsContent, "")
alertContent = WarningTypeEnum.getWarningContent(appId)
}
// 这里处理固定的提示信息
else -> {
ttsContent = WarningTypeEnum.getWarningTts(appId)

View File

@@ -9,6 +9,8 @@ import com.mogo.module.obu.mogo.MogoPrivateObuManager
import com.mogo.utils.logger.Logger
import com.zhidao.support.obu.constants.ObuConstants
import com.zhidao.support.obu.model.CvxIvpThreatIndInfo
import com.zhidao.support.obu.model.CvxPtcInfoIndInfo
import com.zhidao.support.obu.model.CvxRtiThreatIndInfo
import com.zhidao.support.obu.model.CvxSlwThreatIndInfo
import com.zhidao.support.obu.model.advance.*
@@ -34,6 +36,7 @@ class ObuRsuTestTriggerReceiver : BroadcastReceiver() {
val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0)
val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3)
val phase = intent.getIntExtra(MogoObuConst.BROADCAST_LIGHT_LEVEL_EXTRA_KEY, 0)
val pctType = intent.getIntExtra(MogoObuConst.BROADCAST_PTC_INFO_EXTRA_KEY, 0)
Logger.d(
TAG, "obuStatus:$obuStatus phase:$phase obuType:$obuType obuLevel:$obuLevel"
@@ -69,10 +72,31 @@ class ObuRsuTestTriggerReceiver : BroadcastReceiver() {
//弱势交通参与者碰撞预警,行人/摩托车碰撞预警
ObuConstants.USE_CASE_ID.VRUCW -> {
val cvxPtcIndInfo = CvxPtcInfoIndInfo(1,1,1)
val position = Position(0, 399739429, 1164115207, 20)
val movingObjectInfo = MovingObjectInfo(0, position, 1800, 6000)
cvxPtcIndInfo.basic_info = movingObjectInfo
cvxPtcIndInfo.id = "111"
cvxPtcIndInfo.ptc_type = pctType
cvxPtcIndInfo.status = obuStatus
MogoPrivateObuManager.INSTANCE.getMogoObuListener().onCvxPtcInfoIndInfo(cvxPtcIndInfo)
}
}
//道路危险情况, 车内标牌, 前方拥堵提醒
ObuConstants.USE_CASE_ID.HLW, ObuConstants.USE_CASE_ID.IVS,ObuConstants.USE_CASE_ID.TJW -> {
val cvxRtiThreatIndInfo = CvxRtiThreatIndInfo(1,1, 1L)
val dateTime = DateTime(1,1,1,1,1,1,1,1)
val rtiThread = RtiThreat(1, obuType, dateTime,100000, obuLevel, 100)
cvxRtiThreatIndInfo.threat_info = rtiThread
cvxRtiThreatIndInfo.status = obuStatus
MogoPrivateObuManager.INSTANCE.getMogoObuListener().onCvxRtiThreatIndInfo(cvxRtiThreatIndInfo)
}
}
}
}

View File

@@ -85,7 +85,7 @@ object TrafficDataConvertUtils {
}
/**
* OBU 弱势交通参与者信息 转换交通元素数据
* OBU 弱势交通参与者信息 转换交通元素数据 TODO
*/
fun cvxPtcInfoIndInfo2TrafficData(info: CvxPtcInfoIndInfo): TrafficData? {
if (info.basic_info == null || info.basic_info.position == null || info.threat_infos != null) {