diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java index 0715592e7f..45e0d1dedd 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java @@ -26,10 +26,9 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager; +import com.mogo.eagle.core.function.call.autopilot.CallerSweeperFutianCleanSystemListenerManager; import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener; import com.mogo.eagle.core.utilcode.util.ThreadUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; @@ -40,7 +39,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; -import chassis.Chassis; import chassis.SpecialVehicleTaskCmdOuterClass; import chassis.VehicleStateOuterClass; @@ -788,7 +786,7 @@ public class SweeperOperatePanelView extends LinearLayout { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); - CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener); + CallerSweeperFutianCleanSystemListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener); // 最终调试时需要打开 syncVehicleStateAndRecoverOperatePanelStates(); // Mock VehicleState 数据回调 @@ -800,7 +798,7 @@ public class SweeperOperatePanelView extends LinearLayout { @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); - CallerAutopilotVehicleStateListenerManager.INSTANCE.removeListener(TAG); + CallerSweeperFutianCleanSystemListenerManager.INSTANCE.removeListener(TAG); } /** diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoSteeringStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoSteeringStateListener.kt new file mode 100644 index 0000000000..09b2b36556 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoSteeringStateListener.kt @@ -0,0 +1,14 @@ +package com.mogo.eagle.core.function.api.autopilot + +/** + * 车辆方向盘转向角 数据 回调监听 + */ +interface IMoGoSteeringStateListener { + + /** + * 车辆方向盘转向角回调 + * @param steering 方向盘转向角 + */ + fun onAutopilotSteeringData(steering: Float) + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerSteeringStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerSteeringStateListenerManager.kt new file mode 100644 index 0000000000..4d0c970f5e --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerSteeringStateListenerManager.kt @@ -0,0 +1,21 @@ +package com.mogo.eagle.core.function.call.autopilot + +import com.mogo.eagle.core.function.api.autopilot.IMoGoSteeringStateListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * 车辆方向盘转向角 回调监听 + */ +object CallerSteeringStateListenerManager : CallerBase() { + + /** + * 车辆方向盘转向角回调 + * @param steering 方向盘转向角 + */ + fun invokeAutopilotSteeringData(steering: Float){ + M_LISTENERS.forEach{ + val listener = it.value + listener.onAutopilotSteeringData(steering) + } + } +} \ No newline at end of file