[dev_arch_opt_3.0] 添加魔方toast控制,修改HDMAP
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user