Merge branch 'dev_arch_opt_3.0' into 'dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0'
Dev arch opt 3.0 See merge request zhjt/AndroidApp/MoGoEagleEye!512
This commit is contained in:
@@ -62,7 +62,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxroomktx
|
||||
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-network')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.commons.utils.RetryWithDelay
|
||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.data.camera.ReqLiveCarBean
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -90,7 +90,7 @@ class CronTaskManager {
|
||||
* 请求路口一定范围内的设备信息(包含:摄像头、灯)
|
||||
*/
|
||||
private fun requestDeviceList() {
|
||||
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
disposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||
.create(ICameraListServices::class.java)
|
||||
.getDeviceList(location.longitude, location.latitude, 500)
|
||||
@@ -124,7 +124,7 @@ class CronTaskManager {
|
||||
}
|
||||
|
||||
private fun requestCarCameraList() {
|
||||
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()?.let { location ->
|
||||
carDisposable = MoGoRetrofitFactory.getInstance(HostConst.getEagleHost())
|
||||
.create(ICameraListServices::class.java)
|
||||
.getCarCameraList(ReqLiveCarBean(location.longitude, location.latitude))
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.mogo.eagle.core.data.trafficlight.TrafficLightStatusHelper.getCurrent
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
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
|
||||
@@ -84,7 +84,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
|
||||
fun listenTrafficLight() {
|
||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
CallVipSetListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
fun onDestroy() {
|
||||
CallVipSetListenerManager.removeListener(TAG)
|
||||
CallerTrafficLightListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.os.Looper
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -41,7 +41,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
fun initServer(context: Context) {
|
||||
mContext = context
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
mThreadHandler =
|
||||
TrafficLightThreadHandler(Looper.getMainLooper(), {
|
||||
//第一次查询路口时,如果红绿灯显示,则隐藏掉
|
||||
|
||||
@@ -61,13 +61,11 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_res
|
||||
} else {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:mogo-core-res')
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_DEFAULT
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VEHICLE_TEAM
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMType.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.chat.facade.analytics.ChatAnalyticsFacade
|
||||
import com.mogo.eagle.core.function.chat.facade.audio.AudioFocusFacade
|
||||
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
|
||||
@@ -581,7 +581,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
}
|
||||
//告之服务器给发送方下发接收通话消息
|
||||
try {
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VOICE.type).also {
|
||||
it.nickName = mySelf.get().name
|
||||
it.headImgUrl = mySelf.get().icon
|
||||
@@ -812,7 +812,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
}
|
||||
val response = serverApi.inviteJoinVehicleTeam(CallRequestParam().also {
|
||||
val user = mySelf.get()
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
it.snSender = mySn
|
||||
it.snReceiver = sn
|
||||
it.nickName = user.name
|
||||
@@ -958,7 +958,7 @@ object MoGoChatFacade: IMoGoChatFacade {
|
||||
}
|
||||
//告之服务器给发送方下发接收通话消息
|
||||
try {
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val response = serverApi.requestConnectStatus(ConnectStatusParam(MoGoAiCloudClientConfig.getInstance().sn, sn, roomId, PUSH_MSG_AGREE_ENTER, CALL_TYPE_VEHICLE_TEAM.type).also {
|
||||
it.nickName = mySelf.get().name
|
||||
it.headImgUrl = mySelf.get().icon
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.mogo.eagle.core.data.BaseResponse
|
||||
import com.mogo.eagle.core.data.chat.UserInfo
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts
|
||||
import com.mogo.eagle.core.function.api.chat.biz.IMCallType.CALL_TYPE_VOICE
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.chat.facade.net.bean.*
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
@@ -69,7 +69,7 @@ internal class ChatServiceModel {
|
||||
val map = hashMapOf<String, String>()
|
||||
val sn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
if (location != null) {
|
||||
params.lon = location.longitude
|
||||
params.lat = location.latitude
|
||||
@@ -103,7 +103,7 @@ internal class ChatServiceModel {
|
||||
|
||||
suspend fun requestRoomInfo(param: CallRequestParam): BaseResponse<RoomInfo> {
|
||||
val map = hashMapOf<String, String>()
|
||||
val location = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
if (location != null) {
|
||||
param.lat = location.latitude
|
||||
param.lon = location.longitude
|
||||
|
||||
@@ -60,17 +60,14 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
|
||||
implementation project(':libraries:mogo-adas')
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
} else {
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
|
||||
implementation project(':libraries:mogo-adas')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
@@ -6,16 +6,21 @@ 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.obu.IMoGoObuLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
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.FileUtils
|
||||
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
|
||||
|
||||
/**
|
||||
@@ -25,6 +30,7 @@ import mogo.telematics.pad.MessagePad
|
||||
*/
|
||||
object MoGoLocationDispatcher :
|
||||
IMoGoChassisGnssListener,
|
||||
IMoGoObuLocationWGS84Listener,
|
||||
AMapLocationListener {
|
||||
|
||||
private val TAG = "MoGoLocationManager"
|
||||
@@ -37,6 +43,11 @@ object MoGoLocationDispatcher :
|
||||
*/
|
||||
private var lastGnssLocation: MogoLocation = MogoLocation()
|
||||
|
||||
/**
|
||||
* 最后一次OBU GNSS 返回更新的位置
|
||||
*/
|
||||
private var lastOBULocation: MogoLocation = MogoLocation()
|
||||
|
||||
/**
|
||||
* 最后一次高德定位返回的位置信息
|
||||
*/
|
||||
@@ -69,6 +80,7 @@ object MoGoLocationDispatcher :
|
||||
|
||||
// 初始化监听订阅工控机位置信息
|
||||
CallerChassisGnssListenerManager.addListener(TAG, this)
|
||||
CallerObuLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onChassisGnss(gnssInfo: MessagePad.GnssInfo) {
|
||||
@@ -95,17 +107,19 @@ object MoGoLocationDispatcher :
|
||||
lastGnssLocation.errorCode = it.errorCode
|
||||
lastGnssLocation.errorInfo = it.errorInfo
|
||||
}
|
||||
|
||||
// WGS84坐标系高精度位置信息
|
||||
CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84(
|
||||
lastGnssLocation,
|
||||
DataSourceType.TELEMATIC
|
||||
)
|
||||
// GCJ02高德坐标系位置信息
|
||||
CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02(
|
||||
lastGnssLocation,
|
||||
DataSourceType.TELEMATIC
|
||||
)
|
||||
//FileUtils.writeToFile("/sdcard/Download/", "location_wgs84.txt", "${gnssInfo.longitude},${gnssInfo.latitude}\n")
|
||||
if (1 == FunctionBuildConfig.gpsProvider) {
|
||||
// WGS84坐标系高精度位置信息
|
||||
CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84(
|
||||
lastGnssLocation,
|
||||
DataSourceType.TELEMATIC
|
||||
)
|
||||
// GCJ02高德坐标系位置信息
|
||||
CallerChassisLocationGCJ02ListenerManager.invokeChassisLocationGCJ02(
|
||||
lastGnssLocation,
|
||||
DataSourceType.TELEMATIC
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,7 +129,7 @@ object MoGoLocationDispatcher :
|
||||
override fun onLocationChanged(aMapLocation: AMapLocation) {
|
||||
mapLocation = aMapLocation
|
||||
// 更新GNSS 信息
|
||||
|
||||
lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills()
|
||||
|
||||
// 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等
|
||||
mapLocation?.let {
|
||||
@@ -150,27 +164,100 @@ object MoGoLocationDispatcher :
|
||||
lastGaoDeLocation.errorInfo = it.errorInfo
|
||||
}
|
||||
|
||||
// 计算最后一次工控机同步的定位是否超时,如果超时则切换为高德地图定位,暂定超过10秒需要切换
|
||||
if (TimeUtils.getNowMills() - lastGnssLocation.lastReceiveTime > 10000) {
|
||||
// WGS84坐标系高精度位置信息
|
||||
CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84(
|
||||
lastGaoDeLocation,
|
||||
DataSourceType.MAP
|
||||
)
|
||||
// GCJ02高德坐标系位置信息
|
||||
CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02(
|
||||
lastGaoDeLocation,
|
||||
DataSourceType.MAP
|
||||
)
|
||||
// 计算最后一次工控机同步的定位是否超时,如果超时则切换为高德地图定位,暂定超过30秒需要切换
|
||||
if (1 == FunctionBuildConfig.gpsProvider) {
|
||||
if (TimeUtils.getNowMills() - lastGnssLocation.lastReceiveTime > 30000) {
|
||||
syncGaoDeLocation()
|
||||
}
|
||||
} else if (2 == FunctionBuildConfig.gpsProvider) {
|
||||
if (TimeUtils.getNowMills() - lastOBULocation.lastReceiveTime > 30000) {
|
||||
syncGaoDeLocation()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 本地SP缓存城市Code
|
||||
val cityCode = aMapLocation.cityCode
|
||||
if (cityCode != null && cityCode.isNotEmpty()) {
|
||||
mCityCode = aMapLocation.cityCode
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
|
||||
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(
|
||||
SharedPrefsConstants.LOCATION_LATITUDE,
|
||||
aMapLocation.latitude.toString()
|
||||
)
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
|
||||
.putString(
|
||||
SharedPrefsConstants.LOCATION_LONGITUDE,
|
||||
aMapLocation.longitude.toString()
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 对外同步高德回掉的定位数据
|
||||
*/
|
||||
private fun syncGaoDeLocation() {
|
||||
// WGS84坐标系高精度位置信息
|
||||
CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84(
|
||||
lastGaoDeLocation,
|
||||
DataSourceType.MAP
|
||||
)
|
||||
// GCJ02高德坐标系位置信息
|
||||
CallerChassisLocationGCJ02ListenerManager.invokeChassisLocationGCJ02(
|
||||
lastGaoDeLocation,
|
||||
DataSourceType.MAP
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU定位回调监听
|
||||
*/
|
||||
override fun onObuLocationWGS84(data: MogoObuHvBasicsData) {
|
||||
// 更新GNSS 信息
|
||||
lastOBULocation.longitude = data.vehBasicsMsg.longitude
|
||||
lastOBULocation.latitude = data.vehBasicsMsg.latitude
|
||||
lastOBULocation.heading = data.vehBasicsMsg.heading
|
||||
lastOBULocation.gnssSpeed = data.vehBasicsMsg.speed.toFloat()
|
||||
lastOBULocation.altitude = data.vehBasicsMsg.elevation
|
||||
lastOBULocation.satelliteTime = data.vehBasicsMsg.secMark
|
||||
lastOBULocation.lastReceiveTime = TimeUtils.getNowMills()
|
||||
|
||||
// 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等
|
||||
mapLocation?.let {
|
||||
lastOBULocation.cityName = it.city
|
||||
lastOBULocation.cityCode = it.cityCode
|
||||
lastOBULocation.provider = it.provider
|
||||
lastOBULocation.address = it.address
|
||||
lastOBULocation.district = it.district
|
||||
lastOBULocation.province = it.province
|
||||
lastOBULocation.adCode = it.adCode
|
||||
lastOBULocation.locationDetail = it.locationDetail
|
||||
lastOBULocation.poiName = it.poiName
|
||||
lastOBULocation.aoiName = it.aoiName
|
||||
lastOBULocation.street = it.street
|
||||
lastOBULocation.streetNum = it.streetNum
|
||||
lastOBULocation.description = it.description
|
||||
lastOBULocation.buildingId = it.buildingId
|
||||
lastOBULocation.floor = it.floor
|
||||
lastOBULocation.errorCode = it.errorCode
|
||||
lastOBULocation.errorInfo = it.errorInfo
|
||||
}
|
||||
|
||||
if (2 == FunctionBuildConfig.gpsProvider) {
|
||||
// WGS84坐标系高精度位置信息
|
||||
CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84(
|
||||
lastOBULocation,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
// GCJ02高德坐标系位置信息
|
||||
CallerChassisLocationGCJ02ListenerManager.invokeChassisLocationGCJ02(
|
||||
lastOBULocation,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,12 +37,12 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
MogoObuDcCombineManager.INSTANCE.init(context)
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
|
||||
|
||||
//bus乘客版本obu功能去掉
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
//不处理
|
||||
} else {
|
||||
//bus乘客版本obu功能去掉,大理项目需要全部车辆接收,不在限制
|
||||
// if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
// && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
// ) {
|
||||
// //不处理
|
||||
// } else {
|
||||
mContext = context
|
||||
mContext?.let {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { //bus 司机端
|
||||
@@ -66,7 +66,7 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Defa
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
|
||||
@@ -31,7 +32,6 @@ import com.mogo.support.obu.model.*
|
||||
import com.mogo.support.obu.model.advance.SpatLight
|
||||
import com.mogo.support.obu.option.MogoObuCom
|
||||
import com.mogo.support.obu.option.MogoObuOptions
|
||||
import org.json.JSONObject
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
@@ -107,45 +107,22 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
/**
|
||||
* HV车辆基础信息 CvxHvCarIndInfo CvxHvInfoIndInfo
|
||||
*/
|
||||
override fun onMogoObuHvBasics(p0: MogoObuHvBasicsData?) {
|
||||
if (p0 != null && p0.vehBasicsMsg != null) {
|
||||
override fun onMogoObuHvBasics(mogoObuHvBasicsData: MogoObuHvBasicsData?) {
|
||||
if (mogoObuHvBasicsData != null && mogoObuHvBasicsData.vehBasicsMsg != null) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuHvBasics lon = ${p0.vehBasicsMsg.longitude} --- lat = ${p0.vehBasicsMsg.latitude} ---speed = ${p0.vehBasicsMsg.speed} ---heading = ${p0.vehBasicsMsg.heading} --acceleration = ${p0.vehBasicsMsg.accFourAxes.accLat} --yawRate = ${p0.vehBasicsMsg.accFourAxes.accYaw}"
|
||||
"onMogoObuHvBasics lon = ${mogoObuHvBasicsData.vehBasicsMsg.longitude} --- lat = ${mogoObuHvBasicsData.vehBasicsMsg.latitude} ---speed = ${mogoObuHvBasicsData.vehBasicsMsg.speed} ---heading = ${mogoObuHvBasicsData.vehBasicsMsg.heading} --acceleration = ${mogoObuHvBasicsData.vehBasicsMsg.accFourAxes.accLat} --yawRate = ${mogoObuHvBasicsData.vehBasicsMsg.accFourAxes.accYaw}"
|
||||
)
|
||||
val data = JSONObject()
|
||||
try {
|
||||
data.putOpt("lon", p0.vehBasicsMsg.longitude)
|
||||
data.putOpt("lat", p0.vehBasicsMsg.latitude)
|
||||
data.putOpt("speed", p0.vehBasicsMsg.speed)
|
||||
data.putOpt("heading", p0.vehBasicsMsg.heading)
|
||||
data.putOpt("acceleration", p0.vehBasicsMsg.accFourAxes.accLat)
|
||||
data.putOpt("yawRate", p0.vehBasicsMsg.accFourAxes.accYaw)
|
||||
|
||||
try {
|
||||
data.putOpt("systemTime", System.currentTimeMillis())
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
try {
|
||||
data.putOpt("satelliteTime", System.currentTimeMillis())
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统,1-工控机,2-OBU
|
||||
if (2 == FunctionBuildConfig.gpsProvider) {
|
||||
// 同步给MAP地图
|
||||
CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(data)
|
||||
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
|
||||
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(
|
||||
System.currentTimeMillis() / 1000.0,
|
||||
p0.vehBasicsMsg.longitude,
|
||||
p0.vehBasicsMsg.latitude
|
||||
)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
// 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统,1-工控机,2-OBU
|
||||
if (2 == FunctionBuildConfig.gpsProvider) {
|
||||
// 同步给MAP地图
|
||||
CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(mogoObuHvBasicsData)
|
||||
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
|
||||
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(
|
||||
System.currentTimeMillis() / 1000.0,
|
||||
mogoObuHvBasicsData.vehBasicsMsg.longitude,
|
||||
mogoObuHvBasicsData.vehBasicsMsg.latitude
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -621,7 +598,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息的方位 车辆相关
|
||||
@@ -894,7 +871,6 @@ private var isShowGreenWave = false
|
||||
private var isShowRunRedLight = false
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改红绿灯
|
||||
*/
|
||||
@@ -1004,22 +980,38 @@ private fun changeTrafficLightStatus(
|
||||
when (currentLight.light) {
|
||||
// 灯光不可用
|
||||
0 -> {
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(TrafficLightEnum.BLACK,-1,DataSourceType.OBU)
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
|
||||
TrafficLightEnum.BLACK,
|
||||
-1,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
// 红灯
|
||||
2, 3 -> {
|
||||
val red = currentLight.countDown.toInt()
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(TrafficLightEnum.RED,red,DataSourceType.OBU)
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
|
||||
TrafficLightEnum.RED,
|
||||
red,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
// 绿灯
|
||||
4, 5, 6 -> {
|
||||
val green = currentLight.countDown.toInt()
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(TrafficLightEnum.GREEN,green,DataSourceType.OBU)
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
|
||||
TrafficLightEnum.GREEN,
|
||||
green,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
// 黄灯
|
||||
7, 8 -> {
|
||||
val yellow = currentLight.countDown.toInt()
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(TrafficLightEnum.YELLOW,yellow,DataSourceType.OBU)
|
||||
CallerTrafficLightListenerManager.invokeTrafficLightPlusSource(
|
||||
TrafficLightEnum.YELLOW,
|
||||
yellow,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,14 +88,11 @@ dependencies {
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_res
|
||||
}else {
|
||||
implementation project(':foudations:mogo-aicloud-services-sdk')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-res')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,9 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneTAG
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager
|
||||
import com.zhjt.mogo_core_function_devatools.binding.BindingCarManager.Companion.bindingCarManager
|
||||
import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigCenter.Companion.bizConfigCenter
|
||||
@@ -21,6 +23,8 @@ import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchManager
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangManager.Companion.moFangManager
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.MonitorManager
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb.Companion.getDb
|
||||
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager.Companion.iPCReportManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.StatusManager
|
||||
@@ -55,6 +59,27 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
bindingCarManager.init(mContext!!)
|
||||
}
|
||||
|
||||
override fun checkMonitorDb() {
|
||||
mContext?.let {
|
||||
Thread {
|
||||
val limitId: Long = 50001
|
||||
val file = it.getDatabasePath(MonitorDb.INTERNAL_DB_NAME)
|
||||
try {
|
||||
if (file != null && file.exists()) {
|
||||
val cpuList = getDb(it).monitorDao().getAllCPUById(limitId)
|
||||
val memList = getDb(it).monitorDao().getAllMemById(limitId)
|
||||
// 大于5w条清除
|
||||
if (cpuList.isNotEmpty() || memList.isNotEmpty()) {
|
||||
it.deleteDatabase(MonitorDb.INTERNAL_DB_NAME)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
CallerLogger.e(TAG, e.message)
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
}
|
||||
|
||||
override fun startLogCatch() {
|
||||
MogoLogCatchManager.startCatchLog()
|
||||
}
|
||||
@@ -148,6 +173,26 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
return EnvChangeManager.getEnvConfig()
|
||||
}
|
||||
|
||||
override fun getEnvCityName(): String {
|
||||
return EnvChangeManager.getCityName()
|
||||
}
|
||||
|
||||
override fun getEnvNetMode(): String {
|
||||
return EnvChangeManager.getNetMode()
|
||||
}
|
||||
|
||||
override fun envConfigReset() {
|
||||
EnvChangeManager.reset()
|
||||
}
|
||||
|
||||
override fun envConfigChange(cityCode: String, netMode: Int) {
|
||||
EnvChangeManager.changeTo(cityCode, netMode)
|
||||
}
|
||||
|
||||
override fun dockerVersion(dockerVersion: String?) {
|
||||
BadCaseConfig.dockerVersion = dockerVersion
|
||||
}
|
||||
|
||||
override fun modifyCarInfo(callBack: (ModifyBindingcarInfo) -> Unit) {
|
||||
bindingCarManager.modifyCarInfo(callBack)
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@ package com.zhjt.mogo_core_function_devatools.env
|
||||
|
||||
import android.content.Context.MODE_PRIVATE
|
||||
import android.os.Process
|
||||
import com.mogo.commons.constants.*
|
||||
import com.mogo.commons.debug.*
|
||||
import com.mogo.commons.constants.SharedPrefsConstants
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.EnvConfig
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.*
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
|
||||
|
||||
object EnvChangeManager {
|
||||
@@ -34,7 +34,7 @@ object EnvChangeManager {
|
||||
fun getCityName(): String {
|
||||
val cache = getConfig()
|
||||
return if (cache == null) {
|
||||
when(CallerMapLocationListenerManager.getCurrentLocation()?.cityCode ?: SharedPrefsMgr.getInstance(Utils.getApp()).getString(SharedPrefsConstants.LOCATION_CITY_CODE) ?: "010") {
|
||||
when(CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()?.cityCode ?: SharedPrefsMgr.getInstance(Utils.getApp()).getString(SharedPrefsConstants.LOCATION_CITY_CODE) ?: "010") {
|
||||
"010" -> "北京"
|
||||
"0734" -> "衡阳"
|
||||
else -> "未知"
|
||||
|
||||
@@ -78,39 +78,23 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.koomnative
|
||||
implementation rootProject.ext.dependencies.koomxhook
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
api rootProject.ext.dependencies.mogoaicloudservicesdk
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
api rootProject.ext.dependencies.crashreportupgrade
|
||||
|
||||
api rootProject.ext.dependencies.mogo_core_res
|
||||
api rootProject.ext.dependencies.mogo_core_data
|
||||
api rootProject.ext.dependencies.mogo_core_utils
|
||||
api rootProject.ext.dependencies.mogo_core_network
|
||||
api rootProject.ext.dependencies.mogo_core_function_map
|
||||
api rootProject.ext.dependencies.mogo_core_function_v2x
|
||||
api rootProject.ext.dependencies.mogo_core_function_devatools
|
||||
api rootProject.ext.dependencies.mogo_core_function_call
|
||||
|
||||
implementation project(':libraries:map-usbcamera')
|
||||
compileOnly rootProject.ext.dependencies.mogocommons
|
||||
compileOnly rootProject.ext.dependencies.mogo_core_res
|
||||
compileOnly rootProject.ext.dependencies.mogo_core_utils
|
||||
compileOnly rootProject.ext.dependencies.mogo_core_function_datacenter
|
||||
compileOnly rootProject.ext.dependencies.mogo_core_function_call
|
||||
compileOnly project(':libraries:mogo-adas')
|
||||
} else {
|
||||
api project(':foudations:mogo-aicloud-services-sdk')
|
||||
api project(':foudations:mogo-commons')
|
||||
api project(':test:crashreport-upgrade')
|
||||
api project(':test:crashreport-apmbyte')
|
||||
|
||||
api project(':core:mogo-core-res')
|
||||
api project(':core:mogo-core-data')
|
||||
api project(':core:mogo-core-utils')
|
||||
api project(':core:function-impl:mogo-core-function-map')
|
||||
api project(':core:function-impl:mogo-core-function-v2x')
|
||||
api project(':core:function-impl:mogo-core-function-devatools')
|
||||
api project(':core:function-impl:mogo-core-function-chat')
|
||||
api project(':core:function-impl:mogo-core-function-datacenter')
|
||||
api project(':core:function-impl:mogo-core-function-biz')
|
||||
api project(':core:mogo-core-function-call')
|
||||
api project(':libraries:mogo-adas')
|
||||
api project(':libraries:map-usbcamera')
|
||||
compileOnly project(':core:function-impl:mogo-core-function-datacenter')
|
||||
compileOnly project(':foudations:mogo-commons')
|
||||
compileOnly project(':core:mogo-core-res')
|
||||
compileOnly project(':core:mogo-core-utils')
|
||||
compileOnly project(':core:mogo-core-function-call')
|
||||
compileOnly project(':libraries:mogo-adas')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,18 +7,15 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.DriverMsgBoxBubbleAdapter
|
||||
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.layout_driver_msg_box_bubble.view.*
|
||||
|
||||
|
||||
@@ -45,14 +45,12 @@ import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuConnectListener
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
|
||||
@@ -77,7 +75,6 @@ import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.mogo.support.obu.MogoObuManager
|
||||
import com.mogo.support.obu.constants.MogoObuLogLevel
|
||||
import com.mogo.support.obu.option.MogoObuLog
|
||||
import com.zhjt.mogo_core_function_devatools.env.*
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -233,7 +230,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
// 移除 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
// 移除 地图样式改变 监听
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
// 移除 域控制器感知数据 监听
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
// 移除 规划路径相关回调 监听
|
||||
@@ -932,7 +929,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
//切换环境
|
||||
tvCurEnv.text = "当前环境:${EnvChangeManager.getCityName()}${EnvChangeManager.getNetMode()}"
|
||||
tvCurEnv.text = "当前环境:${CallerDevaToolsManager.getEnvCityName()}${CallerDevaToolsManager.getEnvNetMode()}"
|
||||
btChangeEnv.onClick {
|
||||
PopupMenu(context, btChangeEnv).also { p ->
|
||||
p.menuInflater.inflate(R.menu.menu_env_pop, p.menu)
|
||||
@@ -946,19 +943,19 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
return@setOnMenuItemClickListener false
|
||||
}
|
||||
R.id.env_reset ->
|
||||
EnvChangeManager.reset()
|
||||
CallerDevaToolsManager.envConfigReset()
|
||||
R.id.hy_product ->
|
||||
EnvChangeManager.changeTo("0734", DebugConfig.NET_MODE_RELEASE)
|
||||
CallerDevaToolsManager.envConfigChange("0734", DebugConfig.NET_MODE_RELEASE)
|
||||
R.id.hy_qa ->
|
||||
EnvChangeManager.changeTo("0734", DebugConfig.NET_MODE_QA)
|
||||
CallerDevaToolsManager.envConfigChange("0734", DebugConfig.NET_MODE_QA)
|
||||
R.id.hy_demo ->
|
||||
EnvChangeManager.changeTo("0734", DebugConfig.NET_MODE_DEMO)
|
||||
CallerDevaToolsManager.envConfigChange("0734", DebugConfig.NET_MODE_DEMO)
|
||||
R.id.bj_product ->
|
||||
EnvChangeManager.changeTo("010", DebugConfig.NET_MODE_RELEASE)
|
||||
CallerDevaToolsManager.envConfigChange("010", DebugConfig.NET_MODE_RELEASE)
|
||||
R.id.bj_qa ->
|
||||
EnvChangeManager.changeTo("010", DebugConfig.NET_MODE_QA)
|
||||
CallerDevaToolsManager.envConfigChange("010", DebugConfig.NET_MODE_QA)
|
||||
R.id.bj_demo ->
|
||||
EnvChangeManager.changeTo("010", DebugConfig.NET_MODE_DEMO)
|
||||
CallerDevaToolsManager.envConfigChange("010", DebugConfig.NET_MODE_DEMO)
|
||||
else ->
|
||||
throw AssertionError("invalid item: $item")
|
||||
}
|
||||
@@ -1099,17 +1096,9 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
accelerationIsShow = isChecked
|
||||
}
|
||||
|
||||
tbRouteDynamicEffect.isChecked =
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) && !AppIdentityModeUtils.isBus(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
|
||||
tbRouteDynamicEffect.isChecked = HmiBuildConfig.isShowRouteStrategy
|
||||
tbRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
RouteStrategy.enable(true)
|
||||
} else {
|
||||
RouteStrategy.enable(false)
|
||||
}
|
||||
HmiBuildConfig.isShowRouteStrategy = isChecked
|
||||
}
|
||||
|
||||
btnThresholdDefine.setOnClickListener {
|
||||
|
||||
@@ -18,7 +18,6 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.currentPadding
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
@@ -64,16 +63,9 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
//引导线动态效果
|
||||
tbRouteDynamicEffect.isChecked =
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) && !AppIdentityModeUtils.isBus(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
tbRouteDynamicEffect.isChecked = HmiBuildConfig.isShowRouteStrategy
|
||||
tbRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
RouteStrategy.enable(true)
|
||||
} else {
|
||||
RouteStrategy.enable(false)
|
||||
}
|
||||
HmiBuildConfig.isShowRouteStrategy = isChecked
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,8 +76,8 @@ class BatteryGroupView : LinearLayout, IMoGoSkinModeChangeListener {
|
||||
if (isCharging) {
|
||||
it.ivBatteryCharge.visibility = View.VISIBLE
|
||||
when(it.mSkinMode){
|
||||
0 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_light)
|
||||
1 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_dark)
|
||||
0 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_dark)
|
||||
1 -> it.ivBatteryCharge.setImageResource(R.drawable.battery_charge_light)
|
||||
}
|
||||
} else {
|
||||
it.ivBatteryCharge.visibility = View.GONE
|
||||
|
||||
@@ -7,7 +7,7 @@ import android.view.Gravity
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -55,7 +55,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
// 注册位置回调
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
// 开启定时查询速度
|
||||
timerTask?.cancel()
|
||||
val task = object : TimerTask() {
|
||||
@@ -86,7 +86,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 解除注册
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
try {
|
||||
timerTask?.cancel()
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -9,11 +9,11 @@ import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import kotlinx.android.synthetic.main.view_version_name.view.*
|
||||
|
||||
/**
|
||||
@@ -90,7 +90,7 @@ class VersionNameView @JvmOverloads constructor(
|
||||
dockerVersion = autoPilotStatusInfo.dockVersion
|
||||
showCurrentMapVersion()
|
||||
//将工控机版本赋值给BadCase配置常量
|
||||
BadCaseConfig.dockerVersion = autoPilotStatusInfo.dockVersion
|
||||
CallerDevaToolsManager.dockerVersion(autoPilotStatusInfo.dockVersion)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,14 +50,9 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.map.listener.MogoMapListenerHandler.Companion.mogoMapListenerHandler
|
||||
import com.mogo.map.uicontroller.EnumMapUI
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb.Companion.getDb
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
import kotlinx.android.synthetic.main.module_main_activity_main.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
import system_master.SystemStatusInfo
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -223,7 +218,7 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
// 启动Native内存泄漏监测
|
||||
startLeakMonitor()
|
||||
}
|
||||
checkMonitorDb()
|
||||
CallerDevaToolsManager.checkMonitorDb()
|
||||
}
|
||||
|
||||
private fun startLeakMonitor() {
|
||||
@@ -255,25 +250,6 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
start()
|
||||
}
|
||||
|
||||
private fun checkMonitorDb() {
|
||||
Thread {
|
||||
val limitId: Long = 50001
|
||||
val file = getDatabasePath(MonitorDb.INTERNAL_DB_NAME)
|
||||
try {
|
||||
if (file != null && file.exists()) {
|
||||
val cpuList = getDb(this).monitorDao().getAllCPUById(limitId)
|
||||
val memList = getDb(this).monitorDao().getAllMemById(limitId)
|
||||
// 大于5w条清除
|
||||
if (cpuList.isNotEmpty() || memList.isNotEmpty()) {
|
||||
deleteDatabase(MonitorDb.INTERNAL_DB_NAME)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e(TAG, e.message)
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_LINK_LOG_NATIVE_LEAK,
|
||||
linkCode = ChainConstant.CHAIN_LINK_LEAK,
|
||||
|
||||
@@ -13,7 +13,6 @@ import android.os.Handler;
|
||||
import android.os.Process;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -46,8 +45,6 @@ import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
|
||||
/**
|
||||
* 针对作为Launcher的情况,做个性化操作
|
||||
*
|
||||
@@ -78,6 +75,11 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
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) {
|
||||
@@ -251,7 +253,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
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) > 360 && (pressADownTime - startPressTime) < 1300 && pressBDownTime > 0) {
|
||||
if ((pressADownTime - startPressTime) > clickTimeInterval && (pressADownTime - startPressTime) < longPressTime && pressBDownTime > 0) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 A 按AB组合 +1 ");
|
||||
}
|
||||
@@ -260,7 +262,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
}
|
||||
|
||||
if (isCombinationKey != 3 && isCombinationKey != 1) {
|
||||
if ((pressADownTime - startPressTime) > 1320) {
|
||||
if ((pressADownTime - startPressTime) > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按A -2 ");
|
||||
}
|
||||
@@ -271,7 +273,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
} 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) < 350 && isCombinationKey != 3) {
|
||||
if ((pressAUpTime - startPressTime) < clickTime && isCombinationKey != 3) {
|
||||
isCombinationKey = 1;
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击A -1 ");
|
||||
@@ -292,7 +294,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
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) > 360 && (pressBDownTime - startPressTime) < 1300 && pressADownTime > 0) {
|
||||
if ((pressBDownTime - startPressTime) > clickTimeInterval && (pressBDownTime - startPressTime) < longPressTime && pressADownTime > 0) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 B 按AB组合 +1 ");
|
||||
}
|
||||
@@ -300,7 +302,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
isCombinationKey = 3;
|
||||
}
|
||||
if (isCombinationKey != 3 && isCombinationKey != 1) {
|
||||
if ((pressBDownTime - startPressTime) > 1320) {
|
||||
if ((pressBDownTime - startPressTime) > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按B 无操作 ");
|
||||
}
|
||||
@@ -310,7 +312,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
} 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) < 350 && isCombinationKey != 3) {
|
||||
if ((pressBUpTime - startPressTime) < clickTime && isCombinationKey != 3) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击B 0 ");
|
||||
}
|
||||
@@ -332,7 +334,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressCDownTime = System.currentTimeMillis();
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按C 无操作 time dif = " + (pressCDownTime - startPressTime));
|
||||
if ((pressCDownTime - startPressTime) > 1320) {
|
||||
if ((pressCDownTime - startPressTime) > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按C 无操作 ");
|
||||
}
|
||||
@@ -341,7 +343,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
pressCUpTime = System.currentTimeMillis();
|
||||
isPressEnd = false;
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击C ← 向左变道 time dif = " + (pressCUpTime - startPressTime));
|
||||
if ((pressCUpTime - startPressTime) < 350) {
|
||||
if ((pressCUpTime - startPressTime) < clickTime) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击C ← 向左变道 ");
|
||||
}
|
||||
@@ -353,7 +355,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressDDownTime = System.currentTimeMillis();
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按D 无操作 time dif = " + (pressDDownTime - startPressTime));
|
||||
if ((pressDDownTime - startPressTime) > 1320) {
|
||||
if ((pressDDownTime - startPressTime) > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按D 无操作 ");
|
||||
}
|
||||
@@ -362,7 +364,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
pressDUpTime = System.currentTimeMillis();
|
||||
isPressEnd = false;
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 单击D → 向右变道 time dif = " + (pressDUpTime - startPressTime));
|
||||
if ((pressDUpTime - startPressTime) < 350) {
|
||||
if ((pressDUpTime - startPressTime) < clickTime) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击D → 向右变道 ");
|
||||
}
|
||||
@@ -374,7 +376,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
pressEDownTime = System.currentTimeMillis();
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "dispatchKeyEvent 方块 长按E 鸣笛 time dif = " + (pressEDownTime - startPressTime));
|
||||
if ((pressEDownTime - startPressTime) > 1320) {
|
||||
if ((pressEDownTime - startPressTime) > longPressTimeInterval) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 长按E 鸣笛 ");
|
||||
}
|
||||
@@ -394,7 +396,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
pressEUpTime = System.currentTimeMillis();
|
||||
isPressEnd = false;
|
||||
CallerLogger.INSTANCE.d(M_F + "MoFangManager", "方块 单击E 开启自动驾驶 time dif = " + (pressEUpTime - startPressTime));
|
||||
if ((pressEUpTime - startPressTime) < 350) {
|
||||
if ((pressEUpTime - startPressTime) < clickTime) {
|
||||
if (isShowToast) {
|
||||
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
|
||||
}
|
||||
|
||||
@@ -75,13 +75,10 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
|
||||
implementation rootProject.ext.dependencies.mogomap
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
} else {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':core:mogo-core-res')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:function-impl:mogo-core-function-datacenter')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(":libraries:mogo-map")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import androidx.annotation.Nullable;
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
@@ -65,7 +65,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
|
||||
}
|
||||
|
||||
public void start() {
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
Timer mTimer = new Timer();
|
||||
mTimer.schedule(new SpeedTimerTask(), 3000, 1000);
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.zhidaoauto.map.operational.open.GatherApi
|
||||
@@ -26,7 +25,8 @@ import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER)
|
||||
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
||||
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
||||
IMoGoAutopilotRecordListener {
|
||||
|
||||
companion object {
|
||||
@@ -52,16 +52,19 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
|
||||
override fun init(context: Context?) {
|
||||
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
|
||||
executor.set(context?.let {
|
||||
GatherApi.also { itx ->
|
||||
itx.init(it,
|
||||
GatherParams.init()
|
||||
.setDebugMode(false)
|
||||
.setCoordinateType(GatherParams.COORDINATETYPE_GCJ02))
|
||||
} })
|
||||
itx.init(
|
||||
it,
|
||||
GatherParams.init()
|
||||
.setDebugMode(false)
|
||||
.setCoordinateType(GatherParams.COORDINATETYPE_GCJ02)
|
||||
)
|
||||
}
|
||||
})
|
||||
executor.get()?.setOnTaskListener(this)
|
||||
val carSn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
if (!TextUtils.isEmpty(carSn)) {
|
||||
@@ -69,12 +72,12 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
}
|
||||
MoGoAiCloudClient.getInstance().addTokenCallbacks(this)
|
||||
CallerLogger.d("$M_MAP$TAG", "--------- init --------")
|
||||
CallerLogger.d("$M_MAP$TAG", "executor: ${ executor.get()?.hashCode() ?: 0 }")
|
||||
CallerLogger.d("$M_MAP$TAG", "executor: ${executor.get()?.hashCode() ?: 0}")
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerLogger.d("$M_MAP$TAG", "--------- onDestroy --------")
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
executor.get()?.setOnTaskListener(null)
|
||||
listeners.clear()
|
||||
@@ -90,7 +93,13 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
recordPanel.stat == 102 || //工控机达到最大采集时长
|
||||
recordPanel.stat == 103) //工控机磁盘满了
|
||||
) {
|
||||
finish(recordPanel.id, recordPanel.stat, "", recordPanel.filename ?: "", recordPanel.note ?: "")
|
||||
finish(
|
||||
recordPanel.id,
|
||||
recordPanel.stat,
|
||||
"",
|
||||
recordPanel.filename ?: "",
|
||||
recordPanel.note ?: ""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +140,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
}
|
||||
CallerLogger.d("$M_MAP$TAG", "-- finish: 结束任务[$id]")
|
||||
executor.get()?.finishTask(id, state, gpsPath, videoPath, reason)
|
||||
} catch (e : Throwable) {
|
||||
} catch (e: Throwable) {
|
||||
e.printStackTrace()
|
||||
CallerLogger.e("$M_MAP$TAG", "-- finish:\n$e")
|
||||
} finally {
|
||||
@@ -171,14 +180,16 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return
|
||||
executor.get()?.updateLocation(
|
||||
location.longitude,
|
||||
location.latitude,
|
||||
location.altitude,
|
||||
location.heading.toFloat(),
|
||||
location.gnssSpeed,
|
||||
false)
|
||||
if (gnssInfo != null) {
|
||||
executor.get()?.updateLocation(
|
||||
gnssInfo.longitude,
|
||||
gnssInfo.latitude,
|
||||
gnssInfo.altitude,
|
||||
gnssInfo.heading.toFloat(),
|
||||
gnssInfo.gnssSpeed,
|
||||
false
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun isInValidStatus(): Boolean {
|
||||
|
||||
@@ -55,8 +55,8 @@ public class TrackObj {
|
||||
}
|
||||
|
||||
private void correct() {
|
||||
// calAverageSpeedAndType();
|
||||
// calLoc();
|
||||
calAverageSpeedAndType();
|
||||
calLoc();
|
||||
// calHeading();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -43,7 +43,7 @@ public class MogoRouteOverlayManager implements
|
||||
public void init() {
|
||||
CallerPlanningTrajectoryListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
public static MogoRouteOverlayManager getInstance() {
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package com.mogo.eagle.core.function.business.routeoverlay
|
||||
|
||||
import android.animation.*
|
||||
import android.graphics.*
|
||||
import android.view.animation.*
|
||||
import com.mogo.eagle.core.data.config.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.*
|
||||
import android.animation.ArgbEvaluator
|
||||
import android.graphics.Color
|
||||
import android.view.animation.AccelerateInterpolator
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_BLUE
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_BLUE_DARK
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_RED_DARK
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.Colors.Companion.COLOR_TRANSPARENT
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
|
||||
interface IStrategy {
|
||||
@@ -22,26 +23,31 @@ class Colors {
|
||||
companion object {
|
||||
val COLOR_BLUE = Color.parseColor("#FF2ABAD9")
|
||||
val COLOR_BLUE_DARK = Color.parseColor("#FF074EFF")
|
||||
val COLOR_RED_DARK = Color.parseColor("#FFFF5F00")
|
||||
val COLOR_TRANSPARENT = Color.parseColor("#002ABAD9")
|
||||
val COLOR_RED_DARK = Color.parseColor("#FFFF5F00")
|
||||
val COLOR_TRANSPARENT = Color.parseColor("#002ABAD9")
|
||||
}
|
||||
}
|
||||
|
||||
sealed class Strategy: IStrategy
|
||||
sealed class Strategy : IStrategy
|
||||
|
||||
class DefaultStrategy(private val colors: List<Int>? = null): Strategy() {
|
||||
class DefaultStrategy(private val colors: List<Int>? = null) : Strategy() {
|
||||
|
||||
override fun getColors(): List<Int> = colors ?: listOf(COLOR_BLUE, COLOR_TRANSPARENT)
|
||||
}
|
||||
|
||||
class ColorfulStrategy(private val colors: List<Int> = emptyList(), var isLightOn: Boolean): Strategy() {
|
||||
class ColorfulStrategy(private val colors: List<Int> = emptyList(), var isLightOn: Boolean) :
|
||||
Strategy() {
|
||||
override fun getColors(): List<Int> = colors
|
||||
}
|
||||
|
||||
object RouteStrategy {
|
||||
|
||||
@Volatile
|
||||
private var isEnable = !AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
private var isEnable by Delegates.observable(HmiBuildConfig.isShowRouteStrategy) { _, _, newValue ->
|
||||
if (!newValue) {
|
||||
strategy = null
|
||||
colors.clear()
|
||||
}
|
||||
}
|
||||
|
||||
private var strategy: Strategy? = null
|
||||
|
||||
@@ -57,14 +63,6 @@ object RouteStrategy {
|
||||
|
||||
private var hasLessThan0 = false
|
||||
|
||||
fun enable(enable: Boolean) {
|
||||
isEnable = enable
|
||||
if (!enable) {
|
||||
strategy = null
|
||||
colors.clear()
|
||||
}
|
||||
}
|
||||
|
||||
fun start() {
|
||||
if (sorted.isEmpty()) {
|
||||
fill()
|
||||
@@ -89,7 +87,7 @@ object RouteStrategy {
|
||||
}
|
||||
|
||||
fun check(speed: Double, acc: Double, total: Int) {
|
||||
if (!isEnable){
|
||||
if (!isEnable) {
|
||||
return
|
||||
}
|
||||
if (sorted.isEmpty()) {
|
||||
@@ -112,7 +110,11 @@ object RouteStrategy {
|
||||
} else {
|
||||
if (endEvaluator != null) {
|
||||
val fraction = (index - last) * 1.0f / delta
|
||||
colors += endEvaluator!!.evaluate(fraction, startColor, COLOR_TRANSPARENT) as Int
|
||||
colors += endEvaluator!!.evaluate(
|
||||
fraction,
|
||||
startColor,
|
||||
COLOR_TRANSPARENT
|
||||
) as Int
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -156,11 +158,14 @@ object RouteStrategy {
|
||||
total = endValue - startValue
|
||||
while (current <= endValue) {
|
||||
val fraction = (current - startValue) / total
|
||||
val colorValue = evaluator.evaluate(fraction.toFloat(), COLOR_BLUE, COLOR_BLUE_DARK) as Int
|
||||
val colorValue =
|
||||
evaluator.evaluate(fraction.toFloat(), COLOR_BLUE, COLOR_BLUE_DARK) as Int
|
||||
sorted[current] = colorValue
|
||||
current += step
|
||||
}
|
||||
}
|
||||
|
||||
fun getStrategy(): Strategy = if (isEnable) { (strategy ?: DefaultStrategy()) } else DefaultStrategy()
|
||||
fun getStrategy(): Strategy = if (isEnable) {
|
||||
(strategy ?: DefaultStrategy())
|
||||
} else DefaultStrategy()
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class MogoMapService implements IMogoMapService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoOverlayManager getOverlayManager(Context context) {
|
||||
public IMogoOverlayManager getOverlayManager() {
|
||||
return MogoOverlayManager.getInstance();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.view.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
@@ -29,7 +29,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.util.*
|
||||
import kotlin.math.floor
|
||||
|
||||
class SmallMapView @JvmOverloads constructor(
|
||||
@@ -45,7 +44,7 @@ class SmallMapView @JvmOverloads constructor(
|
||||
private var mCarMarker: Marker? = null
|
||||
private var mStartMarker: Marker? = null
|
||||
private var mEndMarker: Marker? = null
|
||||
private val zoomLevel = 15
|
||||
private val zoomLevel = 17
|
||||
private val mCoordinatesLatLng: MutableList<LatLng> = ArrayList()
|
||||
private var mPolyline: Polyline? = null
|
||||
private var mCameraUpdate: CameraUpdate? = null
|
||||
@@ -156,10 +155,9 @@ class SmallMapView @JvmOverloads constructor(
|
||||
initAMapView()
|
||||
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10, this)
|
||||
CallerPlanningRottingListenerManager.addListener(TAG, this)
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
startTask()
|
||||
}
|
||||
|
||||
private fun initAMapView() {
|
||||
@@ -237,52 +235,6 @@ class SmallMapView @JvmOverloads constructor(
|
||||
})
|
||||
}
|
||||
|
||||
private fun startTask() {
|
||||
val mTimer = Timer()
|
||||
mTimer.schedule(UpdateLocationTask(), 1000, 200)
|
||||
}
|
||||
|
||||
private inner class UpdateLocationTask : TimerTask() {
|
||||
override fun run() {
|
||||
if (mLocation != null) {
|
||||
if (mCarMarker == null) {
|
||||
mCarMarker = mAMap!!.addMarker(
|
||||
MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.module_small_map_view_my_location_logo))
|
||||
.anchor(0.5f, 0.5f)
|
||||
)
|
||||
}
|
||||
if (mCarMarker == null) {
|
||||
return
|
||||
}
|
||||
val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude)
|
||||
val bearing = floor(mLocation!!.heading).toFloat()
|
||||
//更新车辆位置
|
||||
mCarMarker!!.position = currentLatLng
|
||||
if (mCoordinatesLatLng.size > 1) {
|
||||
// 结束位置
|
||||
val endLatLng = mCoordinatesLatLng[mCoordinatesLatLng.size - 1]
|
||||
val calculateDistance = CoordinateUtils.calculateLineDistance(
|
||||
endLatLng.latitude, endLatLng.longitude,
|
||||
currentLatLng.latitude, currentLatLng.longitude
|
||||
)
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAP + TAG,
|
||||
"calculateDistance=$calculateDistance"
|
||||
)
|
||||
if (calculateDistance <= 5) {
|
||||
clearPolyline()
|
||||
mCoordinatesLatLng.clear()
|
||||
}
|
||||
}
|
||||
val cameraPosition: CameraPosition =
|
||||
CameraPosition.Builder().target(mCarMarker!!.position).tilt(0f).bearing(bearing)
|
||||
.zoom(zoomLevel.toFloat()).build()
|
||||
mAMap?.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun coordinateConverterFrom84(mContext: Context?, mogoLatLng: MogoLatLng): LatLng {
|
||||
val mCoordinateConverter = CoordinateConverter(mContext)
|
||||
mCoordinateConverter.from(CoordinateConverter.CoordType.GPS)
|
||||
@@ -307,6 +259,53 @@ class SmallMapView @JvmOverloads constructor(
|
||||
return
|
||||
}
|
||||
mLocation = mogoLocation
|
||||
if (mCarMarker == null) {
|
||||
mCarMarker =
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
mAMap?.addMarker(
|
||||
MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.map_bus_icon))
|
||||
.anchor(0.5f, 0.5f)
|
||||
)
|
||||
} else {
|
||||
mAMap?.addMarker(
|
||||
MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.map_car_icon))
|
||||
.anchor(0.5f, 0.5f)
|
||||
)
|
||||
}
|
||||
}
|
||||
if (mCarMarker == null) {
|
||||
return
|
||||
}
|
||||
val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude)
|
||||
val bearing = floor(mLocation!!.heading).toFloat()
|
||||
//更新车辆位置
|
||||
mCarMarker!!.position = currentLatLng
|
||||
if (mCoordinatesLatLng.size > 1) {
|
||||
// 结束位置
|
||||
val endLatLng = mCoordinatesLatLng[mCoordinatesLatLng.size - 1]
|
||||
val calculateDistance = CoordinateUtils.calculateLineDistance(
|
||||
endLatLng.latitude, endLatLng.longitude,
|
||||
currentLatLng.latitude, currentLatLng.longitude
|
||||
)
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAP + TAG,
|
||||
"calculateDistance=$calculateDistance"
|
||||
)
|
||||
if (calculateDistance <= 5) {
|
||||
clearPolyline()
|
||||
mCoordinatesLatLng.clear()
|
||||
}
|
||||
}
|
||||
val cameraPosition: CameraPosition =
|
||||
CameraPosition.Builder()
|
||||
.target(mCarMarker!!.position)
|
||||
.tilt(0f)
|
||||
.bearing(bearing)
|
||||
.zoom(zoomLevel.toFloat())
|
||||
.build()
|
||||
mAMap?.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
@@ -348,7 +347,7 @@ class SmallMapView @JvmOverloads constructor(
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
CallerPlanningRottingListenerManager.removeListener(TAG)
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.v2x.IFuncBizProvider
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showVideoDialog
|
||||
@@ -146,7 +146,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
CallerPlanningRottingListenerManager.addListener(TAG, moGoAutopilotPlanningListener)
|
||||
initAMapView(context)
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
//设置全览模式
|
||||
overLayerView?.setOnClickListener { displayCustomOverView() }
|
||||
}
|
||||
@@ -372,7 +372,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 注册定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
CallerPlanningRottingListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
|
||||
@@ -40,32 +40,20 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation rootProject.ext.dependencies.androidxccorektx
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation project(path: ':foudations:mogo-commons')
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
implementation rootProject.ext.dependencies.android_start_up
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
implementation rootProject.ext.dependencies.thread_opt
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_res
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_api
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.crashreport
|
||||
implementation rootProject.ext.dependencies.mogomap
|
||||
implementation rootProject.ext.dependencies.mogomapapi
|
||||
} else {
|
||||
implementation project(':core:mogo-core-res')
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-api')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(":test:crashreport")
|
||||
implementation project(':libraries:mogo-map')
|
||||
implementation project(":libraries:mogo-map-api")
|
||||
}
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.mogo.eagle.core.function.startup;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.mogo.eagle.core.function.startup";
|
||||
/**
|
||||
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String APPLICATION_ID = "com.mogo.eagle.core.function.startup";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final String FLAVOR = "";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "";
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.mogo.eagle.core.function.startup.MogoStartUpProvider;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Group$$start_up implements IRouteGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> atlas) {
|
||||
atlas.put("/start_up/api", RouteMeta.build(RouteType.PROVIDER, MogoStartUpProvider.class, "/start_up/api", "start_up", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IProviderGroup;
|
||||
import com.mogo.eagle.core.function.startup.MogoStartUpProvider;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Providers$$mogocorefunctionstartup implements IProviderGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> providers) {
|
||||
providers.put("com.mogo.eagle.core.function.api.startup.IStartUpProvider", RouteMeta.build(RouteType.PROVIDER, MogoStartUpProvider.class, "/start_up/api", "start_up", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteRoot;
|
||||
import java.lang.Class;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Root$$mogocorefunctionstartup implements IRouteRoot {
|
||||
@Override
|
||||
public void loadInto(Map<String, Class<? extends IRouteGroup>> routes) {
|
||||
routes.put("start_up", ARouter$$Group$$start_up.class);
|
||||
}
|
||||
}
|
||||
@@ -31,10 +31,9 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -146,7 +145,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
return HttpDnsSimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon)
|
||||
}
|
||||
var mogoLocation: MogoLocation? = null
|
||||
val locationClient = CallerMapLocationListenerManager.getCurrentLocation()
|
||||
val locationClient = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
if (locationClient != null) {
|
||||
mogoLocation = locationClient
|
||||
}
|
||||
@@ -289,7 +288,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
context?.let {
|
||||
MogoLocationInfoServices.getInstance().init(it)
|
||||
MogoLocationInfoServices.getInstance().start()
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(
|
||||
TAG,
|
||||
object : IMoGoChassisLocationGCJ02Listener {
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
@@ -305,7 +304,7 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
|
||||
|
||||
private fun startSocketService() {
|
||||
CallerLogger.d(SceneConstant.M_MAIN + TAG, "startSocketService")
|
||||
val location = CallerMapLocationListenerManager.getCurrentLocation()
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
// 关闭长链服务
|
||||
MogoAiCloudSocketManager.getInstance(context).destroy()
|
||||
MogoAiCloudSocketManager.getInstance(context)
|
||||
|
||||
@@ -62,7 +62,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.localbroadcastmanager
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.flexbox
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
implementation rootProject.ext.dependencies.protobuf_java
|
||||
implementation rootProject.ext.dependencies.protobuf_java_util
|
||||
@@ -71,19 +70,14 @@ dependencies {
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogo_core_data
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
implementation rootProject.ext.dependencies.mogo_core_function_call
|
||||
implementation rootProject.ext.dependencies.mogo_core_res
|
||||
compileOnly rootProject.ext.dependencies.mogomap
|
||||
} else {
|
||||
implementation project(":foudations:mogo-commons")
|
||||
implementation project(':core:mogo-core-data')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
implementation project(':core:mogo-core-res')
|
||||
implementation project(':libraries:mogo-adas')
|
||||
compileOnly project(':libraries:mogo-map')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,9 +29,8 @@ import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
|
||||
@@ -115,25 +114,26 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
||||
|
||||
private fun registerListener() {
|
||||
V2XManager.addCallback(this)
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private fun unRegisterListener() {
|
||||
V2XManager.removeCallback(this)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
mogoMarkersHandler.unregisterMarkerClickListener(CARD_TYPE_ROAD_CONDITION)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return
|
||||
BridgeApi.location.set(location)
|
||||
if (V2XManager.hasInit()) {
|
||||
V2XManager.onLocationChanged(
|
||||
longitude = location.longitude,
|
||||
latitude = location.latitude
|
||||
)
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
BridgeApi.location.set(mogoLocation)
|
||||
mogoLocation?.let {
|
||||
if (V2XManager.hasInit()) {
|
||||
V2XManager.onLocationChanged(
|
||||
longitude = it.longitude,
|
||||
latitude = mogoLocation.latitude
|
||||
)
|
||||
}
|
||||
refreshCarState(mogoLocation)
|
||||
}
|
||||
refreshCarState(location)
|
||||
}
|
||||
|
||||
private fun refreshCarState(location: MogoLocation) {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class V2XAlarmServer {
|
||||
CopyOnWriteArrayList<V2XRoadEventEntity> v2XRoadEventEntityList,
|
||||
MogoLocation currentLocation) {
|
||||
try {
|
||||
Logger.d(TAG, "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
|
||||
//Logger.d(TAG, "getDriveFrontAlarmEvent --- 1 ---" + currentLocation );
|
||||
if (!showedEvents.isEmpty()) {
|
||||
Iterator<V2XRoadEventEntity> iterator = showedEvents.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -54,18 +54,18 @@ public class V2XAlarmServer {
|
||||
}
|
||||
}
|
||||
}
|
||||
Logger.d(TAG, "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
|
||||
//Logger.d(TAG, "getDriveFrontAlarmEvent --- 2 ---" + currentLocation);
|
||||
if (currentLocation != null && v2XRoadEventEntityList != null) {
|
||||
// 因为集合是按照距离排序后的所以这里检索出来第一个就发出警告
|
||||
for (V2XRoadEventEntity v2XRoadEventEntity : v2XRoadEventEntityList) {
|
||||
// 0、道路事件必须有朝向,角度>=0;
|
||||
Logger.d(TAG, "entity:" + v2XRoadEventEntity.getLocation());
|
||||
//Logger.d(TAG, "entity:" + v2XRoadEventEntity.getLocation());
|
||||
if (v2XRoadEventEntity.getLocation().getAngle() >= 0) {
|
||||
// 计算车辆距离指定气泡的距离
|
||||
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
|
||||
// 1、判断是否到达了触发距离,20 ~ 500,
|
||||
double distance = v2XRoadEventEntity.getDistance();
|
||||
Logger.d(TAG, "distance:" + distance);
|
||||
//Logger.d(TAG, "distance:" + distance);
|
||||
if (distance <= 500) {
|
||||
if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
|
||||
if (distance > 25) {
|
||||
@@ -76,7 +76,7 @@ public class V2XAlarmServer {
|
||||
double carBearing = currentLocation.getHeading();
|
||||
double eventBearing = eventLocation.getAngle();
|
||||
double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing);
|
||||
Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
|
||||
//Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
|
||||
if (diffAngle <= 20) {
|
||||
// 3、计算当前车辆行驶方向与事件位置之间夹角《20度,保证道路事件在车辆前方
|
||||
double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
@@ -87,12 +87,12 @@ public class V2XAlarmServer {
|
||||
(int) currentLocation.getHeading()
|
||||
);
|
||||
|
||||
Logger.d(TAG, "eventAngle:" + eventAngle);
|
||||
//Logger.d(TAG, "eventAngle:" + eventAngle);
|
||||
if (0 <= eventAngle && eventAngle <= 20) {
|
||||
if (showedEvents.contains(v2XRoadEventEntity)) {
|
||||
return null;
|
||||
}
|
||||
Logger.d(TAG, "showed---");
|
||||
//Logger.d(TAG, "showed---");
|
||||
showedEvents.add(v2XRoadEventEntity);
|
||||
return v2XRoadEventEntity;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class MoGoPersonWarnPolylineManager implements IMoGoPersonWarnPolylineMan
|
||||
options.add(locations.get(i));
|
||||
}
|
||||
// 绘制线的对象
|
||||
IMogoOverlayManager overlay = CallerMapUIServiceManager.INSTANCE.getOverlayManager(AbsMogoApplication.getApp());
|
||||
IMogoOverlayManager overlay = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (overlay != null) {
|
||||
mMogoPolyline = overlay.addPolyline(options);
|
||||
mMogoPolyline.setTransparency(0.5f);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class MoGoStopPolylineManager implements IMoGoStopPolylineManager {
|
||||
options.add(locations.get(i));
|
||||
}
|
||||
// 绘制线的对象
|
||||
IMogoOverlayManager overlay = CallerMapUIServiceManager.INSTANCE.getOverlayManager(AbsMogoApplication.getApp());
|
||||
IMogoOverlayManager overlay = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (overlay != null) {
|
||||
mMogoPolyline = overlay.addPolyline(options);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.mogo.eagle.core.function.v2x.events.manager.impl;
|
||||
|
||||
import static com.mogo.commons.module.ServiceConst.CARD_TYPE_NOVELTY;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
@@ -12,7 +14,7 @@ import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity;
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.v2x.events.consts.MoGoV2XServicePaths;
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoV2XMarkerManager;
|
||||
@@ -26,6 +28,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
@@ -52,7 +55,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
public CopyOnWriteArrayList<V2XRoadEventEntity> getV2XRoadEventEntityList() {
|
||||
CopyOnWriteArrayList<V2XRoadEventEntity> roadEventEntities = new CopyOnWriteArrayList<>();
|
||||
// 当前车辆数据
|
||||
MogoLocation currentLocation = CallerMapLocationListenerManager.INSTANCE.getCurrentLocation();
|
||||
MogoLocation currentLocation = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02();
|
||||
if (currentLocation != null) {
|
||||
// 重新计算距离
|
||||
for (V2XRoadEventEntity v2XRoadEventEntity : mV2XRoadEventEntityArrayList) {
|
||||
|
||||
@@ -62,7 +62,7 @@ public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager {
|
||||
}
|
||||
// 绘制线的对象
|
||||
|
||||
IMogoOverlayManager overlay = CallerMapUIServiceManager.INSTANCE.getOverlayManager(AbsMogoApplication.getApp());
|
||||
IMogoOverlayManager overlay = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (overlay != null) {
|
||||
mMogoPolyline = overlay.addPolyline(options);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.os.HandlerThread
|
||||
import android.util.Log
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
|
||||
import com.mogo.map.marker.IMogoMarker
|
||||
@@ -90,7 +90,7 @@ object MarkerRemoveManager {
|
||||
if (carLoc.get() == null) {
|
||||
carLoc.set(if (marker.coordinateType == 0) {
|
||||
//高德坐标
|
||||
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
} else {
|
||||
//高精坐标
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
@@ -150,7 +150,7 @@ object MarkerRemoveManager {
|
||||
if (carLoc.get() == null) {
|
||||
carLoc.set(if (marker.coordinateType == 0) {
|
||||
//高德坐标
|
||||
CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
} else {
|
||||
//高精坐标
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
@@ -170,7 +170,7 @@ object MarkerRemoveManager {
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
} finally {
|
||||
val gcInfo = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
|
||||
val gcInfo = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
lastCarLocation.set((gcInfo?.longitude ?: 0.0) to (gcInfo?.latitude ?: 0.0))
|
||||
val wgsInfo = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
lastGpsLocation.set((wgsInfo?.longitude ?: 0.0) to (wgsInfo?.latitude ?: 0.0))
|
||||
|
||||
@@ -39,9 +39,7 @@ class AiRoadMarker {
|
||||
private val marker by lazy { AtomicReference<Marker>() }
|
||||
|
||||
private val overlayManager by lazy {
|
||||
CallerMapUIServiceManager.getOverlayManager(
|
||||
AbsMogoApplication.getApp()
|
||||
)
|
||||
CallerMapUIServiceManager.getOverlayManager()
|
||||
}
|
||||
|
||||
private val START_COLOR = Color.parseColor("#002ABAD9")
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road
|
||||
|
||||
import android.graphics.*
|
||||
import android.graphics.Color
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context
|
||||
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.v2xMarker
|
||||
import com.mogo.eagle.core.function.v2x.events.remove.MarkerWrapper
|
||||
import com.mogo.map.*
|
||||
import com.mogo.map.marker.*
|
||||
import com.mogo.map.overlay.*
|
||||
import java.util.concurrent.atomic.*
|
||||
import kotlin.Pair
|
||||
import kotlin.collections.ArrayList
|
||||
import com.mogo.map.marker.IMogoMarker
|
||||
import com.mogo.map.overlay.IMogoPolyline
|
||||
import com.mogo.map.overlay.MogoPolylineOptions
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
class V2XAiRoadEventMarker {
|
||||
|
||||
@@ -20,7 +20,7 @@ class V2XAiRoadEventMarker {
|
||||
|
||||
private val v2xLocation = AtomicReference<MogoLocation>()
|
||||
|
||||
private val overlayManager by lazy { MogoOverlayManager.getInstance() }
|
||||
private val overlayManager by lazy { CallerMapUIServiceManager.getOverlayManager() }
|
||||
|
||||
fun drawMarkers(entity: V2XRoadEventEntity, wrapper: MarkerWrapper) {
|
||||
val extra = entity.noveltyInfo.extras["polygon"]
|
||||
@@ -68,9 +68,9 @@ class V2XAiRoadEventMarker {
|
||||
options.width(5f)
|
||||
options.zIndex(75000f)
|
||||
options.maxIndex(800000f)
|
||||
val line = overlayManager.addPolyline(options)
|
||||
current.set(Pair(line, wrapper.markers))
|
||||
if (line != null) {
|
||||
val line = overlayManager?.addPolyline(options)
|
||||
line?.let {
|
||||
current.set(Pair(line, wrapper.markers))
|
||||
line.isVisible = true
|
||||
wrapper.addLine(line)
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ object V2XManager {
|
||||
if (!started.get()) {
|
||||
return
|
||||
}
|
||||
V2XLogger.d(TAG, "--- onLocationChanged --[longitude: $longitude, latitude: $latitude]")
|
||||
//V2XLogger.d(TAG, "--- onLocationChanged --[longitude: $longitude, latitude: $latitude]")
|
||||
realLongitude.set(longitude)
|
||||
realLatitude.set(latitude)
|
||||
val oldLon = lastLongitude.get()
|
||||
|
||||
Reference in New Issue
Block a user