From 961e1eb102ad965a4f5c4656f2ea9e5f1d692983 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Tue, 21 Feb 2023 16:58:06 +0800 Subject: [PATCH 01/15] =?UTF-8?q?[opt3.0][adas=20lib]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E5=90=AF=E5=8A=A8=E7=BB=9F=E8=AE=A1=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E4=B8=8B=E6=B2=89=E5=88=B0adas-data=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/manager/OCHAdasAbilityManager.java | 2 +- .../zhidao/adas/client/ui/MainActivity.java | 2 +- .../zhidao/adas/magic/ui/MainActivity.java | 2 +- .../autopilot/adapter/MoGoAdasListenerImpl.kt | 2 +- .../IMoGoAutopilotStatisticsListener.kt | 2 +- ...allerAutopilotStatisticsListenerManager.kt | 2 +- .../adas/data}/bean/AutopilotStatistics.java | 27 ++++++++++++++----- .../zhidao/support/adas/high/AdasChannel.java | 2 +- .../support/adas/high/OnAdasListener.java | 2 +- .../adas/high/common/AutopilotReview.java | 9 ++++--- .../support/adas/high/common/Constants.java | 17 ------------ .../support/adas/high/common/Define.java | 7 ++--- 12 files changed, 38 insertions(+), 38 deletions(-) rename libraries/{mogo-adas/src/main/java/com/zhidao/support/adas/high => mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data}/bean/AutopilotStatistics.java (55%) diff --git a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/OCHAdasAbilityManager.java b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/OCHAdasAbilityManager.java index 83332d1bb8..e97c0b6b34 100644 --- a/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/OCHAdasAbilityManager.java +++ b/OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/manager/OCHAdasAbilityManager.java @@ -10,7 +10,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListene import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager; import com.mogo.eagle.core.utilcode.mogo.logger.Logger; import com.mogo.och.common.module.callback.OchAdasStartFailureCallback; -import com.zhidao.support.adas.high.bean.AutopilotStatistics; +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics; /** * Created on 2022/10/9 diff --git a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java index 50ddaa22bc..08ae38336b 100644 --- a/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java +++ b/app_ipc_monitoring/src/main/java/com/zhidao/adas/client/ui/MainActivity.java @@ -100,7 +100,7 @@ import com.zhidao.support.adas.high.AdasOptions; import com.zhidao.support.adas.high.OnAdasConnectStatusListener; import com.zhidao.support.adas.high.OnAdasListener; import com.zhidao.support.adas.high.OnMultiDeviceListener; -import com.zhidao.support.adas.high.bean.AutopilotStatistics; +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics; import com.zhidao.support.adas.high.bean.VersionCompatibility; import com.zhidao.support.adas.high.common.ByteUtil; import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS; diff --git a/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java b/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java index 685f84610c..3c1ea13ce0 100644 --- a/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java +++ b/app_mogo_magic_ring/src/main/java/com/zhidao/adas/magic/ui/MainActivity.java @@ -45,7 +45,7 @@ import com.zhidao.support.adas.high.AdasManager; import com.zhidao.support.adas.high.AdasOptions; import com.zhidao.support.adas.high.OnAdasConnectStatusListener; import com.zhidao.support.adas.high.OnAdasListener; -import com.zhidao.support.adas.high.bean.AutopilotStatistics; +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics; import com.zhidao.support.adas.high.bean.VersionCompatibility; import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS; import com.zhidao.support.adas.high.common.CupidLogUtils; 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 6374bb350c..8247a0ea90 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 @@ -59,7 +59,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.support.obu.ObuScene import com.zhidao.support.adas.high.AdasManager import com.zhidao.support.adas.high.OnAdasListener -import com.zhidao.support.adas.high.bean.AutopilotStatistics +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics import com.zhidao.support.adas.high.common.ProtocolStatus import com.zhjt.service.chain.ChainLog import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatisticsListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatisticsListener.kt index 8bb5d83d75..f084eeeb5c 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatisticsListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotStatisticsListener.kt @@ -1,6 +1,6 @@ package com.mogo.eagle.core.function.api.autopilot -import com.zhidao.support.adas.high.bean.AutopilotStatistics +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics /** * 启动自动驾驶状态统计监听 diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotStatisticsListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotStatisticsListenerManager.kt index ef6b958436..f4940f5b4f 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotStatisticsListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotStatisticsListenerManager.kt @@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener import com.mogo.eagle.core.function.call.base.CallerBase -import com.zhidao.support.adas.high.bean.AutopilotStatistics +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics object CallerAutopilotStatisticsListenerManager : CallerBase() { diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/bean/AutopilotStatistics.java b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/AutopilotStatistics.java similarity index 55% rename from libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/bean/AutopilotStatistics.java rename to libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/AutopilotStatistics.java index c7aff7feee..487e386140 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/bean/AutopilotStatistics.java +++ b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/AutopilotStatistics.java @@ -1,23 +1,38 @@ -package com.zhidao.support.adas.high.bean; +package com.zhjt.mogo.adas.data.bean; -import com.zhidao.support.adas.high.common.Define; import mogo.telematics.pad.MessagePad; import mogo_msg.MogoReportMsg; /** - * 自动驾驶启动统计 todo 凤坤,后续封装成pb,或者放入adas-data + * 自动驾驶启动统计 */ public class AutopilotStatistics { + /** + * 启动自动驾驶后的状态 + */ + public interface AUTOPILOT_START_STATUS { + /** + * 成功 + */ + int SUCCESSFUL = 0; + /** + * 失败 + */ + int FAILED = 1; + /** + * 取消 + */ + int CANCEL = 2; + } /** * 启动自动驾驶后状态 * 0 成功 * 1 失败 * 2 取消 - * {@link com.zhidao.support.adas.high.common.Constants.AUTOPILOT_START_STATUS} + * {@link AUTOPILOT_START_STATUS} */ - @Define.AutopilotStartStatus public final int status; /** @@ -36,7 +51,7 @@ public class AutopilotStatistics { */ public final MogoReportMsg.MogoReportMessage failedMessage; - public AutopilotStatistics(@Define.AutopilotStartStatus int status, long usedTime, MessagePad.SetAutopilotModeReq req, MogoReportMsg.MogoReportMessage failedMessage) { + public AutopilotStatistics(int status, long usedTime, MessagePad.SetAutopilotModeReq req, MogoReportMsg.MogoReportMessage failedMessage) { this.status = status; this.usedTime = usedTime; this.req = req; diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java index 298d893a2c..b174d75da2 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java @@ -21,7 +21,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.google.protobuf.InvalidProtocolBufferException; -import com.zhidao.support.adas.high.bean.AutopilotStatistics; +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics; import com.zhidao.support.adas.high.bean.VersionCompatibility; import com.zhidao.support.adas.high.common.AutopilotReview; import com.zhidao.support.adas.high.common.ByteUtil; diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java index ff3d6b8b67..8a5318bf1e 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/OnAdasListener.java @@ -1,7 +1,7 @@ package com.zhidao.support.adas.high; import com.mogo.support.obu.ObuScene; -import com.zhidao.support.adas.high.bean.AutopilotStatistics; +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics; import com.zhidao.support.adas.high.common.ProtocolStatus; import bag_manager.BagManagerOuterClass; diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/AutopilotReview.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/AutopilotReview.java index 16f62686fd..3ad3ca761b 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/AutopilotReview.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/AutopilotReview.java @@ -4,7 +4,8 @@ import android.os.SystemClock; import androidx.annotation.NonNull; -import com.zhidao.support.adas.high.bean.AutopilotStatistics; + +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics; import java.util.Timer; import java.util.TimerTask; @@ -60,7 +61,7 @@ public class AutopilotReview { startReq = req; startTime = SystemClock.elapsedRealtime(); } else { - onCallback(Constants.AUTOPILOT_START_STATUS.CANCEL); + onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.CANCEL); } } @@ -72,7 +73,7 @@ public class AutopilotReview { public void onReportResult(MogoReportMsg.MogoReportMessage message) { if (startReq != null && message != null) { failedMessage = message; - onCallback(Constants.AUTOPILOT_START_STATUS.FAILED); + onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED); } } @@ -83,7 +84,7 @@ public class AutopilotReview { */ public void onAutopilotResult(MessagePad.AutopilotState state) { if (startReq != null && state != null && state.getState() == 2) { - onCallback(Constants.AUTOPILOT_START_STATUS.SUCCESSFUL); + onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.SUCCESSFUL); } } } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Constants.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Constants.java index 2591484ac9..503d7f8eb2 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Constants.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Constants.java @@ -110,23 +110,6 @@ public class Constants { } - /** - * 启动自动驾驶后的状态 - */ - public interface AUTOPILOT_START_STATUS { - /** - * 成功 - */ - int SUCCESSFUL = 0; - /** - * 失败 - */ - int FAILED = 1; - /** - * 取消 - */ - int CANCEL = 2; - } /** * 使用底盘数据类型 diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Define.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Define.java index 4ef4b6830c..598ccc3f8c 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Define.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Define.java @@ -3,6 +3,7 @@ package com.zhidao.support.adas.high.common; import androidx.annotation.IntDef; import com.zhidao.support.adas.high.bean.VersionCompatibility; +import com.zhjt.mogo.adas.data.bean.AutopilotStatistics; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -47,9 +48,9 @@ public final class Define { public @interface SubscribeType { } - @IntDef(flag = true, value = {Constants.AUTOPILOT_START_STATUS.SUCCESSFUL, - Constants.AUTOPILOT_START_STATUS.FAILED, - Constants.AUTOPILOT_START_STATUS.CANCEL}) + @IntDef(flag = true, value = {AutopilotStatistics.AUTOPILOT_START_STATUS.SUCCESSFUL, + AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED, + AutopilotStatistics.AUTOPILOT_START_STATUS.CANCEL}) @Retention(RetentionPolicy.SOURCE) public @interface AutopilotStartStatus { } From 36f49d3a51ce6a6eccf609227bf8c151f6d2a0fb Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 12 Jan 2023 16:15:49 +0800 Subject: [PATCH 02/15] =?UTF-8?q?[2.13.2][fix]=E8=A7=A3=E5=86=B3=E6=B1=87?= =?UTF-8?q?=E6=80=BB=E6=B6=88=E6=81=AF=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit f04d790c7389af33d4efa2e24a1b90f30e7594cd) --- .../mogo/eagle/core/function/msgbox/DataManager.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt index 4e0cb392df..e17b432a38 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt @@ -87,7 +87,16 @@ object DataManager { msg.timestamp = System.currentTimeMillis() msg.bean2Json = GsonUtils.toJson(msg.bean) when (type) { - MsgBoxType.V2X, MsgBoxType.OBU, MsgBoxType.NOTICE, MsgBoxType.OPERATION -> { + MsgBoxType.V2X -> { + // 汇总消息不存数据库 + if (msg.sourceType != DataSourceType.SUMMARY) { + synchronized(this) { + notifyList.add(msg) + } + } + CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, msg) + } + MsgBoxType.OBU, MsgBoxType.NOTICE, MsgBoxType.OPERATION -> { synchronized(this) { notifyList.add(msg) } From 0f17b2185f7ea074bb44b9dc95f81e6ded273e4c Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Mon, 20 Feb 2023 12:02:44 +0800 Subject: [PATCH 03/15] =?UTF-8?q?[2.14.0][Opt]=E5=8D=87=E7=BA=A7=E9=AB=98?= =?UTF-8?q?=E5=BE=B7=E5=9C=B0=E5=9B=BE=E7=89=88=E6=9C=AC=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/map/OfflineMapDialog.kt | 10 +++++ .../mogo-core-function-map/build.gradle | 1 - .../call/map/CallerMapUIServiceManager.kt | 4 ++ .../com/mogo/map/hdcache/IHdCacheListener.kt | 2 + .../uicontroller/IMogoMapUIController.java | 2 + .../java/com/mogo/map/AMapViewWrapper.java | 42 +++++++++++++++---- .../com/mogo/map/MogoMapUIController.java | 7 ++++ .../map/uicontroller/AMapUIController.java | 7 ++++ 8 files changed, 66 insertions(+), 9 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt index 0adbe08c49..b1db9d6a14 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt @@ -81,6 +81,9 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) { } okView?.setOnClickListener { + if (isLoading) { + CallerMapUIServiceManager.cancelDownloadCacheData() + } dismiss() } } @@ -90,6 +93,12 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) { override fun onMapHdCacheProgress(cityId: Int, progress: Double) { updateProgress(progress.toInt()) } + + override fun onMapHdCacheResult(cityId: Int, state: Int) { + if (state == 0) {// 失败 + showNewContent(isLoading = false, false) + } + } }) } @@ -131,6 +140,7 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) { @SuppressLint("UseCompatLoadingForDrawables") private fun showNewContent(isLoading: Boolean, isSuccess: Boolean) { + this.isLoading = isLoading change2NewStyle() when { isLoading -> { diff --git a/core/function-impl/mogo-core-function-map/build.gradle b/core/function-impl/mogo-core-function-map/build.gradle index 0cf7bfaf30..87b0a3c14a 100644 --- a/core/function-impl/mogo-core-function-map/build.gradle +++ b/core/function-impl/mogo-core-function-map/build.gradle @@ -60,7 +60,6 @@ dependencies { implementation rootProject.ext.dependencies.mogocustommap implementation rootProject.ext.dependencies.amapnavi3dmap -// implementation rootProject.ext.dependencies.amaplocation implementation rootProject.ext.dependencies.androidxroomruntime kapt rootProject.ext.dependencies.androidxroomcompiler diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt index 1c5104a623..bf7f44b92b 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt @@ -46,4 +46,8 @@ object CallerMapUIServiceManager { fun getGDLocationServer(context: Context): IMogoGDLocationClient?{ return serviceProvider?.getGDLocationServer(context) } + + fun cancelDownloadCacheData() { + serviceProvider?.mapUIController?.cancelDownloadCacheData() + } } \ No newline at end of file diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/hdcache/IHdCacheListener.kt b/libraries/mogo-map-api/src/main/java/com/mogo/map/hdcache/IHdCacheListener.kt index 4761e40fff..9492c60ba7 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/hdcache/IHdCacheListener.kt +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/hdcache/IHdCacheListener.kt @@ -2,4 +2,6 @@ package com.mogo.map.hdcache interface IHdCacheListener { fun onMapHdCacheProgress(cityId: Int, progress: Double) + + fun onMapHdCacheResult(cityId: Int, state: Int)// 0失败,1成功 } \ 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 8235fe8a36..93093c74f7 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 @@ -358,4 +358,6 @@ public interface IMogoMapUIController { * @return */ boolean isCityDataCached(); + + void cancelDownloadCacheData(); } 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 68c15404f3..0becb4a9c9 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 @@ -58,6 +58,7 @@ import com.mogo.map.utils.ResIdCache; import com.zhidaoauto.map.sdk.open.MapAutoApi; import com.zhidaoauto.map.sdk.open.abs.MapStatusListener; import com.zhidaoauto.map.sdk.open.abs.OnCameraChangeListener; +import com.zhidaoauto.map.sdk.open.abs.OnHdDataDownByCityListener; import com.zhidaoauto.map.sdk.open.abs.OnMapClickListener; import com.zhidaoauto.map.sdk.open.abs.OnMapLoadedListener; import com.zhidaoauto.map.sdk.open.abs.OnMapStyleListener; @@ -1051,17 +1052,35 @@ public class AMapViewWrapper implements IMogoMapView, Integer id = HDMapUtils.getHDCityCode(gdCityCode); if (id != null) { hdCacheListener = listener; - mMapView.getMapAutoViewHelper().cacheHDDataByCity(id, (cityId, progress) -> { - if (Thread.currentThread() == Looper.getMainLooper().getThread()) { - if (hdCacheListener != null) { - hdCacheListener.onMapHdCacheProgress(cityId, progress * 100); - } - } else { - UiThreadHandler.post(() -> { + mMapView.getMapAutoViewHelper().cacheHDDataByCity(id, new OnHdDataDownByCityListener() { + @Override + public void onMapHDDataCacheProgressByCity(int cityId, double progress) { + if (Thread.currentThread() == Looper.getMainLooper().getThread()) { if (hdCacheListener != null) { hdCacheListener.onMapHdCacheProgress(cityId, progress * 100); } - }); + } else { + UiThreadHandler.post(() -> { + if (hdCacheListener != null) { + hdCacheListener.onMapHdCacheProgress(cityId, progress * 100); + } + }); + } + } + + @Override + public void onMapHDDataCacheStateByCity(int i, int state) {// 0失败,1成功 + if (Thread.currentThread() == Looper.getMainLooper().getThread()) { + if (hdCacheListener != null) { + hdCacheListener.onMapHdCacheResult(i, state); + } + } else { + UiThreadHandler.post(() -> { + if (hdCacheListener != null) { + hdCacheListener.onMapHdCacheResult(i, state); + } + }); + } } }); } @@ -1086,4 +1105,11 @@ public class AMapViewWrapper implements IMogoMapView, } return true; } + + @Override + public void cancelDownloadCacheData() { + if (mMapView.getMapAutoViewHelper() != null) { + mMapView.getMapAutoViewHelper().cancelCacheHDData(); + } + } } 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 fbbb4ab578..4dca845c89 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 @@ -466,4 +466,11 @@ public class MogoMapUIController implements IMogoMapUIController { } return true; } + + @Override + public void cancelDownloadCacheData() { + if (mDelegate != null) { + mDelegate.cancelDownloadCacheData(); + } + } } 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 f48f36cc66..98bc405067 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 @@ -405,4 +405,11 @@ public class AMapUIController implements IMogoMapUIController { } return true; } + + @Override + public void cancelDownloadCacheData() { + if (mClient != null) { + mClient.cancelDownloadCacheData(); + } + } } From eb12c0d4bcbdd6e936b9ada1a50bc62e772e1b10 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Mon, 20 Feb 2023 13:31:49 +0800 Subject: [PATCH 04/15] =?UTF-8?q?[2.14.0][Fix]=E8=A7=A3=E5=86=B3Taxi?= =?UTF-8?q?=E4=B9=98=E5=AE=A2=E5=B1=8F=E6=89=93=E5=8C=85=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taxi/passenger/model/TaxiPassengerGeocodeSearchModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerGeocodeSearchModel.java b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerGeocodeSearchModel.java index 213ab2d358..c43702af78 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerGeocodeSearchModel.java +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/model/TaxiPassengerGeocodeSearchModel.java @@ -55,10 +55,10 @@ public class TaxiPassengerGeocodeSearchModel implements GeocodeSearch.OnGeocodeS //通过经纬度逆地理编码得到位置 try { mGeocodeSearch = new GeocodeSearch(mContext); + mGeocodeSearch.setOnGeocodeSearchListener(this); } catch (AMapException e) { e.printStackTrace(); } - mGeocodeSearch.setOnGeocodeSearchListener(this); timer = new Timer(); timerTask = new TimerTask() { @Override From 24bb64cf3f9e21fc7466abd8302df0a1a6ce6e38 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Mon, 20 Feb 2023 18:52:03 +0800 Subject: [PATCH 05/15] =?UTF-8?q?[2.14.0][Fix]=E8=A7=A3=E5=86=B3=E9=AB=98?= =?UTF-8?q?=E7=B2=BE=E5=9C=B0=E5=9B=BE=E7=BC=93=E5=AD=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E7=8A=B6=E6=80=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/call/map/CallerMapUIServiceManager.kt | 2 +- .../mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.java | 2 +- .../src/main/java/com/mogo/map/MogoMapUIController.java | 2 +- .../main/java/com/mogo/map/uicontroller/AMapUIController.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt index bf7f44b92b..6db8e65512 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapUIServiceManager.kt @@ -36,7 +36,7 @@ object CallerMapUIServiceManager { } fun isCityDataCached(): Boolean { - return serviceProvider?.mapUIController?.isCityDataCached ?: true + return serviceProvider?.mapUIController?.isCityDataCached ?: false } fun getOverlayManager(): IMogoOverlayManager?{ 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 0becb4a9c9..09aea37182 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 @@ -1103,7 +1103,7 @@ public class AMapViewWrapper implements IMogoMapView, } } } - return true; + return false; } @Override 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 4dca845c89..9554442fea 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 @@ -464,7 +464,7 @@ public class MogoMapUIController implements IMogoMapUIController { if (mDelegate != null) { return mDelegate.isCityDataCached(); } - return true; + return false; } @Override 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 98bc405067..090f1ccbd4 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 @@ -403,7 +403,7 @@ public class AMapUIController implements IMogoMapUIController { if (mClient != null) { return mClient.isCityDataCached(); } - return true; + return false; } @Override From c37d2b162df9ca825e42dd13e0c4edf11d460b30 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 21 Feb 2023 16:20:49 +0800 Subject: [PATCH 06/15] =?UTF-8?q?[2.14.0][Fix]=E8=A7=A3=E5=86=B3=E9=AB=98?= =?UTF-8?q?=E7=B2=BE=E5=9C=B0=E5=9B=BE=E7=BC=93=E5=AD=98=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt index b1db9d6a14..e7c083b27e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/map/OfflineMapDialog.kt @@ -60,8 +60,8 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) { leftView?.setOnClickListener { when { isConfirm -> { - cacheHDOfflineData() showNewContent(isLoading = true, false) + cacheHDOfflineData() } else -> { dismiss() @@ -72,6 +72,7 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) { rightView?.setOnClickListener { when { isRetry -> { + showNewContent(isLoading = true, false) cacheHDOfflineData() } else -> { @@ -160,11 +161,14 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) { downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_success_icon) } else -> { + isRetry = true + isConfirm = false offlineTitleView?.text = context.resources.getString(R.string.offline_download_failure) okView?.visibility = View.GONE progressBar?.visibility = View.GONE downloadPercentView?.visibility = View.GONE leftView?.visibility = View.VISIBLE + leftView?.text = context.resources.getString(R.string.ok_tip) rightView?.visibility = View.VISIBLE vertLineView?.visibility = View.VISIBLE rightView?.text = context.resources.getString(R.string.retry) From 189521c508ebaabd12db4af264e9a0d3b24028a0 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 21 Feb 2023 16:21:18 +0800 Subject: [PATCH 07/15] =?UTF-8?q?[2.14.0][Fix]=E8=A7=A3=E5=86=B3=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E6=97=B6=E5=B0=91=E5=AF=BC=E5=8C=85=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt index e17b432a38..9dc9637ff1 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt @@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.msgbox import android.content.Context import android.os.Looper +import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.msgbox.* import com.mogo.eagle.core.data.report.ReportEntity import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager From 6fa458a31fd91118396d0fe898449b57b79df959 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 21 Feb 2023 17:12:28 +0800 Subject: [PATCH 08/15] =?UTF-8?q?[Opt3.0][Update]=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E6=B4=B1=E6=B5=B7=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 84fbc00de8..0af01e8d99 100644 --- a/gradle.properties +++ b/gradle.properties @@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.4.7 MOGO_TELEMATIC_VERSION=1.4.4.7 ######## MogoAiCloudSDK Version ######## # 自研地图 -MAP_SDK_VERSION=2.10.0.2_test_01 +MAP_SDK_VERSION=2.10.0.9 MAP_SDK_OPERATION_VERSION=1.1.4.1 # websocket WEBSOCKET_VERSION=1.1.7 From b976791e0ebf3d2f993b714298d53d2a2268cbfe Mon Sep 17 00:00:00 2001 From: donghongyu Date: Tue, 21 Feb 2023 18:17:01 +0800 Subject: [PATCH 09/15] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[?= =?UTF-8?q?=201=E3=80=81=E8=A7=A3=E9=99=A4=E6=95=B0=E6=8D=AE=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E5=AF=B9=E9=AB=98=E5=BE=B7=E5=9C=B0=E5=9B=BE=E7=9A=84?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../build.gradle | 1 - .../location/MoGoLocationDispatcher.kt | 105 +++---------- .../map/listener/IGaoDeMapLocationListener.kt | 2 +- .../CallerGaoDeMapLocationListenerManager.kt | 24 +++ .../mogo/map/location/GDLocationClient.java | 101 ------------ .../com/mogo/map/location/GDLocationClient.kt | 147 ++++++++++++++++++ 6 files changed, 192 insertions(+), 188 deletions(-) create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerGaoDeMapLocationListenerManager.kt delete mode 100644 libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.java create mode 100644 libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.kt diff --git a/core/function-impl/mogo-core-function-datacenter/build.gradle b/core/function-impl/mogo-core-function-datacenter/build.gradle index 70e7c4ac08..fab4051ccf 100644 --- a/core/function-impl/mogo-core-function-datacenter/build.gradle +++ b/core/function-impl/mogo-core-function-datacenter/build.gradle @@ -55,7 +55,6 @@ dependencies { implementation rootProject.ext.dependencies.androidxroomktx implementation rootProject.ext.dependencies.mogoaicloudtelematic - implementation rootProject.ext.dependencies.amapnavi3dmap implementation project(':libraries:mogo-obu') implementation project(':libraries:mogo-adas') 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 index dc052cf491..945490bfd2 100644 --- 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 @@ -1,26 +1,21 @@ 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.config.FunctionBuildConfig 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.api.map.listener.IGaoDeMapLocationListener import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager +import com.mogo.eagle.core.function.call.map.CallerGaoDeMapLocationListenerManager import com.mogo.eagle.core.function.call.obu.CallerObuLocationWGS84ListenerManager import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr -import com.mogo.eagle.core.utilcode.util.CoordinateTransform import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils import com.mogo.eagle.core.utilcode.util.TimeUtils -import com.mogo.eagle.core.utilcode.util.Utils -import com.mogo.support.obu.model.MogoObuHvBasicsData import mogo.telematics.pad.MessagePad /** @@ -31,12 +26,11 @@ import mogo.telematics.pad.MessagePad object MoGoLocationDispatcher : IMoGoChassisGnssListener, IMoGoObuLocationWGS84Listener, - AMapLocationListener { + IGaoDeMapLocationListener { private const val TAG = "MoGoLocationManager" private var mCityCode: String? = null - private var mapLocation: AMapLocation? = null /** * 最后一次工控机GNSS返回更新的位置 @@ -54,33 +48,10 @@ object MoGoLocationDispatcher : 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) CallerObuLocationWGS84ListenerManager.addListener(TAG, this) + CallerGaoDeMapLocationListenerManager.addListener(TAG, this) } override fun onChassisGnss(gnssInfo: MessagePad.GnssInfo) { @@ -88,13 +59,13 @@ object MoGoLocationDispatcher : lastGnssLocation.gnssInfo = gnssInfo lastGnssLocation.lastReceiveTime = TimeUtils.getNowMills() // 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等 - mapLocation?.let { + lastGaoDeLocation.let { //agps 高德 //agps_rtk 高德-高精 lastGnssLocation.locType = 1000 // 定位类型为WGS84进行转译的坐标 lastGnssLocation.satellite = 4 - lastGnssLocation.cityName = it.city + lastGnssLocation.cityName = it.cityName lastGnssLocation.cityCode = it.cityCode lastGnssLocation.provider = it.provider lastGnssLocation.address = it.address @@ -128,79 +99,42 @@ object MoGoLocationDispatcher : MultiDisplayUtils.getOtherDisplay() } + /** * 高德地图位置改变回调 - * @param aMapLocation 位置信息 + * @param mogoLocation 位置信息 */ - override fun onLocationChanged(aMapLocation: AMapLocation) { - mapLocation = aMapLocation - // 更新GNSS 信息 - lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills() - - // 将高德中的一些用于业务的数据进行融合,例如: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.locType = 1 // 定位类型为高德坐标(网路或者硬件定位) - lastGaoDeLocation.satellite = 4 - - 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 - } + override fun onMoGoLocationChanged(mogoLocation: MogoLocation) { + // 更新GaoDe 信息 + lastGaoDeLocation = mogoLocation // 计算最后一次工控机同步的定位是否超时,如果超时则切换为高德地图定位,暂定超过30秒需要切换 if (1 == FunctionBuildConfig.gpsProvider) { - if (TimeUtils.getNowMills() - lastGnssLocation.lastReceiveTime > 30000) { + if (TimeUtils.getNowMills() - lastGnssLocation.lastReceiveTime > 10000) { syncGaoDeLocation() } } else if (2 == FunctionBuildConfig.gpsProvider) { - if (TimeUtils.getNowMills() - lastOBULocation.lastReceiveTime > 30000) { + if (TimeUtils.getNowMills() - lastOBULocation.lastReceiveTime > 10000) { syncGaoDeLocation() } } - // 本地SP缓存城市Code - val cityCode = aMapLocation.cityCode + val cityCode = mogoLocation.cityCode if (cityCode != null && cityCode.isNotEmpty()) { - mCityCode = aMapLocation.cityCode + mCityCode = mogoLocation.cityCode SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()) .putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode) SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()) .putString( SharedPrefsConstants.LOCATION_LATITUDE, - aMapLocation.latitude.toString() + mogoLocation.latitude.toString() ) SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()) .putString( SharedPrefsConstants.LOCATION_LONGITUDE, - aMapLocation.longitude.toString() + mogoLocation.longitude.toString() ) } @@ -236,13 +170,13 @@ object MoGoLocationDispatcher : lastOBULocation.lastReceiveTime = TimeUtils.getNowMills() // 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等 - mapLocation?.let { + lastGaoDeLocation.let { //agps 高德 //agps_rtk 高德-高精 lastOBULocation.locType = 1000 // 定位类型为WGS84进行转译的坐标 lastOBULocation.satellite = 4 - lastOBULocation.cityName = it.city + lastOBULocation.cityName = it.cityName lastOBULocation.cityCode = it.cityCode lastOBULocation.provider = it.provider lastOBULocation.address = it.address @@ -274,4 +208,5 @@ object MoGoLocationDispatcher : ) } } + } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IGaoDeMapLocationListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IGaoDeMapLocationListener.kt index 872df234ce..e45c2b085d 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IGaoDeMapLocationListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IGaoDeMapLocationListener.kt @@ -14,5 +14,5 @@ interface IGaoDeMapLocationListener { * * @param location 新定位点 */ - fun onLocationChanged(location: MogoLocation, from: Int, isGps: Boolean) + fun onMoGoLocationChanged(location: MogoLocation) } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerGaoDeMapLocationListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerGaoDeMapLocationListenerManager.kt new file mode 100644 index 0000000000..5c0f09e2dd --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerGaoDeMapLocationListenerManager.kt @@ -0,0 +1,24 @@ +package com.mogo.eagle.core.function.call.map + +import com.mogo.eagle.core.data.map.MogoLocation +import com.mogo.eagle.core.function.api.map.listener.IGaoDeMapLocationListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * 高德地图定位监听 + */ +object CallerGaoDeMapLocationListenerManager : CallerBase() { + + /** + * 高德位置改变监听 + */ + @Synchronized + fun invokeMoGoLocationChanged(location: MogoLocation) { + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.onMoGoLocationChanged(location) + } + } + +} \ No newline at end of file diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.java b/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.java deleted file mode 100644 index 2dfa892d3d..0000000000 --- a/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.mogo.map.location; - -import android.content.Context; - -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.utilcode.mogo.storage.SharedPrefsMgr; - -/** - * 封装高德地图通过设备GPS获取到的位置信息,频率1s一次,坐标系为CJC20 - * 这里的数据仅用于非高精度业务 - */ -public class GDLocationClient implements AMapLocationListener, IMogoGDLocationClient { - - private volatile static GDLocationClient gdLocationClient; - private static final byte[] obj = new byte[0]; - - public static GDLocationClient getInstance(Context context) { - if (gdLocationClient == null) { - synchronized (obj) { - if (gdLocationClient == null) { - gdLocationClient = new GDLocationClient(context); - } - } - } - return gdLocationClient; - } - - //声明LocationClient对象 - private AMapLocationClient mLocationClient; - private String mCityCode; - private AMapLocation mapLocation; - - private GDLocationClient(Context context) { - AMapLocationClient.updatePrivacyShow(context, true, true); - AMapLocationClient.updatePrivacyAgree(context, true); - try { - mLocationClient = new AMapLocationClient(context); - - //初始化定位参数 - //声明mLocationOption对象 - AMapLocationClientOption mLocationOption = new AMapLocationClientOption(); - //设置定位监听 - mLocationClient.setLocationListener(this); - //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式 - mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy); - //设置定位间隔,单位毫秒,默认为2000ms - mLocationOption.setInterval(1000); - //设置定位参数 - mLocationClient.setLocationOption(mLocationOption); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - public void start() { - if (mLocationClient != null) { - mLocationClient.startLocation(); - } - } - - @Override - public void stop() { - if (mLocationClient != null) { - mLocationClient.stopLocation(); - } - } - - @Override - public void onLocationChanged(AMapLocation aMapLocation) { - if (aMapLocation != null) { - mapLocation = aMapLocation; - String cityCode = aMapLocation.getCityCode(); - if (cityCode != null && !cityCode.isEmpty()) { - mCityCode = aMapLocation.getCityCode(); - SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()) - .putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode); - } - } - } - - @Override - public String getLastCityCode() { - return mCityCode; - } - - @Override - public double getLastLat() { - return mapLocation != null ? mapLocation.getLatitude() : 0.0; - } - - @Override - public double getLastLon() { - return mapLocation != null ? mapLocation.getLongitude() : 0.0; - } -} diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.kt b/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.kt new file mode 100644 index 0000000000..8945ded1cf --- /dev/null +++ b/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.kt @@ -0,0 +1,147 @@ +package com.mogo.map.location + +import android.content.Context +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.map.MogoLocation +import com.mogo.eagle.core.function.call.map.CallerGaoDeMapLocationListenerManager +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 + +/** + * 封装高德地图通过设备GPS获取到的位置信息,频率1s一次,坐标系为CJC20 + * 这里的数据仅用于非高精度业务 + */ +class GDLocationClient private constructor(context: Context) : AMapLocationListener, + IMogoGDLocationClient { + //声明LocationClient对象 + private lateinit var mLocationClient: AMapLocationClient + private var mCityCode: String = "" + private var mapLocation: AMapLocation? = null + + /** + * 最后一次高德定位返回的位置信息 + */ + private var lastGaoDeLocation: MogoLocation = MogoLocation() + + init { + AMapLocationClient.updatePrivacyShow(context, true, true) + AMapLocationClient.updatePrivacyAgree(context, true) + try { + mLocationClient = AMapLocationClient(context) + + //初始化定位参数 + //声明mLocationOption对象 + val mLocationOption = AMapLocationClientOption() + //设置定位监听 + mLocationClient.setLocationListener(this) + //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式 + mLocationOption.locationMode = AMapLocationClientOption.AMapLocationMode.Hight_Accuracy + //设置定位间隔,单位毫秒,默认为2000ms + mLocationOption.interval = 1000 + //设置定位参数 + mLocationClient.setLocationOption(mLocationOption) + } catch (e: Exception) { + e.printStackTrace() + } + } + + override fun start() { + if (mLocationClient != null) { + mLocationClient.startLocation() + } + } + + override fun stop() { + if (mLocationClient != null) { + mLocationClient.stopLocation() + } + } + + override fun onLocationChanged(aMapLocation: AMapLocation) { + // 更新GNSS 信息 + lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills() + + // 将高德中的一些用于业务的数据进行融合,例如: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.locType = 1 // 定位类型为高德坐标(网路或者硬件定位) + lastGaoDeLocation.satellite = 4 + + 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 + } + + // 回掉给监听者 + CallerGaoDeMapLocationListenerManager.invokeMoGoLocationChanged(lastGaoDeLocation) + + mapLocation = aMapLocation + val cityCode = aMapLocation.cityCode + if (cityCode != null && !cityCode.isEmpty()) { + mCityCode = aMapLocation.cityCode + SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()) + .putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode) + } + } + + override fun getLastCityCode(): String { + return mCityCode + } + + override fun getLastLat(): Double { + return if (mapLocation != null) mapLocation!!.latitude else 0.0 + } + + override fun getLastLon(): Double { + return if (mapLocation != null) mapLocation!!.longitude else 0.0 + } + + companion object { + @Volatile + private var gdLocationClient: GDLocationClient? = null + private val obj = ByteArray(0) + + @JvmStatic + fun getInstance(context: Context): GDLocationClient? { + if (gdLocationClient == null) { + synchronized(obj) { + if (gdLocationClient == null) { + gdLocationClient = GDLocationClient(context) + } + } + } + return gdLocationClient + } + } +} \ No newline at end of file From d99ee9ba6feeca3ee56ff7bd96240e1f92308f69 Mon Sep 17 00:00:00 2001 From: donghongyu Date: Tue, 21 Feb 2023 18:17:06 +0800 Subject: [PATCH 10/15] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[?= =?UTF-8?q?=201=E3=80=81=E8=A7=A3=E9=99=A4=E6=95=B0=E6=8D=AE=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E5=AF=B9=E9=AB=98=E5=BE=B7=E5=9C=B0=E5=9B=BE=E7=9A=84?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../core/function/startup/stageone/HttpDnsStartUp.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 a5ad0ae66e..34b96faae4 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 @@ -141,8 +141,9 @@ class HttpDnsStartUp : AndroidStartup() { } if (mogoLocation != null && mogoLocation.latitude != 0.0 && mogoLocation.longitude != 0.0) { // 更新 - httpDnsSimpleLocation = if (mogoLocation.cityCode.isNullOrEmpty() - && !CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode.isNullOrEmpty() + httpDnsSimpleLocation = if ( + mogoLocation.cityCode.isNullOrEmpty() && + !CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode.isNullOrEmpty() ) { HttpDnsSimpleLocation( CallerMapUIServiceManager.getGDLocationServer(context!!)?.lastCityCode @@ -233,7 +234,7 @@ class HttpDnsStartUp : AndroidStartup() { } private fun startSocketService() { - CallerLogger.d("$M_MAIN$TAG","startSocketService") + CallerLogger.d("$M_MAIN$TAG", "startSocketService") val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02() MogoAiCloudSocketManager.getInstance(context) .registerLifecycleListener(10020, object : IMogoLifecycleListener { @@ -306,7 +307,10 @@ class HttpDnsStartUp : AndroidStartup() { clientPkFileName = "sn" ) private fun reConnectSocket(oldCityCode: String, newCityCode: String) { - CallerLogger.d("$M_MAIN$TAG", "reConnectSocket oldCityCode : $oldCityCode , newCityCode : $newCityCode") + CallerLogger.d( + "$M_MAIN$TAG", + "reConnectSocket oldCityCode : $oldCityCode , newCityCode : $newCityCode" + ) MogoAiCloudSocketManager.getInstance(context).reConnect() } From 1b1724668c9cbbe90ecfdcdc46c0810e1d3518f4 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Tue, 21 Feb 2023 18:33:27 +0800 Subject: [PATCH 11/15] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=AD=94=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/biz/v2x/v2n/consts/V2XConst.java | 2 +- .../mofang/MoFangManager.kt | 233 +++++++++++++++++- .../function/hmi/ui/setting/SOPSettingView.kt | 1 - .../function/main/MainLauncherActivity.java | 228 +---------------- .../api/mofang/IMoGoMoFangListener.kt | 17 ++ .../mofang/CallerMofangListenerManager.kt | 21 ++ 6 files changed, 275 insertions(+), 227 deletions(-) create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/mofang/IMoGoMoFangListener.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/mofang/CallerMofangListenerManager.kt diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/V2XConst.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/V2XConst.java index c2f4fd35d5..049d25ada1 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/V2XConst.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/consts/V2XConst.java @@ -20,6 +20,6 @@ public class V2XConst { /** * V2X预警日志tag */ - public static final String LOG_NAME_WARN = "liyz"; + public static final String LOG_NAME_WARN = "PersonWarn"; } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt index 23a07755f4..2d2f43601e 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt @@ -7,18 +7,33 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.IntentFilter +import android.view.KeyEvent +import com.mogo.commons.context.ContextHolderUtil import com.mogo.eagle.core.data.mofang.MfConstants +import com.mogo.eagle.core.function.api.mofang.IMoGoMoFangListener +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorChangeLaneLeft +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorChangeLaneRight +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorSetAcceleratedSpeed +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorSetHorn +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager.invokeMoFangStatus +import com.mogo.eagle.core.function.call.mofang.CallerMofangListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +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.Companion.M_F import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr +import com.mogo.eagle.core.utilcode.util.ToastUtils +import com.mogo.eagle.core.utilcode.util.UiThreadHandler +import java.util.* /** * 魔方连接状态和设备管理 */ @SuppressLint("StaticFieldLeak") -class MoFangManager private constructor() { +class MoFangManager private constructor() : IMoGoMoFangListener{ companion object { val moFangManager: MoFangManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { @@ -31,6 +46,29 @@ class MoFangManager private constructor() { private lateinit var mBluetoothAdapter: BluetoothAdapter private var isMfConnect: Boolean = false //添加状态判断 + private val isShowToast = false //toast 控制,自测使用 + private var startPressTime: Long = 0 //开始按键时间 + private var isPressEnd = false //按键是否结束 + @Volatile + private var isCombinationKey = 0 //是否是组合按键 1单击,2长按,3组合 + private var pressADownTime: Long = 0 + private var pressAUpTime: Long = 0 + private var pressBDownTime: Long = 0 + private var pressBUpTime: Long = 0 + private var pressCDownTime: Long = 0 + private var pressCUpTime: Long = 0 + private var pressDDownTime: Long = 0 + private var pressDUpTime: Long = 0 + private var pressEDownTime: Long = 0 + private var pressEUpTime: Long = 0 + + private val clickTime = 300 //单击 + private val clickTimeInterval = 330 + private val longPressTime = 670 + private val longPressTimeInterval = 700 + private var timerHorn: Timer? = null + private var timerAcc: Timer? = null + fun init(context: Context) { mContext = context @@ -41,6 +79,12 @@ class MoFangManager private constructor() { } mBluetoothAdapter.startDiscovery() showBondedDevice(mBluetoothAdapter) + + CallerMofangListenerManager.addListener(TAG, this) + } + + fun release() { + CallerMofangListenerManager.removeListener(TAG) } /** @@ -89,7 +133,7 @@ class MoFangManager private constructor() { private val bluetoothMonitorReceiver: BroadcastReceiver = object : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { when (intent.action) { - BluetoothAdapter.ACTION_STATE_CHANGED -> { //中间状态 TODO + BluetoothAdapter.ACTION_STATE_CHANGED -> { //中间状态 CallerLogger.d("$M_F${TAG}","bluetoothMonitorReceiver ACTION_STATE_CHANGED action = ${intent.action}") } @@ -115,5 +159,190 @@ class MoFangManager private constructor() { } } + /** + * 魔方按键处理 + */ + override fun onMofangHandle(keyCode: Int, action: Int): Boolean { + val bluetoothName = SharedPrefsMgr.getInstance(ContextHolderUtil.getContext()).getString(MfConstants.BLUETOOTH_NAME) + if (bluetoothName == "MINI_KEYBOARD") { + if (!isPressEnd) { + isPressEnd = true + startPressTime = System.currentTimeMillis() + } + e(M_F + "MoFangManager", + "dispatchKeyEvent ------ bluetoothName = $bluetoothName ---code = $keyCode -----action = $action ") + if (keyCode == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2 + if (action == KeyEvent.ACTION_DOWN) { + pressADownTime = System.currentTimeMillis() + d(M_F + "MoFangManager", + "dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime) + if (pressADownTime - startPressTime in (clickTimeInterval + 1) until longPressTime && pressBDownTime > 0) { + if (isShowToast) { + ToastUtils.showShort("方块 A 按AB组合 +1 ") + } + sendAcc(true, +1.0) + isCombinationKey = 3 + } + if (isCombinationKey != 3 && isCombinationKey != 1) { + if (pressADownTime - startPressTime > longPressTimeInterval) { + if (isShowToast) { + ToastUtils.showShort("方块 长按A -2 ") + } + sendAcc(true, -2.0) + isCombinationKey = 2 + } + } + } else if (action == KeyEvent.ACTION_UP) { + pressAUpTime = System.currentTimeMillis() + d(M_F + "MoFangManager", + "dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime + "---isCombinationKey = $isCombinationKey") + if (pressAUpTime - startPressTime < clickTime && isCombinationKey != 3) { + isCombinationKey = 1 + if (isShowToast) { + ToastUtils.showShort("方块 单击A -1 ") + } + sendAcc(true, -1.0) + } + pressADownTime = 0 + isPressEnd = false + UiThreadHandler.postDelayed({ isCombinationKey = 0 }, 300) + } + } else if (keyCode == KeyEvent.KEYCODE_B) { //单击复原,长按+1,AB组合-2 + if (action == KeyEvent.ACTION_DOWN) { + pressBDownTime = System.currentTimeMillis() + d(M_F + "MoFangManager", + "dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime + ) + if (pressBDownTime - startPressTime > clickTimeInterval && pressBDownTime - startPressTime < longPressTime && pressADownTime > 0) { + if (isShowToast) { + ToastUtils.showShort("方块 B 按AB组合 +1 ") + } + sendAcc(true, +1.0) + isCombinationKey = 3 + } + if (isCombinationKey != 3 && isCombinationKey != 1) { + if (pressBDownTime - startPressTime > longPressTimeInterval) { + if (isShowToast) { + ToastUtils.showShort("方块 长按B 无操作 ") + } + isCombinationKey = 2 + } + } + } else if (action == KeyEvent.ACTION_UP) { + pressBUpTime = System.currentTimeMillis() + d(M_F + "MoFangManager", + "dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime + "----isCombinationKey = $isCombinationKey") + if (pressBUpTime - startPressTime < clickTime && isCombinationKey != 3) { + if (isShowToast) { + ToastUtils.showShort("方块 单击B 0 ") + } + sendAcc(false, 0.0) + isCombinationKey = 1 + } + pressBDownTime = 0 + isPressEnd = false + UiThreadHandler.postDelayed({ isCombinationKey = 0 }, 300) + } + } else if (keyCode == KeyEvent.KEYCODE_C) { //单击左变道,长按无操作 + if (action == KeyEvent.ACTION_DOWN) { + pressCDownTime = System.currentTimeMillis() + d(M_F + "MoFangManager", + "dispatchKeyEvent 方块 长按C 无操作 time dif = " + (pressCDownTime - startPressTime)) + if (pressCDownTime - startPressTime > longPressTimeInterval) { + if (isShowToast) { + ToastUtils.showShort("方块 长按C 无操作 ") + } + } + } else if (action == KeyEvent.ACTION_UP) { + pressCUpTime = System.currentTimeMillis() + isPressEnd = false + d(M_F + "MoFangManager", + "dispatchKeyEvent 方块 单击C ← 向左变道 time dif = " + (pressCUpTime - startPressTime)) + if (pressCUpTime - startPressTime < clickTime) { + if (isShowToast) { + ToastUtils.showShort("方块 单击C ← 向左变道 ") + } + sendOperatorChangeLaneLeft() + } + } + } else if (keyCode == KeyEvent.KEYCODE_D) { //单击向右变道,双击无操作 + if (action == KeyEvent.ACTION_DOWN) { + pressDDownTime = System.currentTimeMillis() + d(M_F + "MoFangManager", + "dispatchKeyEvent 方块 长按D 无操作 time dif = " + (pressDDownTime - startPressTime)) + if (pressDDownTime - startPressTime > longPressTimeInterval) { + if (isShowToast) { + ToastUtils.showShort("方块 长按D 无操作 ") + } + } + } else if (action == KeyEvent.ACTION_UP) { + pressDUpTime = System.currentTimeMillis() + isPressEnd = false + d(M_F + "MoFangManager", + "dispatchKeyEvent 方块 单击D → 向右变道 time dif = " + (pressDUpTime - startPressTime)) + if (pressDUpTime - startPressTime < clickTime) { + if (isShowToast) { + ToastUtils.showShort("方块 单击D → 向右变道 ") + } + sendOperatorChangeLaneRight() + } + } + } else if (keyCode == KeyEvent.KEYCODE_E) { //单击启动自驾,长按鸣笛 + if (action == KeyEvent.ACTION_DOWN) { + pressEDownTime = System.currentTimeMillis() + d(M_F + "MoFangManager", + "dispatchKeyEvent 方块 长按E 鸣笛 time dif = " + (pressEDownTime - startPressTime)) + if (pressEDownTime - startPressTime > longPressTimeInterval) { + if (isShowToast) { + ToastUtils.showShort("方块 长按E 鸣笛 ") + } + sendOperatorSetHorn(1.0) + if (timerHorn == null) { + timerHorn = Timer() + } + timerHorn!!.schedule(object : TimerTask() { + override fun run() { + sendOperatorSetHorn(2.0) + timerHorn = null + } + }, 500) + } + } else if (action == KeyEvent.ACTION_UP) { + pressEUpTime = System.currentTimeMillis() + isPressEnd = false + d(M_F + "MoFangManager", + "方块 单击E 开启自动驾驶 time dif = " + (pressEUpTime - startPressTime)) + if (pressEUpTime - startPressTime < clickTime) { + if (isShowToast) { + ToastUtils.showShort("方块 单击E 开启自动驾驶 ") + } + startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters) + } + } + } + } + return true + } + + @Synchronized + private fun sendAcc(isSend: Boolean, acc: Double) { + if (isSend) { + if (timerAcc == null) { + timerAcc = Timer() + timerAcc!!.schedule(object : TimerTask() { + override fun run() { + sendOperatorSetAcceleratedSpeed(acc) + } + }, 0, 500) + } + } else { + if (timerAcc != null) { + timerAcc!!.cancel() + timerAcc = null + } + sendOperatorSetAcceleratedSpeed(acc) + } + } + } 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 2b6dadfb77..d7f34d5901 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 @@ -117,7 +117,6 @@ internal class SOPSettingView @JvmOverloads constructor( tbObuToDcView.setOnCheckedChangeListener { _, isChecked -> // 默认开启 HmiBuildConfig.isShowObuToDcV2iView = !isChecked -// Log.d("liyz", "HmiBuildConfig.isShowObuToDcV2iView = " + HmiBuildConfig.isShowObuToDcV2iView) } //红绿灯标识 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 a80465d6a3..7049008ae7 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 @@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.main; import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_START_UP; import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_INIT; import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_CONNECT_STATUS; -import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_F; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI; import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAIN; @@ -21,20 +20,15 @@ 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.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.CallerAutoPilotControlManager; -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager; +import com.mogo.eagle.core.function.call.mofang.CallerMofangListenerManager; import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager; import com.mogo.eagle.core.function.hmi.R; import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils; 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.ActivityUtils; import com.mogo.eagle.core.utilcode.util.MultiDisplayUtils; -import com.mogo.eagle.core.utilcode.util.ToastUtils; -import com.mogo.eagle.core.utilcode.util.UiThreadHandler; import com.rousetime.android_startup.model.CostTimesModel; import com.zhjt.service.chain.ChainLog; import com.zhjt.service.chain.TracingConstants; @@ -43,8 +37,6 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import java.util.List; -import java.util.Timer; -import java.util.TimerTask; /** * 针对作为Launcher的情况,做个性化操作 @@ -57,31 +49,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis private final static Handler handlerV2XEvent = new Handler(); private static Runnable runnableV2XEvent; - private volatile double accelerated;//加速度 - private Timer timerHorn; - private Timer timerAcc; - - private boolean isShowToast = false; //toast 控制 - private long startPressTime = 0; //开始按减时间 - private boolean isPressEnd = false; //按键是否结束 - private volatile int isCombinationKey = 0; //是否是组合按键 1单击,2长按,3组合 - private long pressADownTime = 0; - private long pressAUpTime = 0; - private long pressBDownTime = 0; - private long pressBUpTime = 0; - private long pressCDownTime = 0; - private long pressCUpTime = 0; - private long pressDDownTime = 0; - private long pressDUpTime = 0; - private long pressEDownTime = 0; - private long pressEUpTime = 0; - - private int clickTime = 300; //单击 - private int clickTimeInterval = 330; - private int longPressTime = 670; - private int longPressTimeInterval = 700; - - @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -240,200 +207,15 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis */ @Override public boolean dispatchKeyEvent(KeyEvent event) { - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent code = " + event.getKeyCode() + "--action = " + event.getAction() + "----" + event); - String bluetoothName = SharedPrefsMgr.getInstance(getContext()).getString(MfConstants.BLUETOOTH_NAME); - if (!isPressEnd) { - CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent ---1--- bluetoothName = " + bluetoothName); + if(CallerMofangListenerManager.INSTANCE.invokeMofangHandle(event.getKeyCode(), event.getAction())) { + return true; + } else { + return super.dispatchKeyEvent(event); } - if (bluetoothName.equals("MINI_KEYBOARD")) { - if (!isPressEnd) { - isPressEnd = true; - startPressTime = System.currentTimeMillis(); - } - CallerLogger.INSTANCE.d(M_F + "MoFangManager","dispatchKeyEvent ---2--- bluetoothName = " + bluetoothName + "--- code = " + event.getKeyCode() + "--action = " + event.getAction()); - if (event.getKeyCode() == KeyEvent.KEYCODE_A) { //单击 -1,长按无操作,AB组合-2 - if (event.getAction() == KeyEvent.ACTION_DOWN) { - pressADownTime = System.currentTimeMillis(); - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent A down pressADownTime = " + pressADownTime + "---" + (pressADownTime - startPressTime) + "----isCombinationKey = " + isCombinationKey + "--pressBDownTime = " + pressBDownTime); - if ((pressADownTime - startPressTime) > clickTimeInterval && (pressADownTime - startPressTime) < longPressTime && pressBDownTime > 0) { - if (isShowToast) { - ToastUtils.showShort("方块 A 按AB组合 +1 "); - } - sendAcc(true, +1); - isCombinationKey = 3; - } - - if (isCombinationKey != 3 && isCombinationKey != 1) { - if ((pressADownTime - startPressTime) > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按A -2 "); - } - sendAcc(true, -2); - isCombinationKey = 2; - } - } - } else if (event.getAction() == KeyEvent.ACTION_UP) { - pressAUpTime = System.currentTimeMillis(); - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent A up pressAUpTime = " + pressAUpTime + "---" + (pressAUpTime - startPressTime) + "--pressBDownTime = " + pressBDownTime); - if ((pressAUpTime - startPressTime) < clickTime && isCombinationKey != 3) { - isCombinationKey = 1; - if (isShowToast) { - ToastUtils.showShort("方块 单击A -1 "); - } - sendAcc(true, -1); - } - pressADownTime = 0; - isPressEnd = false; - UiThreadHandler.postDelayed(new Runnable() { - @Override - public void run() { - isCombinationKey = 0; - } - }, 300); - } - return true; - } else if (event.getKeyCode() == KeyEvent.KEYCODE_B) { //单击复原,长按+1,AB组合-2 - if (event.getAction() == KeyEvent.ACTION_DOWN) { - pressBDownTime = System.currentTimeMillis(); - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent B down pressBDownTime = " + pressBDownTime + "--差-" + (pressBDownTime - startPressTime) + "---isCombinationKey = " + isCombinationKey + "--pressADownTime = " + pressADownTime); - if ((pressBDownTime - startPressTime) > clickTimeInterval && (pressBDownTime - startPressTime) < longPressTime && pressADownTime > 0) { - if (isShowToast) { - ToastUtils.showShort("方块 B 按AB组合 +1 "); - } - sendAcc(true, +1); - isCombinationKey = 3; - } - if (isCombinationKey != 3 && isCombinationKey != 1) { - if ((pressBDownTime - startPressTime) > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按B 无操作 "); - } - isCombinationKey = 2; - } - } - } else if (event.getAction() == KeyEvent.ACTION_UP) { - pressBUpTime = System.currentTimeMillis(); - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent B up pressBUpTime = " + pressBUpTime + "--差-" + (pressBUpTime - startPressTime) + "--pressADownTime = " + pressADownTime); - if ((pressBUpTime - startPressTime) < clickTime && isCombinationKey != 3) { - if (isShowToast) { - ToastUtils.showShort("方块 单击B 0 "); - } - sendAcc(false, 0.0); - isCombinationKey = 1; - } - pressBDownTime = 0; - isPressEnd = false; - - UiThreadHandler.postDelayed(new Runnable() { - @Override - public void run() { - isCombinationKey = 0; - } - }, 300); - } - return true; - } else if (event.getKeyCode() == KeyEvent.KEYCODE_C) { //单击左变道,长按无操作 - if (event.getAction() == KeyEvent.ACTION_DOWN) { - pressCDownTime = System.currentTimeMillis(); - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按C 无操作 time dif = " + (pressCDownTime - startPressTime)); - if ((pressCDownTime - startPressTime) > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按C 无操作 "); - } - } - } else if (event.getAction() == KeyEvent.ACTION_UP) { - pressCUpTime = System.currentTimeMillis(); - isPressEnd = false; - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击C ← 向左变道 time dif = " + (pressCUpTime - startPressTime)); - if ((pressCUpTime - startPressTime) < clickTime) { - if (isShowToast) { - ToastUtils.showShort("方块 单击C ← 向左变道 "); - } - CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneLeft(); - } - } - return true; - } else if (event.getKeyCode() == KeyEvent.KEYCODE_D) { //单击向右变道,双击无操作 - if (event.getAction() == KeyEvent.ACTION_DOWN) { - pressDDownTime = System.currentTimeMillis(); - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按D 无操作 time dif = " + (pressDDownTime - startPressTime)); - if ((pressDDownTime - startPressTime) > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按D 无操作 "); - } - } - } else if (event.getAction() == KeyEvent.ACTION_UP) { - pressDUpTime = System.currentTimeMillis(); - isPressEnd = false; - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击D → 向右变道 time dif = " + (pressDUpTime - startPressTime)); - if ((pressDUpTime - startPressTime) < clickTime) { - if (isShowToast) { - ToastUtils.showShort("方块 单击D → 向右变道 "); - } - CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneRight(); - } - } - return true; - } else if (event.getKeyCode() == KeyEvent.KEYCODE_E) { //单击启动自驾,长按鸣笛 - if (event.getAction() == KeyEvent.ACTION_DOWN) { - pressEDownTime = System.currentTimeMillis(); - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按E 鸣笛 time dif = " + (pressEDownTime - startPressTime)); - if ((pressEDownTime - startPressTime) > longPressTimeInterval) { - if (isShowToast) { - ToastUtils.showShort("方块 长按E 鸣笛 "); - } - CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(1); - if (timerHorn == null) { - timerHorn = new Timer(); - } - timerHorn.schedule(new TimerTask() { - @Override - public void run() { - CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(2); - timerHorn = null; - } - }, 500); - } - } else if (event.getAction() == KeyEvent.ACTION_UP) { - pressEUpTime = System.currentTimeMillis(); - isPressEnd = false; - CallerLogger.INSTANCE.d(M_F + "MoFangManager", "方块 单击E 开启自动驾驶 time dif = " + (pressEUpTime - startPressTime)); - if ((pressEUpTime - startPressTime) < clickTime) { - if (isShowToast) { - ToastUtils.showShort("方块 单击E 开启自动驾驶 "); - } - CallerAutoPilotControlManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters()); - } - } - return true; - } - } - return super.dispatchKeyEvent(event); } @Override public void onSkinModeChange(int skinMode) { } - private synchronized void sendAcc(boolean isSend, double acc) { - if (isSend) { - accelerated = acc; - if (timerAcc == null) { - timerAcc = new Timer(); - timerAcc.schedule(new TimerTask() { - @Override - public void run() { - CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated); - } - }, 0, 500); - } - } else { - if (timerAcc != null) { - timerAcc.cancel(); - timerAcc = null; - } - CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc); - } - } - } diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/mofang/IMoGoMoFangListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/mofang/IMoGoMoFangListener.kt new file mode 100644 index 0000000000..802113f5dc --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/mofang/IMoGoMoFangListener.kt @@ -0,0 +1,17 @@ +package com.mogo.eagle.core.function.api.mofang + + +/** + * 魔方数据的数据处理 + * @author lixiaopeng + * @date 2023-02-20 + */ +interface IMoGoMoFangListener { + /** + * 魔方数据的数据处理 + * @param keyCode 按键类型 + * @param action 按键状态 + */ + fun onMofangHandle(keyCode: Int, action: Int): Boolean + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/mofang/CallerMofangListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/mofang/CallerMofangListenerManager.kt new file mode 100644 index 0000000000..0464d323e1 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/mofang/CallerMofangListenerManager.kt @@ -0,0 +1,21 @@ +package com.mogo.eagle.core.function.call.mofang + +import com.mogo.eagle.core.function.api.mofang.IMoGoMoFangListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * 魔方按键的处理 + */ +object CallerMofangListenerManager : CallerBase() { + fun invokeMofangHandle(keyCode: Int, action: Int): Boolean { + var isConsume = false + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + if (listener.onMofangHandle(keyCode, action)) + isConsume = true + } + return isConsume + } + +} \ No newline at end of file From daf12ce529aff0b7227d3e93d100fc162d808ba4 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Tue, 21 Feb 2023 18:45:50 +0800 Subject: [PATCH 12/15] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=A4=9A=E4=BD=99=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/datacenter/obu/MoGoObuProvider.kt | 3 --- .../function/datacenter/obu/MogoObuDcCombineManager.kt | 4 ---- .../function/datacenter/obu/MogoPrivateObuNewManager.kt | 9 --------- 3 files changed, 16 deletions(-) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt index 0e6f1f200d..3e55c6a63f 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt @@ -2,16 +2,13 @@ package com.mogo.eagle.core.function.datacenter.obu import android.content.Context import com.alibaba.android.arouter.facade.annotation.Route -import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MoGoConfig import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider -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.Companion.M_OBU import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.CommonUtils -import com.mogo.support.obu.MogoObuManager /** * @author xiaoyuzhou 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 d97e5a1c5d..c5e9c8b345 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 @@ -6,16 +6,12 @@ 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 import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningMapListener import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsmListener import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningSpatListener import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager -import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.obu.* import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager 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 3dcdaea07f..ec299f6d9c 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 @@ -4,18 +4,13 @@ import android.content.Context import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.enums.* -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.function.api.hmi.warning.IMoGoWarningStatusListener import com.mogo.eagle.core.function.api.map.angle.Default import com.mogo.eagle.core.function.api.map.angle.TooClose import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager 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.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager import com.mogo.eagle.core.function.call.obu.CallerObuLocationWGS84ListenerManager import com.mogo.eagle.core.function.call.obu.CallerObuSaveMessageListenerManager @@ -856,10 +851,6 @@ class MogoPrivateObuNewManager private constructor() { 1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 if (!isShowRunRedLight) { isShowRunRedLight = true - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "changeTrafficLightStatus 闯红灯 --------> " - ) ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) alertContent = From 70630f2d5a55cbf8dece225868210250466da5a4 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 21 Feb 2023 14:26:20 +0800 Subject: [PATCH 13/15] [2.13.0-arch-opt] update socket ai cloud sdk version --- README.md | 1 - app/build.gradle | 1 - config.gradle | 6 ---- .../mogo-core-function-map/consumer-rules.pro | 1 - gradle.properties | 28 ++++++------------- 5 files changed, 9 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 34b016a07e..699ee30b1b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ repositories { mogo-och 使用到的依赖 implementation "com.mogo.commons:mogo-utils:2.0.63" implementation "com.mogo.commons:mogo-commons:2.0.63" -implementation "com.mogo.module:module-common:2.0.63" implementation "com.mogo.eagle.core:data:0.0.6" implementation "com.mogo.eagle.core.function:call:0.0.6" diff --git a/app/build.gradle b/app/build.gradle index f9c79c925d..38eaa76d91 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -356,7 +356,6 @@ dependencies { implementation rootProject.ext.dependencies.mogocommons implementation rootProject.ext.dependencies.mogo_core_utils implementation rootProject.ext.dependencies.mogo_core_function_map - implementation rootProject.ext.dependencies.mogo_core_function_v2x implementation rootProject.ext.dependencies.mogo_core_function_datacenter implementation rootProject.ext.dependencies.mogo_core_function_devatools implementation rootProject.ext.dependencies.mogo_core_function_chat diff --git a/config.gradle b/config.gradle index fab8cfd576..fd51e09b27 100644 --- a/config.gradle +++ b/config.gradle @@ -125,10 +125,6 @@ ext { mogocustommap : "com.zhidaoauto.machine:map:${MAP_SDK_VERSION}", mogocustommapoperational : "com.zhidaoauto.map:operational:${MAP_SDK_OPERATION_VERSION}", - modulemap : "com.mogo.module:module-map:${MOGO_MODULE_MAP_VERSION}", - - // V2X - moduleV2x : "com.mogo.module:module-v2x:${MOGO_MODULE_V2X_VERSION}", // 基础服务实现 mogowebsocket : "com.mogo.module.carchatting:module-carchatt-socket:${WEBSOCKET_VERSION}", mogologlib : "com.mogo.module:module-loglib:${LOGLIB_VERSION}", @@ -169,8 +165,6 @@ ext { mogo_core_function_devatools : "com.mogo.eagle.core.function.impl:devatools:${MOGO_CORE_FUNCTION_DEVATOOLS_VERSION}", mogo_core_function_hmi : "com.mogo.eagle.core.function.impl:hmi:${MOGO_CORE_FUNCTION_HMI_VERSION}", mogo_core_function_map : "com.mogo.eagle.core.function.impl:map:${MOGO_CORE_FUNCTION_MAP_VERSION}", - mogo_core_function_obu_mogo : "com.mogo.eagle.core.function.impl:obu-mogo:${MOGO_CORE_FUNCTION_OBU_MOGO_VERSION}", - mogo_core_function_v2x : "com.mogo.eagle.core.function.impl:v2x:${MOGO_CORE_FUNCTION_V2X_VERSION}", mogo_core_function_api : "com.mogo.eagle.core.function:api:${MOGO_CORE_FUNCTION_API_VERSION}", mogo_core_function_call : "com.mogo.eagle.core.function:call:${MOGO_CORE_FUNCTION_CALL_VERSION}", mogo_core_data : "com.mogo.eagle.core:data:${MOGO_CORE_DATA_VERSION}", diff --git a/core/function-impl/mogo-core-function-map/consumer-rules.pro b/core/function-impl/mogo-core-function-map/consumer-rules.pro index b294e7f5c4..77b92e3614 100644 --- a/core/function-impl/mogo-core-function-map/consumer-rules.pro +++ b/core/function-impl/mogo-core-function-map/consumer-rules.pro @@ -1,4 +1,3 @@ --keep class com.mogo.module.small.map.*{*;} -keep class com.android.internal.policy.MyPhoneLayoutInflater{*;} -keep class com.amap.api.col.n3.*{*;} diff --git a/gradle.properties b/gradle.properties index 0af01e8d99..89a64966b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -66,23 +66,23 @@ SERVICE_BIZ_VERSION=1.2.4 LOGLIB_VERSION=1.5.10 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION -MOGO_NETWORK_VERSION=1.4.4.7 +MOGO_NETWORK_VERSION=1.4.4.8 # 鉴权 -MOGO_PASSPORT_VERSION=1.4.4.7 +MOGO_PASSPORT_VERSION=1.4.4.8 # 常链接 -MOGO_SOCKET_VERSION=1.4.4.7 +MOGO_SOCKET_VERSION=1.4.4.8 # 数据采集 -MOGO_REALTIME_VERSION=1.4.4.7 +MOGO_REALTIME_VERSION=1.4.4.8 # 探路,道路事件发布,获取 -MOGO_TANLU_VERSION=1.4.4.7 +MOGO_TANLU_VERSION=1.4.4.8 # 直播推流 -MOGO_LIVE_VERSION=1.4.4.7 +MOGO_LIVE_VERSION=1.4.4.8 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.4.4.7 +MOGO_TRAFFICLIVE_VERSION=1.4.4.8 # 定位服务 -MOGO_LOCATION_VERSION=1.4.4.7 +MOGO_LOCATION_VERSION=1.4.4.8 # 远程通讯模块 -MOGO_TELEMATIC_VERSION=1.4.4.7 +MOGO_TELEMATIC_VERSION=1.4.4.8 ######## MogoAiCloudSDK Version ######## # 自研地图 MAP_SDK_VERSION=2.10.0.9 @@ -99,8 +99,6 @@ versionName=3.0.0 ################# 新架构模块Maven版本管理 ################# MOGO_CORE_FUNCTION_HMI_VERSION=0.0.58.10 MOGO_CORE_FUNCTION_MAP_VERSION=0.0.58.10 -MOGO_CORE_FUNCTION_OBU_MOGO_VERSION=0.0.58.10 -MOGO_CORE_FUNCTION_V2X_VERSION=0.0.58.10 MOGO_CORE_DATA_VERSION=0.0.58.10 MOGO_CORE_FUNCTION_API_VERSION=0.0.58.10 MOGO_CORE_FUNCTION_CALL_VERSION=0.0.58.10 @@ -113,8 +111,6 @@ MOGO_CORE_NETWORK_VERSION=0.0.58.10 MOGO_COMMONS_VERSION=2.1.16.10 MOGO_MAP_VERSION=2.1.16.10 MOGO_MAP_API_VERSION=2.1.16.10 -MOGO_MODULE_MAP_VERSION=2.1.16.10 -MOGO_MODULE_V2X_VERSION=2.1.16.10 # obu MOGO_MODULE_OBU_MOGO_VERSION=2.1.16.10 # bugly @@ -138,11 +134,6 @@ MOGO_OCH_TAXI_VERSION=2.0.66 # mogoAiCloud sdk services MOGO_AICLOUD_SERVICES_SDK_VERSION=2.1.16.10 -################# 旧版本架构模块版本 ################# - - - - # ADAS LIB Maven配置(用于地图部门测试使用,鹰眼项目中使用本地依赖) # ADAS_LIB_GROUP=com.zhidao.support.adas ADAS_LIB_POM_ARTIFACT_ID=high @@ -152,6 +143,5 @@ ADAS_DATA_LIB_GROUP=com.zhjt.mogo.adas.data ADAS_DATA_LIB_POM_ARTIFACT_ID=adas-data ADAS_DATA_LIB_CHILD_VERSION=.0 - # 线程优化版本 THREAD_OPT_VERSION=4.0.0 From db8bb54efacc0dc24fdbf58dd20b950e6163f1ac Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 21 Feb 2023 17:59:49 +0800 Subject: [PATCH 14/15] [2.13.0-arch-opt] .. --- .../com/mogo/launcher/startup/ConfigStartUp.kt | 2 +- .../hmi/ui/setting/DebugSettingView.kt | 5 ----- .../smp/view/ISmallMapDirectionView.java | 18 ------------------ .../res/layout/module_small_map_fragment.xml | 17 ----------------- 4 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/ISmallMapDirectionView.java delete mode 100644 core/function-impl/mogo-core-function-map/src/main/res/layout/module_small_map_fragment.xml diff --git a/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt b/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt index 1335dc0e52..a149317547 100644 --- a/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt @@ -101,7 +101,7 @@ object ConfigStartUp { } val mapParams = MapParams.init() - mapParams.setDebugMode(false) //todo 1-使用本地地图数据,0-使用在线地图数据 + mapParams.setDebugMode(false) // 1-使用本地地图数据,0-使用在线地图数据 //.setDataFileSource(1) .setDebugMode(false) .setCoordinateType(MapParams.COORDINATETYPE_GCJ02) 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 3c7341be2d..05606d4bba 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 @@ -662,11 +662,6 @@ internal class DebugSettingView @JvmOverloads constructor( FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = isChecked } - //TODO - tbIsDrawPath.setOnCheckedChangeListener { _, isChecked -> - - } - // 初始化 GSP数据源 数据 rgGpsProvider.check( when (FunctionBuildConfig.gpsProvider) { diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/ISmallMapDirectionView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/ISmallMapDirectionView.java deleted file mode 100644 index 7f2fb52fc9..0000000000 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/view/ISmallMapDirectionView.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.mogo.eagle.core.function.smp.view; - -/** - * @author xiaoyuzhou - * @date 2021/6/24 11:33 上午 - */ -public interface ISmallMapDirectionView { - - /** - * 绘制路径线 - */ - void drawablePolyline(); - - /** - * 清除路径线 - */ - void clearPolyline(); -} diff --git a/core/function-impl/mogo-core-function-map/src/main/res/layout/module_small_map_fragment.xml b/core/function-impl/mogo-core-function-map/src/main/res/layout/module_small_map_fragment.xml deleted file mode 100644 index 39ed764704..0000000000 --- a/core/function-impl/mogo-core-function-map/src/main/res/layout/module_small_map_fragment.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file From 68bf70246740e024d892b463c24ab0f20b76fcc4 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Tue, 21 Feb 2023 20:11:09 +0800 Subject: [PATCH 15/15] [2.13.0-arch-opt] remove brake and turn --- .../src/main/res/layout/bus_p_base_fragment.xml | 9 --------- .../src/main/res/layout/bus_base_fragment.xml | 8 -------- .../src/main/res/layout/sweeper_base_fragment.xml | 8 -------- .../src/main/res/layout/taxi_p_base_fragment.xml | 9 --------- .../src/main/res/layout/taxi_base_fragment.xml | 8 -------- 5 files changed, 42 deletions(-) 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 96b90db2b4..608ac59429 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 @@ -47,15 +47,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"/> - - - - - - - - - - - - - - -