diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt index af151c2bc2..e57ecb21de 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt @@ -9,7 +9,6 @@ import android.os.Process import android.util.AttributeSet import android.view.LayoutInflater import android.view.View -import android.view.View.OnTouchListener import android.widget.FrameLayout import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo @@ -101,7 +100,18 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( override fun onUpdate(inputContent: String?) { if (inputContent != null) { - speedLimit = inputContent.toInt() + try { + speedLimit = inputContent.toInt() + if(speedLimit>60){ + speedLimit = 60 + ToastUtils.showShort("最大限速60") + } + }catch (t: Exception){ + ToastUtils.showShort("最大限速60") + speedLimit = 60 + + } + etInputSpeed.setText(speedLimit.toString()) } } @@ -170,7 +180,10 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( if(speedLimit>=5){ speedLimit -= 5 etInputSpeed.setText(speedLimit.toString()) - }else{ + }else if(speedLimit in 1..4){ + speedLimit = 0 + etInputSpeed.setText(speedLimit.toString()) + } else{ ToastUtils.showShort("车速不能再减了") } } @@ -179,7 +192,10 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( if(speedLimit<=55){ speedLimit += 5 etInputSpeed.setText(speedLimit.toString()) - }else{ + }else if(speedLimit in 56..59){ + speedLimit = 60 + etInputSpeed.setText(speedLimit.toString()) + } else{ ToastUtils.showShort("车速不能再加了") } }