[6.4.0][启自驾指引] 优化代码逻辑
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user