diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/autopilot/SpeedImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/autopilot/SpeedImpl.kt index 9978b4ce60..23448af35f 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/autopilot/SpeedImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/autopilot/SpeedImpl.kt @@ -27,7 +27,7 @@ internal class SpeedImpl(ctx: Context): IFlow(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(ctx), IMoGoChassisLoc last = mogoLocation?.gnssSpeed } } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/ui/AutoPilotLaunchBeforeView.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/ui/AutoPilotLaunchBeforeView.kt index 0f3c196660..1d8e9f59ca 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/ui/AutoPilotLaunchBeforeView.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/ui/AutoPilotLaunchBeforeView.kt @@ -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")