From 0a4b0be72a60ff2bd2a1dab80eac303b8857570a Mon Sep 17 00:00:00 2001 From: renwj Date: Thu, 2 Feb 2023 10:33:54 +0800 Subject: [PATCH 01/32] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launcher/lancet/LeakCanaryCrashFix.kt | 62 ------------------- 1 file changed, 62 deletions(-) delete mode 100644 app/src/main/java/com/mogo/launcher/lancet/LeakCanaryCrashFix.kt diff --git a/app/src/main/java/com/mogo/launcher/lancet/LeakCanaryCrashFix.kt b/app/src/main/java/com/mogo/launcher/lancet/LeakCanaryCrashFix.kt deleted file mode 100644 index e7b10be35d..0000000000 --- a/app/src/main/java/com/mogo/launcher/lancet/LeakCanaryCrashFix.kt +++ /dev/null @@ -1,62 +0,0 @@ -package com.mogo.launcher.lancet - -import android.database.sqlite.* -import androidx.annotation.* -import com.knightboost.lancet.api.* -import com.knightboost.lancet.api.annotations.* -import com.knightboost.lancet.api.annotations.Weaver - -/** - * 此类主要用来修正三方库引起的崩溃 - */ -@Keep -@Weaver -@Group("leak_canary_crash_fix") -class LeakCanaryCrashFix { - - @Insert - @TargetClass("leakcanary.internal.activity.db.ScopedLeaksDb\$DbOpener") - @TargetMethod(methodName = "getReadableDatabase") - fun proxyGetReadableSQLiteDb(): SQLiteDatabase? { - try { - return Origin.call() as SQLiteDatabase? - } catch (t: Throwable) { - t.printStackTrace() - } - return null - } - - @Insert - @TargetClass("leakcanary.internal.activity.db.ScopedLeaksDb\$DbOpener") - @TargetMethod(methodName = "getWritableDatabase") - fun proxyGetWritableSQLiteDb(): SQLiteDatabase? { - try { - return Origin.call() as SQLiteDatabase? - } catch (t: Throwable) { - t.printStackTrace() - } - return null - } - - @Insert - @TargetClass("leakcanary.internal.activity.db.ScopedLeaksDb\$DbOpener") - @TargetMethod(methodName = "close") - fun proxyClose() { - try { - Origin.callVoid() - } catch (t: Throwable) { - t.printStackTrace() - } - } - - @Insert - @TargetClass("leakcanary.internal.activity.db.Io\$execute\$2") - @TargetMethod(methodName = "run") - fun proxyRun() { - try { - Origin.callVoid() - } catch (t: Throwable) { - t.printStackTrace() - } - } -} \ No newline at end of file From 8851a1ef0064014c050fac5bdbfa0fe0bde10be1 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 2 Feb 2023 16:53:14 +0800 Subject: [PATCH 02/32] =?UTF-8?q?[Opt]=E7=9B=B4=E6=8E=A5=E4=BB=8E=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84Caller=E7=B1=BB=E4=B8=AD=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E7=9A=84=E5=85=A8=E5=B1=80=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E8=A7=84=E5=88=92=E8=BD=A8=E8=BF=B9=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/map/MapFragment.kt | 24 ------------------- .../function/overview/view/OverMapView.kt | 8 ++++--- .../core/function/smp/AMapCustomView.java | 5 +++- .../CallerPlanningRottingListenerManager.kt | 7 ++++++ 4 files changed, 16 insertions(+), 28 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt index 403a8d640c..7a0be511e0 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt @@ -11,7 +11,6 @@ import com.mogo.eagle.core.data.constants.MoGoFragmentPaths import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.map.CenterLine import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener -import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener import com.mogo.eagle.core.function.business.MapPointCloudSubscriber @@ -19,22 +18,16 @@ import com.mogo.eagle.core.function.business.SpeedLimitDataManager import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager -import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight import com.mogo.eagle.core.function.call.map.CallerHDMapManager import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager import com.mogo.eagle.core.function.datacenter.location.IMoGoLocationListener import com.mogo.eagle.core.function.datacenter.location.MoGoLocationManager -import com.mogo.eagle.core.function.overview.InfStructureManager -import com.mogo.eagle.core.function.overview.InfStructureManager.savePlanningData -import com.mogo.eagle.core.function.overview.obtainViewModel -import com.mogo.eagle.core.function.overview.vm.OverViewModel import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr -import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.eagle.core.utilcode.util.Utils import com.mogo.map.IMogoMap import com.mogo.map.MogoMapView @@ -55,7 +48,6 @@ class MapFragment : MvpFragment(), IMoGoMapFragmentProvider, IMoGoSkinModeChangeListener, IMoGoLocationListener, - IMoGoPlanningRottingListener, IMoGoChassisLamplightListener { private var mMogoMapView: MogoMapView? = null @@ -113,7 +105,6 @@ class MapFragment : MvpFragment(), } // 添加换肤监听 CallerSkinModeListenerManager.addListener(Companion.functionName, this) - CallerPlanningRottingListenerManager.addListener(Companion.functionName, this) MoGoLocationManager.addListener(Companion.functionName, this) CallerChassisLamplightListenerManager.addListener(Companion.functionName, this) } @@ -200,15 +191,6 @@ class MapFragment : MvpFragment(), MogoRouteOverlayManager.getInstance().init() MapPointCloudSubscriber.instance SpeedLimitDataManager.getInstance().start() - - // TODO GD地图业务需要与高精地图业务拆开 --- 扶风 - queryInfStructure() - } - - private fun queryInfStructure() { - val viewModel = this.obtainViewModel(OverViewModel::class.java) - viewModel.infStructuresMap.observe(this.viewLifecycleOwner) { t -> InfStructureManager.saveData(t) } - viewModel.fetchInfStructures() } override fun getUIController(): IMogoMapUIController { @@ -217,7 +199,6 @@ class MapFragment : MvpFragment(), override fun onDestroyView() { CallerSkinModeListenerManager.removeListener(Companion.functionName) - CallerPlanningRottingListenerManager.removeListener(Companion.functionName) MoGoLocationManager.removeListener(Companion.functionName) CallerChassisLamplightListenerManager.removeListener(Companion.functionName) @@ -334,11 +315,6 @@ class MapFragment : MvpFragment(), override val functionName: String get() = functionName - // TODO 全览模式需要自己监听 --- 扶风 - override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) { - UiThreadHandler.post { savePlanningData(globalPathResp!!.wayPointsList) } - } - private var turnLightTimes = 0 private var isOnTurnLight = false private var turnLight = 0 diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt index ddc6423415..4e4783b492 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt @@ -269,12 +269,14 @@ class OverMapView @JvmOverloads constructor( * 室内某个bag包自动驾驶启动8s后返回 */ override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) { - Log.d(TAG, "onAutopilotRotting") - handlePlanningData(globalPathResp!!.wayPointsList) + globalPathResp?.let { + handlePlanningData(it.wayPointsList) + } } } - fun handlePlanningData(locationList: List) { + fun handlePlanningData(locationList: List?) { + if (locationList.isNullOrEmpty()) return val list: List = locationList // 转成高德坐标系并存储 updateRoutePoints(list, mContext!!) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java index c8f97d3f25..d1147ce765 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java @@ -224,11 +224,14 @@ public class AMapCustomView @Override public void onAutopilotRotting(@org.jetbrains.annotations.Nullable MessagePad.GlobalPathResp globalPathResp) { Log.d(TAG, "onAutopilotRotting"); - handlePlanningData(globalPathResp.getWayPointsList()); + if (globalPathResp != null) { + handlePlanningData(globalPathResp.getWayPointsList()); + } } }; public void handlePlanningData(List locationList) { + if (locationList == null || locationList.size() == 0) return; List list = locationList; // 转成高德坐标系并存储 MarkerDrawerManager.INSTANCE.updateRoutePoints(list, mContext); diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningRottingListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningRottingListenerManager.kt index b3c1d7d43f..157e6c5825 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningRottingListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningRottingListenerManager.kt @@ -11,12 +11,19 @@ import mogo.telematics.pad.MessagePad */ object CallerPlanningRottingListenerManager : CallerBase() { + private var globalPathResp: MessagePad.GlobalPathResp? = null + + override fun doSomeAfterAddListener(tag: String, listener: IMoGoPlanningRottingListener) { + listener.onAutopilotRotting(globalPathResp) + } + /** * 路径规划 回调 * @param globalPathResp 自动驾驶网约车回调数据 */ @Synchronized fun invokeAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) { + this.globalPathResp = globalPathResp M_LISTENERS.forEach { val tag = it.key val listener = it.value From 111940123f88141be9828ff077c7dddebf6166b6 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Thu, 2 Feb 2023 19:24:38 +0800 Subject: [PATCH 03/32] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[?= =?UTF-8?q?=201=E3=80=81=E5=AE=8C=E6=88=90=E5=B7=A5=E6=8E=A7=E6=9C=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=92=8C=E9=AB=98=E5=BE=B7GPS=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E6=95=B0=E6=8D=AE=E7=9A=84=E6=95=B0=E6=8D=AE=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=EF=BC=8C=E4=BB=A5=E5=8F=8A=E5=B7=A5=E6=8E=A7=E6=9C=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=B6=85=E6=97=B6=E5=90=8E=E7=9A=84=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=88=87=E6=8D=A2=E4=B8=BA=E9=AB=98=E5=BE=B7=E5=9C=B0?= =?UTF-8?q?=E5=9B=BEGPS=E6=95=B0=E6=8D=AE=20=E5=AE=9A=E4=BD=8D=E7=9B=91?= =?UTF-8?q?=E5=90=AC=E5=B7=B2=E9=87=8D=E6=9E=84=EF=BC=8CCallerChassisLocat?= =?UTF-8?q?ionGCJ20ListenerManager---=E9=AB=98=E7=9A=84=E5=9D=90=E6=A0=87?= =?UTF-8?q?=E7=B3=BB=EF=BC=8CCallerChassisLocationWGS84ListenerManager--?= =?UTF-8?q?=E9=AB=98=E7=B2=BE=E5=9D=90=E6=A0=87=E7=B3=BB=EF=BC=8C=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E4=BB=A3=E7=A0=81=E5=B7=B2=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E5=A4=A7=E5=AE=B6=E5=90=8E=E7=BB=AD=E9=A1=B9=E7=9B=AE=E4=B8=AD?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=9C=80=E8=A6=81=E8=BF=9B=E8=A1=8C=E8=AE=A2?= =?UTF-8?q?=E9=98=85=EF=BC=8C=E5=A6=82=E9=9C=80=E6=8E=A7=E5=88=B6=E9=A2=91?= =?UTF-8?q?=E7=8E=87=E5=8F=AF=E5=9C=A8=E8=AE=A2=E9=98=85=E6=97=B6=20//=20?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=95=B0=E6=8D=AE=E5=9B=9E=E8=B0=83=E9=A2=91?= =?UTF-8?q?=E7=8E=87=EF=BC=8C=E5=8D=95=E4=BD=8DHZ=EF=BC=8C1HZ=E7=9A=84?= =?UTF-8?q?=E5=91=A8=E6=9C=9F=E6=98=AF1=E7=A7=92=EF=BC=9B50HZ=E7=9A=84?= =?UTF-8?q?=E5=91=A8=E6=9C=9F=E6=98=AF1/50=3D0.02=E7=A7=92=EF=BC=9B10HZ?= =?UTF-8?q?=E7=9A=84=E5=91=A8=E6=9C=9F=E6=98=AF1/10=3D0.1=E7=A7=92?= =?UTF-8?q?=E3=80=82=20CallerChassisLocationWGS84ListenerManager.setListen?= =?UTF-8?q?erHz(Companion.functionName,=2020)=20CallerChassisLocationGCJ20?= =?UTF-8?q?ListenerManagersetListenerHz(Companion.functionName,=2020)=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- ...IBusPassengerControllerStatusCallback.java | 4 +- .../passenger/model/BusPassengerModel.java | 4 +- .../presenter/BaseBusPassengerPresenter.java | 9 +- .../ui/BusPassengerMapDirectionView.java | 5 +- .../ui/BusPassengerRouteFragment.java | 8 +- .../IBusControllerStatusCallback.java | 4 +- .../com/mogo/och/bus/model/BusOrderModel.java | 21 +- .../mogo/och/bus/presenter/BusPresenter.java | 4 +- .../och/bus/util/BusSendTripInfoManager.kt | 4 +- .../och/bus/util/BusTrajectoryManager.java | 4 +- .../module/biz/model/OchCommonLoginModel.kt | 4 +- .../utils/CoordinateCalculateRouteUtil.java | 14 +- .../ISweeperControllerStatusCallback.java | 4 +- .../och/sweeper/model/SweeperOrderModel.java | 19 +- .../sweeper/presenter/SweeperPresenter.java | 5 +- .../sweeper/ui/SweeperOperatePanelView.java | 5 +- .../util/SweeperTrajectoryManager.java | 4 +- ...TaxiPassengerControllerStatusCallback.java | 4 +- .../passenger/model/TaxiPassengerModel.java | 10 +- .../presenter/BaseTaxiPassengerPresenter.java | 2 +- .../TaxiPassengerServingOrderPresenter.java | 3 +- .../ui/TaxiPassengerMapDirectionView.java | 5 +- .../ui/TaxiPassengerServingOrderFragment.java | 7 +- .../ITaxiControllerStatusCallback.java | 4 +- .../com/mogo/och/taxi/model/TaxiModel.java | 30 +- .../och/taxi/presenter/TaxiPresenter.java | 5 +- .../och/taxi/ui/TaxiMapDirectionView.java | 5 +- .../och/taxi/utils/TaxiTrajectoryManager.java | 5 +- .../biz/dispatch/DispatchAutoPilotManager.kt | 4 +- .../redlightwarning/RedLightWarningManager.kt | 8 +- .../core/MogoTrafficLightManager.kt | 6 +- .../build.gradle | 1 + .../eagle/core/function/DataCenterProvider.kt | 3 +- ...der.kt => MoGoAutopilotControlProvider.kt} | 7 +- .../autopilot/adapter/MoGoAdasListenerImpl.kt | 8 +- .../MoGoAdasMsgConnectStatusListenerImpl.kt | 8 +- .../server/AsyncDataToAutopilotServer.kt | 4 +- .../autopilot/telematic/TeleMsgHandler.kt | 8 +- .../location/IMoGoLocationListener.kt | 16 - .../location/MoGoLocationDispatcher.kt | 176 ++++++++ .../location/MoGoLocationManager.kt | 71 --- .../function/datacenter/location/README.md | 4 +- .../badcase/biz/AIDataCollectWindow.kt | 12 +- .../badcase/biz/BadCaseConfigView.kt | 4 +- .../badcase/biz/CaseListDialog.java | 4 +- .../badcase/biz/CaseTopicListDialog.java | 6 +- .../badcase/biz/InitiativeBadCaseWindow.kt | 14 +- .../badcase/biz/PassiveBadCaseWindow.kt | 8 +- .../logcatch/MogoLogCatchManager.kt | 6 +- .../status/flow/can/CanImpl.kt | 4 +- .../status/flow/ipc/IpcImpl.kt | 2 +- .../status/flow/rtk/RTKImpl.kt | 16 +- .../status/flow/trace/TracingImpl.kt | 2 +- .../status/model/StatusModel.kt | 2 +- .../trace/SyncConfig.kt | 4 +- .../core/function/hmi/ui/MoGoHmiFragment.kt | 6 +- .../adapter/DriverMsgBoxBubbleAdapter.kt | 4 +- .../msgbox/adapter/DriverMsgBoxListAdapter.kt | 6 +- .../ui/notice/traffic/NoticeTrafficDialog.kt | 2 +- .../hmi/ui/setting/DebugSettingView.kt | 55 +-- .../hmi/ui/setting/IPCReportAdapter.kt | 6 +- .../hmi/ui/setting/ReportListAdapter.kt | 6 +- .../function/hmi/ui/setting/SOPSettingView.kt | 12 +- .../hmi/ui/switch/DemoModeHiddenSwitch.kt | 6 +- .../hmi/ui/tools/AutoPilotAndCheckView.kt | 10 +- .../hmi/ui/widget/AutoPilotStatusView.kt | 4 +- .../function/hmi/ui/widget/CheckSystemView.kt | 4 +- .../function/hmi/ui/widget/SpeedPanelView.kt | 6 +- .../function/main/MainLauncherActivity.java | 16 +- .../main/PassengerLauncherActivity.java | 17 +- .../business/SpeedLimitDataManager.java | 7 +- .../collect/MoGoMapDataCollectProvider.kt | 18 +- .../routeoverlay/MogoRouteOverlayManager.java | 3 +- .../eagle/core/function/map/MapFragment.kt | 17 +- .../function/overview/view/OverMapView.kt | 9 +- .../core/function/smp/AMapCustomView.java | 7 +- .../function/smp/OverviewMapFragment.java | 4 +- .../function/smp/SmallMapDirectionView.java | 7 +- .../core/function/smp/SmallMapFragment.java | 4 +- .../startup/stageone/HttpDnsStartUp.kt | 12 +- .../function/v2x/events/V2XEventManager.kt | 100 +++-- .../v2x/events/alarm/V2XAlarmServer.java | 8 +- .../v2x/events/remove/MarkerRemoveManager.kt | 11 +- .../scene/road/V2XAiRoadEventMarker.kt | 2 +- .../warning/V2XFrontWarningScenario.java | 10 +- .../scene/warning/V2XWarningMarker.java | 17 +- .../eagle/core/data/map/MogoLocation.java | 424 +++++++++--------- ...er.kt => IMoGoAutopilotControlProvider.kt} | 2 +- .../api/autopilot/IMoGoChassisGnssListener.kt | 18 + .../IMoGoChassisLocationGCJ02Listener.kt | 4 +- .../IMoGoChassisLocationWGS84Listener.kt | 6 +- ...er.kt => CallerAutoPilotControlManager.kt} | 8 +- .../CallerAutopilotIdentifyListenerManager.kt | 2 +- .../CallerChassisGnssListenerManager.kt | 27 ++ ...llerChassisLocationGCJ20ListenerManager.kt | 73 ++- ...llerChassisLocationWGS84ListenerManager.kt | 64 ++- .../core/function/call/base/CallerBase.kt | 6 +- .../call/map/CallerVisualAngleManager.kt | 3 +- .../locationinfo/MogoLocationSource.java | 6 +- .../com/mogo/commons/utils/LocationUtils.java | 2 +- .../map/location/IMoGoGDLocationListener.kt | 15 + .../uicontroller/IMogoMapUIController.java | 3 +- .../java/com/mogo/map/AMapViewWrapper.java | 5 +- .../com/mogo/map/MogoMapUIController.java | 3 +- .../main/java/com/mogo/map/MogoMapView.java | 3 +- .../map/uicontroller/AMapUIController.java | 3 +- .../java/com/mogo/map/utils/ObjectUtils.java | 4 +- 107 files changed, 963 insertions(+), 724 deletions(-) rename core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/{MoGoAutopilotProvider.kt => MoGoAutopilotControlProvider.kt} (99%) delete mode 100644 core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/IMoGoLocationListener.kt create mode 100644 core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt delete mode 100644 core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationManager.kt rename core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/{IMoGoAutopilotProvider.kt => IMoGoAutopilotControlProvider.kt} (99%) create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGnssListener.kt rename core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/{CallerAutoPilotManager.kt => CallerAutoPilotControlManager.kt} (98%) create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGnssListenerManager.kt create mode 100644 libraries/mogo-map-api/src/main/java/com/mogo/map/location/IMoGoGDLocationListener.kt diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/callback/IBusPassengerControllerStatusCallback.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/callback/IBusPassengerControllerStatusCallback.java index e4663fd379..cc0bc3f4c7 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/callback/IBusPassengerControllerStatusCallback.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/callback/IBusPassengerControllerStatusCallback.java @@ -1,6 +1,6 @@ package com.mogo.och.bus.passenger.callback; -import mogo.telematics.pad.MessagePad; +import com.mogo.eagle.core.data.map.MogoLocation; /** * Created on 2022/3/31 @@ -11,5 +11,5 @@ public interface IBusPassengerControllerStatusCallback { // 是否vr map模式 void onVRModeChanged(boolean isVRMode); // 自车定位 - void onCarLocationChanged(MessagePad.GnssInfo location); + void onCarLocationChanged(MogoLocation location); } 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 5a81e37c5d..48b2c39fa2 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 @@ -89,7 +89,7 @@ public class BusPassengerModel { private IBusPassegerDriverStatusCallback mDriverStatusCallback; //出车收车状态 private IBusPassengerRouteLineInfoCallback mRouteLineInfoCallback; // bus路线信息更新 - private MessagePad.GnssInfo mLocation = null; + private MogoLocation mLocation = null; private BusPassengerRoutesResult routesResult = null; @@ -321,7 +321,7 @@ public class BusPassengerModel { private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() { @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { if (null == gnssInfo) return; mLocation = gnssInfo; for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){ diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/presenter/BaseBusPassengerPresenter.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/presenter/BaseBusPassengerPresenter.java index d446f8b6a8..0373dbc61b 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/presenter/BaseBusPassengerPresenter.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/presenter/BaseBusPassengerPresenter.java @@ -1,6 +1,7 @@ package com.mogo.och.bus.passenger.presenter; -import android.location.Location; +import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P; + import android.os.Looper; import androidx.annotation.NonNull; @@ -24,10 +25,6 @@ import com.mogo.och.bus.passenger.ui.BusPassengerRouteFragment; import java.util.List; -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P; - -import mogo.telematics.pad.MessagePad; - /** * Created on 2022/3/31 */ @@ -112,7 +109,7 @@ public class BaseBusPassengerPresenter extends Presenter mView.onCarLocationChanged(location)); } diff --git a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java index 5e262d949f..feead6bbb2 100644 --- a/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java +++ b/OCH/mogo-och-bus-passenger/src/main/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.java @@ -27,6 +27,7 @@ import com.amap.api.maps.model.Marker; import com.amap.api.maps.model.MarkerOptions; import com.amap.api.maps.model.Polyline; import com.amap.api.maps.model.PolylineOptions; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -37,8 +38,6 @@ import com.mogo.och.bus.passenger.utils.BusPassengerMapAssetStyleUtil; import java.util.ArrayList; import java.util.List; -import mogo.telematics.pad.MessagePad; - /** * 乘客屏小地图 */ @@ -175,7 +174,7 @@ public class BusPassengerMapDirectionView } @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { if (gnssInfo == null) { return; } 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 29103f4c3a..9d7393f968 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 @@ -16,7 +16,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.data.map.MogoLocation; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.och.bus.passenger.R; @@ -32,8 +32,6 @@ import com.mogo.och.common.module.wigets.MarqueeTextView; import java.util.ArrayList; import java.util.List; -import mogo.telematics.pad.MessagePad; - /** * @author: wangmingjun * @date: 2022/4/12 @@ -299,8 +297,8 @@ public class BusPassengerRouteFragment extends lastBearing = bearing; } - public void onCarLocationChanged(MessagePad.GnssInfo location) { - updateSpeedView((float) location.getVehicleSpeed()); + public void onCarLocationChanged(MogoLocation location) { + updateSpeedView((float) location.getGnssSpeed()); } public void updateSpeedView(float speed){ diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/IBusControllerStatusCallback.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/IBusControllerStatusCallback.java index 0a0d2e8be4..e10afc44e7 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/IBusControllerStatusCallback.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/IBusControllerStatusCallback.java @@ -2,8 +2,6 @@ package com.mogo.och.bus.callback; import com.mogo.eagle.core.data.map.MogoLocation; -import mogo.telematics.pad.MessagePad; - /** * Created on 2021/9/10 * @@ -13,7 +11,7 @@ public interface IBusControllerStatusCallback { // 是否vr map模式 void onVRModeChanged(boolean isVRMode); // 自车定位 - void onCarLocationChanged(MessagePad.GnssInfo location); + void onCarLocationChanged(MogoLocation location); //开始开启自动驾驶 void startOpenAutopilot(); } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java index 49fa526003..0e235a4f5e 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java @@ -24,10 +24,11 @@ import com.mogo.commons.module.status.StatusDescriptor; import com.mogo.eagle.core.data.BaseData; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager; @@ -377,7 +378,7 @@ public class BusOrderModel { // 自车定位 private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() { @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { if (null == gnssInfo) return; mLongitude = gnssInfo.getLongitude(); mLatitude = gnssInfo.getLatitude(); @@ -393,7 +394,7 @@ public class BusOrderModel { }; //根据围栏判断,是否到达站点 - private void judgeArrivedStation(MessagePad.GnssInfo location) { + private void judgeArrivedStation(MogoLocation location) { if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界"); @@ -634,7 +635,7 @@ public class BusOrderModel { return; } - CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters); + CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters); CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters) + " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName + @@ -778,8 +779,8 @@ public class BusOrderModel { public void closeBeautificationMode() { if (FunctionBuildConfig.isDemoMode) {//收车结束美化 FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; //是否强制绘制引导线 - CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏 - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾 + CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏 + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾 CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false"); } } @@ -861,7 +862,7 @@ public class BusOrderModel { CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)"); } else if (backgroundCurrentStationIndex > 0 && backgroundCurrentStationIndex < stationList.size() - 1) { //美化模式下 中间站点到站 引导线要一直绘制,所以此处不出强制绘制不传false - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false); CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:false(到达中间站)"); clearStartAutopilotTag(); } else { @@ -952,8 +953,8 @@ public class BusOrderModel { private void startBeautificationMode() { FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true; - CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true); - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true); + CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true); } public void clearBusStationDatas() { @@ -992,7 +993,7 @@ public class BusOrderModel { return; } CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束===="); - CallerAutoPilotManager.INSTANCE.cancelAutoPilot(); + CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot(); endTask(); } 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 df44117942..afdc84c3cf 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 @@ -233,9 +233,9 @@ public class BusPresenter extends Presenter } @Override - public void onCarLocationChanged(MessagePad.GnssInfo location) { + public void onCarLocationChanged(MogoLocation location) { if (null != location) { - runOnUIThread(() -> mView.updateSpeedView((float) location.getVehicleSpeed())); + runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed())); } } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/util/BusSendTripInfoManager.kt b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/util/BusSendTripInfoManager.kt index 9d0073363a..b4da61f56f 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/util/BusSendTripInfoManager.kt +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/util/BusSendTripInfoManager.kt @@ -1,6 +1,6 @@ package com.mogo.och.bus.util -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant @@ -31,6 +31,6 @@ object BusSendTripInfoManager{ d(SceneConstant.M_BUS + "BusSendTripInfoManager", "type: "+ type +", lineName: "+ lineName +", departureStopName: "+ departureStopName + ", arrivalStopName: "+arrivalStopName+", isLastStop: "+isLastStop) - CallerAutoPilotManager.sendTripInfo(type,lineName,departureStopName, arrivalStopName, isLastStop) + CallerAutoPilotControlManager.sendTripInfo(type,lineName,departureStopName, arrivalStopName, isLastStop) } } diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java index 94ad2be2d1..337e375df4 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/util/BusTrajectoryManager.java @@ -3,7 +3,7 @@ package com.mogo.och.bus.util; import androidx.annotation.Nullable; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.GsonUtils; import com.mogo.och.bus.bean.BusRoutesResult; @@ -198,7 +198,7 @@ public class BusTrajectoryManager { // mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00 // mAutoPilotLine.setVehicleModel("红旗H9"); - CallerAutoPilotManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine); + CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine); CallerLogger.INSTANCE.d(M_BUS + TAG, "sendTrajectoryReq(): " + GsonUtils.toJson(mAutoPilotLine)); } diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginModel.kt b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginModel.kt index 1b62d34180..8697396a31 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginModel.kt +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/biz/model/OchCommonLoginModel.kt @@ -3,6 +3,7 @@ package com.mogo.och.common.module.biz.model import android.annotation.SuppressLint import android.content.Context import com.mogo.eagle.core.data.BaseData +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager import com.mogo.eagle.core.utilcode.util.NetworkUtils @@ -17,7 +18,6 @@ import com.mogo.och.common.module.biz.constant.TaxiLoginStatusEnum import com.mogo.och.common.module.biz.network.OchCommonServiceCallback import com.mogo.och.common.module.biz.network.OchCommonServiceManager import com.mogo.och.common.module.utils.ToastUtilsOch -import mogo.telematics.pad.MessagePad /** * Created by pangfan on 2021/8/19 @@ -46,7 +46,7 @@ object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener { return true } - override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) { + override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) { gnssInfo?.let { mLongitude = it.longitude mLatitude = it.latitude diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.java index 0eb9f22ed6..b09a1dbc29 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CoordinateCalculateRouteUtil.java @@ -192,7 +192,7 @@ public class CoordinateCalculateRouteUtil { for (MessagePad.Location m : models) { LatLng mogoLatLng = coordinateConverterWgsToGcj(mContext, m); MogoLocation location = new MogoLocation(); - location.setBearing((float) m.getHeading()); + location.setHeading((float) m.getHeading()); location.setLatitude(mogoLatLng.latitude); location.setLongitude(mogoLatLng.longitude); list.add(location); @@ -231,7 +231,7 @@ public class CoordinateCalculateRouteUtil { */ public static Map> getRemainPointListByCompareNew(int preIndex, List mRoutePoints, - MessagePad.GnssInfo realLocation) { + MogoLocation realLocation) { Map> routePonits = new HashMap<>(); List latePoints = new ArrayList<>(); // 剩余轨迹集合 int currentIndex = 0; //记录疑似点 @@ -245,8 +245,8 @@ public class CoordinateCalculateRouteUtil { for (int i= 0; i < mRoutePoints.size(); i++){ MogoLocation latLng = mRoutePoints.get(i); //todo 先看index对应点的方向和realLocation方向是否一致, 方向角度不能过90度 - if (realLocation.getHeading() == realLocation.getHeading() - latLng.getBearing() || - Math.abs(realLocation.getHeading() - latLng.getBearing()) <= 90){ + if (realLocation.getHeading() == realLocation.getHeading() - latLng.getHeading() || + Math.abs(realLocation.getHeading() - latLng.getHeading()) <= 90){ float diff = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(), realLocation.getLatitude(), latLng.getLongitude(),latLng.getLatitude()); @@ -276,7 +276,7 @@ public class CoordinateCalculateRouteUtil { } public static int getArrivedPointIndexNew(int preIndex, List mRoutePoints, - MessagePad.GnssInfo realLocation) { + MogoLocation realLocation) { int currentIndex = 0; //记录疑似点 //基础点 MogoLocation baseLatLng = mRoutePoints.get(0); float baseDiffDis = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(), @@ -285,8 +285,8 @@ public class CoordinateCalculateRouteUtil { for (int i = 0; i < mRoutePoints.size(); i++) { MogoLocation latLng = mRoutePoints.get(i); - if (realLocation.getHeading() == realLocation.getHeading() - latLng.getBearing() || - Math.abs(realLocation.getHeading() - latLng.getBearing()) <= 90){ + if (realLocation.getHeading() == realLocation.getHeading() - latLng.getHeading() || + Math.abs(realLocation.getHeading() - latLng.getHeading()) <= 90){ float diff = CoordinateUtils.calculateLineDistance(realLocation.getLongitude(), realLocation.getLatitude(), latLng.getLongitude(), latLng.getLatitude()); diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/callback/ISweeperControllerStatusCallback.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/callback/ISweeperControllerStatusCallback.java index 21d9169aec..7a831a7c0e 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/callback/ISweeperControllerStatusCallback.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/callback/ISweeperControllerStatusCallback.java @@ -1,6 +1,6 @@ package com.mogo.och.sweeper.callback; -import mogo.telematics.pad.MessagePad; +import com.mogo.eagle.core.data.map.MogoLocation; /** * Created on 2021/9/10 @@ -11,7 +11,7 @@ public interface ISweeperControllerStatusCallback { // 是否vr map模式 void onVRModeChanged(boolean isVRMode); // 自车定位 - void onCarLocationChanged(MessagePad.GnssInfo location); + void onCarLocationChanged(MogoLocation location); //开始开启自动驾驶 void startOpenAutopilot(); } diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java index 30f5611e57..6a3e17c094 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java @@ -19,9 +19,10 @@ import com.mogo.commons.voice.AIAssist; import com.mogo.eagle.core.data.BaseData; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager; @@ -273,7 +274,7 @@ public class SweeperOrderModel { // 自车定位 private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() { @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { if (null == gnssInfo) return; mLongitude = gnssInfo.getLongitude(); mLatitude = gnssInfo.getLatitude(); @@ -289,7 +290,7 @@ public class SweeperOrderModel { }; //根据围栏判断,是否到达起点 - private void judgeStartStation(MessagePad.GnssInfo location) { + private void judgeStartStation(MogoLocation location) { if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { return; @@ -390,7 +391,7 @@ public class SweeperOrderModel { CallerLogger.INSTANCE.d(M_BUS + TAG, "单程真的结束了===="); isGoingToNextStation = false; backgroundCurrentStationIndex = 0; - CallerAutoPilotManager.INSTANCE.cancelAutoPilot(); + CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot(); querySweeperRoutes(); } } @@ -467,7 +468,7 @@ public class SweeperOrderModel { // CallerLogger.INSTANCE.d( M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters) // +" startLatLon="+currentStation.getName()+",endLatLon="+nextStation.getName()); CallerLogger.INSTANCE.d(M_BUS + TAG, "开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)); - CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters); + CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters); if (mControllerStatusCallback != null) { mControllerStatusCallback.startOpenAutopilot(); @@ -553,7 +554,7 @@ public class SweeperOrderModel { private void closeBeautificationMode() { if (FunctionBuildConfig.isDemoMode) {//收车结束美化 FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false); CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false(收车)"); } } @@ -676,7 +677,7 @@ public class SweeperOrderModel { && backgroundCurrentStationIndex <= stationList.size() - 1) && stationList.get(backgroundCurrentStationIndex).isLeaving()) {//行驶过程中设置美化 FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true; - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true); CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)"); } @@ -794,7 +795,7 @@ public class SweeperOrderModel { return; } CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束===="); - CallerAutoPilotManager.INSTANCE.cancelAutoPilot(); + CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot(); AIAssist.getInstance(mContext).speakTTSVoice("感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见"); leaveStation(true, true); } @@ -819,7 +820,7 @@ public class SweeperOrderModel { if (FunctionBuildConfig.isDemoMode && backgroundCurrentStationIndex <= stationList.size() - 1) {//到达一站结束美化 FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false); CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false(到最后一站)"); } CallerLogger.INSTANCE.d(M_BUS + TAG, "到站====currentStationIndex=" + backgroundCurrentStationIndex); diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java index 6eb418f229..e0534eaf5e 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java @@ -11,6 +11,7 @@ import androidx.lifecycle.LifecycleOwner; import com.mogo.commons.mvp.Presenter; import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -237,9 +238,9 @@ public class SweeperPresenter extends Presenter } @Override - public void onCarLocationChanged(MessagePad.GnssInfo location) { + public void onCarLocationChanged(MogoLocation location) { if (null != location) { - runOnUIThread(() -> mView.updateSpeedView((float) location.getVehicleSpeed())); + runOnUIThread(() -> mView.updateSpeedView((float) location.getGnssSpeed())); } } 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 5a72b271fe..372648e53a 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 @@ -27,7 +27,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; 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.CallerAutoPilotControlManager; 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; @@ -39,7 +39,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; -import chassis.Chassis; import chassis.ChassisStatesOuterClass; import chassis.SpecialVehicleTaskCmdOuterClass; @@ -942,7 +941,7 @@ public class SweeperOperatePanelView extends LinearLayout { // onSendCmd mCurrentCmdRequestCallback.onSendCmd(); // 发送命令 - CallerAutoPilotManager.INSTANCE.sendSweeperFuTianTaskCmd(fuTianCleanCmd); + CallerAutoPilotControlManager.INSTANCE.sendSweeperFuTianTaskCmd(fuTianCleanCmd); // log发送命令 logSweeperCmdValue(fuTianCleanCmd); // 开启倒计时 diff --git a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/util/SweeperTrajectoryManager.java b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/util/SweeperTrajectoryManager.java index 8f054bf16a..a259d0348b 100644 --- a/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/util/SweeperTrajectoryManager.java +++ b/OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/util/SweeperTrajectoryManager.java @@ -3,7 +3,7 @@ package com.mogo.och.sweeper.util; import androidx.annotation.Nullable; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.GsonUtils; import com.mogo.och.sweeper.bean.SweeperRoutesResult; @@ -197,7 +197,7 @@ public class SweeperTrajectoryManager { // mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00 // mAutoPilotLine.setVehicleModel("红旗H9"); - CallerAutoPilotManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine); + CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine); CallerLogger.INSTANCE.d(M_BUS + TAG, "sendTrajectoryReq(): " + GsonUtils.toJson(mAutoPilotLine)); } diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/callback/IOCHTaxiPassengerControllerStatusCallback.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/callback/IOCHTaxiPassengerControllerStatusCallback.java index 1fbd38ae6e..dd4b3336fd 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/callback/IOCHTaxiPassengerControllerStatusCallback.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/callback/IOCHTaxiPassengerControllerStatusCallback.java @@ -1,6 +1,6 @@ package com.mogo.och.taxi.passenger.callback; -import mogo.telematics.pad.MessagePad; +import com.mogo.eagle.core.data.map.MogoLocation; /** * Created on 2021/9/10 @@ -11,5 +11,5 @@ public interface IOCHTaxiPassengerControllerStatusCallback { // 是否vr map模式 void onVRModeChanged(boolean isVRMode); // 自车定位 - void onCarLocationChanged(MessagePad.GnssInfo location); + void onCarLocationChanged(MogoLocation location); } 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 54f757e95a..31165f6325 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 @@ -32,7 +32,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener; import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener; import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager; @@ -128,7 +128,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback private int delayTime = 2; private double mLongitude, mLatitude; - private MessagePad.GnssInfo mLocation = null; + private MogoLocation mLocation = null; private List mLocationsModels = new ArrayList<>(); @@ -436,7 +436,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback } // TODO: 2021/9/12 - public void calculateTravelDistance(MessagePad.GnssInfo carLocation){ + public void calculateTravelDistance(MogoLocation carLocation){ if (checkCurrentOCHOrder() && mCurrentOCHOrder.endSiteGcjPoint.size()>0) { double endLon = mCurrentOCHOrder.endSiteGcjPoint.get(0); double endLat = mCurrentOCHOrder.endSiteGcjPoint.get(1); @@ -477,7 +477,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback // 自车定位 private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() { @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { //位置变化时,通过围栏判断是否到达x点 if (null == gnssInfo) return; if (checkCurrentOCHOrder()) { @@ -973,7 +973,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback return; } - CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters); + CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters); CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "start autopilot with parameter: %s" , GsonUtil.jsonFromObject(parameters) + " ,startSiteName=" + mCurrentOCHOrder.startSiteAddr diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/presenter/BaseTaxiPassengerPresenter.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/presenter/BaseTaxiPassengerPresenter.java index 3447f52abd..e05daddd00 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/presenter/BaseTaxiPassengerPresenter.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/presenter/BaseTaxiPassengerPresenter.java @@ -122,7 +122,7 @@ public class BaseTaxiPassengerPresenter extends Presenter mView.onCarLocationChanged(location)); long currentTimeMillis = System.currentTimeMillis(); diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerMapDirectionView.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerMapDirectionView.java index 10a9a541fb..a46631ede1 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerMapDirectionView.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerMapDirectionView.java @@ -29,6 +29,7 @@ import com.amap.api.maps.model.MarkerOptions; import com.amap.api.maps.model.Polyline; import com.amap.api.maps.model.PolylineOptions; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -39,8 +40,6 @@ import com.mogo.och.taxi.passenger.utils.TaxiPassengerMapAssetStyleUtil; import java.util.ArrayList; import java.util.List; -import mogo.telematics.pad.MessagePad; - /** * 乘客屏小地图 */ @@ -180,7 +179,7 @@ public class TaxiPassengerMapDirectionView } @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { if (gnssInfo == null){ return; } diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerServingOrderFragment.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerServingOrderFragment.java index 6735b80eac..0ddf08b2b7 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerServingOrderFragment.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerServingOrderFragment.java @@ -21,6 +21,7 @@ import androidx.fragment.app.FragmentTransaction; import com.amap.api.maps.model.LatLng; import com.mogo.commons.mvp.MvpFragment; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; @@ -42,8 +43,6 @@ import com.mogo.och.taxi.passenger.utils.TPRouteDataTestUtils; import java.util.Calendar; import java.util.List; -import mogo.telematics.pad.MessagePad; - /** * @author: wangmingjun * @date: 2022/3/8 @@ -352,8 +351,8 @@ public class TaxiPassengerServingOrderFragment extends } - public void onCarLocationChanged(MessagePad.GnssInfo location) { - updateSpeedView((float) location.getVehicleSpeed()); + public void onCarLocationChanged(MogoLocation location) { + updateSpeedView((float) location.getGnssSpeed()); } public void onLimitingVelocityChange(int limitingVelocity) { diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiControllerStatusCallback.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiControllerStatusCallback.java index 42baa2e0b5..070559f406 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiControllerStatusCallback.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/callback/ITaxiControllerStatusCallback.java @@ -1,6 +1,6 @@ package com.mogo.och.taxi.callback; -import mogo.telematics.pad.MessagePad; +import com.mogo.eagle.core.data.map.MogoLocation; /** * Created on 2021/9/10 @@ -11,7 +11,7 @@ public interface ITaxiControllerStatusCallback { // 是否vr map模式 void onVRModeChanged(boolean isVRMode); // 自车定位 - void onCarLocationChanged(MessagePad.GnssInfo location); + void onCarLocationChanged(MogoLocation location); //开始开启自动驾驶 void startOpenAutopilot(); } 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 9911796fdc..33d6dce284 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 @@ -30,7 +30,7 @@ import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager; @@ -133,7 +133,7 @@ public class TaxiModel { private int mPreRouteIndex = 0; private double mLongitude, mLatitude; - private MessagePad.GnssInfo mLocation = null; + private MogoLocation mLocation = null; private LoginService loginService; @@ -823,8 +823,8 @@ public class TaxiModel { if (FunctionBuildConfig.isDemoMode) { // 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true; - CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true); - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true); + CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true); CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为true(更新本地order信息)"); } @@ -833,7 +833,7 @@ public class TaxiModel { if (mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.getCode()){ if (FunctionBuildConfig.isDemoMode) { CallerLogger.INSTANCE.d(M_TAXI + TAG, "setIPCDemoMode:false"); - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false); } clearAutopilotControlParameters(); @@ -870,8 +870,8 @@ public class TaxiModel { if (FunctionBuildConfig.isDemoMode) { // 当美化模式(演示模式)开启时: 取消或订单已完成时,置false FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; - CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false); - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); + CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(false); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false); CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为false(已完成or清除当前订单)"); } } @@ -934,7 +934,7 @@ public class TaxiModel { return; } - CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters); + CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters); CallerLogger.INSTANCE.d(M_TAXI + TAG, "start autopilot with parameter: %s", GsonUtil.jsonFromObject(parameters) + " ,startSiteName=" + mCurrentOCHOrder.startSiteAddr @@ -987,7 +987,7 @@ public class TaxiModel { //结束自动驾驶 public void cancelAutopilot() { try { - CallerAutoPilotManager.INSTANCE.cancelAutoPilot(); + CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot(); CallerLogger.INSTANCE.d(M_TAXI + TAG, "结束自动驾驶"); } catch (Exception e) { e.printStackTrace(); @@ -995,7 +995,7 @@ public class TaxiModel { } //根据围栏判断,是否到达起点 - private void judgeStartStation(MessagePad.GnssInfo location) { + private void judgeStartStation(MogoLocation location) { if (mCurrentOCHOrder == null || mCurrentOCHOrder.startSiteGcjPoint == null || mCurrentOCHOrder.startSiteGcjPoint.size() < 2) { return; @@ -1054,7 +1054,7 @@ public class TaxiModel { // 自车定位 private final IMoGoChassisLocationGCJ02Listener mMapLocationLIstener = new IMoGoChassisLocationGCJ02Listener() { @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { //位置变化时,通过围栏判断是否到达x点 if (null == gnssInfo) return; if (checkCurrentOCHOrder()) { @@ -1076,7 +1076,7 @@ public class TaxiModel { } }; - private void judgeEndStation(MessagePad.GnssInfo location) { + private void judgeEndStation(MogoLocation location) { if (mCurrentOCHOrder == null || mCurrentOCHOrder.endSiteGcjPoint == null || mCurrentOCHOrder.endSiteGcjPoint.size() < 2) { return; @@ -1172,8 +1172,8 @@ public class TaxiModel { if (FunctionBuildConfig.isDemoMode) { // 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true; - CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(true); - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true); + CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(true); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(true); CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为true(到达出发点且已开启自动驾驶)"); } } @@ -1243,7 +1243,7 @@ public class TaxiModel { // 2022.10.08 到达目的地时候取消自动起自驾, 服务完成取消引导线和自动驾驶按钮状态 // FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; // CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false); - CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false); + CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false); CallerLogger.INSTANCE.d(M_TAXI + TAG, "美化模式-ignore:置为false(到达目的地)"); } } diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java index 23a8c04806..d43dddc681 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/presenter/TaxiPresenter.java @@ -11,6 +11,7 @@ import androidx.lifecycle.LifecycleOwner; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.mvp.Presenter; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; @@ -314,10 +315,10 @@ public class TaxiPresenter extends Presenter implements ITaxiADASS } @Override - public void onCarLocationChanged(MessagePad.GnssInfo location) { + public void onCarLocationChanged(MogoLocation location) { if (null != location){ runOnUIThread(() -> { - mView.updateSpeedView((float) location.getVehicleSpeed()); + mView.updateSpeedView((float) location.getGnssSpeed()); mView.updateLocation(location.getLatitude(),location.getLongitude()); }); } diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.java index 298d49af2e..d6790c228e 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.java @@ -29,6 +29,7 @@ import com.amap.api.maps.model.MarkerOptions; import com.amap.api.maps.model.Polyline; import com.amap.api.maps.model.PolylineOptions; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; @@ -38,8 +39,6 @@ import com.mogo.och.taxi.utils.TaxiMapAssetStyleUtil; import java.util.ArrayList; import java.util.List; -import mogo.telematics.pad.MessagePad; - /** * taxi司机端前往目的地小地图导航 */ @@ -176,7 +175,7 @@ public class TaxiMapDirectionView } @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { if (gnssInfo == null){ return; } diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TaxiTrajectoryManager.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TaxiTrajectoryManager.java index 282ddd92d8..8d58a0199e 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TaxiTrajectoryManager.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/utils/TaxiTrajectoryManager.java @@ -3,10 +3,9 @@ package com.mogo.och.taxi.utils; import androidx.annotation.Nullable; import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.util.GsonUtils; -import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.och.taxi.bean.OrderQueryRespBean; import com.mogo.och.taxi.constant.TaxiConst; import com.mogo.och.taxi.constant.TaxiOrderStatusEnum; @@ -201,7 +200,7 @@ public class TaxiTrajectoryManager { // mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00 // mAutoPilotLine.setVehicleModel("红旗H9"); - CallerAutoPilotManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine); + CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine); CallerLogger.INSTANCE.d(M_TAXI + TAG, "sendTrajectoryReq(): " + GsonUtils.toJson(mAutoPilotLine)); } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/DispatchAutoPilotManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/DispatchAutoPilotManager.kt index 5d37582878..78070b1ec4 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/DispatchAutoPilotManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/dispatch/DispatchAutoPilotManager.kt @@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager @@ -130,7 +130,7 @@ class DispatchAutoPilotManager private constructor() : AutopilotControlParameters.AutoPilotLonLat(it.endLat, it.endLon) currentAutopilot.vehicleType = 10 CallerLogger.d(SceneConstant.Companion.M_DISPATCH + TAG, "开启自动驾驶====$currentAutopilot") - CallerAutoPilotManager.startAutoPilot(currentAutopilot) + CallerAutoPilotControlManager.startAutoPilot(currentAutopilot) } } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt index 283bd2d5fd..e9f305374f 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/redlightwarning/RedLightWarningManager.kt @@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_G import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.map.MogoLatLng +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -26,7 +27,6 @@ import com.mogo.eagle.core.utilcode.util.LocationUtils import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager import com.zhjt.service_biz.BizConfig -import mogo.telematics.pad.MessagePad import kotlin.math.abs import kotlin.math.ceil import kotlin.math.floor @@ -44,7 +44,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, // 是否已进入到路口(停止线处) private var isEnter = false - private var mLocation: MessagePad.GnssInfo? = null + private var mLocation: MogoLocation? = null companion object { @@ -100,7 +100,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, // 路口100m闯红灯预警 mLocation?.let { // 单位m/s - val speed = it.vehicleSpeed + val speed = it.gnssSpeed // 车停止或者速度非常慢,可能返回负数或者很小的值,需要过滤 CallerLogger.d("$M_V2X$TAG", "speed is:$speed") if (speed <= 2.5f) return// 小于等于9km/h不处理 @@ -277,7 +277,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener, CallerChassisLocationGCJ20ListenerManager.removeListener(TAG) } - override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) { + override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) { gnssInfo?.let { mLocation = it } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt index 199cfc828b..bf94c33f16 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/trafficlight/core/MogoTrafficLightManager.kt @@ -3,6 +3,7 @@ package com.mogo.eagle.function.biz.v2x.trafficlight.core import android.content.Context import android.os.Handler import android.os.Looper +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.trafficlight.* import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager @@ -15,7 +16,6 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandl import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel -import mogo.telematics.pad.MessagePad class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener { @@ -30,7 +30,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener { private var mContext: Context? = null private val trafficLightNetWorkModel = TrafficLightNetWorkModel() - private var mLocation: MessagePad.GnssInfo? = null + private var mLocation: MogoLocation? = null private var roadIDResult: RoadIDResult? = null private var trafficLightResult: TrafficLightResult? = null @@ -174,7 +174,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener { trafficLightResult = null } - override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) { + override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) { gnssInfo?.let { mLocation = it checkOutOfRange() diff --git a/core/function-impl/mogo-core-function-datacenter/build.gradle b/core/function-impl/mogo-core-function-datacenter/build.gradle index 57db40dfb8..5c5057184b 100644 --- a/core/function-impl/mogo-core-function-datacenter/build.gradle +++ b/core/function-impl/mogo-core-function-datacenter/build.gradle @@ -57,6 +57,7 @@ dependencies { implementation rootProject.ext.dependencies.mogoaicloudtelematic implementation rootProject.ext.dependencies.mogoobu + implementation rootProject.ext.dependencies.amapnavi3dmap if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { implementation rootProject.ext.dependencies.mogo_core_data diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt index 81fbb20b23..60f44968d0 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt @@ -4,6 +4,7 @@ import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.function.api.datacenter.IDataCenterProvider +import com.mogo.eagle.core.function.datacenter.location.MoGoLocationDispatcher @Route(path = MogoServicePaths.PATH_DATA_CENTER_MODULE) class DataCenterProvider: IDataCenterProvider { @@ -12,7 +13,7 @@ class DataCenterProvider: IDataCenterProvider { get() = "DataCenterProvider" override fun init(context: Context?) { - + MoGoLocationDispatcher.initListener() } override fun onDestroy() { diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt similarity index 99% rename from core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotProvider.kt rename to core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt index cc50534c63..6758d9458f 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt @@ -21,7 +21,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO import com.mogo.eagle.core.data.trafficlight.TrafficLightResult import com.mogo.eagle.core.data.trafficlight.toTrafficLightDetail import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasListenerImpl import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl @@ -67,8 +67,9 @@ import java.util.concurrent.TimeUnit * @date 2021/9/22 8:43 下午 */ @Route(path = MogoServicePaths.PATH_AUTO_PILOT) -class MoGoAutopilotProvider : - IMoGoAutopilotProvider, IMoGoMapDataCollectProvider.OnMapCollectCmdListener, +class MoGoAutopilotControlProvider : + IMoGoAutopilotControlProvider, + IMoGoMapDataCollectProvider.OnMapCollectCmdListener, IMoGoAutopilotCarConfigListener { private val TAG = "MoGoAutoPilotProvider" private var mContext: Context? = null diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt index 46aedd4696..9b737d7fbb 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -45,8 +45,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen 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.CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02 -import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84 import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager.invokePNCActions import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager.invokeAutopilotRotting import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager.invokeAutopilotTrajectory @@ -135,10 +133,8 @@ class MoGoAdasListenerImpl : OnAdasListener { clientPkFileName = "sn" ) override fun onGnssInfo(header: MessagePad.Header, gnssInfo: MessagePad.GnssInfo) { - // WGS84坐标系高精度位置信息 - invokeChassisLocationWGS84(gnssInfo) - // GCJ02高德坐标系位置信息 - invokeChassisLocationGCJ02(gnssInfo) + CallerChassisGnssListenerManager.invokeChassisGnssListener(gnssInfo) + if (gnssInfo != null) { if (1 == FunctionBuildConfig.gpsProvider) { // 同步给MAP地图 diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt index 61a46fd01e..6a19fe588d 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt @@ -5,7 +5,7 @@ import com.mogo.commons.debug.DebugConfig.* import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils @@ -52,13 +52,13 @@ class MoGoAdasMsgConnectStatusListenerImpl : // 同步SN给工控机 syncBasicInfoToAutopilot() //每次工控机连接成功后,需同步当前设置的美化模式状态 - CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode) + CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode) //当连接状态是关闭美化模式时,同步给工控机 if (!FunctionBuildConfig.isDemoMode) { - CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode) + CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode) } //每次工控机连接成功后,需同步当前设置的雨天模式状态 - CallerAutoPilotManager.setRainMode(FunctionBuildConfig.isRainMode) + CallerAutoPilotControlManager.setRainMode(FunctionBuildConfig.isRainMode) } else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) { CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接失败 reason:$reason") if (connectStatus) { diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt index 49a2aa64e6..ad8ebff257 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/server/AsyncDataToAutopilotServer.kt @@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.datacenter.autopilot.server import com.mogo.eagle.core.data.trafficlight.TrafficLightResult import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager /** @@ -26,6 +26,6 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen } override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) { - CallerAutoPilotManager.sendTrafficLightData(trafficLightResult) + CallerAutoPilotControlManager.sendTrafficLightData(trafficLightResult) } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt index 052b424181..17471344ec 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/telematic/TeleMsgHandler.kt @@ -8,9 +8,9 @@ import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.deva.chain.ChainConstant import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setDemoMode -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setIgnoreConditionDraw +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.utilcode.mogo.logger.* import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant @@ -174,7 +174,7 @@ class TeleMsgHandler : IMsgHandler { private fun queryCarConfig() { invokeNettyConnResult("乘客屏请求司机屏向工控机查询配置信息") - CallerAutoPilotManager.getCarConfig() + CallerAutoPilotControlManager.getCarConfig() } override fun handleClientConn2Server(channel: Channel?) { diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/IMoGoLocationListener.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/IMoGoLocationListener.kt deleted file mode 100644 index 4398708010..0000000000 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/IMoGoLocationListener.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.mogo.eagle.core.function.datacenter.location - -import com.mogo.eagle.core.data.enums.DataSourceType -import mogo.telematics.pad.MessagePad - -/** - * 位置回调监听 - */ -interface IMoGoLocationListener { - /** - * 位置改变回调用 - * @param gnssInfo 位置信息 - * @param sourceType 数据来源 - */ - fun onLocationChanged(gnssInfo: MessagePad.GnssInfo, sourceType: DataSourceType) -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt new file mode 100644 index 0000000000..4c4a2d2823 --- /dev/null +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt @@ -0,0 +1,176 @@ +package com.mogo.eagle.core.function.datacenter.location + +import com.amap.api.location.AMapLocation +import com.amap.api.location.AMapLocationClient +import com.amap.api.location.AMapLocationClientOption +import com.amap.api.location.AMapLocationListener +import com.mogo.commons.AbsMogoApplication +import com.mogo.commons.constants.SharedPrefsConstants +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssListener +import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr +import com.mogo.eagle.core.utilcode.util.CoordinateTransform +import com.mogo.eagle.core.utilcode.util.TimeUtils +import com.mogo.eagle.core.utilcode.util.Utils +import mogo.telematics.pad.MessagePad + +/** + * 融合定位服务,这里同时监听多来源的位置信息,并支持修改频率 + * + * @author donghongyu + */ +object MoGoLocationDispatcher : + IMoGoChassisGnssListener, + AMapLocationListener { + + private val TAG = "MoGoLocationManager" + + private var mCityCode: String? = null + private var mapLocation: AMapLocation? = null + + /** + * 最后一次工控机GNSS返回更新的位置 + */ + private var lastGnssLocation: MogoLocation = MogoLocation() + + /** + * 最后一次高德定位返回的位置信息 + */ + private var lastGaoDeLocation: MogoLocation = MogoLocation() + + fun initListener() { + // 高德SDK隐私政策 + AMapLocationClient.updatePrivacyShow(Utils.getApp(), true, true) + AMapLocationClient.updatePrivacyAgree(Utils.getApp(), true) + + try { + val mLocationClient = AMapLocationClient(Utils.getApp()) + + //初始化定位参数 + //声明mLocationOption对象 + val mLocationOption = AMapLocationClientOption() + //设置定位监听 + mLocationClient.setLocationListener(this) + //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式 + mLocationOption.locationMode = AMapLocationClientOption.AMapLocationMode.Hight_Accuracy + //设置定位间隔,单位毫秒,默认为2000ms + mLocationOption.interval = 1000 + //设置定位参数 + mLocationClient.setLocationOption(mLocationOption) + // 启动定位监听 + mLocationClient.startLocation() + } catch (e: Exception) { + e.printStackTrace() + } + + // 初始化监听订阅工控机位置信息 + CallerChassisGnssListenerManager.addListener(TAG, this) + } + + override fun onChassisGnss(gnssInfo: MessagePad.GnssInfo) { + // 更新GNSS 信息 + lastGnssLocation.gnssInfo = gnssInfo + lastGnssLocation.lastReceiveTime = TimeUtils.getNowMills() + // 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等 + mapLocation?.let { + lastGnssLocation.cityName = it.city + lastGnssLocation.cityCode = it.cityCode + lastGnssLocation.provider = it.provider + lastGnssLocation.address = it.address + lastGnssLocation.district = it.district + lastGnssLocation.province = it.province + lastGnssLocation.adCode = it.adCode + lastGnssLocation.locationDetail = it.locationDetail + lastGnssLocation.poiName = it.poiName + lastGnssLocation.aoiName = it.aoiName + lastGnssLocation.street = it.street + lastGnssLocation.streetNum = it.streetNum + lastGnssLocation.description = it.description + lastGnssLocation.buildingId = it.buildingId + lastGnssLocation.floor = it.floor + lastGnssLocation.errorCode = it.errorCode + lastGnssLocation.errorInfo = it.errorInfo + } + + // WGS84坐标系高精度位置信息 + CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84( + lastGnssLocation, + DataSourceType.TELEMATIC + ) + // GCJ02高德坐标系位置信息 + CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02( + lastGnssLocation, + DataSourceType.TELEMATIC + ) + } + + /** + * 高德地图位置改变回调 + * @param aMapLocation 位置信息 + */ + override fun onLocationChanged(aMapLocation: AMapLocation) { + mapLocation = aMapLocation + // 更新GNSS 信息 + + + // 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等 + mapLocation?.let { + // 转换 GCJ02-->WGS84 坐标 + val wgs84Location = + CoordinateTransform.GCJ02ToWGS84(it.longitude, it.latitude) + + lastGaoDeLocation.longitude = wgs84Location[0] + lastGaoDeLocation.latitude = wgs84Location[1] + lastGaoDeLocation.heading = it.bearing.toDouble() + lastGaoDeLocation.gnssSpeed = it.speed + lastGaoDeLocation.altitude = it.altitude + lastGaoDeLocation.satelliteTime = it.time + lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills() + + lastGaoDeLocation.cityName = it.city + lastGaoDeLocation.cityCode = it.cityCode + lastGaoDeLocation.provider = it.provider + lastGaoDeLocation.address = it.address + lastGaoDeLocation.district = it.district + lastGaoDeLocation.province = it.province + lastGaoDeLocation.adCode = it.adCode + lastGaoDeLocation.locationDetail = it.locationDetail + lastGaoDeLocation.poiName = it.poiName + lastGaoDeLocation.aoiName = it.aoiName + lastGaoDeLocation.street = it.street + lastGaoDeLocation.streetNum = it.streetNum + lastGaoDeLocation.description = it.description + lastGaoDeLocation.buildingId = it.buildingId + lastGaoDeLocation.floor = it.floor + lastGaoDeLocation.errorCode = it.errorCode + lastGaoDeLocation.errorInfo = it.errorInfo + } + + // 计算最后一次工控机同步的定位是否超时,如果超时则切换为高德地图定位,暂定超过30秒需要切换 + if (TimeUtils.getNowMills() - lastGnssLocation.lastReceiveTime > 30000) { + // WGS84坐标系高精度位置信息 + CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84( + lastGaoDeLocation, + DataSourceType.MAP + ) + // GCJ02高德坐标系位置信息 + CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02( + lastGaoDeLocation, + DataSourceType.MAP + ) + } + + // 本地SP缓存城市Code + val cityCode = aMapLocation.cityCode + if (cityCode != null && cityCode.isNotEmpty()) { + mCityCode = aMapLocation.cityCode + SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()) + .putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode) + } + + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationManager.kt deleted file mode 100644 index c58fe3b680..0000000000 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationManager.kt +++ /dev/null @@ -1,71 +0,0 @@ -package com.mogo.eagle.core.function.datacenter.location - -import com.mogo.eagle.core.data.enums.DataSourceType -import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener -import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener -import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager -import com.mogo.eagle.core.function.call.base.CallerBase -import com.mogo.eagle.core.utilcode.util.TimeUtils -import com.mogo.support.obu.model.MogoObuHvBasicsData -import mogo.telematics.pad.MessagePad - -/** - * 融合定位服务,这里同时监听多来源的位置信息,并支持修改频率 - * - * @author donghongyu - */ -object MoGoLocationManager : - CallerBase(), - IMoGoChassisLocationWGS84Listener, - IMoGoObuLocationWGS84Listener { - - private val TAG = "MoGoLocationManager" - - init { - CallerChassisLocationWGS84ListenerManager.addListener(TAG, this) - } - - override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) { - M_LISTENERS.forEach { - val tag = it.key - // 获取数据监听需要的HZ - val hz = M_LISTENERS_HZ[tag] - if (hz != null && hz > 0) { - val hzTime = (1.0 / hz.toDouble()) * 1000 - // 获取最后一次回调的时间 - val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag] - if (hzLastSendTime != null && hzLastSendTime > 0) { - // 计算是否进入下一次回调周期 - val nowTime = TimeUtils.getNowMills() - if (nowTime - hzLastSendTime > hzTime) { - syncLocationCallback(tag, it, gnssInfo, DataSourceType.TELEMATIC) - } - } else { - syncLocationCallback(tag, it, gnssInfo, DataSourceType.TELEMATIC) - } - } else { - syncLocationCallback(tag, it, gnssInfo, DataSourceType.TELEMATIC) - } - } - } - - /** - * 向订阅位置信息的发出定位信息 - */ - private fun syncLocationCallback( - tag: String, - it: Map.Entry, - gnssInfo: MessagePad.GnssInfo, - sourceType: DataSourceType - ) { - // 记录最后一次回调时间 - M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills() - val listener = it.value - listener.onLocationChanged(gnssInfo, sourceType) - } - - override fun onObuLocationWGS84(data: MogoObuHvBasicsData) { - - } - -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/README.md b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/README.md index 5a2b95898c..4ccbd205e0 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/README.md +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/README.md @@ -3,8 +3,8 @@ ##### 位置回调:融合工控机、OBU、高德地图 ```kotlin -// 注册监听位置变换 -MoGoLocationManager.addListener(Companion.functionName, object : IMoGoLocationListener { +// 注册监听位置变换,唯一标记,要接受数据的HZ,回掉监听 +MoGoLocationManager.addListener(Companion.functionName, 20, object : IMoGoLocationListener { override fun onLocationChanged( gnssInfo: MessagePad.GnssInfo, sourceType: DataSourceType diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt index 8a66b2e9c2..13becfbf20 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt @@ -10,11 +10,12 @@ import android.widget.RadioButton import android.widget.TextView import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.app.AppConfigInfo -import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager -import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA import com.mogo.eagle.core.utilcode.mogo.toast.TipToast @@ -27,7 +28,6 @@ import com.zhjt.mogo_core_function_devatools.R import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch -import mogo.telematics.pad.MessagePad import record_cache.RecordPanelOuterClass import java.util.* @@ -119,7 +119,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener // 添加 ADAS车辆状态&定位 监听 CallerChassisLocationWGS84ListenerManager.addListener(this.hashCode().toString(), this) //开始录制AI数据采集Bag包 - CallerAutoPilotManager.recordPackage( + CallerAutoPilotControlManager.recordPackage( 99, Random(SystemClock.elapsedRealtime()).nextInt(), 20, @@ -353,7 +353,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener fun closeWindow() } - override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) { + override fun onChassisLocationWGS84(gnssInfo: MogoLocation) { latitude = gnssInfo.latitude longitude = gnssInfo.longitude } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/BadCaseConfigView.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/BadCaseConfigView.kt index 9a81e1d609..8085354c73 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/BadCaseConfigView.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/BadCaseConfigView.kt @@ -11,7 +11,7 @@ import androidx.recyclerview.widget.GridLayoutManager import com.mogo.eagle.core.data.badcase.RecordTypeEntity import com.mogo.eagle.core.data.badcase.TopicEntity import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.core.utilcode.util.ToastUtils @@ -206,7 +206,7 @@ internal class BadCaseConfigView @JvmOverloads constructor( super.onAttachedToWindow() CallerAutopilotRecordListenerManager.addListener(TAG, this) //获取数据采集录制模式配置列表 - CallerAutoPilotManager.getBadCaseConfig(0, 0, listOf()) + CallerAutoPilotControlManager.getBadCaseConfig(0, 0, listOf()) recordTypesList.add(RecordTypeEntity(0,"自定义", arrayListOf())) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/CaseListDialog.java b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/CaseListDialog.java index 9756927f7f..959f43ee8f 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/CaseListDialog.java +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/CaseListDialog.java @@ -11,7 +11,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.mogo.eagle.core.data.badcase.RecordCaseEntity; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager; import com.mogo.eagle.core.utilcode.util.ThreadUtils; import com.zhjt.mogo_core_function_devatools.R; @@ -77,7 +77,7 @@ public class CaseListDialog extends Dialog implements IMoGoAutopilotRecordListen super.onAttachedToWindow(); CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this); //获取数据采集录制模式配置列表 - CallerAutoPilotManager.INSTANCE.getBadCaseConfig(0, 0,new ArrayList<>()); + CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(0, 0,new ArrayList<>()); } @Override diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/CaseTopicListDialog.java b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/CaseTopicListDialog.java index d44600e30a..a0cd77525a 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/CaseTopicListDialog.java +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/CaseTopicListDialog.java @@ -17,7 +17,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.mogo.eagle.core.data.badcase.RecordTypeEntity; import com.mogo.eagle.core.data.badcase.TopicEntity; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager; import com.mogo.eagle.core.utilcode.util.ThreadUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; @@ -69,7 +69,7 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL init(); initEvent(); //获取所有Topic - CallerAutoPilotManager.INSTANCE.getBadCaseConfig(1, 0, new ArrayList<>()); + CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(1, 0, new ArrayList<>()); if (recordType != null) { tvCaseName.setText(recordType.getDesc()); if (recordType.getTopicsList().size() > 0) { @@ -160,7 +160,7 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL }); tvSave.setOnClickListener(v -> { if (recordType != null) { - Boolean success = CallerAutoPilotManager.INSTANCE.getBadCaseConfig(2, recordType.getId(), addTopicList); + Boolean success = CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(2, recordType.getId(), addTopicList); if (Boolean.TRUE.equals(success)) { ToastUtils.showShort("Topic设置成功"); if (recordType.getId() == 0) { diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt index 35581f2fee..1bcca50ca6 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt @@ -14,11 +14,12 @@ import android.widget.TextView import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.badcase.RecordCaseEntity -import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager -import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA import com.mogo.eagle.core.utilcode.mogo.toast.TipToast @@ -35,7 +36,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch -import mogo.telematics.pad.MessagePad import record_cache.RecordPanelOuterClass import java.io.File import java.util.* @@ -347,7 +347,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList mWindowManager!!.addView(mFloatLayout, mWindowParams) //开启录包 if (recordCaseEntity != null) { - CallerAutoPilotManager.recordPackage( + CallerAutoPilotControlManager.recordPackage( recordCaseEntity.caseId, Random(SystemClock.elapsedRealtime()).nextInt(), BadCaseConfig.totalDuration, @@ -355,7 +355,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList recordCaseEntity.topicList ) } else { - CallerAutoPilotManager.recordPackage( + CallerAutoPilotControlManager.recordPackage( BadCaseConfig.type, Random(SystemClock.elapsedRealtime()).nextInt(), BadCaseConfig.totalDuration, BadCaseConfig.previousDuration ) @@ -394,7 +394,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList fun closeWindow() } - override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) { + override fun onChassisLocationWGS84(gnssInfo: MogoLocation) { latitude = gnssInfo.latitude longitude = gnssInfo.longitude } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt index 9f35b20204..3459ecf586 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt @@ -15,6 +15,7 @@ import android.widget.TextView import com.google.android.flexbox.FlexboxLayout import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.app.AppConfigInfo +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.RecordBagMsg import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener @@ -34,7 +35,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import me.jessyan.autosize.utils.AutoSizeUtils -import mogo.telematics.pad.MessagePad import org.greenrobot.eventbus.EventBus import java.io.File @@ -380,9 +380,9 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene fun closeWindow() } - override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) { - latitude = gnssInfo?.latitude - longitude = gnssInfo?.longitude + override fun onChassisLocationWGS84(gnssInfo: MogoLocation) { + latitude = gnssInfo.latitude + longitude = gnssInfo.longitude } } \ 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/logcatch/MogoLogCatchManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcatch/MogoLogCatchManager.kt index 8cbc2c5abc..19edc0f1b3 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcatch/MogoLogCatchManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcatch/MogoLogCatchManager.kt @@ -15,7 +15,7 @@ import com.mogo.eagle.core.data.constants.MoGoConfig import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FULL_LOG import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger @@ -220,7 +220,7 @@ object MogoLogCatchManager : IMogoOnMessageListener, Handl Logger.init(LogLevel.DEBUG) MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = true MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = true - CallerAutoPilotManager.setEnableLog(true) + CallerAutoPilotControlManager.setEnableLog(true) } /** @@ -230,7 +230,7 @@ object MogoLogCatchManager : IMogoOnMessageListener, Handl Logger.init(if (DebugConfig.isDebug()) LogLevel.DEBUG else LogLevel.OFF) MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = false MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = false - CallerAutoPilotManager.setEnableLog(false) + CallerAutoPilotControlManager.setEnableLog(false) } override fun onError(errorCount: Int) { 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 b0280cd949..f586b22478 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 @@ -41,7 +41,7 @@ internal class CanImpl(ctx: Context) : private val state: AtomicInteger by lazy { AtomicInteger(Int.MIN_VALUE) } override fun onCreate() { - send(CanStatus(CallerAutoPilotManager.isConnected())) + send(CanStatus(CallerAutoPilotControlManager.isConnected())) CallerChassisAccStateListenerManager.addListener(TAG, this) CallerChassisBrakeStateListenerManager.addListener(TAG, this) @@ -60,7 +60,7 @@ internal class CanImpl(ctx: Context) : private fun isCanEnabled(): Boolean { val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode() - return CallerAutoPilotManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0) + return CallerAutoPilotControlManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0) } 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 439294dcab..bf80c144da 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 @@ -28,7 +28,7 @@ internal class IpcImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatu } private fun checkAndSend() { - send(IpcStatus(CallerAutoPilotManager.isConnected())) + send(IpcStatus(CallerAutoPilotControlManager.isConnected())) } override fun onDestroy() { diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/rtk/RTKImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/rtk/RTKImpl.kt index 656730b240..c42b02b60c 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/rtk/RTKImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/rtk/RTKImpl.kt @@ -2,9 +2,10 @@ package com.zhjt.mogo_core_function_devatools.status.flow.rtk import android.content.Context import android.util.Log +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger @@ -15,7 +16,6 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.delay import kotlinx.coroutines.launch -import mogo.telematics.pad.MessagePad.GnssInfo import system_master.SystemStatusInfo.HealthInfo import system_master.SystemStatusInfo.StatusInfo import java.util.concurrent.atomic.AtomicBoolean @@ -42,7 +42,7 @@ internal class RTKImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatu CallerLogger.d("$M_DEVA$TAG", "-- onCreate --") CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerChassisLocationWGS84ListenerManager.addListener(TAG, this) - if (CallerAutoPilotManager.isConnected()) { + if (CallerAutoPilotControlManager.isConnected()) { check() } } @@ -53,7 +53,7 @@ internal class RTKImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatu } check?.takeIf { it.isActive }?.cancel() launch(Dispatchers.Unconfined) { - CallerAutoPilotManager.sendStatusQueryReq() + CallerAutoPilotControlManager.sendStatusQueryReq() delay(5000) isOldVersion.set(true) }.also { @@ -74,18 +74,18 @@ internal class RTKImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatu override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) { super.onAutopilotIpcConnectStatusChanged(status, reason) - if (!CallerAutoPilotManager.isConnected()) { + if (!CallerAutoPilotControlManager.isConnected()) { CallerLogger.d("$M_DEVA$TAG", "工控机断开了....") healthInfo.set(null) send(RTKStatus("", -1)) } - if (CallerAutoPilotManager.isConnected() && check == null && !isOldVersion.get()) { + if (CallerAutoPilotControlManager.isConnected() && check == null && !isOldVersion.get()) { check() } } - override fun onChassisLocationWGS84(gnssInfo: GnssInfo) { + override fun onChassisLocationWGS84(gnssInfo: MogoLocation) { if (isOldVersion.get()) { if (isRTKEnabled()) { send(RTKStatus("RTK", 0)) @@ -103,7 +103,7 @@ internal class RTKImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotStatu private fun isRTKEnabled(): Boolean { val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode() val gnssInfo = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() - return CallerAutoPilotManager.isConnected() && ( + return CallerAutoPilotControlManager.isConnected() && ( code != "EHW_RTK" && code != "EHW_GNSS" && code != "ESYS_RTK_STATUS_FAULT" && 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 1d71984ad3..f7018bcd9d 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 @@ -40,7 +40,7 @@ internal class TracingImpl(ctx: Context): IFlow(ctx), IMoGoAutopi override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) { super.onAutopilotIpcConnectStatusChanged(status, reason) - if (!CallerAutoPilotManager.isConnected()) { + if (!CallerAutoPilotControlManager.isConnected()) { old = UNKNOWN send(TracingStatus(UNKNOWN)) } 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 f29e467b92..18d353881f 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 @@ -19,7 +19,7 @@ internal class StatusModel : ViewModel() { const val TAG = "StatusModel" val DEFAULTS = Pair(null, ArrayList().also { - it += IpcStatus(CallerAutoPilotManager.isConnected()) + it += IpcStatus(CallerAutoPilotControlManager.isConnected()) it += CanStatus(false) it += TracingStatus(UNKNOWN) it += RTKStatus("", -1) diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/SyncConfig.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/SyncConfig.kt index 51ca529e18..240afd4230 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/SyncConfig.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/trace/SyncConfig.kt @@ -7,7 +7,7 @@ import com.mogo.commons.module.status.MogoStatusManager import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.deva.chain.ChainConstant -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger @@ -51,7 +51,7 @@ object SyncConfig { else -> { } } - AppConfigInfo.teleTimeStamp = CallerAutoPilotManager.getTeleTimeStamp() + AppConfigInfo.teleTimeStamp = CallerAutoPilotControlManager.getTeleTimeStamp() logOutConfig(AppConfigInfo) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index b63e9828b0..b1c1f47f2e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -31,9 +31,8 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData import com.mogo.eagle.core.data.report.ReportEntity import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager @@ -51,7 +50,6 @@ import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.came import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog -import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView import com.mogo.eagle.core.function.main.DisplayEffectsHelper import com.mogo.eagle.core.utilcode.kotlin.safeCancel @@ -216,7 +214,7 @@ class MoGoHmiFragment : MvpFragment(), SharedPrefsMgr.getInstance(it) .putLong("roadwork", System.currentTimeMillis() / 1000) } - CallerAutoPilotManager.sendTripInfo(5, "", "", "", false) + CallerAutoPilotControlManager.sendTripInfo(5, "", "", "", false) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index 61488d4325..8592c0bcb3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -12,7 +12,7 @@ import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.data.report.ReportEntity -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager @@ -95,7 +95,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) var resultStr = "类型:" for (result in reportEntity.resultList){ - resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}" + resultStr = "${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}" } holder.tvBubbleReportType.text = resultStr holder.clReportLayout.setOnClickListener { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index a47e4bdcd6..1968a19cfc 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.data.report.ReportEntity -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.R @@ -133,7 +133,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : var resultStr = "类型:" for (result in reportEntity.resultList) { resultStr = - "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}" + "${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}" } holder.tvReportTypeNormal.text = resultStr holder.tvReportTypeOpen.text = resultStr @@ -141,7 +141,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : var actionStr = "" for (action in reportEntity.actionsList) { actionStr = - "${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}" + "${actionStr}${CallerAutoPilotControlManager.getReportActionDesc(action)}" } holder.tvReportActionOpen.text = "建议操作:$actionStr" holder.tvStatusSelect.setOnClickListener { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/traffic/NoticeTrafficDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/traffic/NoticeTrafficDialog.kt index a4359b6dd3..8f2add30d3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/traffic/NoticeTrafficDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/traffic/NoticeTrafficDialog.kt @@ -19,7 +19,7 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo.NoticeTrafficAccountInfo import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData import com.mogo.eagle.core.data.notice.NoticeValue -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.startAutoPilot +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager.bizProvider 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 6087b3d4fc..3d8abc20a1 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 @@ -38,6 +38,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant import com.mogo.eagle.core.data.deva.scene.SceneModule import com.mogo.eagle.core.data.enums.TrafficTypeEnum import com.mogo.eagle.core.data.gnss.AccelerationEntity +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.obu.ObuStatusInfo import com.mogo.eagle.core.data.report.ReportEntity import com.mogo.eagle.core.function.api.autopilot.* @@ -120,7 +121,7 @@ internal class DebugSettingView @JvmOverloads constructor( private var logViewAttach = false private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null - private var mGnssInfo: MessagePad.GnssInfo? = null + private var mGnssInfo: MogoLocation? = null private var accelerationFloatWindow: AccelerationFloatWindow? = null private var accelerationList = arrayListOf() @@ -220,7 +221,7 @@ internal class DebugSettingView @JvmOverloads constructor( Timer().schedule(timerTaskRefresh, Date(), 300) if (AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())) { //查询工控机基础配置信息 - CallerAutoPilotManager.getCarConfig() + CallerAutoPilotControlManager.getCarConfig() } } @@ -594,10 +595,10 @@ internal class DebugSettingView @JvmOverloads constructor( "demoMode", DemoModeView(context) ) - CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode) + CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode) if (!FunctionBuildConfig.isDemoMode) { //关闭美化模式时,通知工控机 - CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode) + CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode) } tbIsDrawAutopilotTrajectoryData.isEnabled = !FunctionBuildConfig.isDemoMode if (!FunctionBuildConfig.isDemoMode) { @@ -615,7 +616,7 @@ internal class DebugSettingView @JvmOverloads constructor( tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode //雨天模式 tbIsRainMode.setOnCheckedChangeListener { _, isChecked -> - CallerAutoPilotManager.setRainMode(isChecked) + CallerAutoPilotControlManager.setRainMode(isChecked) FunctionBuildConfig.isRainMode = isChecked } //雨天模式按钮只在司机屏生效,乘客屏不显示 @@ -634,7 +635,7 @@ internal class DebugSettingView @JvmOverloads constructor( //重启工控机所有节点 btnIpcReboot.onClick { - CallerAutoPilotManager.sendIpcReboot() + CallerAutoPilotControlManager.sendIpcReboot() ToastUtils.showLong("重启命令已发送") } //只在司机端设置工控机节点重启功能 @@ -773,7 +774,7 @@ internal class DebugSettingView @JvmOverloads constructor( // 模拟自动驾驶中 tbChangeAutoPilotStatus.setOnCheckedChangeListener { _, isChecked -> - CallerAutoPilotManager.setControlAutopilotCarAuto(isChecked) + CallerAutoPilotControlManager.setControlAutopilotCarAuto(isChecked) } when { AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> { @@ -794,7 +795,7 @@ internal class DebugSettingView @JvmOverloads constructor( } //初始化ADAS日志开关状态 - tbADASLog.isChecked = CallerAutoPilotManager.isEnableLog() + tbADASLog.isChecked = CallerAutoPilotControlManager.isEnableLog() //查看上报历史列表 tbReportMore.setOnCheckedChangeListener { _, isChecked -> @@ -915,7 +916,7 @@ internal class DebugSettingView @JvmOverloads constructor( btnConnectServerIp.setOnClickListener { val ip = etConnectServerIp.text.toString() if (!ip.isNullOrEmpty()) { - CallerAutoPilotManager.connectSpecifiedServer(ip) + CallerAutoPilotControlManager.connectSpecifiedServer(ip) } } @@ -982,7 +983,7 @@ internal class DebugSettingView @JvmOverloads constructor( btnSetAutopilotIP.setOnClickListener { val autoPilotIp = etAutopilotIP.text.toString() if (autoPilotIp.isNotEmpty()) { - CallerAutoPilotManager.resetIpAddress(autoPilotIp) + CallerAutoPilotControlManager.resetIpAddress(autoPilotIp) } else { ToastUtils.showShort("请输入正确的IP地址") } @@ -990,7 +991,7 @@ internal class DebugSettingView @JvmOverloads constructor( //断开与工控机的连接 btnDisconnectIpc.setOnClickListener { - CallerAutoPilotManager.disconnectIpc() + CallerAutoPilotControlManager.disconnectIpc() } /** @@ -1000,32 +1001,32 @@ internal class DebugSettingView @JvmOverloads constructor( val recordTimeStr = etInputRecordTime.text?.toString() try { if (recordTimeStr.isNullOrEmpty()) { - CallerAutoPilotManager.recordPackage() + CallerAutoPilotControlManager.recordPackage() } val recordTime = recordTimeStr?.toInt() if (recordTime != null && recordTime > 0) { - CallerAutoPilotManager.recordPackage(recordTime) + CallerAutoPilotControlManager.recordPackage(recordTime) } else { - CallerAutoPilotManager.recordPackage() + CallerAutoPilotControlManager.recordPackage() } } catch (e: Exception) { - CallerAutoPilotManager.recordPackage() + CallerAutoPilotControlManager.recordPackage() } } btnRecordBag.onClick { val recordTimeStr = etInputRecordBagTime.text?.toString() try { if (recordTimeStr.isNullOrEmpty()) { - CallerAutoPilotManager.recordPackage() + CallerAutoPilotControlManager.recordPackage() } val recordTime = recordTimeStr?.toInt() if (recordTime != null && recordTime > 0) { - CallerAutoPilotManager.recordPackage(recordTime) + CallerAutoPilotControlManager.recordPackage(recordTime) } else { - CallerAutoPilotManager.recordPackage() + CallerAutoPilotControlManager.recordPackage() } } catch (e: Exception) { - CallerAutoPilotManager.recordPackage() + CallerAutoPilotControlManager.recordPackage() } } @@ -1193,9 +1194,9 @@ internal class DebugSettingView @JvmOverloads constructor( */ tbADASLog.setOnCheckedChangeListener { _, isChecked -> if (isChecked) { - CallerAutoPilotManager.setEnableLog(true) + CallerAutoPilotControlManager.setEnableLog(true) } else { - CallerAutoPilotManager.setEnableLog(false) + CallerAutoPilotControlManager.setEnableLog(false) } } @@ -1519,7 +1520,7 @@ internal class DebugSettingView @JvmOverloads constructor( tvAppVersionNameKey.text = "鹰眼版本名:${AppUtils.getAppVersionName()}" tvAutopilotProtocolVersionInfo.text = - "Autopilot协议版本:${CallerAutoPilotManager.getProtocolVersion()}" + "Autopilot协议版本:${CallerAutoPilotControlManager.getProtocolVersion()}" if (AppConfigInfo.protocolVersionNumber == 0) { tvIpcProtocolVersionInfo.text = "工控机协议版本:未知" } else { @@ -1825,7 +1826,7 @@ internal class DebugSettingView @JvmOverloads constructor( } } - override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) { + override fun onChassisLocationWGS84(gnssInfo: MogoLocation) { mGnssInfo = gnssInfo //实时加速度列表 ThreadUtils.runOnUiThread { @@ -1904,14 +1905,14 @@ internal class DebugSettingView @JvmOverloads constructor( var resultStr = "result:" for (result in it.resultList) { resultStr = - "$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} " + "$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} " } tvReportResult.text = resultStr var actionStr = "action:" for (action in it.actionsList) { actionStr = - "$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} " + "$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} " } tvReportActions.text = actionStr @@ -2010,14 +2011,14 @@ internal class DebugSettingView @JvmOverloads constructor( var resultStr = "result:" for (result in it.resultList) { resultStr = - "$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} " + "$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} " } tvReportResult.text = resultStr var actionStr = "action:" for (action in it.actionsList) { actionStr = - "$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} " + "$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} " } tvReportActions.text = actionStr if ("error" == it.level) { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/IPCReportAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/IPCReportAdapter.kt index c59cc29f03..e2892cc04e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/IPCReportAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/IPCReportAdapter.kt @@ -6,7 +6,7 @@ import android.view.ViewGroup import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import com.mogo.eagle.core.data.report.ReportEntity -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.hmi.R import me.jessyan.autosize.AutoSizeCompat @@ -37,13 +37,13 @@ class IPCReportAdapter: RecyclerView.Adapter() holder.tvReportTimeContent.text = it.time var resultStr = "发生异常" for (result in it.resultList){ - resultStr = "${resultStr}-${CallerAutoPilotManager.getReportResultDesc(result)}" + resultStr = "${resultStr}-${CallerAutoPilotControlManager.getReportResultDesc(result)}" } holder.tvReportResultContent.text = resultStr holder.tvReportMsgContent.text = it.msg var actionStr = "" for (action in it.actionsList){ - actionStr = "${actionStr}-${CallerAutoPilotManager.getReportActionDesc(action)}" + actionStr = "${actionStr}-${CallerAutoPilotControlManager.getReportActionDesc(action)}" } holder.tvReportActionContent.text = actionStr } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/ReportListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/ReportListAdapter.kt index dd51e83326..ebb27aa079 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/ReportListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/ReportListAdapter.kt @@ -9,7 +9,7 @@ import android.view.ViewGroup import android.widget.TextView import androidx.recyclerview.widget.RecyclerView import com.mogo.eagle.core.data.report.ReportEntity -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.hmi.R /** @@ -45,12 +45,12 @@ class ReportListAdapter(context: Context) : holder.tvReportCode.text = "code:${it.code}" var resultStr = "result:" for (result in it.resultList) { - resultStr = "$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} " + resultStr = "$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} " } holder.tvReportResult.text = resultStr var actionStr = "action:" for (action in it.actionsList) { - actionStr = "$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} " + actionStr = "$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} " } holder.tvReportActions.text = actionStr diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index baa3b07802..503ff716be 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -10,7 +10,7 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.obu.CallerObuApiManager @@ -49,7 +49,7 @@ internal class SOPSettingView @JvmOverloads constructor( //绕障类功能开关 tbObstacleAvoidance.isChecked = FunctionBuildConfig.isDetouring tbObstacleAvoidance.setOnCheckedChangeListener { _, isChecked -> - CallerAutoPilotManager.sendDetouring(isChecked) + CallerAutoPilotControlManager.sendDetouring(isChecked) FunctionBuildConfig.isDetouring = isChecked } @@ -161,10 +161,10 @@ internal class SOPSettingView @JvmOverloads constructor( tbDemoMode.setOnCheckedChangeListener { _, _ -> FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode CallerHmiManager.updateStatusBarLeftView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(context)) - CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode) + CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode) if (!FunctionBuildConfig.isDemoMode) { //关闭美化模式时,通知工控机 - CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode) + CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode) } } //只在司机端设置美化模式开关功能 @@ -177,7 +177,7 @@ internal class SOPSettingView @JvmOverloads constructor( tbRainMode.isChecked = FunctionBuildConfig.isRainMode //雨天模式 tbRainMode.setOnCheckedChangeListener { _, isChecked -> - CallerAutoPilotManager.setRainMode(isChecked) + CallerAutoPilotControlManager.setRainMode(isChecked) FunctionBuildConfig.isRainMode = isChecked } //雨天模式按钮只在司机屏生效,乘客屏不显示 @@ -227,7 +227,7 @@ internal class SOPSettingView @JvmOverloads constructor( } btnSpeedSet.setOnClickListener { val isSuccess = - CallerAutoPilotManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble()) + CallerAutoPilotControlManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble()) if (isSuccess == true) { ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置成功") } else { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/switch/DemoModeHiddenSwitch.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/switch/DemoModeHiddenSwitch.kt index 626c5f3861..1aec12237f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/switch/DemoModeHiddenSwitch.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/switch/DemoModeHiddenSwitch.kt @@ -4,7 +4,7 @@ import android.content.Context import android.util.AttributeSet import android.view.View import com.mogo.eagle.core.data.config.FunctionBuildConfig -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView @@ -25,10 +25,10 @@ class DemoModeHiddenSwitch(context: Context, attrs: AttributeSet?) : View(contex "demoMode", DemoModeView(context) ) - CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode) + CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode) if (!FunctionBuildConfig.isDemoMode) { //关闭美化模式时,通知工控机 - CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode) + CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode) } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt index 77e12619af..b6025d5503 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt @@ -7,7 +7,6 @@ import android.graphics.Color import android.graphics.drawable.ColorDrawable import android.os.Process import android.util.AttributeSet -import android.util.Log import android.view.LayoutInflater import android.view.View import android.widget.FrameLayout @@ -18,10 +17,9 @@ import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo import com.mogo.eagle.core.data.temp.EventLogout import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil import com.mogo.eagle.core.function.msgbox.MsgBoxConfig @@ -77,7 +75,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( } else -> { // 设置自动驾驶速度 - val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speed) + val isSuccess = CallerAutoPilotControlManager.setAutoPilotSpeed(speed) when { isSuccess -> { ToastUtils.showShort("车速设置成功,立即生效") @@ -110,7 +108,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( } if (AppConfigInfo.isConnectAutopilot) { - CallerAutoPilotManager.getCarConfig() + CallerAutoPilotControlManager.getCarConfig() } // if (maxAcceleration > 0) { // tvAcceleration.text = "加速度 $maxAcceleration m/s²" @@ -142,7 +140,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( //速度确认 tvSureModify.setOnClickListener { - val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speedLimit) + val isSuccess = CallerAutoPilotControlManager.setAutoPilotSpeed(speedLimit) when { isSuccess -> { //速度显示 diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt index 76b47b683c..dd22839a09 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/AutoPilotStatusView.kt @@ -8,7 +8,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon @@ -85,7 +85,7 @@ class AutoPilotStatusView constructor( AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867) currentAutopilot.vehicleType = 10 - CallerAutoPilotManager.startAutoPilot(currentAutopilot) + CallerAutoPilotControlManager.startAutoPilot(currentAutopilot) } /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CheckSystemView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CheckSystemView.kt index 3d9d4a7660..4fe3463158 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CheckSystemView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CheckSystemView.kt @@ -9,7 +9,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.function.hmi.R @@ -68,7 +68,7 @@ class CheckSystemView @JvmOverloads constructor( else { //确认重启 CallerLogger.d("$M_HMI$TAG", "reboot confirm") - CallerAutoPilotManager.setIPCReboot() + CallerAutoPilotControlManager.setIPCReboot() } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt index 17b6cd5978..2f36d696e4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt @@ -5,12 +5,12 @@ import android.graphics.Color import android.util.AttributeSet import android.view.Gravity import android.widget.FrameLayout +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.util.UiThreadHandler -import mogo.telematics.pad.MessagePad import java.util.* /** @@ -29,7 +29,7 @@ class SpeedPanelView @JvmOverloads constructor( var mContext: Context var mSpeedChartView: SpeedChartView - var mLatLng: MessagePad.GnssInfo? = null + var mLatLng: MogoLocation? = null var mSpeedLimit = 60 private val timer by lazy { @@ -77,7 +77,7 @@ class SpeedPanelView @JvmOverloads constructor( timer.schedule(task, Date(), 200) } - override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) { + override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) { gnssInfo?.let { mLatLng = gnssInfo } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java index ff7e1605b8..137db6ab22 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java @@ -24,7 +24,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.mofang.MfConstants; import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider; import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager; import com.mogo.eagle.core.function.hmi.R; @@ -351,7 +351,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis if (isShowToast) { ToastUtils.showShort("方块 单击C ← 向左变道 "); } - CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft(); + CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneLeft(); } } return true; @@ -372,7 +372,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis if (isShowToast) { ToastUtils.showShort("方块 单击D → 向右变道 "); } - CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight(); + CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneRight(); } } return true; @@ -384,14 +384,14 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis if (isShowToast) { ToastUtils.showShort("方块 长按E 鸣笛 "); } - CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1); + CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(1); if (timerHorn == null) { timerHorn = new Timer(); } timerHorn.schedule(new TimerTask() { @Override public void run() { - CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2); + CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(2); timerHorn = null; } }, 500); @@ -404,7 +404,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis if (isShowToast) { ToastUtils.showShort("方块 单击E 开启自动驾驶 "); } - CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); + CallerAutoPilotControlManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); } } return true; @@ -425,7 +425,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis timerAcc.schedule(new TimerTask() { @Override public void run() { - CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated); + CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated); } }, 0, 500); } @@ -434,7 +434,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis timerAcc.cancel(); timerAcc = null; } - CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc); + CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc); } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/PassengerLauncherActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/PassengerLauncherActivity.java index ea8863899b..9c13121a92 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/PassengerLauncherActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/PassengerLauncherActivity.java @@ -20,13 +20,12 @@ import android.widget.FrameLayout; import androidx.annotation.Nullable; import com.alibaba.android.arouter.launcher.ARouter; -import com.mogo.commons.debug.DebugConfig; import com.mogo.commons.module.intent.IMogoIntentListener; import com.mogo.commons.module.intent.IntentManager; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider; import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager; import com.mogo.eagle.core.function.hmi.R; @@ -300,7 +299,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte isCombinationKey = false; if ((pressCUpTime - startPressTime) < 300) { ToastUtils.showShort("方块 单击C ← 向左变道 "); - CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft(); + CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneLeft(); } } return true; @@ -318,7 +317,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte isCombinationKey = false; if ((pressDUpTime - startPressTime) < 300) { ToastUtils.showShort("方块 单击D → 向右变道 "); - CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight(); + CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneRight(); } } @@ -329,14 +328,14 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte if (!isCombinationKey) { if ((pressEDownTime - startPressTime) > 1900) { ToastUtils.showShort("方块 长按E 鸣笛 "); - CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1); + CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(1); if (timerHorn == null) { timerHorn = new Timer(); } timerHorn.schedule(new TimerTask() { @Override public void run() { - CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2); + CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(2); timerHorn = null; } }, 500); @@ -348,7 +347,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte isCombinationKey = false; if ((pressEUpTime - startPressTime) < 300) { ToastUtils.showShort("方块 单击E 开启自动驾驶 "); - CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); + CallerAutoPilotControlManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); } } @@ -372,7 +371,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte timerAcc.schedule(new TimerTask() { @Override public void run() { - CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated); + CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated); } }, 0, 500); } @@ -381,7 +380,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte timerAcc.cancel(); timerAcc = null; } - CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc); + CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc); } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java index 950ed0e66f..6a91cc3d85 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/SpeedLimitDataManager.java @@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.business; import androidx.annotation.Nullable; import com.mogo.eagle.core.data.enums.DataSourceType; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; @@ -13,8 +14,6 @@ import java.util.Objects; import java.util.Timer; import java.util.TimerTask; -import mogo.telematics.pad.MessagePad; - /** * 限速 * @@ -24,7 +23,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener private final static String TAG = "SpeedLimitDataManager"; private static volatile SpeedLimitDataManager instance; - private MessagePad.GnssInfo mLocation; + private MogoLocation mLocation; private SpeedLimitDataManager() { } @@ -41,7 +40,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener } @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { mLocation = gnssInfo; } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt index c4e6e8a277..1c7ccb13e4 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt @@ -8,16 +8,18 @@ import com.mogo.cloud.passport.MoGoAiCloudClient import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MogoServicePaths -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP -import com.mogo.eagle.core.function.api.autopilot.* +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider -import com.mogo.eagle.core.function.call.autopilot.* -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP import com.zhidaoauto.map.operational.open.GatherApi import com.zhidaoauto.map.operational.open.GatherParams import com.zhidaoauto.map.operational.open.abs.OnTaskListener -import mogo.telematics.pad.MessagePad.GnssInfo import record_cache.RecordPanelOuterClass import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.CopyOnWriteArrayList @@ -168,14 +170,14 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, } } - override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) { + override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) { val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return executor.get()?.updateLocation( location.longitude, location.latitude, location.altitude, - location.bearing, - location.speed, + location.heading.toFloat(), + location.gnssSpeed, false) } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java index 9d0871ad0c..167a8e2df8 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/routeoverlay/MogoRouteOverlayManager.java @@ -5,6 +5,7 @@ import androidx.annotation.Nullable; import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo; import com.mogo.eagle.core.data.config.FunctionBuildConfig; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener; @@ -65,7 +66,7 @@ public class MogoRouteOverlayManager implements } @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { if (gnssInfo == null) { return; } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt index 403a8d640c..799648d27e 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt @@ -8,9 +8,10 @@ import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.commons.mvp.MvpFragment import com.mogo.eagle.core.data.constants.MoGoConfig import com.mogo.eagle.core.data.constants.MoGoFragmentPaths -import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.map.CenterLine +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener @@ -19,13 +20,12 @@ import com.mogo.eagle.core.function.business.SpeedLimitDataManager import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight import com.mogo.eagle.core.function.call.map.CallerHDMapManager import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager -import com.mogo.eagle.core.function.datacenter.location.IMoGoLocationListener -import com.mogo.eagle.core.function.datacenter.location.MoGoLocationManager import com.mogo.eagle.core.function.overview.InfStructureManager import com.mogo.eagle.core.function.overview.InfStructureManager.savePlanningData import com.mogo.eagle.core.function.overview.obtainViewModel @@ -54,7 +54,7 @@ class MapFragment : MvpFragment(), MapView, IMoGoMapFragmentProvider, IMoGoSkinModeChangeListener, - IMoGoLocationListener, + IMoGoChassisLocationWGS84Listener, IMoGoPlanningRottingListener, IMoGoChassisLamplightListener { @@ -114,7 +114,7 @@ class MapFragment : MvpFragment(), // 添加换肤监听 CallerSkinModeListenerManager.addListener(Companion.functionName, this) CallerPlanningRottingListenerManager.addListener(Companion.functionName, this) - MoGoLocationManager.addListener(Companion.functionName, this) + CallerChassisLocationWGS84ListenerManager.addListener(Companion.functionName, this) CallerChassisLamplightListenerManager.addListener(Companion.functionName, this) } @@ -218,7 +218,7 @@ class MapFragment : MvpFragment(), override fun onDestroyView() { CallerSkinModeListenerManager.removeListener(Companion.functionName) CallerPlanningRottingListenerManager.removeListener(Companion.functionName) - MoGoLocationManager.removeListener(Companion.functionName) + CallerChassisLocationWGS84ListenerManager.removeListener(Companion.functionName) CallerChassisLamplightListenerManager.removeListener(Companion.functionName) if (mMogoMapView != null) { @@ -346,8 +346,8 @@ class MapFragment : MvpFragment(), private var isShowTurnLight = false private var brakeLight = -1 - override fun onLocationChanged(gnssInfo: MessagePad.GnssInfo,sourceType: DataSourceType) { - // 跟新地图控件 + override fun onChassisLocationWGS84(gnssInfo: MogoLocation) { + // 更新地图控件 mMogoMapView?.setExtraGPSData(gnssInfo) if (gnssInfo != null) { @@ -364,6 +364,7 @@ class MapFragment : MvpFragment(), } } + override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) { //can数据转发 转向灯状态 0是正常 1是左转 2是右转 if (lightSwitch != null) { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt index ddc6423415..008288d122 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt @@ -19,9 +19,10 @@ import com.amap.api.maps.model.* import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.map.Infrastructure +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.getGlobalPath +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showVideoDialog @@ -83,7 +84,7 @@ class OverMapView @JvmOverloads constructor( // 绘制轨迹线的集合 private val textureList: MutableList = ArrayList() private val texIndexList: MutableList = ArrayList() - private var mLocation: MessagePad.GnssInfo? = null + private var mLocation: MogoLocation? = null private var isFirstLocation = true var mCustomMapStyleOptions: CustomMapStyleOptions? = null var currMarkerList: ArrayList? = null @@ -493,7 +494,7 @@ class OverMapView @JvmOverloads constructor( * * @param location */ - private fun drawCarMarker(location: MessagePad.GnssInfo?) { + private fun drawCarMarker(location: MogoLocation?) { if (location == null) return if (mCarMarker != null) { val currentLatLng = LatLng(location.latitude, location.longitude) @@ -568,7 +569,7 @@ class OverMapView @JvmOverloads constructor( } } - override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) { + override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) { mLocation = gnssInfo lonLat = Pair(gnssInfo!!.longitude, gnssInfo.latitude) drawCarMarker(gnssInfo) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java index c8f97d3f25..528ebcd696 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java @@ -31,6 +31,7 @@ import com.amap.api.maps.model.Polyline; import com.amap.api.maps.model.PolylineOptions; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.map.Infrastructure; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; @@ -92,7 +93,7 @@ public class AMapCustomView private List textureList = new ArrayList<>(); private List texIndexList = new ArrayList<>(); - private MessagePad.GnssInfo mLocation; + private MogoLocation mLocation; private boolean isFirstLocation = true; CustomMapStyleOptions mCustomMapStyleOptions; @@ -456,7 +457,7 @@ public class AMapCustomView * * @param location */ - private void drawCarMarker(MessagePad.GnssInfo location) { + private void drawCarMarker(MogoLocation location) { if (location == null) return; if (mCarMarker != null) { LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude()); @@ -534,7 +535,7 @@ public class AMapCustomView } @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { mLocation = gnssInfo; MarkerDrawerManager.INSTANCE.setLonLat(new Pair(gnssInfo.getLongitude(), gnssInfo.getLatitude())); drawCarMarker(gnssInfo); diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/OverviewMapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/OverviewMapFragment.java index a55727a560..3c4123621f 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/OverviewMapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/OverviewMapFragment.java @@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters; import com.mogo.eagle.core.data.constants.MoGoFragmentPaths; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.map.R; import com.mogo.eagle.core.function.overview.InfStructureManager; @@ -117,7 +117,7 @@ public class OverviewMapFragment extends BaseFragment public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // 主动查一次全局路径规划的数据 - CallerAutoPilotManager.INSTANCE.getGlobalPath(); + CallerAutoPilotControlManager.INSTANCE.getGlobalPath(); queryV2XEvents(); } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java index 43b2152622..b6cf10cfa7 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapDirectionView.java @@ -32,6 +32,7 @@ import com.amap.api.maps.model.PolylineOptions; import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.eagle.core.data.config.FunctionBuildConfig; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener; import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager; import com.mogo.eagle.core.function.map.R; @@ -47,8 +48,6 @@ import java.util.List; import java.util.Timer; import java.util.TimerTask; -import mogo.telematics.pad.MessagePad; - /** * 小地图的方向View * @@ -75,7 +74,7 @@ public class SmallMapDirectionView private Polyline mPolyline; private CameraUpdate mCameraUpdate; private Context mContext; - private MessagePad.GnssInfo mLocation; + private MogoLocation mLocation; public SmallMapDirectionView(Context context) { this(context, null); @@ -179,7 +178,7 @@ public class SmallMapDirectionView } @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { if (gnssInfo == null) { return; } 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 50fbec54c8..39ebd29002 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 @@ -17,7 +17,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener; import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener; import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager; +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager; import com.mogo.eagle.core.function.map.R; @@ -143,7 +143,7 @@ public class SmallMapFragment extends BaseFragment clearPolyline(); }else if (tempStatus == 1 && autoPilotStatus == 0){ CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath"); - CallerAutoPilotManager.INSTANCE.getGlobalPath(); + CallerAutoPilotControlManager.INSTANCE.getGlobalPath(); } autoPilotStatus = tempStatus; } diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt index 3151845564..e023ab05a3 100644 --- a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt @@ -29,9 +29,9 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS import com.mogo.eagle.core.data.map.MogoLocation -import com.mogo.eagle.core.function.api.autopilot.* +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.call.analytics.AnalyticsManager -import com.mogo.eagle.core.function.call.autopilot.* +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager @@ -46,7 +46,6 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils import com.rousetime.android_startup.AndroidStartup import com.zhjt.service.chain.ChainLog import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD -import mogo.telematics.pad.MessagePad.GnssInfo class HttpDnsStartUp : AndroidStartup() { @@ -293,10 +292,9 @@ class HttpDnsStartUp : AndroidStartup() { CallerChassisLocationGCJ20ListenerManager.addListener( TAG, object : IMoGoChassisLocationGCJ02Listener { - - override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) { - CallerMapLocationListenerManager.getCurrentLocation()?.let { loc -> - MogoLocationInfoServices.getInstance().provideLocation(loc) + override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) { + mogoLocation?.let { + MogoLocationInfoServices.getInstance().provideLocation(mogoLocation) } } }, diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index d8789a5797..7d78ee2a3f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -1,47 +1,53 @@ package com.mogo.eagle.core.function.v2x.events -import android.content.* -import android.os.* -import android.util.* -import androidx.localbroadcastmanager.content.* -import com.mogo.cloud.passport.* +import android.content.Context +import android.content.Intent +import android.os.Handler +import android.os.Looper +import android.util.Log +import androidx.localbroadcastmanager.content.LocalBroadcastManager +import com.mogo.cloud.passport.IMoGoTokenCallback +import com.mogo.cloud.passport.MoGoAiCloudClient +import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.commons.constants.HostConst import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION -import com.mogo.eagle.core.data.enums.EventTypeEnumNew -import com.mogo.eagle.core.data.enums.EventTypeHelper -import com.mogo.commons.network.* +import com.mogo.commons.network.ParamsUtil import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N -import com.mogo.eagle.core.data.enums.* -import com.mogo.eagle.core.data.map.* +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.data.enums.EventTypeEnumNew +import com.mogo.eagle.core.data.enums.EventTypeHelper +import com.mogo.eagle.core.data.enums.TrafficTypeEnum +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.map.entity.MarkerExploreWay import com.mogo.eagle.core.data.map.entity.MarkerShowEntity import com.mogo.eagle.core.data.map.entity.V2XMessageEntity import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity -import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg -import com.mogo.eagle.core.data.traffic.* -import com.mogo.eagle.core.function.api.autopilot.* -import com.mogo.eagle.core.function.api.hmi.warning.* -import com.mogo.eagle.core.function.api.map.listener.* -import com.mogo.eagle.core.function.call.autopilot.* -import com.mogo.eagle.core.function.call.hmi.* -import com.mogo.eagle.core.function.call.map.* +import com.mogo.eagle.core.data.traffic.TrafficData +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener +import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager +import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager -import com.mogo.eagle.core.function.v2x.events.alarm.* -import com.mogo.eagle.core.function.v2x.events.bridge.* +import com.mogo.eagle.core.function.v2x.events.alarm.V2XAlarmServer +import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.* -import com.mogo.eagle.core.function.v2x.events.manager.* -import com.mogo.eagle.core.function.v2x.events.receiver.* -import com.mogo.eagle.core.function.v2x.events.scenario.impl.* -import com.mogo.eagle.core.function.v2x.events.utils.* -import com.mogo.eagle.core.function.v2x.events.utils.MapUtils +import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_EXTRA_KEY +import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_HANDLER_ACTION +import com.mogo.eagle.core.function.v2x.events.receiver.SceneBroadcastReceiver +import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager +import com.mogo.eagle.core.function.v2x.events.utils.TrackUtils +import com.mogo.eagle.core.function.v2x.events.utils.toRoadMarker import com.mogo.eagle.core.function.v2x.internal.V2XManager import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback import com.mogo.eagle.core.function.v2x.internal.config.V2XConfig @@ -51,27 +57,35 @@ import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent import com.mogo.eagle.core.function.v2x.road.V2XEventServiceApi import com.mogo.eagle.core.network.MoGoRetrofitFactory -import com.mogo.eagle.core.utilcode.mogo.logger.* +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X -import com.mogo.eagle.core.utilcode.util.* +import com.mogo.eagle.core.utilcode.util.ThreadUtils +import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.eagle.core.utilcode.util.Utils -import com.mogo.map.marker.* +import com.mogo.map.marker.IMogoMarker +import com.mogo.map.marker.IMogoMarkerClickListener import com.mogo.map.marker.MogoMarkersHandler.Companion.mogoMarkersHandler -import com.shuyu.gsyvideoplayer.* -import com.shuyu.gsyvideoplayer.cache.* -import com.shuyu.gsyvideoplayer.model.* -import com.shuyu.gsyvideoplayer.player.* -import com.shuyu.gsyvideoplayer.utils.* -import com.zhjt.service.chain.* +import com.shuyu.gsyvideoplayer.GSYVideoManager +import com.shuyu.gsyvideoplayer.cache.CacheFactory +import com.shuyu.gsyvideoplayer.cache.ProxyCacheManager +import com.shuyu.gsyvideoplayer.model.VideoOptionModel +import com.shuyu.gsyvideoplayer.player.IjkPlayerManager +import com.shuyu.gsyvideoplayer.player.PlayerFactory +import com.shuyu.gsyvideoplayer.utils.GSYVideoType +import com.zhjt.service.chain.ChainLog +import com.zhjt.service.chain.TracingConstants import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.Disposable import io.reactivex.schedulers.Schedulers -import kotlinx.coroutines.* -import kotlinx.coroutines.android.* -import mogo.telematics.pad.MessagePad.GnssInfo -import tv.danmaku.ijk.media.player.* -import java.util.concurrent.* -import java.util.concurrent.atomic.* +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.android.asCoroutineDispatcher +import kotlinx.coroutines.cancel +import kotlinx.coroutines.launch +import tv.danmaku.ijk.media.player.IjkMediaPlayer +import java.util.concurrent.TimeUnit +import java.util.concurrent.atomic.AtomicBoolean object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, IV2XCallback { @@ -188,7 +202,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, return null } - override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) { + override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) { val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return BridgeApi.location.set(location) if (V2XManager.hasInit()) { @@ -208,7 +222,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, val min = if (EventTypeEnumNew.isCloudSocketEvent(v2XRoadEventEntity.poiType)) 0 else 5 CallerLogger.d( "$M_V2X$TAG", - "--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.speed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}" + "--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.gnssSpeed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}" ) if (distance >= min) { CallerLogger.d( diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java index 386e2116ec..43acb5bd68 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java @@ -1,7 +1,5 @@ package com.mogo.eagle.core.function.v2x.events.alarm; -import android.util.Log; - import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.map.entity.MarkerLocation; @@ -51,7 +49,7 @@ public class V2XAlarmServer { if (poiLocation == null) { continue; } - if (isOutOfRange(poiLocation.getLon(), poiLocation.getLat(), currentLocation.getLongitude(), currentLocation.getLatitude(), currentLocation.getBearing())) { + if (isOutOfRange(poiLocation.getLon(), poiLocation.getLat(), currentLocation.getLongitude(), currentLocation.getLatitude(), currentLocation.getHeading())) { iterator.remove(); } } @@ -75,7 +73,7 @@ public class V2XAlarmServer { } } // 2、道路事件方向与当前行驶方向角度偏差《20度以内 - double carBearing = currentLocation.getBearing(); + double carBearing = currentLocation.getHeading(); double eventBearing = eventLocation.getAngle(); double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing); Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle); @@ -86,7 +84,7 @@ public class V2XAlarmServer { currentLocation.getLatitude(), eventLocation.getLon(), eventLocation.getLat(), - (int) currentLocation.getBearing() + (int) currentLocation.getHeading() ); Logger.d(TAG, "eventAngle:" + eventAngle); diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt index 238af1abca..bb9e2b5871 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/remove/MarkerRemoveManager.kt @@ -4,13 +4,14 @@ import android.os.Handler import android.os.HandlerThread import android.util.Log import com.mogo.cloud.commons.utils.CoordinateUtils -import com.mogo.eagle.core.function.call.autopilot.* -import com.mogo.eagle.core.utilcode.util.* +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager +import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils import com.mogo.map.marker.IMogoMarker import com.mogo.map.overlay.IMogoPolyline import kotlinx.coroutines.Runnable -import mogo.telematics.pad.MessagePad.GnssInfo -import java.util.LinkedList +import java.util.* import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicReference @@ -83,7 +84,7 @@ object MarkerRemoveManager { } Log.d(TAG, "--- checkTask --- 3 ---") val toRemove = toRemoveMakers.iterator() - val carLoc = AtomicReference() + val carLoc = AtomicReference() while (toRemove.hasNext()) { val marker = toRemove.next() if (carLoc.get() == null) { diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt index 1ad84664da..e93bae7523 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt @@ -45,7 +45,7 @@ class V2XAiRoadEventMarker { if (polygons.size > 0) { val l2 = entity.noveltyInfo?.location ?: return v2xLocation.set(MogoLocation().also { - it.longitude = l2.lon; it.latitude = l2.lat; it.bearing = l2.angle.toFloat() + it.longitude = l2.lon; it.latitude = l2.lat; it.heading = l2.angle }) val options = MogoPolylineOptions() diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java index 549e56d19f..8c2c6fba7f 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XFrontWarningScenario.java @@ -7,8 +7,11 @@ import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; import android.util.Log; + import androidx.annotation.Nullable; + import com.mogo.eagle.core.data.enums.WarningDirectionEnum; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; import com.mogo.eagle.core.data.msgbox.MsgBoxBean; import com.mogo.eagle.core.data.msgbox.MsgBoxType; @@ -19,14 +22,13 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager; import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget; +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; + import java.math.BigDecimal; import java.util.Locale; import java.util.concurrent.TimeUnit; -import mogo.telematics.pad.MessagePad; - /** * @author liujing * @description 车路云—场景预警-V1.0 前车/行人/摩托车/盲区碰撞预警 @@ -128,7 +130,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas } @Override - public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) { + public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { sV2XWarningMarker.onCarLocationChanged2(gnssInfo); } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java index 5bd251ea4e..51af0affe0 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/warning/V2XWarningMarker.java @@ -3,32 +3,33 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.warning; import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA; import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X; + import com.mogo.cloud.commons.utils.CoordinateUtils; import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.module.status.MogoStatusManager; +import com.mogo.commons.utils.Trigonometric; import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.data.map.MogoLocation; +import com.mogo.eagle.core.data.v2x.DrawLineInfo; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi; -import com.mogo.eagle.core.data.v2x.DrawLineInfo; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoPersonWarnPolylineManager; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoStopPolylineManager; import com.mogo.eagle.core.function.v2x.events.manager.IMoGoWarnPolylineManager; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; +import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation; +import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler; import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.mogo.map.marker.IMogoMarkerManager; import com.mogo.map.overlay.IMogoPolyline; -import com.mogo.commons.utils.Trigonometric; -import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation; -import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; -import mogo.telematics.pad.MessagePad; /** * @author liujing @@ -52,7 +53,7 @@ public class V2XWarningMarker implements IV2XMarker { * */ private MogoLatLng middleLocationInStopLine = new MogoLatLng(0, 0); private static long showTime = 6000; - private float bearing; + private double bearing; private boolean hasStopLines = false; @Override @@ -75,7 +76,7 @@ public class V2XWarningMarker implements IV2XMarker { if (location == null) { return; } - bearing = location.getBearing(); + bearing = location.getHeading(); if (mCloundWarningInfo != null && mCloundWarningInfo.getStopLines() != null) { hasStopLines = mCloundWarningInfo.getStopLines().size() > 0; @@ -428,7 +429,7 @@ public class V2XWarningMarker implements IV2XMarker { } //线随车动 - public void onCarLocationChanged2(MessagePad.GnssInfo latLng) { + public void onCarLocationChanged2(MogoLocation latLng) { carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()); if (MogoStatusManager.getInstance().isVrMode() && !isSelfLineClear) { if (mCloundWarningInfo != null) { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/MogoLocation.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/MogoLocation.java index 9397785bb4..a8bd5fe481 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/MogoLocation.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/MogoLocation.java @@ -1,17 +1,12 @@ package com.mogo.eagle.core.data.map; -import android.os.Parcel; -import android.os.Parcelable; +import mogo.telematics.pad.MessagePad; -public class MogoLocation implements Cloneable, Parcelable { +public class MogoLocation implements Cloneable { + + private MessagePad.GnssInfo gnssInfo = MessagePad.GnssInfo.newBuilder().build(); private int locType = 0; - private double latitude = 0; - private double longitude = 0; - private double altitude = 0; - private long time = 0; - private float bearing = 0; private float accuracy = 0; - private float speed = 0; private String cityName = ""; private String cityCode = ""; private String provider = ""; @@ -22,29 +17,45 @@ public class MogoLocation implements Cloneable, Parcelable { private String locationDetail = ""; private String poiName = ""; private String aoiName = ""; - private int errCode = 0; - private String errInfo = ""; private String street = ""; private String streetNum = ""; private String description = ""; private String buildingId = ""; private String floor = ""; + private int errorCode = 0; + private String errorInfo = ""; private int gpsAccuracyStatus = 0; private int satellite = 0; - public float getBearing() { - return bearing; + // 记录最后一次收到的时间戳,ms,用于计算是否要切换GPS数据源 + private long lastReceiveTime; + + public MessagePad.GnssInfo getGnssInfo() { + return gnssInfo; } - public void setBearing( float bearing ) { - this.bearing = bearing; + public void setGnssInfo(MessagePad.GnssInfo gnssInfo) { + this.gnssInfo = gnssInfo; + } + + public double getHeading() { + if (gnssInfo != null) { + return gnssInfo.getHeading(); + } + return 0; + } + + public void setHeading(double bearing) { + if (gnssInfo != null) { + gnssInfo = gnssInfo.toBuilder().setHeading(bearing).build(); + } } public float getAccuracy() { return accuracy; } - public void setAccuracy( float accuracy ) { + public void setAccuracy(float accuracy) { this.accuracy = accuracy; } @@ -52,23 +63,41 @@ public class MogoLocation implements Cloneable, Parcelable { return provider; } - public void setProvider( String provider ) { + public void setProvider(String provider) { this.provider = provider; } - public float getSpeed() { - return speed; + public float getGnssSpeed() { + if (gnssInfo != null) { + return (float) gnssInfo.getGnssSpeed(); + } + return 0; } - public void setSpeed( float speed ) { - this.speed = speed; + public void setGnssSpeed(float speed) { + if (gnssInfo != null) { + gnssInfo = gnssInfo.toBuilder().setGnssSpeed(speed).build(); + } + } + + public float getAcceleration() { + if (gnssInfo != null) { + return (float) gnssInfo.getAcceleration(); + } + return 0; + } + + public void setAcceleration(double acceleration) { + if (gnssInfo != null) { + gnssInfo = gnssInfo.toBuilder().setAcceleration(acceleration).build(); + } } public String getLocationDetail() { return locationDetail; } - public void setLocationDetail( String locationDetail ) { + public void setLocationDetail(String locationDetail) { this.locationDetail = locationDetail; } @@ -76,7 +105,7 @@ public class MogoLocation implements Cloneable, Parcelable { return poiName; } - public void setPoiName( String poiName ) { + public void setPoiName(String poiName) { this.poiName = poiName; } @@ -84,24 +113,24 @@ public class MogoLocation implements Cloneable, Parcelable { return aoiName; } - public void setAoiName( String aoiName ) { + public void setAoiName(String aoiName) { this.aoiName = aoiName; } - public int getErrCode() { - return errCode; + public int getErrorCode() { + return errorCode; } - public void setErrCode( int errCode ) { - this.errCode = errCode; + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; } - public String getErrInfo() { - return errInfo; + public String getErrorInfo() { + return errorInfo; } - public void setErrInfo( String errInfo ) { - this.errInfo = errInfo; + public void setErrorInfo(String errorInfo) { + this.errorInfo = errorInfo; } public String getStreet() { @@ -116,7 +145,7 @@ public class MogoLocation implements Cloneable, Parcelable { return streetNum; } - public void setStreetNum( String streetNum ) { + public void setStreetNum(String streetNum) { this.streetNum = streetNum; } @@ -124,7 +153,7 @@ public class MogoLocation implements Cloneable, Parcelable { return description; } - public void setDescription( String description ) { + public void setDescription(String description) { this.description = description; } @@ -132,7 +161,7 @@ public class MogoLocation implements Cloneable, Parcelable { return buildingId; } - public void setBuildingId( String buildingId ) { + public void setBuildingId(String buildingId) { this.buildingId = buildingId; } @@ -140,7 +169,7 @@ public class MogoLocation implements Cloneable, Parcelable { return floor; } - public void setFloor( String floor ) { + public void setFloor(String floor) { this.floor = floor; } @@ -148,7 +177,7 @@ public class MogoLocation implements Cloneable, Parcelable { return gpsAccuracyStatus; } - public void setGpsAccuracyStatus( int gpsAccuracyStatus ) { + public void setGpsAccuracyStatus(int gpsAccuracyStatus) { this.gpsAccuracyStatus = gpsAccuracyStatus; } @@ -156,24 +185,151 @@ public class MogoLocation implements Cloneable, Parcelable { return satellite; } - public void setSatellite( int satellite ) { + public void setSatellite(int satellite) { this.satellite = satellite; } public MogoLocation() { } + public double getAltitude() { + if (gnssInfo != null) { + return gnssInfo.getAltitude(); + } + return 0; + } + + public void setAltitude(double altitude) { + if (gnssInfo != null) { + gnssInfo = gnssInfo.toBuilder().setAltitude(altitude).build(); + } + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getAdCode() { + return adCode; + } + + public void setAdCode(String adCode) { + this.adCode = adCode; + } + + public int getLocType() { + return locType; + } + + public void setLocType(int locType) { + this.locType = locType; + } + + public double getLatitude() { + if (gnssInfo != null) { + return gnssInfo.getLatitude(); + } + return 0; + } + + public void setLatitude(double latitude) { + if (gnssInfo != null) { + gnssInfo = gnssInfo.toBuilder().setLatitude(latitude).build(); + } + } + + public double getLongitude() { + if (gnssInfo != null) { + return gnssInfo.getLongitude(); + } + return 0; + } + + public void setLongitude(double longitude) { + if (gnssInfo != null) { + gnssInfo = gnssInfo.toBuilder().setLongitude(longitude).build(); + } + } + + public long getSatelliteTime() { + if (gnssInfo != null) { + return (long) gnssInfo.getSatelliteTime(); + } + return 0; + } + + public void setSatelliteTime(long time) { + if (gnssInfo != null) { + gnssInfo = gnssInfo.toBuilder().setSatelliteTime(time).build(); + } + } + + public String getCityCode() { + return cityCode; + } + + public void setCityCode(String cityCode) { + this.cityCode = cityCode; + } + + public String getCityName() { + return cityName; + } + + public void setCityName(String cityName) { + this.cityName = cityName; + } + + + @Override + public MogoLocation clone() { + try { + return (MogoLocation) super.clone(); + } catch (CloneNotSupportedException e) { + e.printStackTrace(); + } + return this; + } + + public long getLastReceiveTime() { + return lastReceiveTime; + } + + public void setLastReceiveTime(long lastReceiveTime) { + this.lastReceiveTime = lastReceiveTime; + } + @Override public String toString() { return "MogoLocation{" + "locType=" + locType + - ", latitude=" + latitude + - ", longitude=" + longitude + - ", altitude=" + altitude + - ", time=" + time + - ", bearing=" + bearing + + ", latitude=" + getLatitude() + + ", longitude=" + getLongitude() + + ", altitude=" + getAltitude() + + ", time=" + getSatelliteTime() + + ", bearing=" + getHeading() + ", accuracy=" + accuracy + - ", speed=" + speed + + ", speed=" + getGnssSpeed() + ", cityName='" + cityName + '\'' + ", cityCode='" + cityCode + '\'' + ", provider='" + provider + '\'' + @@ -184,8 +340,8 @@ public class MogoLocation implements Cloneable, Parcelable { ", locationDetail='" + locationDetail + '\'' + ", poiName='" + poiName + '\'' + ", aoiName='" + aoiName + '\'' + - ", errCode=" + errCode + - ", errInfo='" + errInfo + '\'' + + ", errCode=" + errorCode + + ", errInfo='" + errorInfo + '\'' + ", street='" + street + '\'' + ", streetNum='" + streetNum + '\'' + ", description='" + description + '\'' + @@ -195,180 +351,4 @@ public class MogoLocation implements Cloneable, Parcelable { ", satellite=" + satellite + '}'; } - - public double getAltitude() { - return altitude; - } - - public void setAltitude( double altitude ) { - this.altitude = altitude; - } - - public String getAddress() { - return address; - } - - public void setAddress( String address ) { - this.address = address; - } - - public String getDistrict() { - return district; - } - - public void setDistrict( String district ) { - this.district = district; - } - - public String getProvince() { - return province; - } - - public void setProvince( String province ) { - this.province = province; - } - - public String getAdCode() { - return adCode; - } - - public void setAdCode( String adCode ) { - this.adCode = adCode; - } - - public int getLocType() { - return locType; - } - - public void setLocType( int locType ) { - this.locType = locType; - } - - public double getLatitude() { - return latitude; - } - - public void setLatitude( double latitude ) { - this.latitude = latitude; - } - - public double getLongitude() { - return longitude; - } - - public void setLongitude( double longitude ) { - this.longitude = longitude; - } - - public long getTime() { - return time; - } - - public void setTime( long time ) { - this.time = time; - } - - public String getCityCode() { - return cityCode; - } - - public void setCityCode( String cityCode ) { - this.cityCode = cityCode; - } - - public String getCityName() { - return cityName; - } - - public void setCityName( String cityName ) { - this.cityName = cityName; - } - - @Override - public MogoLocation clone() { - try { - return ( MogoLocation ) super.clone(); - } catch ( CloneNotSupportedException e ) { - e.printStackTrace(); - } - return this; - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel( Parcel dest, int flags ) { - dest.writeInt( this.locType ); - dest.writeDouble( this.latitude ); - dest.writeDouble( this.longitude ); - dest.writeDouble( this.altitude ); - dest.writeLong( this.time ); - dest.writeFloat( this.bearing ); - dest.writeFloat( this.accuracy ); - dest.writeFloat( this.speed ); - dest.writeString( this.cityName ); - dest.writeString( this.cityCode ); - dest.writeString( this.provider ); - dest.writeString( this.address ); - dest.writeString( this.district ); - dest.writeString( this.province ); - dest.writeString( this.adCode ); - dest.writeString( this.locationDetail ); - dest.writeString( this.poiName ); - dest.writeString( this.aoiName ); - dest.writeInt( this.errCode ); - dest.writeString( this.errInfo ); - dest.writeString( this.street ); - dest.writeString( this.streetNum ); - dest.writeString( this.description ); - dest.writeString( this.buildingId ); - dest.writeString( this.floor ); - dest.writeInt( this.gpsAccuracyStatus ); - dest.writeInt( this.satellite ); - } - - protected MogoLocation( Parcel in ) { - this.locType = in.readInt(); - this.latitude = in.readDouble(); - this.longitude = in.readDouble(); - this.altitude = in.readDouble(); - this.time = in.readLong(); - this.bearing = in.readFloat(); - this.accuracy = in.readFloat(); - this.speed = in.readFloat(); - this.cityName = in.readString(); - this.cityCode = in.readString(); - this.provider = in.readString(); - this.address = in.readString(); - this.district = in.readString(); - this.province = in.readString(); - this.adCode = in.readString(); - this.locationDetail = in.readString(); - this.poiName = in.readString(); - this.aoiName = in.readString(); - this.errCode = in.readInt(); - this.errInfo = in.readString(); - this.street = in.readString(); - this.streetNum = in.readString(); - this.description = in.readString(); - this.buildingId = in.readString(); - this.floor = in.readString(); - this.gpsAccuracyStatus = in.readInt(); - this.satellite = in.readInt(); - } - - public static final Parcelable.Creator< MogoLocation > CREATOR = new Parcelable.Creator< MogoLocation >() { - @Override - public MogoLocation createFromParcel( Parcel source ) { - return new MogoLocation( source ); - } - - @Override - public MogoLocation[] newArray( int size ) { - return new MogoLocation[size]; - } - }; } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt similarity index 99% rename from core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt rename to core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt index edb38584ed..dc241305a4 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt @@ -10,7 +10,7 @@ import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider * @date 2021/9/22 8:27 下午 * 自动驾驶节点 */ -interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider { +interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider { /** * 重新连接自动驾驶域控制器,指定IP地址 * diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGnssListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGnssListener.kt new file mode 100644 index 0000000000..78ed89ff46 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisGnssListener.kt @@ -0,0 +1,18 @@ +package com.mogo.eagle.core.function.api.autopilot + +import mogo.telematics.pad.MessagePad + +/** + * 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听 + * @author donghongyu + * @date 2023/1/11 2:06 下午 + */ +interface IMoGoChassisGnssListener { + + /** + * 车辆定位 GCJ02 坐标系-高德坐标系 数据 + * + * @param gnssInfo + */ + fun onChassisGnss(gnssInfo: MessagePad.GnssInfo) +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisLocationGCJ02Listener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisLocationGCJ02Listener.kt index 8cff2a917c..1b3bdc18c1 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisLocationGCJ02Listener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisLocationGCJ02Listener.kt @@ -1,6 +1,6 @@ package com.mogo.eagle.core.function.api.autopilot -import mogo.telematics.pad.MessagePad +import com.mogo.eagle.core.data.map.MogoLocation /** * @author donghongyu @@ -14,5 +14,5 @@ interface IMoGoChassisLocationGCJ02Listener { * * @param gnssInfo */ - fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) + fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisLocationWGS84Listener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisLocationWGS84Listener.kt index c6c1a7e9ce..ac93e07a09 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisLocationWGS84Listener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoChassisLocationWGS84Listener.kt @@ -1,11 +1,11 @@ package com.mogo.eagle.core.function.api.autopilot -import mogo.telematics.pad.MessagePad +import com.mogo.eagle.core.data.map.MogoLocation /** + * 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听 * @author donghongyu * @date 2023/1/11 2:06 下午 - * 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听 */ interface IMoGoChassisLocationWGS84Listener { @@ -14,5 +14,5 @@ interface IMoGoChassisLocationWGS84Listener { * * @param gnssInfo */ - fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) + fun onChassisLocationWGS84(gnssInfo: MogoLocation) } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt similarity index 98% rename from core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt rename to core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt index eefa5acfa5..d140c3ff21 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt @@ -10,7 +10,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT import com.mogo.eagle.core.data.trafficlight.TrafficLightResult -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.zhjt.service.chain.ChainLog @@ -23,12 +23,12 @@ import kotlin.random.Random *@date 2021/10/14 2:15 下午 * 域控制器管理 */ -object CallerAutoPilotManager { +object CallerAutoPilotControlManager { private val TAG = "CallerAutoPilotManager" - private val providerApi: IMoGoAutopilotProvider? + private val providerApi: IMoGoAutopilotControlProvider? get() = CallerBase.getApiInstance( - IMoGoAutopilotProvider::class.java, + IMoGoAutopilotControlProvider::class.java, MogoServicePaths.PATH_AUTO_PILOT ) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt index 9db721a9f8..f458436d49 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotIdentifyListenerManager.kt @@ -6,9 +6,9 @@ import mogo.telematics.pad.MessagePad import perception.TrafficLightOuterClass /** + * 域控制器感知数据 * @author xiaoyuzhou * @date 2021/9/30 5:48 下午 - * 域控制器感知数据 */ object CallerAutopilotIdentifyListenerManager : CallerBase() { diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGnssListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGnssListenerManager.kt new file mode 100644 index 0000000000..1b0d27083a --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisGnssListenerManager.kt @@ -0,0 +1,27 @@ +package com.mogo.eagle.core.function.call.autopilot + +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssListener +import com.mogo.eagle.core.function.call.base.CallerBase +import mogo.telematics.pad.MessagePad + +/** + * 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听 + * @author xiaoyuzhou + * @date 2021/9/30 5:48 下午 + */ +object CallerChassisGnssListenerManager : CallerBase() { + + /** + * 车辆定位 WGS84 坐标系-高精度坐标系 数据 + * @param gnssInfo + */ + @Synchronized + fun invokeChassisGnssListener(gnssInfo: MessagePad.GnssInfo) { + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.onChassisGnss(gnssInfo) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ20ListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ20ListenerManager.kt index 39686e6854..4ae3a74afd 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ20ListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ20ListenerManager.kt @@ -1,10 +1,12 @@ package com.mogo.eagle.core.function.call.autopilot +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener import com.mogo.eagle.core.function.call.base.CallerBase import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.eagle.core.utilcode.util.CoordinateTransform -import mogo.telematics.pad.MessagePad +import com.mogo.eagle.core.utilcode.util.TimeUtils /** * @author xiaoyuzhou @@ -16,9 +18,21 @@ object CallerChassisLocationGCJ20ListenerManager : CallerBaseGCJ02 坐标 - val gcj20Location = CoordinateTransform.WGS84ToGCJ02(gnssInfo.longitude, gnssInfo.latitude) + val gcj20Location = + CoordinateTransform.WGS84ToGCJ02(gnssInfo.longitude, gnssInfo.latitude) - val gnssBuilder = gnssInfo.toBuilder() - gnssBuilder.longitude = gcj20Location[0] - gnssBuilder.latitude = gcj20Location[1] + gnssInfo.longitude = gcj20Location[0] + gnssInfo.latitude = gcj20Location[1] - this.mGnssInfo = gnssBuilder.build() + this.mGnssInfo = gnssInfo M_LISTENERS.forEach { val tag = it.key - val listener = it.value - listener.onChassisLocationGCJ02(this.mGnssInfo) + // 获取数据监听需要的HZ + val hz = M_LISTENERS_HZ[tag] + if (hz != null && hz > 0) { + val hzTime = (1.0 / hz.toDouble()) * 1000 + // 获取最后一次回调的时间 + val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag] + if (hzLastSendTime != null && hzLastSendTime > 0) { + // 计算是否进入下一次回调周期 + val nowTime = TimeUtils.getNowMills() + if (nowTime - hzLastSendTime > hzTime) { + syncLocationCallback(tag, it, gnssInfo, sourceType) + } + } else { + syncLocationCallback(tag, it, gnssInfo, sourceType) + } + } else { + syncLocationCallback(tag, it, gnssInfo, sourceType) + } } } ?: let { Logger.e(TAG, "定位数据为Null") } } + + /** + * 向订阅位置信息的发出定位信息 + * @param tag + * @param it + * @param gnssInfo + * @param sourceType 数据来源 + */ + private fun syncLocationCallback( + tag: String, + it: Map.Entry, + mogoLocation: MogoLocation, + sourceType: DataSourceType + ) { + // 记录最后一次回调时间 + M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills() + val listener = it.value + listener.onChassisLocationGCJ02(mogoLocation) + } + + } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationWGS84ListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationWGS84ListenerManager.kt index 20801f9171..ba14319910 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationWGS84ListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationWGS84ListenerManager.kt @@ -1,8 +1,10 @@ package com.mogo.eagle.core.function.call.autopilot +import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener import com.mogo.eagle.core.function.call.base.CallerBase -import mogo.telematics.pad.MessagePad +import com.mogo.eagle.core.utilcode.util.TimeUtils /** * @author xiaoyuzhou @@ -12,24 +14,74 @@ import mogo.telematics.pad.MessagePad object CallerChassisLocationWGS84ListenerManager : CallerBase() { @Volatile - private var gnssInfo: MessagePad.GnssInfo? = null + private var gnssInfo: MogoLocation? = null - fun getChassisLocationWGS84(): MessagePad.GnssInfo? { + fun getChassisLocationWGS84(): MogoLocation? { return gnssInfo } + /** + * 添加监听并指定回掉频率 + */ + fun addListener( + tag: String, + callBackHz: Int, + listener: IMoGoChassisLocationWGS84Listener + ) { + addListener(tag, listener) + setListenerHz(tag, callBackHz) + } + + /** * 车辆定位 WGS84 坐标系-高精度坐标系 数据 * @param gnssInfo */ @Synchronized - fun invokeChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) { + fun invokeChassisLocationWGS84(gnssInfo: MogoLocation,sourceType: DataSourceType) { this.gnssInfo = gnssInfo M_LISTENERS.forEach { val tag = it.key - val listener = it.value - listener.onChassisLocationWGS84(gnssInfo) + // 获取数据监听需要的HZ + val hz = M_LISTENERS_HZ[tag] + if (hz != null && hz > 0) { + val hzTime = (1.0 / hz.toDouble()) * 1000 + // 获取最后一次回调的时间 + val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag] + if (hzLastSendTime != null && hzLastSendTime > 0) { + // 计算是否进入下一次回调周期 + val nowTime = TimeUtils.getNowMills() + if (nowTime - hzLastSendTime > hzTime) { + syncLocationCallback(tag, it, gnssInfo, sourceType) + } + } else { + syncLocationCallback(tag, it, gnssInfo, sourceType) + } + } else { + syncLocationCallback(tag, it, gnssInfo, sourceType) + } } } + + /** + * 向订阅位置信息的发出定位信息 + * @param tag + * @param it + * @param gnssInfo + * @param sourceType 数据来源 + */ + private fun syncLocationCallback( + tag: String, + it: Map.Entry, + mogoLocation: MogoLocation, + sourceType: DataSourceType + ) { + // 记录最后一次回调时间 + M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills() + val listener = it.value + listener.onChassisLocationWGS84(mogoLocation) + } + + } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/base/CallerBase.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/base/CallerBase.kt index ae930fffdb..953afa08f7 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/base/CallerBase.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/base/CallerBase.kt @@ -30,12 +30,14 @@ open class CallerBase { /** * 设置对应监听,指定Hz频率 + * @param tag 订阅者标记 + * @param callBackHz 订阅者想要接受的回调的hz频率 */ - fun setListenerHz(tag: String, hz: Int) { + fun setListenerHz(tag: String, callBackHz: Int) { if (M_LISTENERS_HZ.containsKey(tag)) { return } - M_LISTENERS_HZ[tag] = hz + M_LISTENERS_HZ[tag] = callBackHz } /** diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt index 5e314cb6aa..afe7a33163 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerVisualAngleManager.kt @@ -24,7 +24,6 @@ import com.zhidaoauto.map.sdk.open.tools.MapTools import kotlinx.coroutines.* import kotlinx.coroutines.android.asCoroutineDispatcher import kotlinx.coroutines.internal.synchronized -import mogo.telematics.pad.MessagePad.GnssInfo import java.util.* import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit.SECONDS @@ -65,7 +64,7 @@ object CallerVisualAngleManager { val displayThreshold: Long //最大展示时长 > 0; 表示最长展示多长时间, -1 表示,一直展示,直到触发默认视角, 0: 默认视角专用值, } - private val triggerLocation = AtomicReference() + private val triggerLocation = AtomicReference() private val distanceOfCarToStopLine = AtomicReference(0.0) diff --git a/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/locationinfo/MogoLocationSource.java b/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/locationinfo/MogoLocationSource.java index d726507fe5..dbb851896b 100644 --- a/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/locationinfo/MogoLocationSource.java +++ b/foudations/mogo-aicloud-services-sdk/src/main/java/com/mogo/aicloud/services/locationinfo/MogoLocationSource.java @@ -9,7 +9,7 @@ public class MogoLocationSource extends LocationServiceProvider { @Override public float getBearing() { if (MogoLocationInfoServices.getInstance().getLocation() != null) { - return MogoLocationInfoServices.getInstance().getLocation().getBearing(); + return (float) MogoLocationInfoServices.getInstance().getLocation().getHeading(); } return 0; } @@ -33,7 +33,7 @@ public class MogoLocationSource extends LocationServiceProvider { @Override public float getSpeed() { if (MogoLocationInfoServices.getInstance().getLocation() != null) { - return MogoLocationInfoServices.getInstance().getLocation().getSpeed(); + return MogoLocationInfoServices.getInstance().getLocation().getGnssSpeed(); } return 0; } @@ -81,7 +81,7 @@ public class MogoLocationSource extends LocationServiceProvider { @Override public long getTime() { if (MogoLocationInfoServices.getInstance().getLocation() != null) { - return MogoLocationInfoServices.getInstance().getLocation().getTime(); + return MogoLocationInfoServices.getInstance().getLocation().getSatelliteTime(); } return 0; } diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/LocationUtils.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/LocationUtils.java index 27303ea247..54431f4680 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/LocationUtils.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/utils/LocationUtils.java @@ -27,7 +27,7 @@ public class LocationUtils { double carLat = carLocal.getLatitude(); double poiLon = pointLocal.getLon(); double poiLat = pointLocal.getLat(); - float carAngle = carLocal.getBearing(); + double carAngle = carLocal.getHeading(); // 计算车辆与点之间的夹角 int diffAngle = DrivingDirectionUtils.getDegreeOfCar2Poi( diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/location/IMoGoGDLocationListener.kt b/libraries/mogo-map-api/src/main/java/com/mogo/map/location/IMoGoGDLocationListener.kt new file mode 100644 index 0000000000..11f927755d --- /dev/null +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/location/IMoGoGDLocationListener.kt @@ -0,0 +1,15 @@ +package com.mogo.map.location + +import com.mogo.eagle.core.data.map.MogoLocation + +/** + * 高德定位位置监听 + */ +interface IMoGoGDLocationListener { + /** + * 位置信息 + * + * @param mogoLocation 位置信息 + */ + fun onLocationChanged(mogoLocation: MogoLocation) +} \ No newline at end of file diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java index f1a463ac75..6f84a09bb4 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/uicontroller/IMogoMapUIController.java @@ -10,6 +10,7 @@ import androidx.annotation.RawRes; import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.MogoLocation; import org.json.JSONObject; @@ -331,5 +332,5 @@ public interface IMogoMapUIController { * * @param gnssInfo RTK 高精坐标,车辆惯导数据 */ - void setExtraGPSData(MessagePad.GnssInfo gnssInfo); + void setExtraGPSData(MogoLocation gnssInfo); } diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java index 075f159e6f..0601c8a4c0 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java @@ -324,9 +324,6 @@ public class AMapViewWrapper implements IMogoMapView, CallerLogger.INSTANCE.d(M_MAP + TAG, "map onDestroy"); } -// if (mLocationTask != null) { -// mainHandler.removeCallbacks(mLocationTask); -// } } @Override @@ -1051,7 +1048,7 @@ public class AMapViewWrapper implements IMogoMapView, @Override - public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) { + public void setExtraGPSData(MogoLocation gnssInfo) { LocationClient locationClient = mMapView.getLocationClient(); if (locationClient != null) { locationClient.setIsUseExtraGPSData(true);//设置是否使用外界坐标 diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java index dbedbd0a54..c98a952f30 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapUIController.java @@ -7,6 +7,7 @@ import android.view.View; import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.uicontroller.CarCursorOption; import com.mogo.map.uicontroller.IMogoMapUIController; @@ -414,7 +415,7 @@ public class MogoMapUIController implements IMogoMapUIController { } @Override - public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) { + public void setExtraGPSData(MogoLocation gnssInfo) { initDelegate(); if (mDelegate != null) { mDelegate.setExtraGPSData(gnssInfo); diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapView.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapView.java index 36f6f29fe3..e41bb52765 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapView.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMapView.java @@ -9,6 +9,7 @@ import android.widget.FrameLayout; import androidx.annotation.Nullable; +import com.mogo.eagle.core.data.map.MogoLocation; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.zhidaoauto.map.sdk.open.view.MapAutoView; @@ -88,7 +89,7 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle { super.onLowMemory(); } - public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) { + public void setExtraGPSData(MogoLocation gnssInfo) { getMap().getUIController().setExtraGPSData(gnssInfo); } diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java b/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java index 5546642519..7181ca456e 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/uicontroller/AMapUIController.java @@ -8,6 +8,7 @@ import android.view.View; import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.data.map.MogoLatLng; +import com.mogo.eagle.core.data.map.MogoLocation; import com.zhidaoauto.map.sdk.open.MapAutoApi; import org.json.JSONObject; @@ -355,7 +356,7 @@ public class AMapUIController implements IMogoMapUIController { } @Override - public void setExtraGPSData(MessagePad.GnssInfo gnssInfo) { + public void setExtraGPSData(MogoLocation gnssInfo) { if (mClient != null) { mClient.setExtraGPSData(gnssInfo); } diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/utils/ObjectUtils.java b/libraries/mogo-map/src/main/java/com/mogo/map/utils/ObjectUtils.java index ede2675cb7..eeae86dd6b 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/utils/ObjectUtils.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/utils/ObjectUtils.java @@ -152,11 +152,11 @@ public class ObjectUtils { location.setLocType(0); } location.setSatellite(4); - location.setSpeed(aLocation.getSpeed()); + location.setGnssSpeed(aLocation.getSpeed()); location.setLatitude(aLocation.getLat()); location.setLongitude(aLocation.getLon()); location.setAltitude(aLocation.getAltitude()); - location.setBearing((float) aLocation.getHeading()); + location.setHeading((float) aLocation.getHeading()); location.setCityCode(aLocation.getCityCode()); location.setCityName(aLocation.getCity()); location.setProvider(aLocation.getProvider()); From 33c51b7ace37691612b5b850254ad0b3e9af5374 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Thu, 2 Feb 2023 19:32:28 +0800 Subject: [PATCH 04/32] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[?= =?UTF-8?q?=201=E3=80=81=E8=A7=A3=E5=86=B3=E5=90=88=E5=B9=B6=E5=86=B2?= =?UTF-8?q?=E7=AA=81=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../core/function/datacenter/location/README.md | 17 +++++++++++------ .../mogo/eagle/core/function/map/MapFragment.kt | 10 ---------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/README.md b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/README.md index 4ccbd205e0..6edf070634 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/README.md +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/README.md @@ -4,14 +4,19 @@ ```kotlin // 注册监听位置变换,唯一标记,要接受数据的HZ,回掉监听 -MoGoLocationManager.addListener(Companion.functionName, 20, object : IMoGoLocationListener { - override fun onLocationChanged( - gnssInfo: MessagePad.GnssInfo, - sourceType: DataSourceType - ) { +CallerChassisLocationWGS84ListenerManager.addListener(Companion.functionName, 20,object :IMoGoChassisLocationWGS84Listener{ + override fun onChassisLocationWGS84(gnssInfo: MogoLocation) { TODO("Not yet implemented") } }) // 设置数据回调频率,单位HZ,1HZ的周期是1秒;50HZ的周期是1/50=0.02秒;10HZ的周期是1/10=0.1秒。 -MoGoLocationManager.setListenerHz(Companion.functionName, 20) +CallerChassisLocationWGS84ListenerManager.setListenerHz(Companion.functionName, 20) + +// 注册监听位置变换,唯一标记,要接受数据的HZ,回掉监听 +CallerChassisLocationGCJ20ListenerManager.addListener(Companion.functionName, 20,object :IMoGoChassisLocationGCJ02Listener{ + override fun onChassisLocationGCJ02(gnssInfo: MogoLocation) { + TODO("Not yet implemented") + } +}) + ``` \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt index b1b6ae996b..09c70eda05 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt @@ -12,7 +12,6 @@ import com.mogo.eagle.core.data.map.CenterLine import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener -import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener import com.mogo.eagle.core.function.business.MapPointCloudSubscriber @@ -21,17 +20,10 @@ import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager -import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight import com.mogo.eagle.core.function.call.map.CallerHDMapManager import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager -import com.mogo.eagle.core.function.overview.InfStructureManager -import com.mogo.eagle.core.function.overview.InfStructureManager.savePlanningData -import com.mogo.eagle.core.function.overview.obtainViewModel -import com.mogo.eagle.core.function.overview.vm.OverViewModel -import com.mogo.eagle.core.function.datacenter.location.IMoGoLocationListener -import com.mogo.eagle.core.function.datacenter.location.MoGoLocationManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant @@ -42,7 +34,6 @@ import com.mogo.map.MogoMapView import com.mogo.map.uicontroller.IMogoMapUIController import com.zhidaoauto.map.sdk.open.MapAutoApi import com.zhidaoauto.map.sdk.open.business.PointCloudHelper -import mogo.telematics.pad.MessagePad /** * @author donghongyu @@ -56,7 +47,6 @@ class MapFragment : MvpFragment(), IMoGoMapFragmentProvider, IMoGoSkinModeChangeListener, IMoGoChassisLocationWGS84Listener, - IMoGoPlanningRottingListener, IMoGoChassisLamplightListener { private var mMogoMapView: MogoMapView? = null From 116c7a61bb66e5f20a49a8b30a968a14d75d0ec2 Mon Sep 17 00:00:00 2001 From: renwj Date: Thu, 2 Feb 2023 20:00:24 +0800 Subject: [PATCH 05/32] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/v2x/events/V2XEventManager.kt | 67 +------------------ .../events/consts/MoGoV2XServicePaths.java | 10 --- .../function/v2x/events/consts/V2XConst.java | 19 +----- .../function/v2x/events/utils/TrackUtils.java | 36 ---------- .../core/function/v2x/internal/V2XManager.kt | 30 ++++----- .../v2x/internal/data/V2XMarkerCardResult.kt | 11 +++ .../logger/{Logger.kt => V2XLogger.kt} | 2 +- .../socket/V2XMessageListener_401012.kt | 6 +- .../socket/V2XMessageListener_401018.kt | 6 +- .../socket/V2XMessageListener_402000.kt | 6 +- .../socket/V2XMessageListener_404000.kt | 6 +- .../socket/V2XMessageListener_503000.kt | 6 +- .../socket/V2XMessageListener_70001.kt | 6 +- 13 files changed, 47 insertions(+), 164 deletions(-) delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java rename core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/{Logger.kt => V2XLogger.kt} (95%) diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index 7d78ee2a3f..427097955b 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -130,13 +130,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, private fun registerListener() { V2XManager.addCallback(this) CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this) - mogoMarkersHandler.registerMarkerClickListener(CARD_TYPE_ROAD_CONDITION, - object : IMogoMarkerClickListener { - override fun onMarkerClicked(marker: IMogoMarker?): Boolean { - handleRoadConditionMarkerClick(marker) - return super.onMarkerClicked(marker) - } - }) } private fun unRegisterListener() { @@ -145,64 +138,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, mogoMarkersHandler.unregisterMarkerClickListener(CARD_TYPE_ROAD_CONDITION) } - private fun handleRoadConditionMarkerClick(marker: IMogoMarker?) { - //点击的marker的具体数据 - val exploreWay = extractFromMarker(marker) - exploreWay?.let { - val item = it.items[0] - val path = item.url - if (path.contains(".mp4")) { - initVideo() - } - - val roadEventEntity = V2XRoadEventEntity() - roadEventEntity.noveltyInfo = exploreWay - roadEventEntity.poiType = it.poiType - roadEventEntity.expireTime = 20000 //地理位置 - //地理位置 - val location = it.location - roadEventEntity.location = location - - val v2XMessageEntity: V2XMessageEntity = - V2XMessageEntity() - v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING - v2XMessageEntity.isShowState = true - v2XMessageEntity.isOnlyShow = true - v2XMessageEntity.isNeedAddLine = false - v2XMessageEntity.content = roadEventEntity - val intent = Intent(BROADCAST_SCENE_HANDLER_ACTION) - intent.putExtra(BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) - LocalBroadcastManager.getInstance(context()).sendBroadcast(intent) - //埋点 - TrackUtils.trackV2XMarkerClick(2) - } - } - - private fun initVideo() { - PlayerFactory.setPlayManager(IjkPlayerManager::class.java) - CacheFactory.setCacheManager(ProxyCacheManager::class.java) - val list = mutableListOf() - list.add(VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "enable-accurate-seek", 1)) - list.add(VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "videotoolbox", 0)) - GSYVideoManager.instance().optionModelList = list - GSYVideoType.enableMediaCodec() - GSYVideoType.enableMediaCodecTexture() - } - - private fun extractFromMarker(marker: IMogoMarker?): MarkerExploreWay? { - if (marker == null) { - return null - } - if (marker.getObject() is MarkerShowEntity) { - val showEntity = marker.getObject() as MarkerShowEntity - if (showEntity.bindObj is MarkerExploreWay) { - return showEntity.bindObj as MarkerExploreWay - } - } - return null - } - - override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) { + override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) { val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return BridgeApi.location.set(location) if (V2XManager.hasInit()) { @@ -229,7 +165,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, "$M_V2X$TAG", "--- trigger show ---:poiType:" + v2XRoadEventEntity.poiType ) - TrackUtils.trackV2xRoadProduceEvent(1) val v2XMessageEntity = V2XMessageEntity() v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING v2XMessageEntity.content = v2XRoadEventEntity diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/MoGoV2XServicePaths.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/MoGoV2XServicePaths.java index fc6b4757c6..cccd481291 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/MoGoV2XServicePaths.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/MoGoV2XServicePaths.java @@ -13,11 +13,6 @@ import androidx.annotation.Keep; */ @Keep public class MoGoV2XServicePaths { - /** - * V2X 状态管理 - */ - @Keep - public static final String PATH_V2X_STATUS_MANAGER = "/v2xStatusManager/api"; /** * V2X 道路事件POI点 @@ -25,11 +20,6 @@ public class MoGoV2XServicePaths { @Keep public static final String PATH_V2X_MARKER_MANAGER = "/v2xMarkerManager/api"; - /** - * V2X 道路事件与车辆的连接线 - */ - @Keep - public static final String PATH_V2X_POLYLINE_MANAGER = "/v2xPolylineManager/api"; /** * V2X 道路事件与车辆的连接线 diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/V2XConst.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/V2XConst.java index 5cee64e8ef..bcc9d0ecf7 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/V2XConst.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/consts/V2XConst.java @@ -9,10 +9,6 @@ package com.mogo.eagle.core.function.v2x.events.consts; */ public class V2XConst { - /** - * V2X面板名称 - */ - public static final String MODULE_NAME = "V2X_UI"; /** * V2X 场景广播 Action @@ -28,23 +24,10 @@ public class V2XConst { public static final String BROADCAST_SCENE_ACTION = "com.v2x.scene_local_broadcast"; - /** - * V2X 埋点 - */ - public static final String V2X_ROAD_SHOW = "v2x_road_show"; public static final String V2X_ROAD_PRODUCE = "v2x_road_produce"; + public static final String LAUNCHER_ICON_CLICK = "Launcher_Icon_Click"; - /** - * V2X 地图上发出警告的POI - */ - public static final String V2X_EVENT_ALARM_POI = "V2X_EVENT_ALARM_POI"; - - /* - *V2X 车路云前方预警-识别物 - * */ - public static final String V2X_FRONT_WARNING_MARKER = "V2X_FRONT_WARNING_MARKER"; - /** * V2X预警日志tag */ diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java deleted file mode 100644 index 7d7f1a2244..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/TrackUtils.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.utils; - -import com.mogo.commons.analytics.AnalyticsUtils; -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; -import java.util.HashMap; -import java.util.Map; - -/** - * 统计埋点工具 - */ -public class TrackUtils { - /** - * @param type type=1 短距离角度匹配 - * type=2 历史轨迹匹配 - */ - public static void trackV2xRoadProduceEvent(int type) { - try { - Map properties = new HashMap<>(); - properties.put("type", type); - AnalyticsUtils.track(V2XConst.V2X_ROAD_PRODUCE, properties); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void trackV2XMarkerClick(int type) { - try { - Map properties = new HashMap<>(); - properties.put("type", type); - AnalyticsUtils.track(V2XConst.LAUNCHER_ICON_CLICK, properties); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/V2XManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/V2XManager.kt index 8622fd1f21..d40195909f 100755 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/V2XManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/V2XManager.kt @@ -10,7 +10,7 @@ import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerResponse import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent import com.mogo.eagle.core.function.v2x.internal.http.V2XRefreshModel import com.mogo.eagle.core.function.v2x.internal.http.callback.IV2XRefreshCallback -import com.mogo.eagle.core.function.v2x.internal.logger.Logger +import com.mogo.eagle.core.function.v2x.internal.logger.V2XLogger import com.mogo.eagle.core.function.v2x.internal.socket.* import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_401012 import com.mogo.eagle.core.function.v2x.internal.socket.V2XMessageListener_401018 @@ -86,12 +86,12 @@ object V2XManager { * @param config 相关配置类 */ fun init(config: V2XConfig) { - Logger.d(TAG, "-- init --") + V2XLogger.d(TAG, "-- init --") if (V2XManager.config.get() != null) { throw IllegalStateException("V2XManager has been initialized, don't initialize repeatably.") } V2XManager.config.set(config) - Logger.loggable = config.loggable + V2XLogger.loggable = config.loggable } /** @@ -104,28 +104,28 @@ object V2XManager { * 3.短链[V2XRefreshModel.querySnapshot]定时轮循,轮循时长取[V2XConfig.durationForTriggerRefresh] */ fun start() { - Logger.d(TAG, "-- start --") + V2XLogger.d(TAG, "-- start --") val config = config.get() ?: throw IllegalStateException("V2XManager has not been initialized, please invoke V2XManager#init(config: X2XConfig) firstly.") if (started.get()) { - Logger.d(TAG, "-- has been started --") + V2XLogger.d(TAG, "-- has been started --") return } if (config.aiCloudConfig.sn?.isBlank() == true) { - Logger.e(TAG, "sn is null or blank, please ensure sn exists and then invoke V2XManager#start() again.") + V2XLogger.e(TAG, "sn is null or blank, please ensure sn exists and then invoke V2XManager#start() again.") cbs.forEach { it.onFail("sn is null or blank, please ensure sn exists and then invoke V2XManager#start() again.") } return } if (config.aiCloudConfig.token?.isBlank() == true) { - Logger.e(TAG, "token is null or blank, please ensure token exists and then invoke V2Manager#start() again.") + V2XLogger.e(TAG, "token is null or blank, please ensure token exists and then invoke V2Manager#start() again.") cbs.forEach { it.onFail("token is null or blank, please ensure token exists and then invoke V2Manager#start() again.") } return } if (started.compareAndSet(false, true)) { - Logger.d(TAG, "-- start real --") + V2XLogger.d(TAG, "-- start real --") SocketManager.getInstance().init(config.context,0.0,0.0) SocketManager.getInstance().registerOnMessageListener(401012, V2XMessageListener_401012(cbs)) SocketManager.getInstance().registerOnMessageListener(401018, V2XMessageListener_401018(cbs)) @@ -160,12 +160,12 @@ object V2XManager { * 3. 取消短链定时轮循任务 */ fun stop() { - Logger.d(TAG, "-- stop --") + V2XLogger.d(TAG, "-- stop --") if (config.get() == null) { throw IllegalStateException("V2XManager has not been initialized, please invoke V2XManager#init(config: X2XConfig) firstly.") } if (started.compareAndSet(true, false)) { - Logger.d(TAG, "-- stop real --") + V2XLogger.d(TAG, "-- stop real --") SocketManager.getInstance().release() handler.removeCallbacks(refreshTask) lastLatitude.set(0.0) @@ -178,7 +178,7 @@ object V2XManager { * @param cb 要添加的回调接口 */ fun addCallback(cb: IV2XCallback) { - Logger.d(TAG, "-- addCallback --") + V2XLogger.d(TAG, "-- addCallback --") if (cbs.contains(cb)) { return } @@ -190,7 +190,7 @@ object V2XManager { * @param cb 要移除的回调接口 */ fun removeCallback(cb: IV2XCallback) { - Logger.d(TAG, "-- removeCallback --") + V2XLogger.d(TAG, "-- removeCallback --") if (!cbs.contains(cb)) { return } @@ -209,7 +209,7 @@ object V2XManager { if (!started.get()) { return } - Logger.d(TAG, "--- onLocationChanged --[longitude: $longitude, latitude: $latitude]") + V2XLogger.d(TAG, "--- onLocationChanged --[longitude: $longitude, latitude: $latitude]") realLongitude.set(longitude) realLatitude.set(latitude) val oldLon = lastLongitude.get() @@ -217,14 +217,14 @@ object V2XManager { var update = false try { if (oldLon == 0.0 || oldLat == 0.0) { - Logger.d(TAG, "--- onLocationChanged -- first --[longitude: $longitude, latitude: $latitude]") + V2XLogger.d(TAG, "--- onLocationChanged -- first --[longitude: $longitude, latitude: $latitude]") handler.removeCallbacks(refreshTask) handler.post(refreshTask) update = true return } if (DistanceUtils.calculateLineDistance(oldLon, oldLat, longitude, latitude) >= config.get().distanceForTriggerRefresh) { - Logger.d(TAG, "--- onLocationChanged -- trigger --[longitude: $longitude, latitude: $latitude]") + V2XLogger.d(TAG, "--- onLocationChanged -- trigger --[longitude: $longitude, latitude: $latitude]") handler.removeCallbacks(refreshTask) handler.post(refreshTask) update = true diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt index 48bd6a55e4..db6a6b5754 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt @@ -436,6 +436,17 @@ class V2XMarkerExploreWay: Serializable { var coordinateType: Int? = null + /** + * polygon字段,用来表示事件围栏 + */ + var polygon: List? = null + + + /** + * 事件的高精坐标 + */ + var gpsLocation: V2XLocation? = null + override fun toString(): String { return "V2XMarkerExploreWay(infoId=$infoId, type=$type, poiType=$poiType, sn=$sn, location=$location, direction=$direction, canLive=$canLive, fileType=$fileType, addr=$addr, generateTime=$generateTime, cityName=$cityName, distance=$distance, userInfo=$userInfo, items=$items, uploadType=$uploadType, isFabulous=$isFabulous, infoCheckNode=$infoCheckNode, coordinateType=$coordinateType)" } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/Logger.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/V2XLogger.kt similarity index 95% rename from core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/Logger.kt rename to core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/V2XLogger.kt index c230c13abf..58463eb45c 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/Logger.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/logger/V2XLogger.kt @@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.v2x.internal.logger import android.util.Log -internal object Logger { +internal object V2XLogger { var loggable: Boolean = false diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401012.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401012.kt index 94fa71b532..23ca38f148 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401012.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401012.kt @@ -5,7 +5,7 @@ import com.mogo.eagle.core.function.v2x.internal.V2XManager import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent -import com.mogo.eagle.core.function.v2x.internal.logger.Logger +import com.mogo.eagle.core.function.v2x.internal.logger.V2XLogger internal class V2XMessageListener_401012(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { @@ -16,10 +16,10 @@ internal class V2XMessageListener_401012(val cbs: Iterable?): IMog return } if (data == null) { - Logger.i(V2XManager.TAG, "V2XMessageListener_401012:message is null!") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_401012:message is null!") return } - Logger.i(V2XManager.TAG, "V2XMessageListener_401012:$data") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_401012:$data") cbs?.forEach { it.onAck(V2XEvent.Road(data = data)) } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401018.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401018.kt index b9f8c8747d..a7cf8e8933 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401018.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_401018.kt @@ -5,7 +5,7 @@ import com.mogo.eagle.core.function.v2x.internal.V2XManager import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget -import com.mogo.eagle.core.function.v2x.internal.logger.Logger +import com.mogo.eagle.core.function.v2x.internal.logger.V2XLogger internal class V2XMessageListener_401018(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { @@ -16,10 +16,10 @@ internal class V2XMessageListener_401018(val cbs: Iterable?): IMog return } if (data == null) { - Logger.i(V2XManager.TAG, "V2XMessageListener_401018:message is null!") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_401018:message is null!") return } - Logger.i(V2XManager.TAG, "V2XMessageListener_401018:$data") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_401018:$data") cbs?.forEach { it.onAck(V2XEvent.Warning(data = data)) } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_402000.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_402000.kt index c968eb1e5a..e5b94036de 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_402000.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_402000.kt @@ -5,7 +5,7 @@ import com.mogo.eagle.core.function.v2x.internal.V2XManager import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback import com.mogo.eagle.core.function.v2x.internal.data.V2XOptimalRoute import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent -import com.mogo.eagle.core.function.v2x.internal.logger.Logger +import com.mogo.eagle.core.function.v2x.internal.logger.V2XLogger internal class V2XMessageListener_402000(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { @@ -16,10 +16,10 @@ internal class V2XMessageListener_402000(val cbs: Iterable?): IMog return } if (data == null) { - Logger.i(V2XManager.TAG, "V2XMessageListener_402000:message is null!") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_402000:message is null!") return } - Logger.i(V2XManager.TAG, "V2XMessageListener_402000:$data") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_402000:$data") cbs?.forEach { it.onAck(V2XEvent.OptimalRoute(data = data)) } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_404000.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_404000.kt index 4d9c046429..c8b402cedd 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_404000.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_404000.kt @@ -5,7 +5,7 @@ import com.mogo.eagle.core.function.v2x.internal.V2XManager import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback import com.mogo.eagle.core.function.v2x.internal.data.V2XAdvanceWarning import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent -import com.mogo.eagle.core.function.v2x.internal.logger.Logger +import com.mogo.eagle.core.function.v2x.internal.logger.V2XLogger internal class V2XMessageListener_404000(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { @@ -16,10 +16,10 @@ internal class V2XMessageListener_404000(val cbs: Iterable?): IMog return } if (data == null) { - Logger.i(V2XManager.TAG, "V2XMessageListener_404000:message is null!") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_404000:message is null!") return } - Logger.i(V2XManager.TAG, "V2XMessageListener_404000:$data") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_404000:$data") cbs?.forEach { it.onAck(V2XEvent.ForwardsWarning(data = data)) } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_503000.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_503000.kt index cbfeca79df..dbfc7f7ff4 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_503000.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_503000.kt @@ -4,7 +4,7 @@ import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener import com.mogo.eagle.core.function.v2x.internal.V2XManager import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent.RoadAI -import com.mogo.eagle.core.function.v2x.internal.logger.Logger +import com.mogo.eagle.core.function.v2x.internal.logger.V2XLogger import roadwork.Road.RW_PB internal class V2XMessageListener_503000(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { @@ -16,10 +16,10 @@ internal class V2XMessageListener_503000(val cbs: Iterable?): IMog return } if (data == null) { - Logger.i(V2XManager.TAG, "V2XMessageListener_503000:message is null!") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_503000:message is null!") return } - Logger.i(V2XManager.TAG, "V2XMessageListener_503000:$data") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_503000:$data") cbs?.forEach { it.onAck(RoadAI(data = data)) } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_70001.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_70001.kt index cb1b9be044..320b6529d4 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_70001.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/socket/V2XMessageListener_70001.kt @@ -5,7 +5,7 @@ import com.mogo.eagle.core.function.v2x.internal.V2XManager import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback import com.mogo.eagle.core.function.v2x.internal.data.V2XRoadXData import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent -import com.mogo.eagle.core.function.v2x.internal.logger.Logger +import com.mogo.eagle.core.function.v2x.internal.logger.V2XLogger internal class V2XMessageListener_70001(val cbs: Iterable?): IMogoCloudSocketOnMessageListener { @@ -16,10 +16,10 @@ internal class V2XMessageListener_70001(val cbs: Iterable?): IMogo return } if (data == null) { - Logger.i(V2XManager.TAG, "V2XMessageListener_70001:message is null!") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_70001:message is null!") return } - Logger.i(V2XManager.TAG, "V2XMessageListener_70001:$data") + V2XLogger.i(V2XManager.TAG, "V2XMessageListener_70001:$data") cbs?.forEach { it.onAck(V2XEvent.RoadEventX(data = data)) } From d032e77f6e8ccaa7e0a0267677eecf6dc9c7b29b Mon Sep 17 00:00:00 2001 From: yangyakun Date: Thu, 2 Feb 2023 20:56:17 +0800 Subject: [PATCH 06/32] =?UTF-8?q?dev=5Farch=5Fopt=5F3.0]=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=94=BE=E5=85=A5=E4=B8=9A=E5=8A=A1=E7=B1=BB?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../och/taxi/passenger/ui/OverviewFragment.kt | 66 +++++++++++++++++++ .../ui/TaxiPassengerBaseFragment.java | 49 +++++++++++++- .../main/res/layout/taxi_p_base_fragment.xml | 17 +++-- app/src/main/AndroidManifest.xml | 4 +- 4 files changed, 125 insertions(+), 11 deletions(-) create mode 100644 OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/OverviewFragment.kt diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/OverviewFragment.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/OverviewFragment.kt new file mode 100644 index 0000000000..5ed383fa6e --- /dev/null +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/OverviewFragment.kt @@ -0,0 +1,66 @@ +package com.mogo.och.taxi.passenger.ui + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.mogo.commons.mvp.BaseFragment +import com.mogo.eagle.core.function.overview.view.OverMapView + +class OverviewFragment : BaseFragment() { + + private var overmapview:OverMapView?=null + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + if (overmapview == null) { + overmapview = OverMapView(requireContext()) + } else { + val viewGroup = overmapview?.parent as ViewGroup + viewGroup.removeView(overmapview) + } + overmapview?.onCreateView(savedInstanceState) + return overmapview!! + } + + override fun onResume() { + super.onResume() + overmapview?.onResume() + } + + override fun onPause() { + super.onPause() + overmapview?.onPause() + } + + override fun onDestroy() { + super.onDestroy() + overmapview?.onDestroy() + } + + override fun getLayoutId(): Int { + return 0 + } + + override fun getTagName(): String { + return TAG + } + + override fun initViews() { + + } + + companion object{ + private const val TAG = "OverviewFragment" + @JvmStatic + fun newInstance(): OverviewFragment { + val args = Bundle() + val fragment = OverviewFragment() + fragment.arguments = args + return fragment + } + } +} \ No newline at end of file diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java index f30fa8d8c3..9ac0743124 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerBaseFragment.java @@ -61,6 +61,8 @@ public class TaxiPassengerBaseFragment extends MvpFragment mArrivedCheckView; private WeakReference mStartAutopilotView; protected TaxiPassengerServingOrderFragment ochServingOrderFragment = null; + + protected OverviewFragment overviewFragment = null; //消息盒子 private PassengerMsgBoxButtonView viewPassengerMsgBoxButton; private PassengerMsgBoxBubbleView viewPassengerMsgBoxBubble; @@ -149,6 +151,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment { + OverlayLeftViewUtils.INSTANCE.showOverlayView(getActivity(),0,true,-1,true); + //showOrHideArrivedEndLayout(true, "北京北京北京", "1527481606997577728"); + //showOrHidePressengerCheckPager(true, "开始站点开", "开始站点开始站点开始", "2", "京A888888", "18811539480"); + //OCHFloatWindowManager.getInstance().ShowFloatWindow(getContext()); + }); } private void initArrivedView() { @@ -258,10 +266,12 @@ public class TaxiPassengerBaseFragment extends MvpFragment + android:layout_height="match_parent"> @@ -21,7 +20,7 @@ android:layout_height="@dimen/module_mogo_och_operation_status_bg_height" android:layout_gravity="center_horizontal" android:layout_marginLeft="40dp" - android:layout_marginTop="48dp" + android:layout_marginTop="@dimen/dp_120" android:scaleType="fitXY" android:src="@drawable/taxi_p_un_auto_nor" android:visibility="gone" @@ -96,6 +95,7 @@ android:id="@+id/btnAutopilotDisable" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="@dimen/dp_72" android:text="模拟 不可自动驾驶" android:textSize="20sp" android:visibility="gone" @@ -154,7 +154,7 @@ android:id="@+id/module_mogo_och_navi_panel_container" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/dp_120" + android:layout_marginTop="@dimen/dp_192" android:layout_marginRight="@dimen/dp_10" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -163,10 +163,15 @@ android:id="@+id/traffic_light_view" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/taxi_p_traffic_light_layout_margin_top" + android:layout_marginTop="@dimen/dp_95" android:layout_marginRight="@dimen/taxi_p_traffic_light_layout_margin_right" android:visibility="gone" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ed485f3a03..86e6613133 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -20,10 +20,10 @@ tools:replace="android:label"> + android:value="2560"/> + android:value="1600"/> From 40e9fdb7080e9037bd07e7794a6924d180ebc765 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Thu, 2 Feb 2023 20:37:41 +0800 Subject: [PATCH 07/32] [2.13.0-arch-opt] merge --- .../main/res/layout/bus_p_base_fragment.xml | 2 +- .../src/main/res/layout/bus_base_fragment.xml | 4 +- .../main/res/layout/och_noop_fragment_hmi.xml | 8 +- .../main/res/layout/sweeper_base_fragment.xml | 4 +- .../main/res/layout/taxi_p_base_fragment.xml | 2 +- .../main/res/layout/taxi_base_fragment.xml | 4 +- .../redlightwarning/RedLightWarningManager.kt | 12 +- .../function/biz/v2x/vip/VipCarManager.kt | 23 +- .../datacenter/obu/MogoObuDcCombineManager.kt | 138 +++++--- .../obu/MogoPrivateObuNewManager.kt | 45 +-- .../binding/BindingCarNetWorkManager.kt | 8 +- .../src/main/AndroidManifest.xml | 8 - .../receiver/BindingcarBroadcastReceiver.kt | 8 +- .../receiver/TurnLightBroadcastReceiver.kt | 41 --- .../receiver/V2XWarningBroadcastReceiver.kt | 6 +- .../core/function/hmi/ui/MoGoHmiFragment.kt | 301 ++---------------- .../DispatchAirportDialog.java | 2 +- .../DispatchBaseDialog.java | 2 +- .../DispatchCarsDialog.java | 2 +- .../DispatchDialogManager.java | 2 +- .../ModifyBindingCarDialog.kt | 2 +- .../ToBindingCarDialog.kt | 2 +- .../{bindingcar => tools}/UpgradeAppDialog.kt | 2 +- .../{turnlight => vehicle}/BrakeViewStatus.kt | 5 +- .../hmi/ui/{pnc => vehicle}/PncActionsView.kt | 2 +- .../hmi/ui/vehicle/SteeringBrakeView.kt | 99 ++++++ .../ui/{takeover => vehicle}/TakeOverView.kt | 7 +- .../TurnLightViewStatus.kt | 98 ++---- .../function/hmi/ui/widget/V2XWarningView.kt | 43 ++- .../src/main/res/layout/fragment_hmi.xml | 27 -- .../res/layout/module_main_activity_main.xml | 5 +- .../main/res/layout/view_steering_brake.xml | 31 ++ .../src/main/res/values/attr.xml | 4 + .../src/main/res/values/styles.xml | 1 - .../eagle/core/function/map/MapBizView.kt | 39 ++- .../eagle/core/function/map/MapFragment.kt | 89 ++---- .../function/v2x/events/V2XEventManager.kt | 5 +- .../scene/road/V2XRoadEventScenario.java | 17 +- .../warning/V2XFrontWarningScenario.java | 2 +- .../api/hmi/warning/IMoGoHmiProvider.kt | 25 +- .../CallerAutoPilotControlManager.kt | 1 + .../CallerChassisLamplightListenerManager.kt | 27 +- .../function/call/hmi/CallerHmiManager.kt | 38 +-- gradle.properties | 2 +- 44 files changed, 455 insertions(+), 740 deletions(-) delete mode 100644 core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/TurnLightBroadcastReceiver.kt rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{dispatch => notice}/DispatchAirportDialog.java (97%) rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{dispatch => notice}/DispatchBaseDialog.java (95%) rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{dispatch => notice}/DispatchCarsDialog.java (97%) rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{dispatch => notice}/DispatchDialogManager.java (98%) rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{bindingcar => tools}/ModifyBindingCarDialog.kt (98%) rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{bindingcar => tools}/ToBindingCarDialog.kt (98%) rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{bindingcar => tools}/UpgradeAppDialog.kt (98%) rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{turnlight => vehicle}/BrakeViewStatus.kt (93%) rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{pnc => vehicle}/PncActionsView.kt (98%) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{takeover => vehicle}/TakeOverView.kt (93%) rename core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/{turnlight => vehicle}/TurnLightViewStatus.kt (65%) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_steering_brake.xml diff --git a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml index 95eaa395d2..ebfb0e785e 100644 --- a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml +++ b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml @@ -27,7 +27,7 @@ app:layout_constraintTop_toTopOf="parent"/> - - - - - - - - - - - - , IMoGoTrafficLightListe showWarning( EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType, EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.content, - EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts, - EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts ) } else { showWarning( EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType, EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.content, - EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts, - EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType + EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts ) } return@turnLightToGreen @@ -230,8 +228,7 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe showWarning( EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType, EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试", - EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts, - EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts ) return@turnLightToGreen } @@ -251,8 +248,7 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe showWarning( EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType, EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + time, - EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts, - EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType + EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts ) } else { CallerLogger.d( @@ -272,7 +268,6 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe v2xType: String, alertContent: CharSequence, ttsContent: String, - tag: String ) { if (alertContent.toString().isEmpty() || ttsContent.isEmpty()) { Log.d("MsgBox-VipCarManager", "alertContent或ttsContent为空!") @@ -280,15 +275,7 @@ class VipCarManager : IMogoOnMessageListener, IMoGoTrafficLightListe CallerMsgBoxManager.saveMsgBox( MsgBoxBean(MsgBoxType.V2X, V2XMsg(v2xType, alertContent.toString(), ttsContent)) ) - CallerHmiManager.warningV2X( - v2xType, alertContent, ttsContent, tag, - object : IMoGoWarningStatusListener { - override fun onShow() {} - override fun onDismiss() {} - }, - true, - 5000L - ) + CallerHmiManager.warningV2X(v2xType, alertContent, ttsContent) } fun destroy() { diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt index 50623760c5..ac8b07b2ff 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt @@ -2,10 +2,10 @@ package com.mogo.eagle.core.function.datacenter.obu import android.content.Context import com.mogo.eagle.core.data.config.HmiBuildConfig -import com.mogo.eagle.core.data.enums.EventTypeEnumNew -import com.mogo.eagle.core.data.enums.WarningDirectionEnum import com.mogo.eagle.core.data.enums.DataSourceType +import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.enums.TrafficLightEnum +import com.mogo.eagle.core.data.enums.WarningDirectionEnum import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.V2XMsg @@ -98,7 +98,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener val status = rsiWarningData.status val level = rsiWarningData.warningMsgList[0].warningLevel val direction = getMessageDirection(rsiWarningData.warningMsgList[0].targetPosition) - CallerLogger.d("${M_OBU}${TAG}", + CallerLogger.d( + "${M_OBU}${TAG}", "MogoObuDcCombineManager onMogoObuDcRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${rsiWarningData.warningMsgList[0].eventSerialNum} ---signSerialNum = ${rsiWarningData.warningMsgList[0].signSerialNum} --- direction = $direction -- targetPosition = ${rsiWarningData.warningMsgList[0].targetPosition}" ) @@ -277,15 +278,12 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener appId, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 object : IMoGoWarningStatusListener { override fun onDismiss() { // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL) } - }, - true, - 5000L + } ) // 更新数据,是否需要 @@ -302,8 +300,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener MogoObuConstants.STATUS.DELETE -> { // 关闭警告红边 // CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) - // 移除顶部弹窗 - CallerHmiManager.disableWarningV2X((appId + direction.direction)) // 更新数据,删除标牌? // TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData) // ?.let { @@ -351,7 +347,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener level = rsmWarningData.warningMsg.warningDataList[0].warningLevel CallerLogger.d( "${M_OBU}${TAG}", - "MogoObuDcCombineManager onMogoObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${rsmWarningData.warningMsg.warningDataList.get(0).status} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent" + "MogoObuDcCombineManager onMogoObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${ + rsmWarningData.warningMsg.warningDataList.get( + 0 + ).status + } --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent" ) when (rsmWarningData.warningMsg.warningDataList.get(0).status) { @@ -374,17 +374,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener v2xType, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 object : IMoGoWarningStatusListener { override fun onDismiss() { // 关闭警告红边 - CallerHmiManager.showWarning( - WarningDirectionEnum.ALERT_WARNING_NON + CallerHmiManager.dismissWarning( + WarningDirectionEnum.ALERT_WARNING_ALL ) } - }, - true, - 5000L + } ) // 更新数据 TODO @@ -426,7 +423,10 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener * 红绿灯预警信息 */ fun onMogoObuDcSpatWarning(spatWarningData: SpatWarningData?) { - CallerLogger.d("${M_OBU}${TAG}", "onMogoObuDcSpatWarning warningType = ${spatWarningData!!.warningType} --status = ${spatWarningData?.status} --lightsList = ${spatWarningData.lightsList}") + CallerLogger.d( + "${M_OBU}${TAG}", + "onMogoObuDcSpatWarning warningType = ${spatWarningData!!.warningType} --status = ${spatWarningData?.status} --lightsList = ${spatWarningData.lightsList}" + ) handlerTrafficLight( spatWarningData!!.warningType, spatWarningData?.status, @@ -438,22 +438,36 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener * 地图匹配 是OBU算法输出地图匹配结果,主车匹配道路哪条路或者哪条车道 */ fun onMogoObuMapMath(data: MapMatchData?) { - CallerLogger.d("${M_OBU}${TAG}", "MogoObuDcCombineManager onMogoObuMapMath HmiBuildConfig.isShowObuLimitSpeedView = " + HmiBuildConfig.isShowObuLimitSpeedView) - if(HmiBuildConfig.isShowObuLimitSpeedView) { + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager onMogoObuMapMath HmiBuildConfig.isShowObuLimitSpeedView = " + HmiBuildConfig.isShowObuLimitSpeedView + ) + if (HmiBuildConfig.isShowObuLimitSpeedView) { if (data != null) { - CallerLogger.d("${M_OBU}${TAG}", - "MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*0.02*3.6))} --- data.speedMaxLimit = ${data.speedMaxLimit}") + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${ + Math.round( + (data.speedMaxLimit * 0.02 * 3.6) + ) + } --- data.speedMaxLimit = ${data.speedMaxLimit}" + ) when (data.status) { MogoObuConstants.STATUS.ADD -> { // 添加 TODO CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange( - (data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),DataSourceType.OBU) + (data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(), + DataSourceType.OBU + ) } MogoObuConstants.STATUS.UPDATE -> { // 更新 } MogoObuConstants.STATUS.DELETE -> { // 删除 - CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1 ,DataSourceType.OBU) + CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange( + -1, + DataSourceType.OBU + ) } } } @@ -496,7 +510,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener /** * 处理红绿灯 */ - private fun handlerTrafficLight(appId: Int, status: Int, lights: List) { + private fun handlerTrafficLight( + appId: Int, + status: Int, + lights: List + ) { CallerLogger.d( "${M_OBU}${TAG}", "MogoObuDcCombineManager handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId" @@ -514,7 +532,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener MogoObuConstants.STATUS.DELETE -> { // 移除顶部弹窗,当收不到信号的时候触发一次 CallerTrafficLightListenerManager.disableTrafficLight() - CallerHmiManager.disableWarningV2X(appId.toString()) isShowGreenWave = false isShowRunRedLight = false } @@ -551,10 +568,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener 1 -> { //闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 if (!isShowRunRedLight) { isShowRunRedLight = true - CallerHmiManager.disableWarningV2X(1667.toString()) - ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) - alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) - CallerLogger.d("${M_OBU}${TAG}","MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent ") + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent " + ) CallerMsgBoxManager.saveMsgBox( MsgBoxBean( MsgBoxType.V2X, @@ -569,22 +590,32 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener ) CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, null, true, 5000L) + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 + ) } } 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 if (!isShowGreenWave) { isShowGreenWave = true - CallerHmiManager.disableWarningV2X(1666.toString()) CallerLogger.d( "${M_OBU}${TAG}", - "MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}") + "MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}" + ) val adviceSpeed = - "${Math.round(currentLight.suggestMinSpeed*3.6*0.02)} - ${Math.round(currentLight.suggestMaxSpeed*3.6*0.02)}" + "${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${ + Math.round( + currentLight.suggestMaxSpeed * 3.6 * 0.02 + ) + }" val adviceSpeedTts = - "${Math.round(currentLight.suggestMinSpeed*3.6*0.02)} - ${Math.round(currentLight.suggestMaxSpeed*3.6*0.02)}" + "${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${ + Math.round( + currentLight.suggestMaxSpeed * 3.6 * 0.02 + ) + }" ttsContent = String.format( @@ -596,7 +627,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), adviceSpeed ) - val maxSpeed = currentLight.suggestMaxSpeed*3.6 + val maxSpeed = currentLight.suggestMaxSpeed * 3.6 if (maxSpeed > 0) { CallerMsgBoxManager.saveMsgBox( MsgBoxBean( @@ -614,11 +645,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener CallerHmiManager.warningV2X( EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - appId.toString(), - null, - true, - 5000L + ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 ) } } @@ -628,37 +655,46 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener when (currentLight.light) { // 灯光不可用 0 -> { - CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.BLACK, DataSourceType.TELEMATIC) + CallerTrafficLightListenerManager.showTrafficLight( + TrafficLightEnum.BLACK, + DataSourceType.TELEMATIC + ) } // 红灯 - 2, 3 -> { + 2, 3 -> { //todo 小鹏 if (!isRedLight) { - CallerHmiManager.disableWarningV2X(appId.toString()) isRedLight = true } isGreenLight = false - CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.RED, DataSourceType.TELEMATIC) + CallerTrafficLightListenerManager.showTrafficLight( + TrafficLightEnum.RED, + DataSourceType.TELEMATIC + ) val red = currentLight.countDown / 10 CallerTrafficLightListenerManager.changeCountdownRed(red) } // 绿灯 - 4, 5, 6 -> { + 4, 5, 6 -> { //todo 小鹏 if (!isGreenLight) { - CallerHmiManager.disableWarningV2X(appId.toString()) isGreenLight = true } isRedLight = false - CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.GREEN, DataSourceType.TELEMATIC) + CallerTrafficLightListenerManager.showTrafficLight( + TrafficLightEnum.GREEN, + DataSourceType.TELEMATIC + ) val green = currentLight.countDown / 10 CallerTrafficLightListenerManager.changeCountdownGreen(green) } // 黄灯 7, 8 -> { - CallerHmiManager.disableWarningV2X(appId.toString()) - CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.YELLOW, DataSourceType.TELEMATIC) + CallerTrafficLightListenerManager.showTrafficLight( + TrafficLightEnum.YELLOW, + DataSourceType.TELEMATIC + ) val yellow = currentLight.countDown / 10 CallerTrafficLightListenerManager.changeCountdownYellow(yellow) } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index 2a2b323404..7d75b06c6c 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -410,15 +410,12 @@ class MogoPrivateObuNewManager private constructor() { appId, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 object : IMoGoWarningStatusListener { override fun onDismiss() { // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL) } - }, - true, - 5000L + } ) // 更新数据 @@ -573,17 +570,14 @@ class MogoPrivateObuNewManager private constructor() { v2xType, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 object : IMoGoWarningStatusListener { override fun onDismiss() { // 关闭警告红边 - CallerHmiManager.showWarning( - WarningDirectionEnum.ALERT_WARNING_NON + CallerHmiManager.dismissWarning( + WarningDirectionEnum.ALERT_WARNING_ALL ) } - }, - true, - 5000L + } ) } @@ -844,7 +838,6 @@ private fun handleSdkObu( appId, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - (appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的 object : IMoGoWarningStatusListener { override fun onShow() { super.onShow() @@ -855,14 +848,12 @@ private fun handleSdkObu( override fun onDismiss() { // 关闭警告红边 - CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL) if (changeVisualAngle) { CallerVisualAngleManager.changeVisualAngle(Default()) } } - }, - true, - 5000L + } ) //显示警告红边 CallerHmiManager.showWarning(direction) @@ -910,7 +901,6 @@ private fun handlerTrafficLight(appId: Int, status: Int, lights: List MogoObuConstants.STATUS.DELETE -> { // 移除顶部弹窗 CallerTrafficLightListenerManager.disableTrafficLight() - CallerHmiManager.disableWarningV2X(appId.toString()) isShowGreenWave = false isShowRunRedLight = false isYellowLight = false @@ -956,7 +946,6 @@ private fun changeTrafficLightStatus( 1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 if (!isShowRunRedLight) { isShowRunRedLight = true - CallerHmiManager.disableWarningV2X(1667.toString()) CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "changeTrafficLightStatus 闯红灯 --------> " @@ -981,11 +970,7 @@ private fun changeTrafficLightStatus( CallerHmiManager.warningV2X( EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - null, - true, - 5000L + ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 ) } } @@ -993,7 +978,6 @@ private fun changeTrafficLightStatus( 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候 if (!isShowGreenWave) { isShowGreenWave = true - CallerHmiManager.disableWarningV2X(1666.toString()) var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6) var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6) @@ -1038,11 +1022,7 @@ private fun changeTrafficLightStatus( CallerHmiManager.warningV2X( EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - appId.toString(), - null, - true, - 5000L + ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 ) } } @@ -1056,8 +1036,7 @@ private fun changeTrafficLightStatus( } // 红灯 2, 3 -> { - if (!isRedLight) { - CallerHmiManager.disableWarningV2X(appId.toString()) + if (!isRedLight) { //todo 小鹏 isRedLight = true } isGreenLight = false @@ -1067,9 +1046,8 @@ private fun changeTrafficLightStatus( } // 绿灯 - 4, 5, 6 -> { + 4, 5, 6 -> { //todo 小鹏 if (!isGreenLight) { - CallerHmiManager.disableWarningV2X(appId.toString()) isGreenLight = true } isRedLight = false @@ -1085,7 +1063,6 @@ private fun changeTrafficLightStatus( } isRedLight = false isGreenLight = false - CallerHmiManager.disableWarningV2X(appId.toString()) CallerTrafficLightListenerManager.invokeObuTrafficLightStatus(TrafficLightEnum.YELLOW) val yellow = currentLight.countDown.toInt() } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt index 2c7e11bdc8..0d980cdf19 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt @@ -7,8 +7,8 @@ import com.mogo.eagle.core.data.bindingcar.BindingCarInfo import com.mogo.eagle.core.data.bindingcar.BindingCarRequest import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo import com.mogo.eagle.core.data.config.HdMapBuildConfig -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingcarDialog -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingcarDialog +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog import com.mogo.eagle.core.function.call.map.CallerHDMapManager.changeCurrentIcon import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.network.utils.GsonUtil @@ -79,8 +79,8 @@ class BindingCarNetWorkManager private constructor() { //根据车辆类型切换不同的车辆模型,只针对红旗做处理 updateCarVrIconRes(info.getData().brandId) when (info.getData().compare) { - "0" -> showBindingcarDialog() - "3" -> showModifyBindingcarDialog() + "0" -> showBindingCarDialog() + "3" -> showModifyBindingCarDialog() "null" -> TipToast.shortTip("当前工控机没有入库") } SharedPrefsMgr.getInstance(context!!).putString( diff --git a/core/function-impl/mogo-core-function-hmi/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-hmi/src/main/AndroidManifest.xml index bbc8f0d792..33c14875d8 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/AndroidManifest.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/AndroidManifest.xml @@ -157,14 +157,6 @@ - - - - - - - - diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/BindingcarBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/BindingcarBroadcastReceiver.kt index 235488a705..2d00e7d2ea 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/BindingcarBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/BindingcarBroadcastReceiver.kt @@ -3,8 +3,8 @@ package com.mogo.eagle.core.function.hmi.receiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingcarDialog -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingcarDialog +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog +import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog /** * 绑定车辆 @@ -31,9 +31,9 @@ class BindingcarBroadcastReceiver : BroadcastReceiver() { type: Int ) { if (type == 1) { - showBindingcarDialog() + showBindingCarDialog() } else if (type == 2) { - showModifyBindingcarDialog() + showModifyBindingCarDialog() } } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/TurnLightBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/TurnLightBroadcastReceiver.kt deleted file mode 100644 index 397103c575..0000000000 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/TurnLightBroadcastReceiver.kt +++ /dev/null @@ -1,41 +0,0 @@ -package com.mogo.eagle.core.function.hmi.receiver - -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight -import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight - -/** - * 转向灯,刹车 - * - * @author lixiaopeng - */ -class TurnLightBroadcastReceiver : BroadcastReceiver() { - - companion object { - private const val TAG = "TurnLightBroadcastReceiver" - } - - override fun onReceive(context: Context, intent: Intent) { - try { - val type = intent.getIntExtra("type", 0) - val lightInt = intent.getIntExtra("light", 0) - showTurnLight(type, lightInt) - } catch (e: Exception) { - e.printStackTrace() - } - } - - - private fun showTurnLight( //type 1,转向灯,2刹车 - type: Int, - lightInt: Int - ) { - if (type == 1) { - showTurnLight(lightInt) //设置转向灯 - } else if (type == 2) { - showBrakeLight(lightInt) //设置刹车信息 - } - } -} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt index fefd2b4366..e95dd4c575 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt @@ -47,7 +47,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() { ) if (v2xIsShow) { // 分发场景 - dispatchShowWaring(v2xType, alertContent, ttsContent, tag) + dispatchShowWaring(v2xType, alertContent, ttsContent) } else { dispatchCloseWaring(tag) } @@ -75,7 +75,6 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() { v2xType: Int, alertContent: String?, ttsContent: String?, - tag: String? ) { if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) { CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(1,DataSourceType.MAP) @@ -90,7 +89,6 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() { ) ) //预留调试入口 - CallerHmiManager.warningV2X(v2xType.toString(), alertContent, ttsContent, - tag, null, true, 5000L) + CallerHmiManager.warningV2X(v2xType.toString(), alertContent, ttsContent) } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index b1c1f47f2e..e0f9474b10 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -2,12 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui import android.content.Context import android.text.TextUtils -import android.util.Log -import android.view.View import android.view.ViewGroup -import android.view.animation.AlphaAnimation -import android.view.animation.Animation -import android.view.animation.LinearInterpolator import androidx.lifecycle.lifecycleScope import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.launcher.ARouter @@ -34,33 +29,26 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager -import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager -import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager -import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Turning import com.mogo.eagle.core.function.hmi.R -import com.mogo.eagle.core.function.hmi.notification.WarningFloat -import com.mogo.eagle.core.function.hmi.ui.bindingcar.ModifyBindingCarDialog -import com.mogo.eagle.core.function.hmi.ui.bindingcar.ToBindingCarDialog -import com.mogo.eagle.core.function.hmi.ui.bindingcar.UpgradeAppDialog import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog -import com.mogo.eagle.core.function.hmi.ui.dispatch.DispatchDialogManager +import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog +import com.mogo.eagle.core.function.hmi.ui.tools.ModifyBindingCarDialog +import com.mogo.eagle.core.function.hmi.ui.tools.ToBindingCarDialog +import com.mogo.eagle.core.function.hmi.ui.tools.UpgradeAppDialog import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView import com.mogo.eagle.core.function.main.DisplayEffectsHelper import com.mogo.eagle.core.utilcode.kotlin.safeCancel import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr -import com.mogo.eagle.core.utilcode.reminder.api.IReminder import com.mogo.eagle.core.utilcode.util.ThreadUtils -import com.mogo.eagle.core.utilcode.util.ToastUtils import com.zhjt.service_biz.BizConfig import kotlinx.android.synthetic.main.fragment_hmi.* import kotlinx.coroutines.* @@ -83,39 +71,9 @@ class MoGoHmiFragment : MvpFragment(), private val lastSpeakJob by lazy { AtomicReference() } private var lastShowV2XJob: Job? = null - private var showingV2XTip: IReminder? = null - override fun initViews() { - } - /** - * ok - * 工控机重启返回结果 - * @param code - * @param msg - */ - override fun showDockerRebootResult(code: Int, msg: String) { - ThreadUtils.runOnUiThread { - if (code >= -1) { - //重启成功 - ToastUtils.showShort("重启成功") - } else { - //重启失败 - msg.let { - ToastUtils.showShort(it) - } - } - } - } - - /** - * ok - * 展示工控机监控上报数据 - * @param errorReportList 错误级别上报数据列表 - * @param warningReportList 提醒级别上报数据列表 - * @param reportLevel 1:error级别 2:warning级别 - */ override fun showIPCReportWindow( errorReportList: ArrayList, warningReportList: ArrayList, @@ -193,7 +151,6 @@ class MoGoHmiFragment : MvpFragment(), v2xType: String, alertContent: CharSequence?, ttsContent: String?, - tag: String?, listener: IMoGoWarningStatusListener?, playTts: Boolean, expireTime: Long @@ -204,20 +161,6 @@ class MoGoHmiFragment : MvpFragment(), val warningContent = alertContent ?: EventTypeEnumNew.getWarningContent(v2xType) - //占道施工预警 - if (v2xType == "10006" || v2xType == "100061") { - val currentTime = System.currentTimeMillis() / 1000 - val oldTime = - context?.let { it -> SharedPrefsMgr.getInstance(it).getLong("roadwork", 0) } - if (currentTime - oldTime!! > 60) { //超过一分钟,才会继续播报重复提醒 - context?.let { it -> - SharedPrefsMgr.getInstance(it) - .putLong("roadwork", System.currentTimeMillis() / 1000) - } - CallerAutoPilotControlManager.sendTripInfo(5, "", "", "", false) - } - } - if (warningContent.isEmpty()) { CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!") return @@ -232,22 +175,18 @@ class MoGoHmiFragment : MvpFragment(), delay(expireTime) }.also { itx -> lastShowV2XJob = itx - }.invokeOnCompletion { _ -> + }.invokeOnCompletion { listener?.onDismiss() - showWarning(WarningDirectionEnum.ALERT_WARNING_NON) + dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL) } if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) { val last = lastSpeakJob.get() - Log.d("CODE", "---- 0 ------: last: $last") if (last != null && !last.isCompleted) { - Log.d("CODE", "---- 1 ------") return } lifecycleScope.launch(Dispatchers.Default) { - Log.d("CODE", "---- 2 ------") speak(it, ttsContent) - Log.d("CODE", "---- 3 ------") }.also { itx -> lastSpeakJob.set(itx) } @@ -274,150 +213,73 @@ class MoGoHmiFragment : MvpFragment(), AIAssist.getInstance(ctx).speakTTSVoiceWithLevel(text, AIAssist.LEVEL2, voiceCallback) } catch (t: Throwable) { it.resumeWith(Result.success(Unit)) - CallerLogger.d("$M_HMI$TAG", t.message) + CallerLogger.w("$M_HMI$TAG", t.message) } } - /** - * 关闭指定floatTag 的 VR下V2X预警弹窗 - * @param tag 弹窗标识 - */ - override fun disableWarningV2X(tag: String?) { - activity?.let { - WarningFloat.dismiss(tag) - } - CallerLogger.d("$M_HMI$TAG", "--- disableWarningV2X ---") - lifecycleScope.launch { - showingV2XTip?.takeIf { it.isShowing() }?.also { it.hide() } - } - } - - /** - * 展示指定方位上的红框预警 - * @param direction - * @see WarningDirectionEnum - */ override fun showWarning(direction: WarningDirectionEnum) { CallerLogger.d(TAG, "showWarning====") flV2XWarningView?.showWarning(direction) - if (flV2XWarningView != null) { - flicker(flV2XWarningView) - } } - /** - * 闪动动画 - */ - fun flicker(view: View) { - val alphaAnimation = AlphaAnimation(0f, 0.88f) - alphaAnimation.duration = 600 - alphaAnimation.interpolator = LinearInterpolator() - alphaAnimation.repeatCount = Animation.INFINITE - alphaAnimation.repeatMode = Animation.REVERSE - view.startAnimation(alphaAnimation) - } - - fun clearAnimation(view: View) { - view.clearAnimation() - } - - /** - * 展示指定方位上的红框预警 - * @param direction - * @see WarningDirectionEnum - * @param closeTime 倒计时 - */ override fun showWarning(direction: WarningDirectionEnum, closeTime: Long) { flV2XWarningView?.showWarning(direction, closeTime) - flicker(flV2XWarningView) } override fun dismissWarning(direction: WarningDirectionEnum) { flV2XWarningView?.dismissWarning(direction) - clearAnimation(flV2XWarningView) } + /** todo----------------------------------------------- **/ - /** - * ok - */ override fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) { context?.let { DispatchDialogManager.getInstance(it).showDialog(msgData) } } - /** - * ok - */ override fun dismissDispatchDialog() { context?.let { DispatchDialogManager.getInstance(it).releaseDialog() } } - /** - * ok - * 展示云公告交警详情 - * @param trafficStylePushData - */ override fun showNoticeForTrafficWithData(trafficStylePushData: NoticeTrafficStylePushData?) { - if (trafficStylePushData == null) { - return - } - ThreadUtils.runOnUiThread { - context?.let { - NoticeTrafficDialog.show(it, trafficStylePushData) + trafficStylePushData?.let { + ThreadUtils.runOnUiThread { + context?.let { it -> + NoticeTrafficDialog.show(it, trafficStylePushData) + } } } } - /** - * ok - * 展示云公告详情 - */ override fun showNoticeNormalData(normalData: NoticeNormalData?) { - if (normalData == null) { - return - } - ThreadUtils.runOnUiThread { - context?.let { - NoticeCheckDialog.show(it, normalData) + normalData?.let { + ThreadUtils.runOnUiThread { + context?.let { it -> + NoticeCheckDialog.show(it, normalData) + } } } } - /** - * ok - */ override fun startRoadCameraLive(flvUrl: String) { cameraLiveView.startRoadCameraLive(flvUrl) } - /** - * ok - */ override fun showNoSignView() { cameraLiveView.showNoSignView() } - /** - * ok - */ override fun showToolsView() { toolsView.showToolsFloat(context) } - /** - * ok - */ override fun hideToolsView() { toolsView.dismiss() } - /** - * ok - */ @BizConfig(V2I, "", BIZ_RTS) override fun showVideoDialog(infList: List) { ThreadUtils.runOnUiThread { @@ -427,125 +289,18 @@ class MoGoHmiFragment : MvpFragment(), } } - /** todo----------------------------------------------- **/ - private var isLeftLight: Boolean = false - private var isRightLight: Boolean = false - private var isDisappare: Boolean = false - - @Volatile - private var isVisualAngleChanged = false - - /** - * 显示转向灯效果 if (HmiBuildConfig.isShowBadCaseView) { - */ - override fun showTurnLight(light: Int) { - CallerLogger.d( - "${SceneConstant.M_DEVA}${"TurnLight"}", - "---showTurnLight = $light ---isLeftLight = $isLeftLight ---isRightLight = $isRightLight" - ) - ThreadUtils.runOnUiThread { - if (light == 1 || light == 2) { - if (!isVisualAngleChanged) { - isVisualAngleChanged = true - CallerVisualAngleManager.changeVisualAngle(Turning(true)) - } - } else { - if (isVisualAngleChanged) { - isVisualAngleChanged = false - CallerVisualAngleManager.changeVisualAngle(Turning(false)) - } - } - if (light == 1) { //左转灯 - if (!isLeftLight) { - isLeftLight = true - isRightLight = false - isDisappare = false - CallerLogger.d( - "${SceneConstant.M_DEVA}${"TurnLight"}", - "---showTurnLight ---light = 1" - ) - CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500) - } - } else if (light == 2) { //右转灯 - if (!isRightLight) { - isRightLight = true - isLeftLight = false - isDisappare = false - CallerLogger.d( - "${SceneConstant.M_DEVA}${"TurnLight"}", - "---showTurnLight ---light = 2" - ) - CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500) - } - } else { - if (!isDisappare) { //默认 不亮灯 - isDisappare = true - isLeftLight = false - isRightLight = false - CallerLogger.d( - "${SceneConstant.M_DEVA}${"TurnLight"}", - "---showTurnLight ---light other" - ) - CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500) - } - } - } - } - - private var isBrake: Boolean = false - - /** - * 显示刹车效果 - */ - override fun showBrakeLight(light: Int) { - ThreadUtils.runOnUiThread { - if (light == 1) { //刹车灯亮 - if (!isBrake) { - isBrake = true - CallerLogger.d( - "${SceneConstant.M_DEVA}${"BrakeLight"}", - " showBrakeLight light = 1 " - ) - CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500) - } - } else { - if (isBrake) {//默认 不亮灯 - isBrake = false - CallerLogger.d( - "${SceneConstant.M_DEVA}${"BrakeLight"}", - " showBrakeLight light != 1 " - ) - CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500) - } - } - //brakeView.setBrakeLight(light) - } - } - /** todo----------------------------------------------- **/ - - - /** - * ok - */ override fun showToBindingcarDialog() { if (ContextHolderUtil.getContext() != null) { ToBindingCarDialog.show(ContextHolderUtil.getContext()) } } - /** - * ok - */ override fun showModifyBindingcarDialog() { if (ContextHolderUtil.getContext() != null) { ModifyBindingCarDialog.show(ContextHolderUtil.getContext()) } } - /** - * ok - * 升级app弹框 - */ override fun showUpgradeDialog( name: String, url: String, @@ -556,22 +311,11 @@ class MoGoHmiFragment : MvpFragment(), if (ContextHolderUtil.getContext() != null) { UpgradeAppDialog.show( ContextHolderUtil.getContext(), - name, - url, - title, - content, - installType + name, url, title, content, installType ) } } - /** - * ok - * 工控机镜像升级确认窗 - * @param images 镜像列表 - * @param padSn SN - * @param releaseId 任务ID - */ override fun showAdUpgradeDialog(images: List, padSn: String, releaseId: String) { ThreadUtils.runOnUiThread { if (ContextHolderUtil.getContext() != null) { @@ -580,9 +324,6 @@ class MoGoHmiFragment : MvpFragment(), } } - /** - * ok - */ override fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) { ThreadUtils.runOnUiThread { toolsView.showAdUpgradeStatus(ipcUpgradeStateInfo) @@ -632,8 +373,4 @@ class MoGoHmiFragment : MvpFragment(), ?.commitAllowingStateLoss() } - override fun onDestroy() { - super.onDestroy() - CallerLogger.d("$M_HMI$TAG", "onDestroy") - } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchAirportDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchAirportDialog.java similarity index 97% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchAirportDialog.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchAirportDialog.java index 1b8da4b6e1..22905e8b3d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchAirportDialog.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchAirportDialog.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.dispatch; +package com.mogo.eagle.core.function.hmi.ui.notice; import android.content.Context; import android.text.TextUtils; diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchBaseDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchBaseDialog.java similarity index 95% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchBaseDialog.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchBaseDialog.java index 6f47cb8e71..d22a34eae7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchBaseDialog.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchBaseDialog.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.dispatch; +package com.mogo.eagle.core.function.hmi.ui.notice; import android.app.Dialog; import android.content.Context; diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchCarsDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchCarsDialog.java similarity index 97% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchCarsDialog.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchCarsDialog.java index 53b912f5a6..b2d450f7ff 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchCarsDialog.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchCarsDialog.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.dispatch; +package com.mogo.eagle.core.function.hmi.ui.notice; import android.content.Context; import android.os.Handler; diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchDialogManager.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchDialogManager.java similarity index 98% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchDialogManager.java rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchDialogManager.java index 88cfdb089b..f77c58d62e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchDialogManager.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchDialogManager.java @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.dispatch; +package com.mogo.eagle.core.function.hmi.ui.notice; import static com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_SOURCE_EZHOU; import static com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_SOURCE_HENGYANG; diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ModifyBindingCarDialog.kt similarity index 98% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ModifyBindingCarDialog.kt index 162b620264..6d3c75519a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ModifyBindingCarDialog.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.bindingcar +package com.mogo.eagle.core.function.hmi.ui.tools import android.content.Context import android.widget.TextView diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToBindingCarDialog.kt similarity index 98% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToBindingCarDialog.kt index 31633e2f5b..9f0c04ae9b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToBindingCarDialog.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.bindingcar +package com.mogo.eagle.core.function.hmi.ui.tools import android.content.Context import android.widget.TextView diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/UpgradeAppDialog.kt similarity index 98% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/UpgradeAppDialog.kt index 92fe6ed30b..74cecac037 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/UpgradeAppDialog.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.bindingcar +package com.mogo.eagle.core.function.hmi.ui.tools import android.content.Context import android.view.View diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/BrakeViewStatus.kt similarity index 93% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/BrakeViewStatus.kt index 56f19763b4..3c9fe2419f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/BrakeViewStatus.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.turnlight +package com.mogo.eagle.core.function.hmi.ui.vehicle import android.animation.AnimatorSet import android.animation.ObjectAnimator @@ -11,6 +11,7 @@ import android.view.animation.Animation import android.view.animation.DecelerateInterpolator import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import kotlinx.android.synthetic.main.view_brake_light_status.view.* @@ -47,6 +48,7 @@ class BrakeViewStatus @JvmOverloads constructor( if (brakeLight == 1) { //刹车灯亮 if (!isBrake) { isBrake = true + CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500) GlobalScope.launch(Dispatchers.Main) { var appearAnimation = AlphaAnimation(0f, 1f) appearAnimation.duration = 300 @@ -61,6 +63,7 @@ class BrakeViewStatus @JvmOverloads constructor( } else { //不踩刹车,就消失 if (isBrake) { isBrake = false + CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500) GlobalScope.launch(Dispatchers.Main) { // scaleImageAndTv() var disappearAnimation = AlphaAnimation(1f, 0f) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt similarity index 98% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt index e221ee5fa1..085dcae0f1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.pnc +package com.mogo.eagle.core.function.hmi.ui.vehicle import android.content.Context import android.util.AttributeSet diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt new file mode 100644 index 0000000000..7ef29438c3 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt @@ -0,0 +1,99 @@ +package com.mogo.eagle.core.function.hmi.ui.vehicle + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.View +import androidx.constraintlayout.widget.ConstraintLayout +import chassis.Chassis +import com.mogo.eagle.core.data.constants.MoGoConfig +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI +import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr +import com.mogo.eagle.core.utilcode.util.Utils +import kotlinx.android.synthetic.main.view_steering_brake.view.* +import mogo.telematics.pad.MessagePad + +/** + * 现阶段模型支持刹车与转向同时触发,现有逻辑中还存在两者优先级状态。后续通过各自实现,将去除优先级 + * 刹车,调用模型的逻辑暂时放入view。 转向不受影响 + */ +class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayout(context, attrs), + IMoGoChassisLamplightListener, IMoGoChassisLocationWGS84Listener { + + companion object { + private const val TAG = "SteeringBrakeView" + } + + private var isShowTurnLight = false + private var brakeLight = -1 + + init { + LayoutInflater.from(context).inflate(R.layout.view_steering_brake, this, true) + val typedArray = context.obtainStyledAttributes(attrs, R.styleable.SteeringBrakeView) + val dayLight = typedArray.getBoolean(R.styleable.SteeringBrakeView_day_light_mode, false) + turnLightView.dayLightMode(dayLight) + typedArray.recycle() + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerChassisLamplightListenerManager.addListener(TAG, this) + CallerChassisLocationWGS84ListenerManager.addListener(TAG, this) + } + + override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo?) { + if (gnssInfo != null) { + //设置刹车信息,小于默认认为是刹车 + brakeLight = + if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat( + MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f + ) + ) { + 1 + } else { + 0 + } + CallerLogger.d( + "$M_HMI$TAG", + "---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight + ) + if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效 + brakeView.visibility = View.VISIBLE + brakeView.setBrakeLight(brakeLight) + } else { + brakeView.visibility = View.GONE + } + } + } + + override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) { + super.onAutopilotLightSwitchData(lightSwitch) + //can数据转发 转向灯状态 0是正常 1是左转 2是右转 + if (lightSwitch != null) { + CallerLogger.d("$M_HMI$TAG", "---lightSwitch.getNumber() = " + lightSwitch.number) + if (lightSwitch.number == 1 || lightSwitch.number == 2) { + isShowTurnLight = true + brakeView.visibility = View.VISIBLE + brakeView.setBrakeLight(0) + } else { + brakeView.visibility = View.GONE + isShowTurnLight = false + } + turnLightView.visibility = View.VISIBLE + turnLightView.setTurnLight(lightSwitch) + } + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerChassisLamplightListenerManager.removeListener(TAG) + CallerChassisLocationWGS84ListenerManager.removeListener(TAG) + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TakeOverView.kt similarity index 93% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TakeOverView.kt index 4b447c2eaa..29cd185384 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TakeOverView.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.takeover +package com.mogo.eagle.core.function.hmi.ui.vehicle import android.content.Context import android.util.AttributeSet @@ -59,7 +59,6 @@ class TakeOverView @JvmOverloads constructor( EventTypeEnumNew.TAKE_OVER_EVENT.poiType, EventTypeEnumNew.TAKE_OVER_EVENT.content, EventTypeEnumNew.TAKE_OVER_EVENT.tts, - EventTypeEnumNew.TAKE_OVER_EVENT.poiType, object : IMoGoWarningStatusListener { override fun onShow() { takeOver = true @@ -70,9 +69,7 @@ class TakeOverView @JvmOverloads constructor( takeOver = false visibility = View.GONE } - }, - true, - 6000L + } ) } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt similarity index 65% rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt index a507b08ac2..e21e0514a6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt @@ -1,4 +1,4 @@ -package com.mogo.eagle.core.function.hmi.ui.turnlight +package com.mogo.eagle.core.function.hmi.ui.vehicle import android.animation.AnimatorSet import android.animation.ObjectAnimator @@ -10,12 +10,10 @@ import android.view.animation.AlphaAnimation import android.view.animation.Animation import android.widget.ImageView import androidx.constraintlayout.widget.ConstraintLayout -import com.mogo.eagle.core.data.config.FunctionBuildConfig +import chassis.Chassis import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager -import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Turning import com.mogo.eagle.core.function.hmi.R -import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import kotlinx.android.synthetic.main.view_turn_light_status.view.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope @@ -28,82 +26,52 @@ import kotlinx.coroutines.launch * @since 2022/1/10 */ class TurnLightViewStatus @JvmOverloads constructor( - context: Context, - attrs: AttributeSet? = null, - defStyleAttr: Int = 0 + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 ) : ConstraintLayout(context, attrs, defStyleAttr) { - init { - if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { - LayoutInflater.from(context).inflate(R.layout.view_turn_light_status_daytime, this, true) + + private var init: Boolean = false + + fun dayLightMode(dayLight: Boolean) { + if (dayLight) { + LayoutInflater.from(context) + .inflate(R.layout.view_turn_light_status_daytime, this, true) } else { LayoutInflater.from(context).inflate(R.layout.view_turn_light_status, this, true) } + invalidate() + init = true } - private var isShowNormalBg :Boolean = false - private var isLeftLight :Boolean = false - private var isRightLight :Boolean = false - private var isDisappare :Boolean = false - - @Volatile - private var isVisualAngleChanged = false - /** * 转向灯动画 */ - fun setTurnLight(directionLight: Int) { - if (!isShowNormalBg && (directionLight == 1 || directionLight == 2)) { - isShowNormalBg = true - GlobalScope.launch(Dispatchers.Main) { - showNormalAnimation() + fun setTurnLight(directionLight: Chassis.LightSwitch) { + GlobalScope.launch(Dispatchers.Main) { + if (!init) { + return@launch } - } - - if (directionLight == 1 || directionLight == 2) { - if (!isVisualAngleChanged) { - isVisualAngleChanged = true - CallerVisualAngleManager.changeVisualAngle(Turning(true)) - } - } - - //根据左右进行显示和隐藏,实际要判断每个来的时间和频度 - if (directionLight == 1) { //左转向 - if (!isLeftLight) { - isLeftLight = true - isRightLight = false - isDisappare = false - GlobalScope.launch(Dispatchers.Main) { + //根据左右进行显示和隐藏,实际要判断每个来的时间和频度 + when (directionLight) { + Chassis.LightSwitch.LIGHT_LEFT -> { //左转向 + CallerVisualAngleManager.changeVisualAngle(Turning(true)) + showNormalAnimation() left_select_image.visibility = View.VISIBLE right_select_image.visibility = View.GONE right_select_image.clearAnimation() setAnimation(left_select_image) } - - } - } else if (directionLight == 2) { //右转向 - if (!isRightLight) { - isRightLight = true - isLeftLight = false - isDisappare = false - GlobalScope.launch(Dispatchers.Main) { + Chassis.LightSwitch.LIGHT_RIGHT -> { //右转向 + CallerVisualAngleManager.changeVisualAngle(Turning(true)) + showNormalAnimation() left_select_image.visibility = View.GONE right_select_image.visibility = View.VISIBLE left_select_image.clearAnimation() setAnimation(right_select_image) } - } - - } else { //消失 - if (isVisualAngleChanged) { - isVisualAngleChanged = false - CallerVisualAngleManager.changeVisualAngle(Turning(false)) - } - if (!isDisappare) { - isDisappare = true - isShowNormalBg = false - isLeftLight = false - isRightLight = false - GlobalScope.launch(Dispatchers.Main) { + else -> { //消失 + CallerVisualAngleManager.changeVisualAngle(Turning(false)) animationDisappear() } } @@ -168,7 +136,7 @@ class TurnLightViewStatus @JvmOverloads constructor( override fun onAnimationEnd(p0: Animation?) { turn_light_layout.visibility = View.GONE -// stopAnimate() + stopAnimate() } }) } @@ -176,18 +144,14 @@ class TurnLightViewStatus @JvmOverloads constructor( //实现图片闪烁效果 private fun setAnimation(imageView: ImageView) { val animationSet = AnimatorSet() - - val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha",0f, 1.0f) - val valueAnimatorDisappare = ObjectAnimator.ofFloat(imageView, "alpha",1.0f, 0f) + val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha", 0f, 1.0f) + val valueAnimatorDisappare = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f) valueAnimator.duration = 1000 valueAnimatorDisappare.duration = 800 - valueAnimator.repeatCount = -1 valueAnimatorDisappare.repeatCount = -1 - animationSet.playTogether(valueAnimatorDisappare, valueAnimator) animationSet.start() - } private fun stopAnimate() { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt index 6bc394fba8..2041f3b15b 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt @@ -4,6 +4,9 @@ import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater import android.view.View +import android.view.animation.AlphaAnimation +import android.view.animation.Animation +import android.view.animation.LinearInterpolator import android.widget.RelativeLayout import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.data.enums.WarningDirectionEnum @@ -36,22 +39,13 @@ class V2XWarningView @JvmOverloads constructor( LayoutInflater.from(context).inflate(R.layout.module_hmi_warning_v2x, this, true) } - /** - * 展示指定方位上的红框预警 - * @param direction - * @see WarningDirectionEnum - */ - fun showWarning(direction: WarningDirectionEnum) { - showWarning(direction, ALL_CLOSE_TIMER) - } - /** * 展示指定方位上的红框预警 * @param direction * @see WarningDirectionEnum * @param closeTime 倒计时 */ - fun showWarning(direction: WarningDirectionEnum, closeTime: Long) { + fun showWarning(direction: WarningDirectionEnum, closeTime: Long = ALL_CLOSE_TIMER) { UiThreadHandler.post { // 如果传入的不是关闭显示,则设置倒计时,定时关闭红框警示 if (direction != ALERT_WARNING_NON) { @@ -59,16 +53,8 @@ class V2XWarningView @JvmOverloads constructor( postDelayed(closeWarningTask, closeTime) } when (direction) { - ALERT_WARNING_NON -> { - removeCallbacks(closeWarningTask) - hmiWarningTopImg.visibility = View.GONE - hmiWarningRightImg.visibility = View.GONE - hmiWarningBottomImg.visibility = View.GONE - hmiWarningLeftImg.visibility = View.GONE - hmiWarningLeftTopImg.visibility = View.GONE - hmiWarningLeftBottomImg.visibility = View.GONE - hmiWarningRightTopImg.visibility = View.GONE - hmiWarningRightBottomImg.visibility = View.GONE + ALERT_WARNING_NON ->{ + // nothing } ALERT_WARNING_TOP -> { hmiWarningTopImg.visibility = View.VISIBLE @@ -150,7 +136,7 @@ class V2XWarningView @JvmOverloads constructor( hmiWarningRightTopImg.visibility = View.GONE hmiWarningRightBottomImg.visibility = View.GONE } - ALERT_WARNING_ALL -> { + ALERT_WARNING_ALL -> { //todo problem hmiWarningTopImg.visibility = View.VISIBLE hmiWarningRightImg.visibility = View.GONE hmiWarningBottomImg.visibility = View.GONE @@ -161,6 +147,12 @@ class V2XWarningView @JvmOverloads constructor( hmiWarningRightBottomImg.visibility = View.GONE } } + val alphaAnimation = AlphaAnimation(0f, 0.88f) + alphaAnimation.duration = 600 + alphaAnimation.interpolator = LinearInterpolator() + alphaAnimation.repeatCount = Animation.INFINITE + alphaAnimation.repeatMode = Animation.REVERSE + startAnimation(alphaAnimation) } } @@ -171,11 +163,7 @@ class V2XWarningView @JvmOverloads constructor( removeCallbacks(closeWarningTask) when (direction) { ALERT_WARNING_TOP -> { -// hmiWarningTopImg.visibility = View.GONE hmiWarningRightTopImg.visibility = View.GONE -// hmiWarningLeftTopImg.visibility = View.GONE -// hmiWarningLeftBottomImg.visibility = View.GONE -// hmiWarningRightBottomImg.visibility = View.GONE } ALERT_WARNING_RIGHT -> { hmiWarningRightImg.visibility = View.GONE @@ -199,6 +187,10 @@ class V2XWarningView @JvmOverloads constructor( hmiWarningLeftTopImg.visibility = View.GONE } ALERT_WARNING_ALL -> { + hmiWarningTopImg.visibility = View.GONE + hmiWarningRightImg.visibility = View.GONE + hmiWarningBottomImg.visibility = View.GONE + hmiWarningLeftImg.visibility = View.GONE hmiWarningLeftTopImg.visibility = View.GONE hmiWarningLeftBottomImg.visibility = View.GONE hmiWarningRightTopImg.visibility = View.GONE @@ -208,5 +200,6 @@ class V2XWarningView @JvmOverloads constructor( CallerLogger.d("$M_HMI$TAG", "Not Support Direction") } } + clearAnimation() } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml index 8e84662b5e..f2f6e4c657 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml @@ -16,31 +16,4 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - - - - - - - - - \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml index e8e3c08f6e..54037f7e0f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml @@ -74,7 +74,6 @@ android:layout_height="match_parent" android:background="@drawable/main_splash_bg"> - + android:layout_gravity="bottom" /> \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_steering_brake.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_steering_brake.xml new file mode 100644 index 0000000000..dfbfdbe7bd --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_steering_brake.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml index 7e72417466..638b1ca53c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml @@ -69,4 +69,8 @@ @android:color/transparent + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/styles.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/styles.xml index 035df811a8..99c0c612b0 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/styles.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/styles.xml @@ -7,7 +7,6 @@ @drawable/module_push_message_background -