diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml
index 96b90db2b4..608ac59429 100644
--- a/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml
+++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/res/layout/bus_p_base_fragment.xml
@@ -47,15 +47,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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/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 =
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..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
@@ -87,7 +88,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)
}
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/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..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 -> {
@@ -81,6 +82,9 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
}
okView?.setOnClickListener {
+ if (isLoading) {
+ CallerMapUIServiceManager.cancelDownloadCacheData()
+ }
dismiss()
}
}
@@ -90,6 +94,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 +141,7 @@ class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
@SuppressLint("UseCompatLoadingForDrawables")
private fun showNewContent(isLoading: Boolean, isSuccess: Boolean) {
+ this.isLoading = isLoading
change2NewStyle()
when {
isLoading -> {
@@ -150,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)
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 963bdac269..9b915f9a16 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
@@ -672,11 +672,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-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/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/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/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
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()
}
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-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-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/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/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/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..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?{
@@ -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/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
diff --git a/gradle.properties b/gradle.properties
index f5313f4759..fca6ede982 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -66,26 +66,26 @@ 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.2_test_01
+MAP_SDK_VERSION=2.10.0.9
MAP_SDK_OPERATION_VERSION=1.1.4.1
# websocket
WEBSOCKET_VERSION=1.1.7
@@ -99,8 +99,6 @@ versionName=1.0.2
################# 新架构模块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
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 {
}
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..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
@@ -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);
+ }
+ });
+ }
}
});
}
@@ -1084,6 +1103,13 @@ public class AMapViewWrapper implements IMogoMapView,
}
}
}
- return true;
+ return false;
+ }
+
+ @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..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,6 +464,13 @@ public class MogoMapUIController implements IMogoMapUIController {
if (mDelegate != null) {
return mDelegate.isCityDataCached();
}
- return true;
+ return false;
+ }
+
+ @Override
+ public void cancelDownloadCacheData() {
+ if (mDelegate != null) {
+ mDelegate.cancelDownloadCacheData();
+ }
}
}
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
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..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,6 +403,13 @@ public class AMapUIController implements IMogoMapUIController {
if (mClient != null) {
return mClient.isCityDataCached();
}
- return true;
+ return false;
+ }
+
+ @Override
+ public void cancelDownloadCacheData() {
+ if (mClient != null) {
+ mClient.cancelDownloadCacheData();
+ }
}
}