[6.4.0][启自驾指引] 优化代码逻辑

This commit is contained in:
renwj
2024-04-18 18:31:23 +08:00
parent 74da2a0e59
commit 40c078909a
2 changed files with 4 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ internal class SpeedImpl(ctx: Context): IFlow<SpeedStatus>(ctx), IMoGoChassisLoc
private var last: Float? = null
override fun onCreate() {
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 5, this)
}
override fun onDestroy() {
@@ -41,4 +41,5 @@ internal class SpeedImpl(ctx: Context): IFlow<SpeedStatus>(ctx), IMoGoChassisLoc
last = mogoLocation?.gnssSpeed
}
}
}

View File

@@ -35,6 +35,7 @@ import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.iv_ste
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.speed
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.tv_brake_or_accelerator
import me.jessyan.autosize.utils.AutoSizeUtils
import kotlin.math.abs
class AutoPilotLaunchBeforeView: LinearLayout, IStatusListener {
@@ -102,7 +103,7 @@ class AutoPilotLaunchBeforeView: LinearLayout, IStatusListener {
iv_steer?.isSelected = isError
}
is SpeedStatus -> {
speed?.text = "${status.speed.toInt()}"
speed?.text = "${(abs(status.speed) * 3.6f).toInt()}"
}
else -> {
Logger.d(TAG, "other state: $status")