From fb84e5aafff693b3ca0a5966d9af37eeda11741b Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Tue, 31 Jan 2023 18:31:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BD=AC=E5=90=91=E7=81=AF?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/eagle/core/function/map/MapFragment.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt index 0591bc9c92..6a0f9ffb49 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt @@ -352,14 +352,14 @@ class MapFragment : MvpFragment(), mMogoMapView?.setExtraGPSData(gnssInfo) if (gnssInfo != null) { - //设置刹车信息 - if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f)) { - brakeLight = 1 + //设置刹车信息,小于默认认为是刹车 + brakeLight = if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f)) { + 1 } else { - brakeLight = 0 + 0 } d(SceneConstant.M_DEVA + "BrakeLight", "---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight) - if (!isShowTurnLight) { + if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效 showBrakeLight(brakeLight) } } @@ -368,7 +368,7 @@ class MapFragment : MvpFragment(), override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) { //can数据转发 转向灯状态 0是正常 1是左转 2是右转 if (lightSwitch != null) { - val state: Int = setTurnLightState(lightSwitch.number) + val state: Int = setTurnLightState(lightSwitch.number) //对转向灯进行转换 d(SceneConstant.M_DEVA + "TurnLight", "---onAutopilotLightSwitchData ---state = " + state + "---lightSwitch.getNumber() = " + lightSwitch.number) if (state == 1 || state == 2) { isShowTurnLight = true