Merge remote-tracking branch 'origin/release_robotaxi-d-app-module_2120_221017_2.12.0.1'
# Conflicts: # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java # core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt # libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MessageType.java
This commit is contained in:
@@ -137,6 +137,12 @@ object CallerAutoPilotManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun recordPackage(type: Int,id: Int,duration: Int,bduration: Int,topics: List<String>){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
providerApi?.recordPackage(type, id, duration, bduration, topics)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止录制bag包
|
||||
*/
|
||||
@@ -230,12 +236,36 @@ object CallerAutoPilotManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* 绕障类功能开关
|
||||
* isEnable = true 开启
|
||||
* isEnable = false 关闭
|
||||
* @return boolean
|
||||
*/
|
||||
fun getBadCaseConfig() {
|
||||
fun sendDetouring(isEnable: Boolean): Boolean?{
|
||||
return providerApi?.sendDetouring(isEnable)
|
||||
}
|
||||
|
||||
/**
|
||||
* 变道绕障的目标障碍物速度阈值
|
||||
* @param speed 速度阈值 m/s
|
||||
* @return boolean
|
||||
*/
|
||||
fun sendDetouringSpeed(speed: Double): Boolean?{
|
||||
return providerApi?.sendDetouringSpeed(speed)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
|
||||
* @param topicsNeedToCache
|
||||
*/
|
||||
fun getBadCaseConfig(reqType: Int,recordType: Int,topicsNeedToCache: List<String>): Boolean?{
|
||||
// 司机屏才能查询数据采集的配置
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
providerApi?.getBadCaseConfig()
|
||||
return providerApi?.getBadCaseConfig(reqType, recordType, topicsNeedToCache)
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,6 +297,23 @@ object CallerAutoPilotManager {
|
||||
providerApi?.sendOperatorSetHorn(value)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发生行程相关
|
||||
* type=1或2的时 需要参数 lineName
|
||||
* type=3或4的时 需要参数 lineName departureStopName arrivalStopName isLastStop
|
||||
* type=5时 不需要任何参数
|
||||
*
|
||||
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
|
||||
* @param lineName 路线名
|
||||
* @param departureStopName 出站站点名
|
||||
* @param arrivalStopName 下一站到达站点名
|
||||
* @param isLastStop 是否最终站
|
||||
* @return boolean
|
||||
*/
|
||||
fun sendTripInfo(type: Int, lineName: String, departureStopName: String, arrivalStopName: String, isLastStop: Boolean) {
|
||||
providerApi?.sendTripInfo(type, lineName, departureStopName, arrivalStopName, isLastStop)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送工控机所有节点重启命令
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import android.util.*
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
@@ -67,18 +66,14 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
* 获取当前时刻WGS84 lat
|
||||
*/
|
||||
fun getCurWgs84Lat(): Double {
|
||||
val locationLat = mAutopilotStatusInfo.locationLat
|
||||
Log.d("GO", "wgs84_lat:" + locationLat)
|
||||
return locationLat
|
||||
return mAutopilotStatusInfo.locationLat
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时刻WGS84 lon
|
||||
*/
|
||||
fun getCurWgs84Lon(): Double {
|
||||
val locationLon = mAutopilotStatusInfo.locationLon
|
||||
Log.d("GO", "wgs84_lon:" + locationLon)
|
||||
return locationLon
|
||||
return mAutopilotStatusInfo.locationLon
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
|
||||
object CallerAutopilotStatisticsListenerManager : CallerBase() {
|
||||
|
||||
private val M_AUTOPILOT_STATISTICS_LISTENER: ConcurrentHashMap<String, IMoGoAutopilotStatisticsListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoAutopilotStatisticsListener
|
||||
) {
|
||||
if (M_AUTOPILOT_STATISTICS_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_STATISTICS_LISTENER[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_AUTOPILOT_STATISTICS_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_STATISTICS_LISTENER.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoAutopilotStatisticsListener) {
|
||||
M_AUTOPILOT_STATISTICS_LISTENER.forEach {
|
||||
if (it.value == listener) {
|
||||
M_AUTOPILOT_STATISTICS_LISTENER.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun invokeAutopilotStatistics(statistics: AutopilotStatistics?) {
|
||||
M_AUTOPILOT_STATISTICS_LISTENER.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotStatistics(statistics)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoStartAutopilotFailedListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo_msg.MogoReportMsg
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* 启动自动驾驶失败监听
|
||||
* 注册/取消注册
|
||||
*/
|
||||
object CallerStartAutopilotFailedListenerManager : CallerBase() {
|
||||
|
||||
private val M_START_AUTOPILOT_FAILED_LISTENER: ConcurrentHashMap<String, IMoGoStartAutopilotFailedListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoStartAutopilotFailedListener
|
||||
) {
|
||||
if (M_START_AUTOPILOT_FAILED_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_START_AUTOPILOT_FAILED_LISTENER[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_START_AUTOPILOT_FAILED_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_START_AUTOPILOT_FAILED_LISTENER.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoStartAutopilotFailedListener) {
|
||||
M_START_AUTOPILOT_FAILED_LISTENER.forEach {
|
||||
if (it.value == listener) {
|
||||
M_START_AUTOPILOT_FAILED_LISTENER.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun invokeStartAutopilotFailed(message: MogoReportMsg.MogoReportMessage?) {
|
||||
M_START_AUTOPILOT_FAILED_LISTENER.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartAutopilotFailed(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,8 @@ object CallerDevaToolsFuncConfigListenerManager {
|
||||
private val M_DEVA_TOOLS_FUNC_CONFIG_LISTENER: ConcurrentHashMap<String, IMoGoDevaToolsFuncConfigListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
private val cacheMap = mutableMapOf<String,MutableList<SubBiz>>()
|
||||
private val cacheMap = mutableMapOf<String, MutableList<SubBiz>>()
|
||||
private val viewCacheMap = mutableMapOf<String, Boolean>()
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
@@ -20,15 +21,19 @@ object CallerDevaToolsFuncConfigListenerManager {
|
||||
fun registerDevaToolsFuncConfigListener(
|
||||
@Nullable biz: String,
|
||||
@Nullable tag: String,
|
||||
onlyViewRegister:Boolean = false,
|
||||
@Nullable listener: IMoGoDevaToolsFuncConfigListener
|
||||
) {
|
||||
if (M_DEVA_TOOLS_FUNC_CONFIG_LISTENER.containsKey("$biz'_'$tag")) {
|
||||
return
|
||||
}
|
||||
M_DEVA_TOOLS_FUNC_CONFIG_LISTENER["$biz'_'$tag"] = listener
|
||||
viewCacheMap["$biz'_'$tag"] = onlyViewRegister
|
||||
|
||||
cacheMap[biz]?.let {
|
||||
invokeDevaToolsFuncConfigBizUpdate(biz,it)
|
||||
if (it.size > 0) {
|
||||
invokeDevaToolsFuncConfigBizUpdate(biz, it, tag)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +46,7 @@ object CallerDevaToolsFuncConfigListenerManager {
|
||||
return
|
||||
}
|
||||
M_DEVA_TOOLS_FUNC_CONFIG_LISTENER.remove("$biz'_'$tag")
|
||||
viewCacheMap.remove("$biz'_'$tag")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,15 +67,32 @@ object CallerDevaToolsFuncConfigListenerManager {
|
||||
/**
|
||||
* 由订阅方判断Type类型,聚合一些
|
||||
*/
|
||||
fun invokeDevaToolsFuncConfigBizUpdate(biz: String, list: MutableList<SubBiz>) {
|
||||
fun invokeDevaToolsFuncConfigBizUpdate(
|
||||
biz: String,
|
||||
list: MutableList<SubBiz>,
|
||||
tag: String = ""
|
||||
) {
|
||||
cacheMap[biz] = list
|
||||
M_DEVA_TOOLS_FUNC_CONFIG_LISTENER.forEach {
|
||||
val key = it.key
|
||||
if (key.contains(biz)) {
|
||||
//全量更新
|
||||
if (tag.isEmpty()) {
|
||||
list.forEach { subBiz ->
|
||||
val listener = it.value
|
||||
listener.updateBizData(subBiz.type, subBiz.state, subBiz.lock, subBiz.data)
|
||||
}
|
||||
return@forEach
|
||||
}
|
||||
// 根据biz_tag选择行下发
|
||||
val key = it.key
|
||||
if (key.contains("$biz'_'$tag")) {
|
||||
list.forEach { subBiz ->
|
||||
val listener = it.value
|
||||
if(viewCacheMap["$biz'_'$tag"] == true){
|
||||
listener.updateBizView(subBiz.type,subBiz.lock)
|
||||
}else{
|
||||
listener.updateBizData(subBiz.type, subBiz.state, subBiz.lock, subBiz.data)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.call.hmi
|
||||
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
@@ -292,7 +293,13 @@ object CallerHmiManager : CallerBase() {
|
||||
waringProviderApi?.showModifyBindingcarDialog()
|
||||
}
|
||||
|
||||
fun showUpgradeDialog(name: String, url: String, title: String, content: String, installType: String) {
|
||||
fun showUpgradeDialog(
|
||||
name: String,
|
||||
url: String,
|
||||
title: String,
|
||||
content: String,
|
||||
installType: String
|
||||
) {
|
||||
waringProviderApi?.showUpgradeDialog(name, url, title, content, installType)
|
||||
}
|
||||
|
||||
@@ -397,7 +404,6 @@ object CallerHmiManager : CallerBase() {
|
||||
waringProviderApi?.showVideoDialog(infList)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置 bus出车/收车View
|
||||
* @param view
|
||||
@@ -405,4 +411,19 @@ object CallerHmiManager : CallerBase() {
|
||||
fun setBusOperationView(view: IOchBusView) {
|
||||
waringProviderApi?.setBusOperationView(view)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置状态栏暗夜或明亮模式
|
||||
* 默认 light
|
||||
*/
|
||||
fun setStatusBarDarkOrLight(light: Boolean = true) {
|
||||
waringProviderApi?.setStatusBarDarkOrLight(light)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新(添加/删除)状态栏右侧元素
|
||||
*/
|
||||
fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
waringProviderApi?.updateStatusBarRightView(insert, tag, viewGroup)
|
||||
}
|
||||
}
|
||||
@@ -26,4 +26,19 @@ object CallerOBUManager {
|
||||
providerApi.connect(ipAddress)
|
||||
}
|
||||
|
||||
/**
|
||||
* 断开OBU连接
|
||||
*/
|
||||
fun disConnectObu(){
|
||||
providerApi.disConnect()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取OBU连接状态
|
||||
* @return boolean 连接状态
|
||||
*/
|
||||
fun isConnected(): Boolean{
|
||||
return providerApi.isConnected()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user