[dev_arch_opt_3.0]

[Change]
[
1、完成工控机数据和高德GPS地图数据的数据中心,以及工控机数据超时后的自动切换为高德地图GPS数据
定位监听已重构,CallerChassisLocationGCJ20ListenerManager---高的坐标系,CallerChassisLocationWGS84ListenerManager--高精坐标系,之前代码已修改,大家后续项目中根据需要进行订阅,如需控制频率可在订阅时
// 设置数据回调频率,单位HZ,1HZ的周期是1秒;50HZ的周期是1/50=0.02秒;10HZ的周期是1/10=0.1秒。
CallerChassisLocationWGS84ListenerManager.setListenerHz(Companion.functionName, 20)
CallerChassisLocationGCJ20ListenerManagersetListenerHz(Companion.functionName, 20)
]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-02-02 19:24:38 +08:00
parent 0a4b0be72a
commit 111940123f
107 changed files with 963 additions and 724 deletions

View File

@@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
@@ -130,7 +130,7 @@ class DispatchAutoPilotManager private constructor() :
AutopilotControlParameters.AutoPilotLonLat(it.endLat, it.endLon)
currentAutopilot.vehicleType = 10
CallerLogger.d(SceneConstant.Companion.M_DISPATCH + TAG, "开启自动驾驶====$currentAutopilot")
CallerAutoPilotManager.startAutoPilot(currentAutopilot)
CallerAutoPilotControlManager.startAutoPilot(currentAutopilot)
}
}

View File

@@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_IVP_G
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.V2I
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
@@ -26,7 +27,6 @@ import com.mogo.eagle.core.utilcode.util.LocationUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
import com.zhjt.service_biz.BizConfig
import mogo.telematics.pad.MessagePad
import kotlin.math.abs
import kotlin.math.ceil
import kotlin.math.floor
@@ -44,7 +44,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
// 是否已进入到路口(停止线处)
private var isEnter = false
private var mLocation: MessagePad.GnssInfo? = null
private var mLocation: MogoLocation? = null
companion object {
@@ -100,7 +100,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
// 路口100m闯红灯预警
mLocation?.let {
// 单位m/s
val speed = it.vehicleSpeed
val speed = it.gnssSpeed
// 车停止或者速度非常慢,可能返回负数或者很小的值,需要过滤
CallerLogger.d("$M_V2X$TAG", "speed is:$speed")
if (speed <= 2.5f) return// 小于等于9km/h不处理
@@ -277,7 +277,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
}
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLocation = it
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.function.biz.v2x.trafficlight.core
import android.content.Context
import android.os.Handler
import android.os.Looper
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.trafficlight.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
@@ -15,7 +16,6 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandl
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel
import mogo.telematics.pad.MessagePad
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
@@ -30,7 +30,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
private var mContext: Context? = null
private val trafficLightNetWorkModel = TrafficLightNetWorkModel()
private var mLocation: MessagePad.GnssInfo? = null
private var mLocation: MogoLocation? = null
private var roadIDResult: RoadIDResult? = null
private var trafficLightResult: TrafficLightResult? = null
@@ -174,7 +174,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
trafficLightResult = null
}
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLocation = it
checkOutOfRange()

View File

@@ -57,6 +57,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogoaicloudtelematic
implementation rootProject.ext.dependencies.mogoobu
implementation rootProject.ext.dependencies.amapnavi3dmap
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
implementation rootProject.ext.dependencies.mogo_core_data

View File

