diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt
index 62b6e5d953..f22ffd93a5 100644
--- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt
+++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt
@@ -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,
diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt
index 3f7f908681..5f182177b6 100644
--- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt
+++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt
@@ -407,6 +407,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
alertContent = EventTypeEnumNew.getWarningContent(appId)
ttsContent = EventTypeEnumNew.getWarningTts(appId)
+
alertContent = String.format( //标牌是没有影响范围的
alertContent,
Math.round(data.warningMsgList[0].distance).toString()
@@ -455,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)
diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt
index 27ffcea085..28ab73c903 100644
--- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt
+++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt
@@ -9,6 +9,7 @@ import android.content.Intent
import android.content.IntentFilter
import android.view.KeyEvent
import com.mogo.commons.context.ContextHolderUtil
+import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.deva.mofang.MfConstants
import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorChangeLaneLeft
@@ -46,7 +47,6 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
private lateinit var mBluetoothAdapter: BluetoothAdapter
private var isMfConnect: Boolean = false //添加状态判断
- private val isShowToast = false //toast 控制,自测使用
private var startPressTime: Long = 0 //开始按键时间
private var isPressEnd = false //按键是否结束
@Volatile
@@ -171,23 +171,23 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
startPressTime = System.currentTimeMillis()
}
e(M_F + "MoFangManager",
- "dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ")
+ "dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ---HmiBuildConfig.isShowMfToastView = ${HmiBuildConfig.isShowMfToastView}")
if (keyCode == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2
if (action == KeyEvent.ACTION_DOWN) {
pressADownTime = System.currentTimeMillis()
d(M_F + "MoFangManager",
"dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime)
if (pressADownTime - startPressTime in (clickTimeInterval + 1) until longPressTime && pressBDownTime > 0) {
- if (isShowToast) {
- ToastUtils.showShort("方块 A 按AB组合 +1 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 A 按AB组合 +1 timeInterval: ${pressADownTime - startPressTime}ms---$pressBDownTime")
}
sendAcc(true, +1.0)
isCombinationKey = 3
}
if (isCombinationKey != 3 && isCombinationKey != 1) {
if (pressADownTime - startPressTime > longPressTimeInterval) {
- if (isShowToast) {
- ToastUtils.showShort("方块 长按A -2 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 长按A -2 timeInterval: ${pressADownTime - startPressTime}ms")
}
sendAcc(true, -2.0)
isCombinationKey = 2
@@ -199,8 +199,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
"dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime + "---isCombinationKey = $isCombinationKey")
if (pressAUpTime - startPressTime < clickTime && isCombinationKey != 3) {
isCombinationKey = 1
- if (isShowToast) {
- ToastUtils.showShort("方块 单击A -1 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 单击A -1 timeInterval: ${pressAUpTime - startPressTime}ms")
}
sendAcc(true, -1.0)
}
@@ -215,16 +215,16 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
"dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime
)
if (pressBDownTime - startPressTime > clickTimeInterval && pressBDownTime - startPressTime < longPressTime && pressADownTime > 0) {
- if (isShowToast) {
- ToastUtils.showShort("方块 B 按AB组合 +1 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 B 按AB组合 +1 timeInterval: ${pressBDownTime - startPressTime}ms ---pressADownTime = $pressADownTime ")
}
sendAcc(true, +1.0)
isCombinationKey = 3
}
if (isCombinationKey != 3 && isCombinationKey != 1) {
if (pressBDownTime - startPressTime > longPressTimeInterval) {
- if (isShowToast) {
- ToastUtils.showShort("方块 长按B 无操作 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 长按B 无操作 timeInterval: ${pressBDownTime - startPressTime}ms")
}
isCombinationKey = 2
}
@@ -234,8 +234,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime + "----isCombinationKey = $isCombinationKey")
if (pressBUpTime - startPressTime < clickTime && isCombinationKey != 3) {
- if (isShowToast) {
- ToastUtils.showShort("方块 单击B 0 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 单击B 0 timeInterval: ${pressBUpTime - startPressTime}ms")
}
sendAcc(false, 0.0)
isCombinationKey = 1
@@ -250,8 +250,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 长按C 无操作 time dif = " + (pressCDownTime - startPressTime))
if (pressCDownTime - startPressTime > longPressTimeInterval) {
- if (isShowToast) {
- ToastUtils.showShort("方块 长按C 无操作 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 长按C 无操作 timeInterval: ${pressCDownTime - startPressTime}ms")
}
}
} else if (action == KeyEvent.ACTION_UP) {
@@ -260,8 +260,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 单击C ← 向左变道 time dif = " + (pressCUpTime - startPressTime))
if (pressCUpTime - startPressTime < clickTime) {
- if (isShowToast) {
- ToastUtils.showShort("方块 单击C ← 向左变道 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 单击C ← 向左变道 timeInterval: ${pressCUpTime - startPressTime}ms")
}
sendOperatorChangeLaneLeft()
}
@@ -272,8 +272,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 长按D 无操作 time dif = " + (pressDDownTime - startPressTime))
if (pressDDownTime - startPressTime > longPressTimeInterval) {
- if (isShowToast) {
- ToastUtils.showShort("方块 长按D 无操作 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 长按D 无操作 timeInterval: ${pressDDownTime - startPressTime}ms")
}
}
} else if (action == KeyEvent.ACTION_UP) {
@@ -282,8 +282,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 单击D → 向右变道 time dif = " + (pressDUpTime - startPressTime))
if (pressDUpTime - startPressTime < clickTime) {
- if (isShowToast) {
- ToastUtils.showShort("方块 单击D → 向右变道 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 单击D → 向右变道 timeInterval: ${pressDUpTime - startPressTime}ms")
}
sendOperatorChangeLaneRight()
}
@@ -294,8 +294,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"dispatchKeyEvent 方块 长按E 鸣笛 time dif = " + (pressEDownTime - startPressTime))
if (pressEDownTime - startPressTime > longPressTimeInterval) {
- if (isShowToast) {
- ToastUtils.showShort("方块 长按E 鸣笛 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 长按E 鸣笛 timeInterval: ${pressEDownTime - startPressTime}ms")
}
sendOperatorSetHorn(1.0)
if (timerHorn == null) {
@@ -314,8 +314,8 @@ class MoFangManager private constructor() : IMoGoMoFangListener {
d(M_F + "MoFangManager",
"方块 单击E 开启自动驾驶 time dif = " + (pressEUpTime - startPressTime))
if (pressEUpTime - startPressTime < clickTime) {
- if (isShowToast) {
- ToastUtils.showShort("方块 单击E 开启自动驾驶 ")
+ if (HmiBuildConfig.isShowMfToastView) {
+ ToastUtils.showShort("方块 单击E 开启自动驾驶 timeInterval: ${pressEUpTime - startPressTime}ms")
}
startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters)
}
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt
index b00371609d..a59e5d2ef7 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt
@@ -9,6 +9,7 @@ import android.graphics.Color
import android.os.Build
import android.text.Html
import android.util.AttributeSet
+import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.annotation.RequiresApi
@@ -77,6 +78,8 @@ import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import kotlinx.android.synthetic.main.view_debug_setting.view.*
+import kotlinx.android.synthetic.main.view_debug_setting.view.tbRouteDynamicEffect
+import kotlinx.android.synthetic.main.view_sop_setting.view.*
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
@@ -296,21 +299,22 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
- /**
- * 魔戒控制
- */
tbMojie.setOnCheckedChangeListener { buttonView, isChecked ->
if (isChecked) {
buttonView.setCompoundDrawables(null, null, iconDown, null)
- btnOpenAllGestures.visibility = View.VISIBLE
+ tbOpenMfView.visibility = View.VISIBLE
} else {
buttonView.setCompoundDrawables(null, null, iconRight, null)
- btnOpenAllGestures.visibility = View.GONE
+ tbOpenMfView.visibility = View.GONE
}
}
- btnOpenAllGestures.setOnClickListener {
- CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
+ /**
+ * 蘑方控制 默认关闭
+ */
+ tbOpenMfView.isChecked = HmiBuildConfig.isShowMfToastView
+ tbOpenMfView.setOnCheckedChangeListener { _, isChecked ->
+ HmiBuildConfig.isShowMfToastView = isChecked
}
/**
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml
index eb5078690b..27d514d3b1 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml
@@ -309,21 +309,22 @@
android:background="@drawable/radio_button_normal_background_right"
android:drawableEnd="@drawable/icon_right"
android:padding="@dimen/dp_20"
- android:textOff="魔戒控制"
- android:textOn="魔戒控制"
+ android:textOff="蘑方控制"
+ android:textOn="蘑方控制"
android:textSize="@dimen/dp_24" />
-
+ android:layout_marginLeft="10dp"
+ android:scaleY="1"
+ android:scaleX="1"
+ />