remove networkold api and union the adasapis and adasstatus lat lon data
This commit is contained in:
@@ -37,6 +37,38 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
return GsonUtils.toJson(mAutopilotStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过Gnss定位更新来同步更新自动驾驶状态
|
||||
*/
|
||||
fun updateAutoPilotLatLon(satelliteTime: Long, lon: Double, lat: Double) {
|
||||
mAutopilotStatusInfo.locationLat = lat
|
||||
mAutopilotStatusInfo.locationLon = lon
|
||||
mAutopilotStatusInfo.satelliteTime = satelliteTime
|
||||
mAutopilotStatusInfo.locationStatus = true
|
||||
invokeAutoPilotStatus()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时刻WGS84 lat
|
||||
*/
|
||||
fun getCurWgs84Lat(): Double {
|
||||
return mAutopilotStatusInfo.locationLat
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时刻WGS84 lon
|
||||
*/
|
||||
fun getCurWgs84Lon(): Double {
|
||||
return mAutopilotStatusInfo.locationLon
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时刻WGS84 卫星时间
|
||||
*/
|
||||
fun getCurWgs84SatelliteTime(): Long {
|
||||
return mAutopilotStatusInfo.satelliteTime
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加 ADAS状态 监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
|
||||
@@ -13,7 +13,7 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val M_AUTOPILOT_VEHICLE_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotVehicleStateListener> =
|
||||
ConcurrentHashMap()
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加 ADAS车辆状态&定位 监听
|
||||
@@ -21,8 +21,8 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoAutopilotVehicleStateListener
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoAutopilotVehicleStateListener
|
||||
) {
|
||||
if (M_AUTOPILOT_VEHICLE_LISTENERS.containsKey(tag)) {
|
||||
return
|
||||
@@ -77,16 +77,5 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆刹车根据加速度判断
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotBrakeLightByAcceleration(accrleration: Double) {
|
||||
M_AUTOPILOT_VEHICLE_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotBrakeLightByAcceleration(accrleration)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user