@@ -4,6 +4,7 @@ import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.datacenter.IDataCenterProvider
import com.mogo.eagle.core.function.datacenter.location.MoGoLocationDispatcher
@Route(path = MogoServicePaths.PATH_DATA_CENTER_MODULE)
class DataCenterProvider: IDataCenterProvider {
@@ -12,7 +13,7 @@ class DataCenterProvider: IDataCenterProvider {
get() = "DataCenterProvider"
override fun init(context: Context?) {
MoGoLocationDispatcher.initListener()
}
override fun onDestroy() {

View File

@@ -21,7 +21,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.trafficlight.toTrafficLightDetail
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasListenerImpl
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
@@ -67,8 +67,9 @@ import java.util.concurrent.TimeUnit
* @date 2021/9/22 8:43 下午
*/
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
class MoGoAutopilotProvider :
IMoGoAutopilotProvider, IMoGoMapDataCollectProvider.OnMapCollectCmdListener,
class MoGoAutopilotControlProvider :
IMoGoAutopilotControlProvider,
IMoGoMapDataCollectProvider.OnMapCollectCmdListener,
IMoGoAutopilotCarConfigListener {
private val TAG = "MoGoAutoPilotProvider"
private var mContext: Context? = null

View File

@@ -45,8 +45,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager.invokeAutopilotStatistics
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager.invokePNCActions
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager.invokeAutopilotRotting
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager.invokeAutopilotTrajectory
@@ -135,10 +133,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
clientPkFileName = "sn"
)
override fun onGnssInfo(header: MessagePad.Header, gnssInfo: MessagePad.GnssInfo) {
// WGS84坐标系高精度位置信息
invokeChassisLocationWGS84(gnssInfo)
// GCJ02高德坐标系位置信息
invokeChassisLocationGCJ02(gnssInfo)
CallerChassisGnssListenerManager.invokeChassisGnssListener(gnssInfo)
if (gnssInfo != null) {
if (1 == FunctionBuildConfig.gpsProvider) {
// 同步给MAP地图

View File

@@ -5,7 +5,7 @@ import com.mogo.commons.debug.DebugConfig.*
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -52,13 +52,13 @@ class MoGoAdasMsgConnectStatusListenerImpl :
// 同步SN给工控机
syncBasicInfoToAutopilot()
//每次工控机连接成功后,需同步当前设置的美化模式状态
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
//当连接状态是关闭美化模式时,同步给工控机
if (!FunctionBuildConfig.isDemoMode) {
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
//每次工控机连接成功后,需同步当前设置的雨天模式状态
CallerAutoPilotManager.setRainMode(FunctionBuildConfig.isRainMode)
CallerAutoPilotControlManager.setRainMode(FunctionBuildConfig.isRainMode)
} else if (ipcConnectionStatus == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
CallerLogger.d("$M_ADAS_IMPL$TAG", "webSocket 连接失败 reason:$reason")
if (connectStatus) {

View File

@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.datacenter.autopilot.server
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
/**
@@ -26,6 +26,6 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
}
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
CallerAutoPilotManager.sendTrafficLightData(trafficLightResult)
CallerAutoPilotControlManager.sendTrafficLightData(trafficLightResult)
}
}

View File

@@ -8,9 +8,9 @@ import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setDemoMode
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.setIgnoreConditionDraw
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.utilcode.mogo.logger.*
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
@@ -174,7 +174,7 @@ class TeleMsgHandler : IMsgHandler {
private fun queryCarConfig() {
invokeNettyConnResult("乘客屏请求司机屏向工控机查询配置信息")
CallerAutoPilotManager.getCarConfig()
CallerAutoPilotControlManager.getCarConfig()
}
override fun handleClientConn2Server(channel: Channel?) {

View File

@@ -1,16 +0,0 @@
package com.mogo.eagle.core.function.datacenter.location
import com.mogo.eagle.core.data.enums.DataSourceType
import mogo.telematics.pad.MessagePad
/**
* 位置回调监听
*/
interface IMoGoLocationListener {
/**
* 位置改变回调用
* @param gnssInfo 位置信息
* @param sourceType 数据来源
*/
fun onLocationChanged(gnssInfo: MessagePad.GnssInfo, sourceType: DataSourceType)
}

View File

@@ -0,0 +1,176 @@
package com.mogo.eagle.core.function.datacenter.location
import com.amap.api.location.AMapLocation
import com.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption
import com.amap.api.location.AMapLocationListener
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.constants.SharedPrefsConstants
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.Utils
import mogo.telematics.pad.MessagePad
/**
* 融合定位服务,这里同时监听多来源的位置信息,并支持修改频率
*
* @author donghongyu
*/
object MoGoLocationDispatcher :
IMoGoChassisGnssListener,
AMapLocationListener {
private val TAG = "MoGoLocationManager"
private var mCityCode: String? = null
private var mapLocation: AMapLocation? = null
/**
* 最后一次工控机GNSS返回更新的位置
*/
private var lastGnssLocation: MogoLocation = MogoLocation()
/**
* 最后一次高德定位返回的位置信息
*/
private var lastGaoDeLocation: MogoLocation = MogoLocation()
fun initListener() {
// 高德SDK隐私政策
AMapLocationClient.updatePrivacyShow(Utils.getApp(), true, true)
AMapLocationClient.updatePrivacyAgree(Utils.getApp(), true)
try {
val mLocationClient = AMapLocationClient(Utils.getApp())
//初始化定位参数
//声明mLocationOption对象
val mLocationOption = AMapLocationClientOption()
//设置定位监听
mLocationClient.setLocationListener(this)
//设置定位模式为高精度模式Battery_Saving为低功耗模式Device_Sensors是仅设备模式
mLocationOption.locationMode = AMapLocationClientOption.AMapLocationMode.Hight_Accuracy
//设置定位间隔,单位毫秒,默认为2000ms
mLocationOption.interval = 1000
//设置定位参数
mLocationClient.setLocationOption(mLocationOption)
// 启动定位监听
mLocationClient.startLocation()
} catch (e: Exception) {
e.printStackTrace()
}
// 初始化监听订阅工控机位置信息
CallerChassisGnssListenerManager.addListener(TAG, this)
}
override fun onChassisGnss(gnssInfo: MessagePad.GnssInfo) {
// 更新GNSS 信息
lastGnssLocation.gnssInfo = gnssInfo
lastGnssLocation.lastReceiveTime = TimeUtils.getNowMills()
// 将高德中的一些用于业务的数据进行融合例如CityCode、address等
mapLocation?.let {
lastGnssLocation.cityName = it.city
lastGnssLocation.cityCode = it.cityCode
lastGnssLocation.provider = it.provider
lastGnssLocation.address = it.address
lastGnssLocation.district = it.district
lastGnssLocation.province = it.province
lastGnssLocation.adCode = it.adCode
lastGnssLocation.locationDetail = it.locationDetail
lastGnssLocation.poiName = it.poiName
lastGnssLocation.aoiName = it.aoiName
lastGnssLocation.street = it.street
lastGnssLocation.streetNum = it.streetNum
lastGnssLocation.description = it.description
lastGnssLocation.buildingId = it.buildingId
lastGnssLocation.floor = it.floor
lastGnssLocation.errorCode = it.errorCode
lastGnssLocation.errorInfo = it.errorInfo
}
// WGS84坐标系高精度位置信息
CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84(
lastGnssLocation,
DataSourceType.TELEMATIC
)
// GCJ02高德坐标系位置信息
CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02(
lastGnssLocation,
DataSourceType.TELEMATIC
)
}
/**
* 高德地图位置改变回调
* @param aMapLocation 位置信息
*/
override fun onLocationChanged(aMapLocation: AMapLocation) {
mapLocation = aMapLocation
// 更新GNSS 信息
// 将高德中的一些用于业务的数据进行融合例如CityCode、address等
mapLocation?.let {
// 转换 GCJ02-->WGS84 坐标
val wgs84Location =
CoordinateTransform.GCJ02ToWGS84(it.longitude, it.latitude)
lastGaoDeLocation.longitude = wgs84Location[0]
lastGaoDeLocation.latitude = wgs84Location[1]
lastGaoDeLocation.heading = it.bearing.toDouble()
lastGaoDeLocation.gnssSpeed = it.speed
lastGaoDeLocation.altitude = it.altitude
lastGaoDeLocation.satelliteTime = it.time
lastGaoDeLocation.lastReceiveTime = TimeUtils.getNowMills()
lastGaoDeLocation.cityName = it.city
lastGaoDeLocation.cityCode = it.cityCode
lastGaoDeLocation.provider = it.provider
lastGaoDeLocation.address = it.address
lastGaoDeLocation.district = it.district
lastGaoDeLocation.province = it.province
lastGaoDeLocation.adCode = it.adCode
lastGaoDeLocation.locationDetail = it.locationDetail
lastGaoDeLocation.poiName = it.poiName
lastGaoDeLocation.aoiName = it.aoiName
lastGaoDeLocation.street = it.street
lastGaoDeLocation.streetNum = it.streetNum
lastGaoDeLocation.description = it.description
lastGaoDeLocation.buildingId = it.buildingId
lastGaoDeLocation.floor = it.floor
lastGaoDeLocation.errorCode = it.errorCode
lastGaoDeLocation.errorInfo = it.errorInfo
}
// 计算最后一次工控机同步的定位是否超时,如果超时则切换为高德地图定位,暂定超过30秒需要切换
if (TimeUtils.getNowMills() - lastGnssLocation.lastReceiveTime > 30000) {
// WGS84坐标系高精度位置信息
CallerChassisLocationWGS84ListenerManager.invokeChassisLocationWGS84(
lastGaoDeLocation,
DataSourceType.MAP
)
// GCJ02高德坐标系位置信息
CallerChassisLocationGCJ20ListenerManager.invokeChassisLocationGCJ02(
lastGaoDeLocation,
DataSourceType.MAP
)
}
// 本地SP缓存城市Code
val cityCode = aMapLocation.cityCode
if (cityCode != null && cityCode.isNotEmpty()) {
mCityCode = aMapLocation.cityCode
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp())
.putString(SharedPrefsConstants.LOCATION_CITY_CODE, cityCode)
}
}
}

View File

@@ -1,71 +0,0 @@
package com.mogo.eagle.core.function.datacenter.location
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.support.obu.model.MogoObuHvBasicsData
import mogo.telematics.pad.MessagePad
/**
* 融合定位服务,这里同时监听多来源的位置信息,并支持修改频率
*
* @author donghongyu
*/
object MoGoLocationManager :
CallerBase<IMoGoLocationListener>(),
IMoGoChassisLocationWGS84Listener,
IMoGoObuLocationWGS84Listener {
private val TAG = "MoGoLocationManager"
init {
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
M_LISTENERS.forEach {
val tag = it.key
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, gnssInfo, DataSourceType.TELEMATIC)
}
} else {
syncLocationCallback(tag, it, gnssInfo, DataSourceType.TELEMATIC)
}
} else {
syncLocationCallback(tag, it, gnssInfo, DataSourceType.TELEMATIC)
}
}
}
/**
* 向订阅位置信息的发出定位信息
*/
private fun syncLocationCallback(
tag: String,
it: Map.Entry<String, IMoGoLocationListener>,
gnssInfo: MessagePad.GnssInfo,
sourceType: DataSourceType
) {
// 记录最后一次回调时间
M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills()
val listener = it.value
listener.onLocationChanged(gnssInfo, sourceType)
}
override fun onObuLocationWGS84(data: MogoObuHvBasicsData) {
}
}

View File

@@ -3,8 +3,8 @@
##### 位置回调融合工控机、OBU、高德地图
```kotlin
// 注册监听位置变换
MoGoLocationManager.addListener(Companion.functionName, object : IMoGoLocationListener {
// 注册监听位置变换,唯一标记要接受数据的HZ回掉监听
MoGoLocationManager.addListener(Companion.functionName, 20, object : IMoGoLocationListener {
override fun onLocationChanged(
gnssInfo: MessagePad.GnssInfo,
sourceType: DataSourceType

View File

@@ -10,11 +10,12 @@ import android.widget.RadioButton
import android.widget.TextView
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
@@ -27,7 +28,6 @@ import com.zhjt.mogo_core_function_devatools.R
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import record_cache.RecordPanelOuterClass
import java.util.*
@@ -119,7 +119,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
// 添加 ADAS车辆状态&定位 监听
CallerChassisLocationWGS84ListenerManager.addListener(this.hashCode().toString(), this)
//开始录制AI数据采集Bag包
CallerAutoPilotManager.recordPackage(
CallerAutoPilotControlManager.recordPackage(
99,
Random(SystemClock.elapsedRealtime()).nextInt(),
20,
@@ -353,7 +353,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}

View File

@@ -11,7 +11,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import com.mogo.eagle.core.data.badcase.RecordTypeEntity
import com.mogo.eagle.core.data.badcase.TopicEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
@@ -206,7 +206,7 @@ internal class BadCaseConfigView @JvmOverloads constructor(
super.onAttachedToWindow()
CallerAutopilotRecordListenerManager.addListener(TAG, this)
//获取数据采集录制模式配置列表
CallerAutoPilotManager.getBadCaseConfig(0, 0, listOf())
CallerAutoPilotControlManager.getBadCaseConfig(0, 0, listOf())
recordTypesList.add(RecordTypeEntity(0,"自定义", arrayListOf()))
}

View File

@@ -11,7 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.data.badcase.RecordCaseEntity;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.zhjt.mogo_core_function_devatools.R;
@@ -77,7 +77,7 @@ public class CaseListDialog extends Dialog implements IMoGoAutopilotRecordListen
super.onAttachedToWindow();
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
//获取数据采集录制模式配置列表
CallerAutoPilotManager.INSTANCE.getBadCaseConfig(0, 0,new ArrayList<>());
CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(0, 0,new ArrayList<>());
}
@Override

View File

@@ -17,7 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.data.badcase.RecordTypeEntity;
import com.mogo.eagle.core.data.badcase.TopicEntity;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
@@ -69,7 +69,7 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
init();
initEvent();
//获取所有Topic
CallerAutoPilotManager.INSTANCE.getBadCaseConfig(1, 0, new ArrayList<>());
CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(1, 0, new ArrayList<>());
if (recordType != null) {
tvCaseName.setText(recordType.getDesc());
if (recordType.getTopicsList().size() > 0) {
@@ -160,7 +160,7 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
});
tvSave.setOnClickListener(v -> {
if (recordType != null) {
Boolean success = CallerAutoPilotManager.INSTANCE.getBadCaseConfig(2, recordType.getId(), addTopicList);
Boolean success = CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(2, recordType.getId(), addTopicList);
if (Boolean.TRUE.equals(success)) {
ToastUtils.showShort("Topic设置成功");
if (recordType.getId() == 0) {

View File

@@ -14,11 +14,12 @@ import android.widget.TextView
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.badcase.RecordCaseEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
@@ -35,7 +36,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import record_cache.RecordPanelOuterClass
import java.io.File
import java.util.*
@@ -347,7 +347,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
mWindowManager!!.addView(mFloatLayout, mWindowParams)
//开启录包
if (recordCaseEntity != null) {
CallerAutoPilotManager.recordPackage(
CallerAutoPilotControlManager.recordPackage(
recordCaseEntity.caseId,
Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration,
@@ -355,7 +355,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
recordCaseEntity.topicList
)
} else {
CallerAutoPilotManager.recordPackage(
CallerAutoPilotControlManager.recordPackage(
BadCaseConfig.type, Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration
)
@@ -394,7 +394,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}

View File

@@ -15,6 +15,7 @@ import android.widget.TextView
import com.google.android.flexbox.FlexboxLayout
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
@@ -34,7 +35,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import me.jessyan.autosize.utils.AutoSizeUtils
import mogo.telematics.pad.MessagePad
import org.greenrobot.eventbus.EventBus
import java.io.File
@@ -380,9 +380,9 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
latitude = gnssInfo?.latitude
longitude = gnssInfo?.longitude
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}
}

View File

@@ -15,7 +15,7 @@ import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FULL_LOG
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -220,7 +220,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
Logger.init(LogLevel.DEBUG)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = true
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = true
CallerAutoPilotManager.setEnableLog(true)
CallerAutoPilotControlManager.setEnableLog(true)
}
/**
@@ -230,7 +230,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
Logger.init(if (DebugConfig.isDebug()) LogLevel.DEBUG else LogLevel.OFF)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = false
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = false
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotControlManager.setEnableLog(false)
}
override fun onError(errorCount: Int) {

View File

@@ -41,7 +41,7 @@ internal class CanImpl(ctx: Context) :
private val state: AtomicInteger by lazy { AtomicInteger(Int.MIN_VALUE) }
override fun onCreate() {
send(CanStatus(CallerAutoPilotManager.isConnected()))
send(CanStatus(CallerAutoPilotControlManager.isConnected()))
CallerChassisAccStateListenerManager.addListener(TAG, this)
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
@@ -60,7 +60,7 @@ internal class CanImpl(ctx: Context) :
private fun isCanEnabled(): Boolean {
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
return CallerAutoPilotManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
return CallerAutoPilotControlManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
}

View File

@@ -28,7 +28,7 @@ internal class IpcImpl(ctx: Context): IFlow<IpcStatus>(ctx), IMoGoAutopilotStatu
}
private fun checkAndSend() {
send(IpcStatus(CallerAutoPilotManager.isConnected()))
send(IpcStatus(CallerAutoPilotControlManager.isConnected()))
}
override fun onDestroy() {

View File

@@ -2,9 +2,10 @@ package com.zhjt.mogo_core_function_devatools.status.flow.rtk
import android.content.Context
import android.util.Log
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -15,7 +16,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad.GnssInfo
import system_master.SystemStatusInfo.HealthInfo
import system_master.SystemStatusInfo.StatusInfo
import java.util.concurrent.atomic.AtomicBoolean
@@ -42,7 +42,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
CallerLogger.d("$M_DEVA$TAG", "-- onCreate --")
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
if (CallerAutoPilotManager.isConnected()) {
if (CallerAutoPilotControlManager.isConnected()) {
check()
}
}
@@ -53,7 +53,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
}
check?.takeIf { it.isActive }?.cancel()
launch(Dispatchers.Unconfined) {
CallerAutoPilotManager.sendStatusQueryReq()
CallerAutoPilotControlManager.sendStatusQueryReq()
delay(5000)
isOldVersion.set(true)
}.also {
@@ -74,18 +74,18 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
if (!CallerAutoPilotManager.isConnected()) {
if (!CallerAutoPilotControlManager.isConnected()) {
CallerLogger.d("$M_DEVA$TAG", "工控机断开了....")
healthInfo.set(null)
send(RTKStatus("", -1))
}
if (CallerAutoPilotManager.isConnected() && check == null && !isOldVersion.get()) {
if (CallerAutoPilotControlManager.isConnected() && check == null && !isOldVersion.get()) {
check()
}
}
override fun onChassisLocationWGS84(gnssInfo: GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
if (isOldVersion.get()) {
if (isRTKEnabled()) {
send(RTKStatus("RTK", 0))
@@ -103,7 +103,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
private fun isRTKEnabled(): Boolean {
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
val gnssInfo = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
return CallerAutoPilotManager.isConnected() && (
return CallerAutoPilotControlManager.isConnected() && (
code != "EHW_RTK" &&
code != "EHW_GNSS" &&
code != "ESYS_RTK_STATUS_FAULT" &&

View File

@@ -40,7 +40,7 @@ internal class TracingImpl(ctx: Context): IFlow<TracingStatus>(ctx), IMoGoAutopi
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
if (!CallerAutoPilotManager.isConnected()) {
if (!CallerAutoPilotControlManager.isConnected()) {
old = UNKNOWN
send(TracingStatus(UNKNOWN))
}

View File

@@ -19,7 +19,7 @@ internal class StatusModel : ViewModel() {
const val TAG = "StatusModel"
val DEFAULTS = Pair(null, ArrayList<Status>().also {
it += IpcStatus(CallerAutoPilotManager.isConnected())
it += IpcStatus(CallerAutoPilotControlManager.isConnected())
it += CanStatus(false)
it += TracingStatus(UNKNOWN)
it += RTKStatus("", -1)

View File

@@ -7,7 +7,7 @@ import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -51,7 +51,7 @@ object SyncConfig {
else -> {
}
}
AppConfigInfo.teleTimeStamp = CallerAutoPilotManager.getTeleTimeStamp()
AppConfigInfo.teleTimeStamp = CallerAutoPilotControlManager.getTeleTimeStamp()
logOutConfig(AppConfigInfo)
}

View File

@@ -31,9 +31,8 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
@@ -51,7 +50,6 @@ import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.came
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.function.main.DisplayEffectsHelper
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
@@ -216,7 +214,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
SharedPrefsMgr.getInstance(it)
.putLong("roadwork", System.currentTimeMillis() / 1000)
}
CallerAutoPilotManager.sendTripInfo(5, "", "", "", false)
CallerAutoPilotControlManager.sendTripInfo(5, "", "", "", false)
}
}

View File

@@ -12,7 +12,7 @@ import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxEventListenerManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
@@ -95,7 +95,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat())
var resultStr = "类型:"
for (result in reportEntity.resultList){
resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
resultStr = "${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}"
}
holder.tvBubbleReportType.text = resultStr
holder.clReportLayout.setOnClickListener {

View File

@@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.*
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.R
@@ -133,7 +133,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
var resultStr = "类型:"
for (result in reportEntity.resultList) {
resultStr =
"${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}"
"${resultStr}${CallerAutoPilotControlManager.getReportResultDesc(result)}"
}
holder.tvReportTypeNormal.text = resultStr
holder.tvReportTypeOpen.text = resultStr
@@ -141,7 +141,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
var actionStr = ""
for (action in reportEntity.actionsList) {
actionStr =
"${actionStr}${CallerAutoPilotManager.getReportActionDesc(action)}"
"${actionStr}${CallerAutoPilotControlManager.getReportActionDesc(action)}"
}
holder.tvReportActionOpen.text = "建议操作:$actionStr"
holder.tvStatusSelect.setOnClickListener {

View File

@@ -19,7 +19,7 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo.NoticeTrafficAccountInfo
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.notice.NoticeValue
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.startAutoPilot
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager.bizProvider

View File

@@ -38,6 +38,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.data.gnss.AccelerationEntity
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.autopilot.*
@@ -120,7 +121,7 @@ internal class DebugSettingView @JvmOverloads constructor(
private var logViewAttach = false
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private var mGnssInfo: MessagePad.GnssInfo? = null
private var mGnssInfo: MogoLocation? = null
private var accelerationFloatWindow: AccelerationFloatWindow? = null
private var accelerationList = arrayListOf<AccelerationEntity>()
@@ -220,7 +221,7 @@ internal class DebugSettingView @JvmOverloads constructor(
Timer().schedule(timerTaskRefresh, Date(), 300)
if (AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())) {
//查询工控机基础配置信息
CallerAutoPilotManager.getCarConfig()
CallerAutoPilotControlManager.getCarConfig()
}
}
@@ -594,10 +595,10 @@ internal class DebugSettingView @JvmOverloads constructor(
"demoMode",
DemoModeView(context)
)
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
tbIsDrawAutopilotTrajectoryData.isEnabled = !FunctionBuildConfig.isDemoMode
if (!FunctionBuildConfig.isDemoMode) {
@@ -615,7 +616,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tbIsRainMode.isChecked = FunctionBuildConfig.isRainMode
//雨天模式
tbIsRainMode.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.setRainMode(isChecked)
CallerAutoPilotControlManager.setRainMode(isChecked)
FunctionBuildConfig.isRainMode = isChecked
}
//雨天模式按钮只在司机屏生效,乘客屏不显示
@@ -634,7 +635,7 @@ internal class DebugSettingView @JvmOverloads constructor(
//重启工控机所有节点
btnIpcReboot.onClick {
CallerAutoPilotManager.sendIpcReboot()
CallerAutoPilotControlManager.sendIpcReboot()
ToastUtils.showLong("重启命令已发送")
}
//只在司机端设置工控机节点重启功能
@@ -773,7 +774,7 @@ internal class DebugSettingView @JvmOverloads constructor(
// 模拟自动驾驶中
tbChangeAutoPilotStatus.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.setControlAutopilotCarAuto(isChecked)
CallerAutoPilotControlManager.setControlAutopilotCarAuto(isChecked)
}
when {
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {
@@ -794,7 +795,7 @@ internal class DebugSettingView @JvmOverloads constructor(
}
//初始化ADAS日志开关状态
tbADASLog.isChecked = CallerAutoPilotManager.isEnableLog()
tbADASLog.isChecked = CallerAutoPilotControlManager.isEnableLog()
//查看上报历史列表
tbReportMore.setOnCheckedChangeListener { _, isChecked ->
@@ -915,7 +916,7 @@ internal class DebugSettingView @JvmOverloads constructor(
btnConnectServerIp.setOnClickListener {
val ip = etConnectServerIp.text.toString()
if (!ip.isNullOrEmpty()) {
CallerAutoPilotManager.connectSpecifiedServer(ip)
CallerAutoPilotControlManager.connectSpecifiedServer(ip)
}
}
@@ -982,7 +983,7 @@ internal class DebugSettingView @JvmOverloads constructor(
btnSetAutopilotIP.setOnClickListener {
val autoPilotIp = etAutopilotIP.text.toString()
if (autoPilotIp.isNotEmpty()) {
CallerAutoPilotManager.resetIpAddress(autoPilotIp)
CallerAutoPilotControlManager.resetIpAddress(autoPilotIp)
} else {
ToastUtils.showShort("请输入正确的IP地址")
}
@@ -990,7 +991,7 @@ internal class DebugSettingView @JvmOverloads constructor(
//断开与工控机的连接
btnDisconnectIpc.setOnClickListener {
CallerAutoPilotManager.disconnectIpc()
CallerAutoPilotControlManager.disconnectIpc()
}
/**
@@ -1000,32 +1001,32 @@ internal class DebugSettingView @JvmOverloads constructor(
val recordTimeStr = etInputRecordTime.text?.toString()
try {
if (recordTimeStr.isNullOrEmpty()) {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
val recordTime = recordTimeStr?.toInt()
if (recordTime != null && recordTime > 0) {
CallerAutoPilotManager.recordPackage(recordTime)
CallerAutoPilotControlManager.recordPackage(recordTime)
} else {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
} catch (e: Exception) {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
}
btnRecordBag.onClick {
val recordTimeStr = etInputRecordBagTime.text?.toString()
try {
if (recordTimeStr.isNullOrEmpty()) {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
val recordTime = recordTimeStr?.toInt()
if (recordTime != null && recordTime > 0) {
CallerAutoPilotManager.recordPackage(recordTime)
CallerAutoPilotControlManager.recordPackage(recordTime)
} else {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
} catch (e: Exception) {
CallerAutoPilotManager.recordPackage()
CallerAutoPilotControlManager.recordPackage()
}
}
@@ -1193,9 +1194,9 @@ internal class DebugSettingView @JvmOverloads constructor(
*/
tbADASLog.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerAutoPilotManager.setEnableLog(true)
CallerAutoPilotControlManager.setEnableLog(true)
} else {
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotControlManager.setEnableLog(false)
}
}
@@ -1519,7 +1520,7 @@ internal class DebugSettingView @JvmOverloads constructor(
tvAppVersionNameKey.text = "鹰眼版本名:${AppUtils.getAppVersionName()}"
tvAutopilotProtocolVersionInfo.text =
"Autopilot协议版本${CallerAutoPilotManager.getProtocolVersion()}"
"Autopilot协议版本${CallerAutoPilotControlManager.getProtocolVersion()}"
if (AppConfigInfo.protocolVersionNumber == 0) {
tvIpcProtocolVersionInfo.text = "工控机协议版本:未知"
} else {
@@ -1825,7 +1826,7 @@ internal class DebugSettingView @JvmOverloads constructor(
}
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
mGnssInfo = gnssInfo
//实时加速度列表
ThreadUtils.runOnUiThread {
@@ -1904,14 +1905,14 @@ internal class DebugSettingView @JvmOverloads constructor(
var resultStr = "result:"
for (result in it.resultList) {
resultStr =
"$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
"$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} "
}
tvReportResult.text = resultStr
var actionStr = "action:"
for (action in it.actionsList) {
actionStr =
"$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
"$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} "
}
tvReportActions.text = actionStr
@@ -2010,14 +2011,14 @@ internal class DebugSettingView @JvmOverloads constructor(
var resultStr = "result:"
for (result in it.resultList) {
resultStr =
"$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
"$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} "
}
tvReportResult.text = resultStr
var actionStr = "action:"
for (action in it.actionsList) {
actionStr =
"$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
"$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} "
}
tvReportActions.text = actionStr
if ("error" == it.level) {

View File

@@ -6,7 +6,7 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.hmi.R
import me.jessyan.autosize.AutoSizeCompat
@@ -37,13 +37,13 @@ class IPCReportAdapter: RecyclerView.Adapter<IPCReportAdapter.IPCReportHolder>()
holder.tvReportTimeContent.text = it.time
var resultStr = "发生异常"
for (result in it.resultList){
resultStr = "${resultStr}-${CallerAutoPilotManager.getReportResultDesc(result)}"
resultStr = "${resultStr}-${CallerAutoPilotControlManager.getReportResultDesc(result)}"
}
holder.tvReportResultContent.text = resultStr
holder.tvReportMsgContent.text = it.msg
var actionStr = ""
for (action in it.actionsList){
actionStr = "${actionStr}-${CallerAutoPilotManager.getReportActionDesc(action)}"
actionStr = "${actionStr}-${CallerAutoPilotControlManager.getReportActionDesc(action)}"
}
holder.tvReportActionContent.text = actionStr
}

View File

@@ -9,7 +9,7 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.hmi.R
/**
@@ -45,12 +45,12 @@ class ReportListAdapter(context: Context) :
holder.tvReportCode.text = "code:${it.code}"
var resultStr = "result:"
for (result in it.resultList) {
resultStr = "$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} "
resultStr = "$resultStr$result${CallerAutoPilotControlManager.getReportResultDesc(result)} "
}
holder.tvReportResult.text = resultStr
var actionStr = "action:"
for (action in it.actionsList) {
actionStr = "$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} "
actionStr = "$actionStr$action${CallerAutoPilotControlManager.getReportActionDesc(action)} "
}
holder.tvReportActions.text = actionStr

View File

@@ -10,7 +10,7 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
@@ -49,7 +49,7 @@ internal class SOPSettingView @JvmOverloads constructor(
//绕障类功能开关
tbObstacleAvoidance.isChecked = FunctionBuildConfig.isDetouring
tbObstacleAvoidance.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.sendDetouring(isChecked)
CallerAutoPilotControlManager.sendDetouring(isChecked)
FunctionBuildConfig.isDetouring = isChecked
}
@@ -161,10 +161,10 @@ internal class SOPSettingView @JvmOverloads constructor(
tbDemoMode.setOnCheckedChangeListener { _, _ ->
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
CallerHmiManager.updateStatusBarLeftView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(context))
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
}
//只在司机端设置美化模式开关功能
@@ -177,7 +177,7 @@ internal class SOPSettingView @JvmOverloads constructor(
tbRainMode.isChecked = FunctionBuildConfig.isRainMode
//雨天模式
tbRainMode.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.setRainMode(isChecked)
CallerAutoPilotControlManager.setRainMode(isChecked)
FunctionBuildConfig.isRainMode = isChecked
}
//雨天模式按钮只在司机屏生效,乘客屏不显示
@@ -227,7 +227,7 @@ internal class SOPSettingView @JvmOverloads constructor(
}
btnSpeedSet.setOnClickListener {
val isSuccess =
CallerAutoPilotManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
CallerAutoPilotControlManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
if (isSuccess == true) {
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置成功")
} else {

View File

@@ -4,7 +4,7 @@ import android.content.Context
import android.util.AttributeSet
import android.view.View
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
@@ -25,10 +25,10 @@ class DemoModeHiddenSwitch(context: Context, attrs: AttributeSet?) : View(contex
"demoMode",
DemoModeView(context)
)
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setDemoMode(FunctionBuildConfig.isDemoMode)
if (!FunctionBuildConfig.isDemoMode) {
//关闭美化模式时,通知工控机
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
CallerAutoPilotControlManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
}
}
}

View File

@@ -7,7 +7,6 @@ import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Process
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
@@ -18,10 +17,9 @@ import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.data.temp.EventLogout
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil
import com.mogo.eagle.core.function.msgbox.MsgBoxConfig
@@ -77,7 +75,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
}
else -> {
// 设置自动驾驶速度
val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speed)
val isSuccess = CallerAutoPilotControlManager.setAutoPilotSpeed(speed)
when {
isSuccess -> {
ToastUtils.showShort("车速设置成功,立即生效")
@@ -110,7 +108,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
}
if (AppConfigInfo.isConnectAutopilot) {
CallerAutoPilotManager.getCarConfig()
CallerAutoPilotControlManager.getCarConfig()
}
// if (maxAcceleration > 0) {
// tvAcceleration.text = "加速度 $maxAcceleration m/s²"
@@ -142,7 +140,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
//速度确认
tvSureModify.setOnClickListener {
val isSuccess = CallerAutoPilotManager.setAutoPilotSpeed(speedLimit)
val isSuccess = CallerAutoPilotControlManager.setAutoPilotSpeed(speedLimit)
when {
isSuccess -> {
//速度显示

View File

@@ -8,7 +8,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
@@ -85,7 +85,7 @@ class AutoPilotStatusView constructor(
AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867)
currentAutopilot.vehicleType = 10
CallerAutoPilotManager.startAutoPilot(currentAutopilot)
CallerAutoPilotControlManager.startAutoPilot(currentAutopilot)
}
/**

View File

@@ -9,7 +9,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.function.hmi.R
@@ -68,7 +68,7 @@ class CheckSystemView @JvmOverloads constructor(
else {
//确认重启
CallerLogger.d("$M_HMI$TAG", "reboot confirm")
CallerAutoPilotManager.setIPCReboot()
CallerAutoPilotControlManager.setIPCReboot()
}
}

View File

@@ -5,12 +5,12 @@ import android.graphics.Color
import android.util.AttributeSet
import android.view.Gravity
import android.widget.FrameLayout
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import mogo.telematics.pad.MessagePad
import java.util.*
/**
@@ -29,7 +29,7 @@ class SpeedPanelView @JvmOverloads constructor(
var mContext: Context
var mSpeedChartView: SpeedChartView
var mLatLng: MessagePad.GnssInfo? = null
var mLatLng: MogoLocation? = null
var mSpeedLimit = 60
private val timer by lazy {
@@ -77,7 +77,7 @@ class SpeedPanelView @JvmOverloads constructor(
timer.schedule(task, Date(), 200)
}
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
gnssInfo?.let {
mLatLng = gnssInfo
}

View File

@@ -24,7 +24,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.mofang.MfConstants;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
import com.mogo.eagle.core.function.hmi.R;
@@ -351,7 +351,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (isShowToast) {
ToastUtils.showShort("方块 单击C ← 向左变道 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft();
CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneLeft();
}
}
return true;
@@ -372,7 +372,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (isShowToast) {
ToastUtils.showShort("方块 单击D → 向右变道 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight();
CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneRight();
}
}
return true;
@@ -384,14 +384,14 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (isShowToast) {
ToastUtils.showShort("方块 长按E 鸣笛 ");
}
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(1);
if (timerHorn == null) {
timerHorn = new Timer();
}
timerHorn.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(2);
timerHorn = null;
}
}, 500);
@@ -404,7 +404,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
if (isShowToast) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
}
CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
}
}
return true;
@@ -425,7 +425,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
timerAcc.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated);
}
}, 0, 500);
}
@@ -434,7 +434,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
timerAcc.cancel();
timerAcc = null;
}
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc);
}
}

View File

@@ -20,13 +20,12 @@ import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.module.intent.IMogoIntentListener;
import com.mogo.commons.module.intent.IntentManager;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.base.IMoGoFunctionProvider;
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager;
import com.mogo.eagle.core.function.hmi.R;
@@ -300,7 +299,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
isCombinationKey = false;
if ((pressCUpTime - startPressTime) < 300) {
ToastUtils.showShort("方块 单击C ← 向左变道 ");
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneLeft();
CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneLeft();
}
}
return true;
@@ -318,7 +317,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
isCombinationKey = false;
if ((pressDUpTime - startPressTime) < 300) {
ToastUtils.showShort("方块 单击D → 向右变道 ");
CallerAutoPilotManager.INSTANCE.sendOperatorChangeLaneRight();
CallerAutoPilotControlManager.INSTANCE.sendOperatorChangeLaneRight();
}
}
@@ -329,14 +328,14 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
if (!isCombinationKey) {
if ((pressEDownTime - startPressTime) > 1900) {
ToastUtils.showShort("方块 长按E 鸣笛 ");
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(1);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(1);
if (timerHorn == null) {
timerHorn = new Timer();
}
timerHorn.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetHorn(2);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetHorn(2);
timerHorn = null;
}
}, 500);
@@ -348,7 +347,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
isCombinationKey = false;
if ((pressEUpTime - startPressTime) < 300) {
ToastUtils.showShort("方块 单击E 开启自动驾驶 ");
CallerAutoPilotManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getAutopilotControlParameters());
}
}
@@ -372,7 +371,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
timerAcc.schedule(new TimerTask() {
@Override
public void run() {
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(accelerated);
}
}, 0, 500);
}
@@ -381,7 +380,7 @@ public class PassengerLauncherActivity extends MainActivity implements IMogoInte
timerAcc.cancel();
timerAcc = null;
}
CallerAutoPilotManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc);
CallerAutoPilotControlManager.INSTANCE.sendOperatorSetAcceleratedSpeed(acc);
}
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.business;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.enums.DataSourceType;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
@@ -13,8 +14,6 @@ import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
import mogo.telematics.pad.MessagePad;
/**
* 限速
*
@@ -24,7 +23,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
private final static String TAG = "SpeedLimitDataManager";
private static volatile SpeedLimitDataManager instance;
private MessagePad.GnssInfo mLocation;
private MogoLocation mLocation;
private SpeedLimitDataManager() {
}
@@ -41,7 +40,7 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationGCJ02Listener
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
mLocation = gnssInfo;
}

View File

@@ -8,16 +8,18 @@ import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.zhidaoauto.map.operational.open.GatherApi
import com.zhidaoauto.map.operational.open.GatherParams
import com.zhidaoauto.map.operational.open.abs.OnTaskListener
import mogo.telematics.pad.MessagePad.GnssInfo
import record_cache.RecordPanelOuterClass
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList
@@ -168,14 +170,14 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
}
}
override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return
executor.get()?.updateLocation(
location.longitude,
location.latitude,
location.altitude,
location.bearing,
location.speed,
location.heading.toFloat(),
location.gnssSpeed,
false)
}

View File

@@ -5,6 +5,7 @@ import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener;
@@ -65,7 +66,7 @@ public class MogoRouteOverlayManager implements
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (gnssInfo == null) {
return;
}

View File

@@ -8,9 +8,10 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.CenterLine
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
@@ -19,13 +20,12 @@ import com.mogo.eagle.core.function.business.SpeedLimitDataManager
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.datacenter.location.IMoGoLocationListener
import com.mogo.eagle.core.function.datacenter.location.MoGoLocationManager
import com.mogo.eagle.core.function.overview.InfStructureManager
import com.mogo.eagle.core.function.overview.InfStructureManager.savePlanningData
import com.mogo.eagle.core.function.overview.obtainViewModel
@@ -54,7 +54,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
MapView,
IMoGoMapFragmentProvider,
IMoGoSkinModeChangeListener,
IMoGoLocationListener,
IMoGoChassisLocationWGS84Listener,
IMoGoPlanningRottingListener,
IMoGoChassisLamplightListener {
@@ -114,7 +114,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
// 添加换肤监听
CallerSkinModeListenerManager.addListener(Companion.functionName, this)
CallerPlanningRottingListenerManager.addListener(Companion.functionName, this)
MoGoLocationManager.addListener(Companion.functionName, this)
CallerChassisLocationWGS84ListenerManager.addListener(Companion.functionName, this)
CallerChassisLamplightListenerManager.addListener(Companion.functionName, this)
}
@@ -218,7 +218,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
override fun onDestroyView() {
CallerSkinModeListenerManager.removeListener(Companion.functionName)
CallerPlanningRottingListenerManager.removeListener(Companion.functionName)
MoGoLocationManager.removeListener(Companion.functionName)
CallerChassisLocationWGS84ListenerManager.removeListener(Companion.functionName)
CallerChassisLamplightListenerManager.removeListener(Companion.functionName)
if (mMogoMapView != null) {
@@ -346,8 +346,8 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
private var isShowTurnLight = false
private var brakeLight = -1
override fun onLocationChanged(gnssInfo: MessagePad.GnssInfo,sourceType: DataSourceType) {
// 新地图控件
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
// 新地图控件
mMogoMapView?.setExtraGPSData(gnssInfo)
if (gnssInfo != null) {
@@ -364,6 +364,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
}
}
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
if (lightSwitch != null) {

View File

@@ -19,9 +19,10 @@ import com.amap.api.maps.model.*
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.getGlobalPath
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showVideoDialog
@@ -83,7 +84,7 @@ class OverMapView @JvmOverloads constructor(
// 绘制轨迹线的集合
private val textureList: MutableList<BitmapDescriptor?> = ArrayList()
private val texIndexList: MutableList<Int> = ArrayList()
private var mLocation: MessagePad.GnssInfo? = null
private var mLocation: MogoLocation? = null
private var isFirstLocation = true
var mCustomMapStyleOptions: CustomMapStyleOptions? = null
var currMarkerList: ArrayList<Marker>? = null
@@ -493,7 +494,7 @@ class OverMapView @JvmOverloads constructor(
*
* @param location
*/
private fun drawCarMarker(location: MessagePad.GnssInfo?) {
private fun drawCarMarker(location: MogoLocation?) {
if (location == null) return
if (mCarMarker != null) {
val currentLatLng = LatLng(location.latitude, location.longitude)
@@ -568,7 +569,7 @@ class OverMapView @JvmOverloads constructor(
}
}
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
mLocation = gnssInfo
lonLat = Pair(gnssInfo!!.longitude, gnssInfo.latitude)
drawCarMarker(gnssInfo)

View File

@@ -31,6 +31,7 @@ import com.amap.api.maps.model.Polyline;
import com.amap.api.maps.model.PolylineOptions;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.Infrastructure;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
@@ -92,7 +93,7 @@ public class AMapCustomView
private List<BitmapDescriptor> textureList = new ArrayList<>();
private List<Integer> texIndexList = new ArrayList<>();
private MessagePad.GnssInfo mLocation;
private MogoLocation mLocation;
private boolean isFirstLocation = true;
CustomMapStyleOptions mCustomMapStyleOptions;
@@ -456,7 +457,7 @@ public class AMapCustomView
*
* @param location
*/
private void drawCarMarker(MessagePad.GnssInfo location) {
private void drawCarMarker(MogoLocation location) {
if (location == null) return;
if (mCarMarker != null) {
LatLng currentLatLng = new LatLng(location.getLatitude(), location.getLongitude());
@@ -534,7 +535,7 @@ public class AMapCustomView
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
mLocation = gnssInfo;
MarkerDrawerManager.INSTANCE.setLonLat(new Pair(gnssInfo.getLongitude(), gnssInfo.getLatitude()));
drawCarMarker(gnssInfo);

View File

@@ -13,7 +13,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.function.overview.InfStructureManager;
@@ -117,7 +117,7 @@ public class OverviewMapFragment extends BaseFragment
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
// 主动查一次全局路径规划的数据
CallerAutoPilotManager.INSTANCE.getGlobalPath();
CallerAutoPilotControlManager.INSTANCE.getGlobalPath();
queryV2XEvents();
}

View File

@@ -32,6 +32,7 @@ import com.amap.api.maps.model.PolylineOptions;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.map.R;
@@ -47,8 +48,6 @@ import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import mogo.telematics.pad.MessagePad;
/**
* 小地图的方向View
*
@@ -75,7 +74,7 @@ public class SmallMapDirectionView
private Polyline mPolyline;
private CameraUpdate mCameraUpdate;
private Context mContext;
private MessagePad.GnssInfo mLocation;
private MogoLocation mLocation;
public SmallMapDirectionView(Context context) {
this(context, null);
@@ -179,7 +178,7 @@ public class SmallMapDirectionView
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (gnssInfo == null) {
return;
}

View File

@@ -17,7 +17,7 @@ import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.map.R;
@@ -143,7 +143,7 @@ public class SmallMapFragment extends BaseFragment
clearPolyline();
}else if (tempStatus == 1 && autoPilotStatus == 0){
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath");
CallerAutoPilotManager.INSTANCE.getGlobalPath();
CallerAutoPilotControlManager.INSTANCE.getGlobalPath();
}
autoPilotStatus = tempStatus;
}

View File

@@ -29,9 +29,9 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.analytics.AnalyticsManager
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
@@ -46,7 +46,6 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.rousetime.android_startup.AndroidStartup
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
import mogo.telematics.pad.MessagePad.GnssInfo
class HttpDnsStartUp : AndroidStartup<Boolean>() {
@@ -293,10 +292,9 @@ class HttpDnsStartUp : AndroidStartup<Boolean>() {
CallerChassisLocationGCJ20ListenerManager.addListener(
TAG,
object : IMoGoChassisLocationGCJ02Listener {
override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) {
CallerMapLocationListenerManager.getCurrentLocation()?.let { loc ->
MogoLocationInfoServices.getInstance().provideLocation(loc)
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
mogoLocation?.let {
MogoLocationInfoServices.getInstance().provideLocation(mogoLocation)
}
}
},

View File

@@ -1,47 +1,53 @@
package com.mogo.eagle.core.function.v2x.events
import android.content.*
import android.os.*
import android.util.*
import androidx.localbroadcastmanager.content.*
import com.mogo.cloud.passport.*
import android.content.Context
import android.content.Intent
import android.os.Handler
import android.os.Looper
import android.util.Log
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.mogo.cloud.passport.IMoGoTokenCallback
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.constants.HostConst
import com.mogo.commons.module.ServiceConst.CARD_TYPE_ROAD_CONDITION
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.EventTypeHelper
import com.mogo.commons.network.*
import com.mogo.commons.network.ParamsUtil
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CLOUD_V2N
import com.mogo.eagle.core.data.enums.*
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.EventTypeHelper
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
import com.mogo.eagle.core.data.map.entity.MarkerShowEntity
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.traffic.*
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.api.hmi.warning.*
import com.mogo.eagle.core.function.api.map.listener.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.hmi.*
import com.mogo.eagle.core.function.call.map.*
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.v2x.events.alarm.*
import com.mogo.eagle.core.function.v2x.events.bridge.*
import com.mogo.eagle.core.function.v2x.events.alarm.V2XAlarmServer
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi.context
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.*
import com.mogo.eagle.core.function.v2x.events.manager.*
import com.mogo.eagle.core.function.v2x.events.receiver.*
import com.mogo.eagle.core.function.v2x.events.scenario.impl.*
import com.mogo.eagle.core.function.v2x.events.utils.*
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_EXTRA_KEY
import com.mogo.eagle.core.function.v2x.events.consts.V2XConst.BROADCAST_SCENE_HANDLER_ACTION
import com.mogo.eagle.core.function.v2x.events.receiver.SceneBroadcastReceiver
import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager
import com.mogo.eagle.core.function.v2x.events.utils.TrackUtils
import com.mogo.eagle.core.function.v2x.events.utils.toRoadMarker
import com.mogo.eagle.core.function.v2x.internal.V2XManager
import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback
import com.mogo.eagle.core.function.v2x.internal.config.V2XConfig
@@ -51,27 +57,35 @@ import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget
import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent
import com.mogo.eagle.core.function.v2x.road.V2XEventServiceApi
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.eagle.core.utilcode.mogo.logger.*
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.map.marker.*
import com.mogo.map.marker.IMogoMarker
import com.mogo.map.marker.IMogoMarkerClickListener
import com.mogo.map.marker.MogoMarkersHandler.Companion.mogoMarkersHandler
import com.shuyu.gsyvideoplayer.*
import com.shuyu.gsyvideoplayer.cache.*
import com.shuyu.gsyvideoplayer.model.*
import com.shuyu.gsyvideoplayer.player.*
import com.shuyu.gsyvideoplayer.utils.*
import com.zhjt.service.chain.*
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.shuyu.gsyvideoplayer.cache.CacheFactory
import com.shuyu.gsyvideoplayer.cache.ProxyCacheManager
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager
import com.shuyu.gsyvideoplayer.player.PlayerFactory
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.coroutines.*
import kotlinx.coroutines.android.*
import mogo.telematics.pad.MessagePad.GnssInfo
import tv.danmaku.ijk.media.player.*
import java.util.concurrent.*
import java.util.concurrent.atomic.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.android.asCoroutineDispatcher
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicBoolean
object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, IV2XCallback {
@@ -188,7 +202,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
return null
}
override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) {
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return
BridgeApi.location.set(location)
if (V2XManager.hasInit()) {
@@ -208,7 +222,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
val min = if (EventTypeEnumNew.isCloudSocketEvent(v2XRoadEventEntity.poiType)) 0 else 5
CallerLogger.d(
"$M_V2X$TAG",
"--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.speed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}"
"--- trigger show before ---:data=>[${location.longitude}, ${location.latitude}, ${location.gnssSpeed}], distance: $distance, minDistance: $min, poiType: ${v2XRoadEventEntity.poiType}"
)
if (distance >= min) {
CallerLogger.d(

View File

@@ -1,7 +1,5 @@
package com.mogo.eagle.core.function.v2x.events.alarm;
import android.util.Log;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
@@ -51,7 +49,7 @@ public class V2XAlarmServer {
if (poiLocation == null) {
continue;
}
if (isOutOfRange(poiLocation.getLon(), poiLocation.getLat(), currentLocation.getLongitude(), currentLocation.getLatitude(), currentLocation.getBearing())) {
if (isOutOfRange(poiLocation.getLon(), poiLocation.getLat(), currentLocation.getLongitude(), currentLocation.getLatitude(), currentLocation.getHeading())) {
iterator.remove();
}
}
@@ -75,7 +73,7 @@ public class V2XAlarmServer {
}
}
// 2、道路事件方向与当前行驶方向角度偏差《20度以内
double carBearing = currentLocation.getBearing();
double carBearing = currentLocation.getHeading();
double eventBearing = eventLocation.getAngle();
double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing);
Logger.d(TAG, "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle);
@@ -86,7 +84,7 @@ public class V2XAlarmServer {
currentLocation.getLatitude(),
eventLocation.getLon(),
eventLocation.getLat(),
(int) currentLocation.getBearing()
(int) currentLocation.getHeading()
);
Logger.d(TAG, "eventAngle:" + eventAngle);

View File

@@ -4,13 +4,14 @@ import android.os.Handler
import android.os.HandlerThread
import android.util.Log
import com.mogo.cloud.commons.utils.CoordinateUtils
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import com.mogo.map.marker.IMogoMarker
import com.mogo.map.overlay.IMogoPolyline
import kotlinx.coroutines.Runnable
import mogo.telematics.pad.MessagePad.GnssInfo
import java.util.LinkedList
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference
@@ -83,7 +84,7 @@ object MarkerRemoveManager {
}
Log.d(TAG, "--- checkTask --- 3 ---")
val toRemove = toRemoveMakers.iterator()
val carLoc = AtomicReference<GnssInfo>()
val carLoc = AtomicReference<MogoLocation>()
while (toRemove.hasNext()) {
val marker = toRemove.next()
if (carLoc.get() == null) {

View File

@@ -45,7 +45,7 @@ class V2XAiRoadEventMarker {
if (polygons.size > 0) {
val l2 = entity.noveltyInfo?.location ?: return
v2xLocation.set(MogoLocation().also {
it.longitude = l2.lon; it.latitude = l2.lat; it.bearing = l2.angle.toFloat()
it.longitude = l2.lon; it.latitude = l2.lat; it.heading = l2.angle
})
val options = MogoPolylineOptions()

View File

@@ -7,8 +7,11 @@ import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
@@ -19,14 +22,13 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import java.math.BigDecimal;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import mogo.telematics.pad.MessagePad;
/**
* @author liujing
* @description 车路云—场景预警-V1.0 前车/行人/摩托车/盲区碰撞预警
@@ -128,7 +130,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
}
@Override
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
sV2XWarningMarker.onCarLocationChanged2(gnssInfo);
}

View File

@@ -3,32 +3,33 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.warning;
import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
import static com.mogo.eagle.core.data.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.utils.Trigonometric;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.v2x.DrawLineInfo;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.function.v2x.events.bridge.BridgeApi;
import com.mogo.eagle.core.data.v2x.DrawLineInfo;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoPersonWarnPolylineManager;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoStopPolylineManager;
import com.mogo.eagle.core.function.v2x.events.manager.IMoGoWarnPolylineManager;
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation;
import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.overlay.IMogoPolyline;
import com.mogo.commons.utils.Trigonometric;
import com.mogo.eagle.core.function.v2x.internal.data.V2XLocation;
import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import mogo.telematics.pad.MessagePad;
/**
* @author liujing
@@ -52,7 +53,7 @@ public class V2XWarningMarker implements IV2XMarker {
* */
private MogoLatLng middleLocationInStopLine = new MogoLatLng(0, 0);
private static long showTime = 6000;
private float bearing;
private double bearing;
private boolean hasStopLines = false;
@Override
@@ -75,7 +76,7 @@ public class V2XWarningMarker implements IV2XMarker {
if (location == null) {
return;
}
bearing = location.getBearing();
bearing = location.getHeading();
if (mCloundWarningInfo != null && mCloundWarningInfo.getStopLines() != null) {
hasStopLines = mCloundWarningInfo.getStopLines().size() > 0;
@@ -428,7 +429,7 @@ public class V2XWarningMarker implements IV2XMarker {
}
//线随车动
public void onCarLocationChanged2(MessagePad.GnssInfo latLng) {
public void onCarLocationChanged2(MogoLocation latLng) {
carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
if (MogoStatusManager.getInstance().isVrMode() && !isSelfLineClear) {
if (mCloundWarningInfo != null) {