From 430328ea7fb9da1584591434e0faa2e6de8a9cbb Mon Sep 17 00:00:00 2001 From: renwj Date: Fri, 27 May 2022 17:00:56 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=8A=B6=E6=80=81=E6=A0=8F]Can=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=8A=B6=E6=80=81=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../passenger/model/BusPassengerModel.java | 2 +- .../mogo/och/bus/presenter/BusPresenter.java | 3 +- .../passenger/model/TaxiPassengerModel.java | 2 +- .../com/mogo/och/taxi/model/TaxiModel.java | 2 +- .../autopilot/adapter/MoGoAdasListenerImpl.kt | 7 ++- .../MoGoAdasMsgConnectStatusListenerImpl.kt | 1 + .../adapter/MoGoHandAdasMsgManager.java | 5 +- .../status/flow/can/CanImpl.kt | 48 +++++++++++++------ .../status/flow/ipc/IpcImpl.kt | 10 ++-- .../status/flow/trace/TracingImpl.kt | 5 +- .../status/model/StatusModel.kt | 7 ++- .../dispatch/DispatchAutoPilotManager.java | 4 +- .../hmi/ui/setting/DebugSettingView.kt | 6 --- .../hmi/ui/widget/SteeringWheelView.java | 12 +++-- .../core/function/main/MainActivity.java | 7 ++- .../core/function/smp/SmallMapFragment.java | 10 ++-- .../autopilot/IMoGoAutopilotStatusListener.kt | 4 +- .../IMoGoAutopilotVehicleStateListener.kt | 5 +- .../CallerAutoPilotStatusListenerManager.kt | 11 ++++- ...lerAutopilotVehicleStateListenerManager.kt | 7 +-- .../routeoverlay/MogoRouteOverlayManager.java | 2 +- 21 files changed, 92 insertions(+), 68 deletions(-) diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java index 27fdd1e6c7..b07af094f0 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/model/BusPassengerModel.java @@ -289,7 +289,7 @@ public class BusPassengerModel { private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){ @Override - public void onAutopilotNotData(long timestamp) { + public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } @Override diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java index d9eb1a29eb..b3bbe5a29c 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java @@ -6,6 +6,7 @@ import android.location.Location; import android.os.Looper; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.lifecycle.LifecycleOwner; import com.mogo.commons.mvp.Presenter; @@ -279,6 +280,6 @@ public class BusPresenter extends Presenter } @Override - public void onAutopilotNotData(long timestamp) { + public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } } diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java index 75f488cb4f..5b271f3f15 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerModel.java @@ -484,7 +484,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback @Override - public void onAutopilotNotData(long timestamp) { + public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } @Override diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java index da90193b91..7d388dca9b 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java @@ -1043,7 +1043,7 @@ public class TaxiModel { private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() { @Override - public void onAutopilotNotData(long timestamp) { + public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } @Override diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt index 938b2e661a..5a3a620ab5 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -1,5 +1,6 @@ package com.mogo.eagle.core.function.autopilot.adapter +import android.util.* import chassis.VehicleStateOuterClass import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.HdMapBuildConfig @@ -139,6 +140,7 @@ class MoGoAdasListenerImpl : OnAdasListener { header: MessagePad.Header, vehicleState: VehicleStateOuterClass.VehicleState? ) { + if (vehicleState != null) { //转向灯数据 CallerAutopilotVehicleStateListenerManager.invokeAutopilotLightSwitchData(vehicleState.light) @@ -149,10 +151,7 @@ class MoGoAdasListenerImpl : OnAdasListener { //挂挡档位数据 CallerAutopilotVehicleStateListenerManager.invokeAutopilotGearData(vehicleState.gear) } else { - /** - * 底盘没有返回数据 - */ - CallerAutopilotVehicleStateListenerManager.invokeAutopilotNotData(header.timestamp.toLong()) + CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong()) } } diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt index cae2b3874c..c1e998d1b7 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt @@ -36,6 +36,7 @@ class MoGoAdasMsgConnectStatusListenerImpl : OnAdasConnectStatusListener, private var connectStatus = false override fun onConnectionIPCStatus(ipcConnectionStatus: Int, reason: String?) { + CallerAutoPilotStatusListenerManager.invokeAutoPilotIPCStatusChanged(ipcConnectionStatus, reason) if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.CONNECTED) { CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接成功") connectStatus = true diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java index c83ee74773..70b6dd7f54 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java @@ -7,7 +7,6 @@ import android.util.Log; import androidx.annotation.Nullable; import com.mogo.cloud.passport.MoGoAiCloudClientConfig; -import com.mogo.commons.constants.SharedPrefsConstants; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.constants.MoGoConfig; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener; @@ -20,7 +19,6 @@ import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; -import com.mogo.eagle.core.utilcode.util.GsonUtils; import org.jetbrains.annotations.NotNull; @@ -150,7 +148,6 @@ public class MoGoHandAdasMsgManager implements } @Override - public void onAutopilotNotData(long timestamp) { - + public void onAutopilotDataException(long timestamp) { } } \ 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/flow/can/CanImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt index 2ef890282e..7096af4e37 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt @@ -4,11 +4,12 @@ import android.content.* import android.util.* import chassis.Chassis.GearPosition import chassis.Chassis.LightSwitch -import com.mogo.eagle.core.data.autopilot.* import com.mogo.eagle.core.function.api.autopilot.* import com.mogo.eagle.core.function.call.autopilot.* +import com.mogo.eagle.core.utilcode.kotlin.* import com.zhjt.mogo_core_function_devatools.status.flow.IFlow import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus +import kotlinx.coroutines.* internal class CanImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotVehicleStateListener, IMoGoAutopilotStatusListener { @@ -16,44 +17,61 @@ internal class CanImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotVehic const val TAG = "CanImpl" } + private var job: Job? = null + override fun onCreate() { Log.d(TAG, "-- onCreate --") - send(CanStatus(false)) + send(CanStatus(CallerAutoPilotManager.isConnected())) CallerAutopilotVehicleStateListenerManager.addListener(TAG, this) CallerAutoPilotStatusListenerManager.addListener(TAG, this) } - override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) { - super.onAutopilotStatusResponse(autoPilotStatusInfo) - if (!CallerAutoPilotManager.isConnected()) { - send(CanStatus(false)) - } + override fun onAutopilotLightSwitchData(lightSwitch: LightSwitch?) { + send(CanStatus(CallerAutoPilotManager.isConnected())) + timeOutCheck() } - override fun onAutopilotLightSwitchData(lightSwitch: LightSwitch?) { - send(CanStatus(true)) - } override fun onAutopilotBrakeLightData(brakeLight: Boolean) { - send(CanStatus(true)) + send(CanStatus(CallerAutoPilotManager.isConnected())) + timeOutCheck() } override fun onAutopilotSteeringData(steering: Float) { - send(CanStatus(true)) + send(CanStatus(CallerAutoPilotManager.isConnected())) + timeOutCheck() } override fun onAutopilotGearData(gear: GearPosition) { - send(CanStatus(true)) + send(CanStatus(CallerAutoPilotManager.isConnected())) + timeOutCheck() } - override fun onAutopilotNotData(timestamp: Long) { + override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) { + super.onAutopilotIpcConnectStatusChanged(status, reason) + send(CanStatus(CallerAutoPilotManager.isConnected())) + timeOutCheck() + } + + override fun onAutopilotDataException(timestamp: Long) { + super.onAutopilotDataException(timestamp) send(CanStatus(false)) + timeOutCheck() + } + + private fun timeOutCheck() { + job?.safeCancel() + launch(Dispatchers.Default) { + delay(1000) + send(CanStatus(false)) + }.also { job = it } } override fun onDestroy() { super.onDestroy() + job?.safeCancel() Log.d(TAG, "-- onDestroy --") - CallerAutoPilotStatusListenerManager.removeListener(TAG) + CallerAutopilotVehicleStateListenerManager.removeListener(TAG) CallerAutoPilotStatusListenerManager.removeListener(TAG) } } \ 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/flow/ipc/IpcImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/ipc/IpcImpl.kt index f6611d3262..6fd5f70891 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/ipc/IpcImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/ipc/IpcImpl.kt @@ -22,13 +22,11 @@ internal class IpcImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatu CallerAutoPilotStatusListenerManager.addListener(TAG, this) } - - override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) { - super.onAutopilotStatusResponse(autoPilotStatusInfo) - Log.d(TAG, "-- onAutopilotStatusResponse -- state: ${autoPilotStatusInfo.state}") - if (state != autoPilotStatusInfo.state) { + override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) { + super.onAutopilotIpcConnectStatusChanged(status, reason) + if (state != status) { checkAndSend() - state = autoPilotStatusInfo.state + state = status } } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/trace/TracingImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/trace/TracingImpl.kt index ddaf051dcd..33c95a00b5 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/trace/TracingImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/trace/TracingImpl.kt @@ -5,8 +5,7 @@ import android.util.* import com.mogo.eagle.core.function.api.autopilot.* import com.mogo.eagle.core.function.call.autopilot.* import com.zhjt.mogo_core_function_devatools.status.entity.* -import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus -import com.zhjt.mogo_core_function_devatools.status.flow.IFlow +import com.zhjt.mogo_core_function_devatools.status.flow.* import mogo_msg.MogoReportMsg.MogoReportMessage internal class TracingImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatusListener { @@ -29,8 +28,8 @@ internal class TracingImpl(ctx: Context): IFlow(ctx), IMoGoAutopi override fun onAutopilotGuardian(guardianInfo: MogoReportMessage?) { super.onAutopilotGuardian(guardianInfo) val current = guardianInfo?.code + Log.d(TAG, "-- onAutopilotGuardian --: $current") if (current != null && current != old) { - Log.d(TAG, "-- onAutopilotGuardian --") send(TracingStatus(current.toState())) old = current } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/model/StatusModel.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/model/StatusModel.kt index d1cf719460..9da8025efa 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/model/StatusModel.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/model/StatusModel.kt @@ -1,5 +1,6 @@ package com.zhjt.mogo_core_function_devatools.status.model +import android.util.* import androidx.lifecycle.* import com.mogo.eagle.core.function.call.autopilot.* import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus @@ -43,6 +44,8 @@ internal class StatusModel : ViewModel() { val nv = ArrayList(v).also { it.updateOrInsert(s) } val data = Pair(getExceptionStatus(nv), nv) old.set(data) + Log.d(TAG, "status: $s") + Log.d(TAG, "data: ${data.second}") status.postValue(data) } } @@ -80,7 +83,9 @@ internal class StatusModel : ViewModel() { } } is TracingStatus -> { - if (CallerAutoPilotManager.isConnected() && s.state.isException()) { + if (CallerAutoPilotManager.isConnected() && + (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().pilotmode == 1) && + s.state.isException()) { s } else { null diff --git a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java index 1c15ecad1c..1dca020a61 100644 --- a/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java +++ b/core/function-impl/mogo-core-function-dispatch/src/main/java/com/zhjt/dispatch/DispatchAutoPilotManager.java @@ -38,6 +38,8 @@ import static com.zhjt.dispatch.model.DispatchServiceModel.DISPATCH_RESULT_AFFIR import static com.zhjt.dispatch.model.DispatchServiceModel.DISPATCH_RESULT_MANUAL_CANCEL; import static com.zhjt.dispatch.model.DispatchServiceModel.DISPATCH_RESULT_TIMER_CANCEL; +import androidx.annotation.Nullable; + import mogo.telematics.pad.MessagePad; import mogo_msg.MogoReportMsg; @@ -335,6 +337,6 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener implement FragmentStackTransactionListener, IMoGoAutopilotStatusListener { - @Override - public void onAutopilotNotData(long timestamp) { - } - protected static final String TAG = "MainActivity"; private static final int REQUEST_CODE_DIALOG = 100; @@ -393,6 +389,9 @@ public class MainActivity extends MvpActivity implement public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) { } + @Override + public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { } + @Override public void onAutopilotSNRequest() { } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java index 70dc9085bf..c0eda012a2 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java @@ -4,6 +4,8 @@ import android.content.Context; import android.os.Bundle; import android.view.View; +import androidx.annotation.Nullable; + import com.alibaba.android.arouter.facade.annotation.Route; import com.mogo.commons.mvp.BaseFragment; import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; @@ -55,10 +57,6 @@ public class SmallMapFragment extends BaseFragment SmpServiceManager.init(getContext()); } - @Override - public void onAutopilotNotData(long timestamp) { - } - @Override protected void initViews(Bundle savedInstanceState) { super.initViews(savedInstanceState); @@ -159,6 +157,10 @@ public class SmallMapFragment extends BaseFragment } + @Override + public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) { + } + @Override public void onAutopilotRotting(MessagePad.GlobalPathResp globalPathResp) { if (globalPathResp == null || globalPathResp.getWayPointsList().size() == 0) { diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt index 9d3ef5986a..e1c30bd929 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatusListener.kt @@ -36,9 +36,9 @@ interface IMoGoAutopilotStatusListener { fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {} /** - * 工控机底盘没有返回数据 + * 工控机连接状态回调 */ - fun onAutopilotNotData(timestamp: Long) {} + fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {} companion object { diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt index 97f8784495..bca93e135e 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt @@ -31,8 +31,9 @@ interface IMoGoAutopilotVehicleStateListener { */ fun onAutopilotGearData(gear: Chassis.GearPosition) + /** - * 底盘没有返回数据 + * 没有自车状态数据 */ - fun onAutopilotNotData(timestamp: Long) + fun onAutopilotDataException(timestamp: Long){} } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index f76f04e807..19a899eddc 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -167,12 +167,21 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { @Synchronized fun invokeAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) { M_AUTOPILOT_STATUS_LISTENERS.forEach { - val tag = it.key val listener = it.value autoPilotMessageCode = guardianInfo?.code ?: "" listener.onAutopilotGuardian(guardianInfo) } } + /** + * 工控机与车机连接状态回调 + */ + fun invokeAutoPilotIPCStatusChanged(ipcConnectionStatus: Int, reason: String?) { + M_AUTOPILOT_STATUS_LISTENERS.forEach { + val listener = it.value + listener.onAutopilotIpcConnectStatusChanged(ipcConnectionStatus, reason) + } + } + } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt index 2191ea3db8..37653bb62d 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt @@ -114,13 +114,10 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() { return this.timeStamp } - /** - * 底盘没有返回数据 - */ - fun invokeAutopilotNotData(timestamp: Long) { + fun invokeAutopilotDataException(timestamp: Long) { M_AUTOPILOT_VEHICLE_LISTENERS.forEach{ val listener = it.value - listener.onAutopilotNotData(timestamp) + listener.onAutopilotDataException(timestamp) } } } \ No newline at end of file diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/MogoRouteOverlayManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/MogoRouteOverlayManager.java index a59d3c5de3..7a5c0defbe 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/MogoRouteOverlayManager.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/routeoverlay/MogoRouteOverlayManager.java @@ -211,6 +211,6 @@ public class MogoRouteOverlayManager implements } @Override - public void onAutopilotNotData(long timestamp) { + public void onAutopilotIpcConnectStatusChanged(int status, @androidx.annotation.Nullable String reason) { } }