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..97b4eb3975 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() 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..c08ac6fc9c 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,23 @@ 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 -> + Log.d("liyz", "isChecked = $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" /> -