Merge branch 'dev_robotaxi-d_230912_6.1.0' into base_3.4.0-map-sdk

This commit is contained in:
zhongchao
2023-09-21 14:15:30 +08:00
2 changed files with 12 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.animation.LinearInterpolator
import android.widget.ImageView
@@ -87,16 +88,19 @@ class ParallelDriveView @JvmOverloads constructor(
when (state) {
0 -> {
state = APP_REQUESTING
Log.d(TAG, "Click-开始请求平行驾驶")
updateUI(APP_REQUESTING)
reqParaDrive()
listener?.onReqClick()
}
APP_REQUESTING -> {
cancelParaDrive()
Log.d(TAG, "Click-请求已取消")
ToastUtils.showShort("请求已取消!")
checkAvailableAndUpdateUI()
}
UNAVAILABLE -> {
Log.d(TAG, "Click-请P档驻车并松开油门刹车后请求")
ToastUtils.showShort("请P档驻车并松开油门刹车后请求")
}
}
@@ -116,6 +120,7 @@ class ParallelDriveView @JvmOverloads constructor(
7 -> {
if (this.autopilotState != 7) {
isAutoDriving = false
Log.d(TAG, "onAutopilotStatusResponse-7")
ThreadUtils.runOnUiThread({
updateUI(PARALLEL_DRIVING)
}, ThreadUtils.MODE.QUEUE)
@@ -125,12 +130,14 @@ class ParallelDriveView @JvmOverloads constructor(
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()
@@ -149,11 +156,13 @@ class ParallelDriveView @JvmOverloads constructor(
unableParallelDrivingReasons: ArrayList<UnableLaunchReason>?
) {
if (!isParallelDrivingAbility) {
Log.d(TAG, "onParallelDrivingAbility-UNAVAILABLE")
ThreadUtils.runOnUiThread({
state = UNAVAILABLE
updateUI(UNAVAILABLE)
}, ThreadUtils.MODE.QUEUE)
} else {
Log.d(TAG, "onParallelDrivingAbility-AVAILABLE")
ThreadUtils.runOnUiThread({
state = 0
updateUI(0)
@@ -164,6 +173,7 @@ class ParallelDriveView @JvmOverloads constructor(
override fun onParallelDrivingResp(parallelTaskProcessNotice: ParallelTaskProcessNoticeOuterClass.ParallelTaskProcessNotice?) {
parallelTaskProcessNotice?.let {
ThreadUtils.runOnUiThread({
Log.d(TAG, "onParallelDrivingResp-code:${it.code}")
when (it.code) {
"START_SYNC" -> {// 同步中
state = SYNCHRONIZING