From ab59b885fb7cf4be3db4f158c36f2f85642b623f Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Tue, 24 May 2022 11:34:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BA=A2=E7=BB=BF=E7=81=AF=E5=92=8CMAP?= =?UTF-8?q?=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、红绿灯融合增加AI云请求红绿灯失败回调,当AI云失败后展示感知红绿灯数据 2、更改MAP升级状态码 --- .../core/MogoTrafficLightManager.kt | 2 ++ .../core/TrafficLightDispatcher.kt | 12 +++++++ .../data/bindingcar/AdUpgradeStateHelper.kt | 6 ++-- .../trafficlight/IMoGoTrafficLightListener.kt | 7 ++++ .../CallTrafficLightListenerManager.kt | 33 +++++++++++++++++++ 5 files changed, 57 insertions(+), 3 deletions(-) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt index 2a28de27a3..3b1acf95b2 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/MogoTrafficLightManager.kt @@ -105,6 +105,8 @@ class MogoTrafficLightManager : IMogoCarLocationChangedListener2 { TrafficLightHMIManager.INSTANCE.hideTrafficLight() CallTrafficLightListenerManager.resetTrafficLightData() } + CallTrafficLightListenerManager.invokeTrafficRequestError() + }) } }, { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt index 51ae3e3135..c9ae0ed908 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/trafficlight/core/TrafficLightDispatcher.kt @@ -37,6 +37,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLigh CallTrafficLightListenerManager.registerTrafficLightListener(TAG, this) //注册监听AI云进入路口 CallTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this) + //注册监听红绿灯请求失败 + CallTrafficLightListenerManager.registerTrafficRequestErrorListener(TAG,this) //注册监听工控机感知红绿灯 CallerAutopilotIdentifyListenerManager.addListener(TAG, this) } @@ -107,11 +109,21 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLigh } + /** + * 红绿灯接口请求失败 + */ + override fun onTrafficRequestError() { + hasAiLightStatus = false + } + + fun destroy(){ //取消注册监听AI云获取红绿灯状态 CallTrafficLightListenerManager.unRegisterTrafficLightListener(TAG) //取消注册监听工控机感知红绿灯 CallerAutopilotIdentifyListenerManager.removeListener(TAG) + //取消注册监听红绿灯请求失败 + CallTrafficLightListenerManager.unRegisterTrafficRequestErrorListener(TAG) //取消注册监听AI云进入路口 CallTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG) } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/bindingcar/AdUpgradeStateHelper.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/bindingcar/AdUpgradeStateHelper.kt index 1bd49ab863..d1bd8aa1ac 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/bindingcar/AdUpgradeStateHelper.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/bindingcar/AdUpgradeStateHelper.kt @@ -12,9 +12,9 @@ class AdUpgradeStateHelper { private const val DOWNLOAD_FINISH = "31" //下载成功 private const val DOWNLOAD_FAILED = "32" //下载失败 - private const val UPGRADING = "50" //升级中 - private const val UPGRADE_SUCCEED = "51" //升级成功 - private const val UPGRADE_FAILED = "52" //升级失败 + private const val UPGRADING = "60" //升级中 + private const val UPGRADE_SUCCEED = "61" //升级成功 + private const val UPGRADE_FAILED = "62" //升级失败 private var UPGRADEABLE = false //是否是可升级状态 diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/trafficlight/IMoGoTrafficLightListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/trafficlight/IMoGoTrafficLightListener.kt index 54eff7224e..b0f9026b07 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/trafficlight/IMoGoTrafficLightListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/trafficlight/IMoGoTrafficLightListener.kt @@ -16,4 +16,11 @@ interface IMoGoTrafficLightListener { } + /** + * 红绿灯接口请求失败 + */ + fun onTrafficRequestError(){ + + } + } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/trafficlight/CallTrafficLightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/trafficlight/CallTrafficLightListenerManager.kt index dc3cf89bc8..a520edaf98 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/trafficlight/CallTrafficLightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/trafficlight/CallTrafficLightListenerManager.kt @@ -82,6 +82,32 @@ object CallTrafficLightListenerManager { M_TRAFFIC_LIGHT_LISTENER.remove(tag) } + /** + * 添加监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ + fun registerTrafficRequestErrorListener( + @Nullable tag: String, + @Nullable listener: IMoGoTrafficLightListener + ) { + if (M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) { + return + } + M_TRAFFIC_LIGHT_LISTENER[tag] = listener + } + + /** + * 删除监听 + * @param tag 标记,用来注销监听使用 + */ + fun unRegisterTrafficRequestErrorListener(@Nullable tag: String) { + if (!M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) { + return + } + M_TRAFFIC_LIGHT_LISTENER.remove(tag) + } + /** * 删除监听 * @param listener 要删除的监听对象 @@ -113,6 +139,13 @@ object CallTrafficLightListenerManager { } } + fun invokeTrafficRequestError(){ + M_TRAFFIC_LIGHT_LISTENER.forEach{ + val listener = it.value + listener.onTrafficRequestError() + } + } + fun resetTrafficLightData() { trafficLightResult = null } From 8d419f2dd846cd4f470adb9c53968aa282bed752 Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Tue, 24 May 2022 11:51:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E8=AF=95=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix布局错误 --- .../eagle/core/function/hmi/ui/setting/DebugSettingView.kt | 7 ++++++- .../src/main/res/layout/view_debug_setting.xml | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 5c3ea8b1ce..9a4f92b8f5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -545,7 +545,7 @@ class DebugSettingView @JvmOverloads constructor( } - // 演示模式,上一次勾选的数据 + // 强制绘制引导线 tbIsDrawAutopilotTrajectoryData.setOnCheckedChangeListener { _, isChecked -> FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = isChecked } @@ -598,6 +598,11 @@ class DebugSettingView @JvmOverloads constructor( // FunctionBuildConfig.isDrawObuIdentifyData = isChecked // } + //TODO + tbIsDrawPath.setOnCheckedChangeListener { _, isChecked -> + + } + // 模拟自动驾驶中 tbChangeAutoPilotStatus.setOnCheckedChangeListener { _, isChecked -> CallerAutoPilotManager.setControlAutopilotCarAuto(isChecked) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index 67f4f1cbcc..7b856b341c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -1450,10 +1450,11 @@ android:textOn="强制绘制引导线" android:textSize="@dimen/dp_24" app:layout_constraintLeft_toLeftOf="parent" - app:layout_constraintRight_toLeftOf="@id/tbIsDrawAutopilotTrajectoryData" + app:layout_constraintRight_toLeftOf="@id/tbIsDrawPath" app:layout_constraintTop_toBottomOf="@id/tbIsDrawIdentifyData" />