From f483f51c25aa6fc7c57591a43360fe806e95b889 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Fri, 7 Apr 2023 17:58:00 +0800 Subject: [PATCH] =?UTF-8?q?[dev=5Frobubus-d=5F230322=5F3.0.0]=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=AE=B1=E8=BD=A6=E9=80=9F=E8=AE=BE=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/tools/AutoPilotAndCheckView.kt | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) 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("车速不能再加了") } }