[dev_arch_opt_3.0] 添加大于10m,才显示rsi信息

This commit is contained in:
lixiaopeng
2023-03-08 17:15:00 +08:00
parent 2005201d04
commit 04c63a7977
3 changed files with 29 additions and 24 deletions

View File

@@ -127,13 +127,13 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //事件才有影响范围
alertContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
}
@@ -210,11 +210,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //标牌是没有影响范围的
alertContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString()
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString()
)
}
@@ -225,13 +225,13 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //事件才有影响范围
alertContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
ttsContent = String.format(
ttsContent,
Math.round(rsiWarningData.warningMsgList[0].distance / 100.0).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius / 10.0).toString()
Math.round(rsiWarningData.warningMsgList[0].distance).toString(),
Math.round(rsiWarningData.warningMsgList[0].eventRadius).toString()
)
}
@@ -252,8 +252,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
//大于10m才提示rsi
if (Math.round(rsiWarningData.warningMsgList[0].distance) > 10) {
saveObuToDcData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
}
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
@@ -392,14 +395,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${
Math.round(
(data.speedMaxLimit * 0.02 * 3.6)
(data.speedMaxLimit * 3.6)
)
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
)
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
CallerLimitingVelocityListenerManager.invokeUnion(
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
(data.speedMaxLimit * 3.6).roundToInt(),
DataSourceType.OBU
)
}
@@ -526,15 +529,15 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
)
val adviceSpeed =
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
"${Math.round(currentLight.suggestMinSpeed * 3.6)} - ${
Math.round(
currentLight.suggestMaxSpeed * 3.6 * 0.02
currentLight.suggestMaxSpeed * 3.6
)
}"
val adviceSpeedTts =
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
"${Math.round(currentLight.suggestMinSpeed * 3.6)} - ${
Math.round(
currentLight.suggestMaxSpeed * 3.6 * 0.02
currentLight.suggestMaxSpeed * 3.6
)
}"
@@ -571,7 +574,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
// 红灯
2, 3 -> {
val red = (currentLight.countDown / 10).toInt()
val red = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.RED,
red,
@@ -580,7 +583,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
// 绿灯
4, 5, 6 -> {
val green = (currentLight.countDown / 10).toInt()
val green = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.GREEN,
green,
@@ -589,7 +592,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
// 黄灯
7, 8 -> {
val yellow = (currentLight.countDown / 10).toInt()
val yellow = currentLight.countDown.toInt()
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
TrafficLightEnum.YELLOW,
yellow,

View File

@@ -456,8 +456,11 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
//大于10m才提示rsi
if (Math.round(data.warningMsgList[0].distance) > 10) {
saveObuData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
}
// 更新数据
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)

View File

@@ -314,7 +314,6 @@ internal class DebugSettingView @JvmOverloads constructor(
*/
tbOpenMfView.isChecked = HmiBuildConfig.isShowMfToastView
tbOpenMfView.setOnCheckedChangeListener { _, isChecked ->
Log.d("liyz", "isChecked = $isChecked")
HmiBuildConfig.isShowMfToastView = isChecked
}