diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ParallelDriveView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ParallelDriveView.kt index 84742609d3..fead1ec4c7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ParallelDriveView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/ParallelDriveView.kt @@ -93,16 +93,19 @@ class ParallelDriveView @JvmOverloads constructor( reqParaDrive() listener?.onReqClick() } + APP_REQUESTING -> { cancelParaDrive() Log.d(TAG, "Click-请求已取消") ToastUtils.showShort("请求已取消!") checkAvailableAndUpdateUI() } + AD_REQUESTING -> { Log.d(TAG, "Click-自动驾驶正在请求平行驾驶") ToastUtils.showShort("自动驾驶正在请求平行驾驶") } + UNAVAILABLE -> { Log.d(TAG, "Click-请P档驻车并松开油门刹车后请求") ToastUtils.showShort("请P档驻车并松开油门刹车后请求") @@ -118,41 +121,42 @@ class ParallelDriveView @JvmOverloads constructor( override fun onAutopilotStatusResponse(state: Int) { super.onAutopilotStatusResponse(state) - if (state != autopilotState) { - synchronized(this) { - when (state) { - 7 -> { - if (this.autopilotState != 7) { - isAutoDriving = false - Log.d(TAG, "onAutopilotStatusResponse-7") - ThreadUtils.runOnUiThread({ - updateUI(PARALLEL_DRIVING) - }, ThreadUtils.MODE.QUEUE) - } - } + when (state) { + 7 -> { + if (this.autopilotState != 7) { + isAutoDriving = false + Log.d(TAG, "onAutopilotStatusResponse-7") + ThreadUtils.runOnUiThread({ + updateUI(PARALLEL_DRIVING) + }, ThreadUtils.MODE.QUEUE) + } + } - 2 -> { - if (this.autopilotState != state) { - isAutoDriving = true - Log.d(TAG, "onAutopilotStatusResponse-2") - } - } - - else -> { - if (this.autopilotState != state) { - isAutoDriving = false - Log.d(TAG, "onAutopilotStatusResponse-else") - if (this.autopilotState == 7) { - ThreadUtils.runOnUiThread({ - checkAvailableAndUpdateUI() - }, ThreadUtils.MODE.QUEUE) - } - } + 2 -> { + if (this.autopilotState != state) { + isAutoDriving = true + Log.d(TAG, "onAutopilotStatusResponse-2") + if (this.autopilotState == 7) { + ThreadUtils.runOnUiThread({ + checkAvailableAndUpdateUI() + }, ThreadUtils.MODE.QUEUE) + } + } + } + + else -> { + if (this.autopilotState != state) { + isAutoDriving = false + Log.d(TAG, "onAutopilotStatusResponse-else") + if (this.autopilotState == 7) { + ThreadUtils.runOnUiThread({ + checkAvailableAndUpdateUI() + }, ThreadUtils.MODE.QUEUE) } } - this.autopilotState = state } } + this.autopilotState = state } override fun onParallelDrivingAbility(