From 8ba6f22c196640a1d275fa74826fa97a5efbf47a Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Wed, 9 Nov 2022 14:22:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[change]=20=E7=BB=9F=E8=AE=A1=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E6=B7=BB=E5=8A=A0=E6=B3=A8=E5=86=8C=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/adapter/MoGoAdasListenerImpl.kt | 3 +- .../IMoGoAutopilotStatisticsListener.kt | 16 +++++ ...allerAutopilotStatisticsListenerManager.kt | 60 +++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatisticsListener.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotStatisticsListenerManager.kt 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 0e3a30e99a..2f87c60356 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 @@ -48,6 +48,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListen import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordConfig import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult +import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager.invokeAutopilotStatistics import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerStartAutopilotFailedListenerManager.invokeStartAutopilotFailed import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager @@ -467,7 +468,7 @@ class MoGoAdasListenerImpl : OnAdasListener { * @param statistics 统计数据 */ override fun onAutopilotStatistics(statistics: AutopilotStatistics?) { - + invokeAutopilotStatistics(statistics); } /** diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatisticsListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatisticsListener.kt new file mode 100644 index 0000000000..deebe23b33 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatisticsListener.kt @@ -0,0 +1,16 @@ +package com.mogo.eagle.core.function.api.autopilot + +import com.zhidao.support.adas.high.bean.AutopilotStatistics + + +interface IMoGoAutopilotStatisticsListener { + + /** + * 启动自动驾驶状态统计 + * 触发机制:下发启动自动驾驶命令,根据MAP返回状态判断成功或失败 + * 统计四种状态:成功 失败 取消 超时 + * + * @param statistics 统计数据 + */ + fun onAutopilotStatistics(statistics: AutopilotStatistics?) +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotStatisticsListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotStatisticsListenerManager.kt new file mode 100644 index 0000000000..3e8dd76882 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotStatisticsListenerManager.kt @@ -0,0 +1,60 @@ +package com.mogo.eagle.core.function.call.autopilot + +import androidx.annotation.Nullable +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.zhidao.support.adas.high.bean.AutopilotStatistics +import java.util.concurrent.ConcurrentHashMap + + +object CallerAutopilotStatisticsListenerManager : CallerBase() { + + private val M_AUTOPILOT_STATISTICS_LISTENER: ConcurrentHashMap = + ConcurrentHashMap() + + /** + * 添加监听 + * @param tag 标记,用来注销监听使用 + * @param listener 监听回调 + */ + fun addListener( + @Nullable tag: String, + @Nullable listener: IMoGoAutopilotStatisticsListener + ) { + if (M_AUTOPILOT_STATISTICS_LISTENER.containsKey(tag)) { + return + } + M_AUTOPILOT_STATISTICS_LISTENER[tag] = listener + } + + /** + * 删除监听 + * @param tag 标记,用来注销监听使用 + */ + fun removeListener(@Nullable tag: String) { + if (!M_AUTOPILOT_STATISTICS_LISTENER.containsKey(tag)) { + return + } + M_AUTOPILOT_STATISTICS_LISTENER.remove(tag) + } + + /** + * 删除自动驾驶按钮选中监听 + * @param listener 要删除的监听对象 + */ + fun removeListener(@Nullable listener: IMoGoAutopilotStatisticsListener) { + M_AUTOPILOT_STATISTICS_LISTENER.forEach { + if (it.value == listener) { + M_AUTOPILOT_STATISTICS_LISTENER.remove(it.key) + } + } + } + + @Synchronized + fun invokeAutopilotStatistics(statistics: AutopilotStatistics?) { + M_AUTOPILOT_STATISTICS_LISTENER.forEach { + val listener = it.value + listener.onAutopilotStatistics(statistics) + } + } +} \ No newline at end of file From e2d90821ebf6dac2c12dad1a143f445491b36aee Mon Sep 17 00:00:00 2001 From: lianglihui Date: Wed, 9 Nov 2022 14:49:42 +0800 Subject: [PATCH 2/4] =?UTF-8?q?2.12.0=20revert=20=E5=B0=8F=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E4=BF=AE=E6=94=B9=20=20213=E5=86=8D=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/eagle/core/function/smp/SmallMapFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 bb8ff56c04..4c18ef8844 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 @@ -144,7 +144,7 @@ public class SmallMapFragment extends BaseFragment int tempStatus = autoPilotStatusInfo.getPilotmode(); if (tempStatus != 1) { clearPolyline(); - }else if (tempStatus == 0 && autoPilotStatus == 1){ + }else if (tempStatus == 1 && autoPilotStatus == 0){ CallerAutoPilotManager.INSTANCE.getGlobalPath(); } autoPilotStatus = tempStatus; @@ -178,7 +178,7 @@ public class SmallMapFragment extends BaseFragment for (MessagePad.Location routeModel : globalPathResp.getWayPointsList()) { latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude())); } - if (latLngList.size() > 0 && autoPilotStatus ==1) { + if (latLngList.size() > 0) { drawablePolyline(latLngList); } else { clearPolyline(); From 089e2b9025012eaeabfa35885d0d306d53fadcd9 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Wed, 9 Nov 2022 15:32:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[2.12.0]=201=E3=80=81bus=E4=B9=98=E5=AE=A2?= =?UTF-8?q?=E5=B1=8F=E6=96=AD=E5=BC=80=E5=8F=B8=E6=9C=BA=E7=AB=AF=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E6=97=B6=E5=80=99=EF=BC=8C=E8=BD=A8=E8=BF=B9=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E7=BB=93=E6=9D=9F=202=E3=80=81bus=E5=8F=B8=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E4=B9=98=E5=AE=A2=E6=A0=B8=E9=94=80=E8=AF=AD=E9=9F=B3?= =?UTF-8?q?=E6=92=AD=E6=8A=A5=E6=96=87=E5=AD=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../passenger/model/BusPassengerModel.java | 4 ++- .../ui/BusPassengerRouteFragment.java | 29 ++++++++++--------- .../mogo/och/bus/presenter/BusPresenter.java | 9 +++--- 3 files changed, 24 insertions(+), 18 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 876105b948..2be7474aeb 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 @@ -172,8 +172,10 @@ public class BusPassengerModel { @Override public void onFail(int code, String msg) { - //code = 1003; message = bus车辆已收车或未出车; + //code = 1003; message = bus车辆已收车或未出车;bus driver shadow,not exists if (code == 1003){ + routesResult = null; + startOrStopCalculateRouteInfo(false); queryDriverOperationDelay(); } } diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteFragment.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteFragment.java index 7c72fc813e..e56557e570 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteFragment.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerRouteFragment.java @@ -14,6 +14,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.amap.api.maps.model.LatLng; import com.elegant.utils.UiThreadHandler; +import com.mogo.commons.debug.DebugConfig; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; @@ -98,19 +99,21 @@ public class BusPassengerRouteFragment extends mMapArrowIcon = findViewById(R.id.bus_p_arrow_nor); //测试 - mSpeedTv.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - BPRouteDataTestUtils.converToRouteData(); - UiThreadHandler.postDelayed(new Runnable() { - @Override - public void run() { - updateWayPointList(mStationsList,1); - } - },1000); - return false; - } - }); + if (DebugConfig.isDebug()){ + mSpeedTv.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + BPRouteDataTestUtils.converToRouteData(); + UiThreadHandler.postDelayed(new Runnable() { + @Override + public void run() { + updateWayPointList(mStationsList,1); + } + },1000); + return false; + } + }); + } } @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 7bc2b51727..0ed6ee5692 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 @@ -304,10 +304,11 @@ public class BusPresenter extends Presenter @Override public void playPassenger(WriteOffPassenger passenger) { int passengerNum = passenger.passengerSize; - if (passengerNum > 1){ //多人播报 "x人" - VoiceNotice.showNotice(passengerNum+"人", AIAssist.LEVEL3); - }else { //是 1 播放 "滴" - mView.playDI(); + if (passengerNum > 1){ //多人播报 "x人" ---》x人核验通过 + VoiceNotice.showNotice(passengerNum+"人核验通过", AIAssist.LEVEL3); + }else { //是 1 播放 "滴" 2022.11.09 改为: "核验通过" +// mView.playDI(); + VoiceNotice.showNotice("核验通过", AIAssist.LEVEL3); } } } From 623d8351199b1ed125a102e0093755721822a8bf Mon Sep 17 00:00:00 2001 From: renwj Date: Wed, 9 Nov 2022 16:13:10 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[2.12.0][Route]=E7=A7=BB=E9=99=A4=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=E7=BA=BF=E7=9B=B8=E5=85=B3=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/service/routeoverlay/MogoRouteOverlayManager.java | 3 --- 1 file changed, 3 deletions(-) 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 5506928df5..acb043ad72 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 @@ -66,13 +66,11 @@ public class MogoRouteOverlayManager implements return; } if (isArriveAtStation.get() && autopilotMode.get() != 1) { - Logger.d(TAG, "--- onLocationChanged 1 -- [isDemo1: " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + ",isDemo2:" +FunctionBuildConfig.isDemoMode + ",isGps:" + isGps + ",mode:" + autopilotMode.get() + ",lon:" + location.getLongitude() + ",lat:" + location.getLatitude() + ",angle:" + location.getBearing() + "]"); RouteOverlayDrawer.getInstance().clearMogoRouteOverlay(); return; } boolean force = FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData; if (!force && autopilotMode.get() != 1) { - Logger.d(TAG, "--- onLocationChanged 2 -- [isDemo1: " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + ",isDemo2:" +FunctionBuildConfig.isDemoMode + ",isGps:" + isGps + ",mode:" + autopilotMode.get() + ",lon:" + location.getLongitude() + ",lat:" + location.getLatitude() + ",angle:" + location.getBearing() + "]"); RouteOverlayDrawer.getInstance().clearMogoRouteOverlay(); return; } @@ -80,7 +78,6 @@ public class MogoRouteOverlayManager implements if (!queue.isEmpty()) { List items = queue.pollLast(); if (items != null && !items.isEmpty()) { - Logger.d(TAG, "--- onLocationChanged -- [isDemo1: " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + ",isDemo2:" +FunctionBuildConfig.isDemoMode + ",isGps:" + isGps + ",mode:" + autopilotMode.get() + ",lon:" + location.getLongitude() + ",lat:" + location.getLatitude() + ",angle:" + location.getBearing() + "]"); RouteOverlayDrawer.getInstance().drawTrajectoryList(items, location.getBearing()); } }