Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0

# Conflicts:
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficLightView.kt
This commit is contained in:
donghongyu
2023-02-01 19:41:41 +08:00
206 changed files with 3587 additions and 2293 deletions

View File

@@ -23,7 +23,7 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocati
* @param gnssInfo
*/
@Synchronized
fun invokeChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo?) {
fun invokeChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
this.gnssInfo = gnssInfo
M_LISTENERS.forEach {
val tag = it.key

View File

@@ -12,8 +12,31 @@ import java.util.concurrent.ConcurrentHashMap
*/
open class CallerBase<T : Any> {
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
val M_LISTENERS: ConcurrentHashMap<String, T> = ConcurrentHashMap()
/**
* 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
*/
protected val M_LISTENERS: ConcurrentHashMap<String, T> = ConcurrentHashMap()
/**
* 存储所有注册了监听的对象,并设定监听频率invokeXXXX进行遍历回调将信息同步,
*/
protected val M_LISTENERS_HZ: ConcurrentHashMap<String, Int> = ConcurrentHashMap()
/**
* HZ发送记录最后一次发送时间
*/
protected val M_LISTENERS_HZ_LAST_SEND_TIME: ConcurrentHashMap<String, Long> =
ConcurrentHashMap()
/**
* 设置对应监听指定Hz频率
*/
fun setListenerHz(tag: String, hz: Int) {
if (M_LISTENERS_HZ.containsKey(tag)) {
return
}
M_LISTENERS_HZ[tag] = hz
}
/**
* 添加 监听
@@ -21,8 +44,8 @@ open class CallerBase<T : Any> {
* @param listener 监听回调
*/
fun addListener(
tag: String,
listener: T
tag: String,
listener: T
) {
if (M_LISTENERS.containsKey(tag)) {
return

View File

@@ -10,7 +10,6 @@ import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.notice.NoticeNormalData
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
import com.mogo.eagle.core.data.report.ReportEntity
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
@@ -32,20 +31,6 @@ object CallerHmiManager {
waringProviderApi?.displayEffects()
}
/**
* 控制转向灯功能
*/
fun setTurnLightFunction(isOpen: Boolean) {
waringProviderApi?.setTurnLightFunction(isOpen)
}
/**
* 控制刹车功能
*/
fun setBrakeLightFunction(isOpen: Boolean) {
waringProviderApi?.setBrakeLightFunction(isOpen)
}
/**
* 控制显示sn绑定弹框
*/
@@ -98,67 +83,6 @@ object CallerHmiManager {
waringProviderApi?.disableWarningV2X(tag)
}
/**
* 展示红绿灯预警
*
* @param checkLightId 0-都是默认1-红2-黄3-绿
* @param lightSource 1:云端下发2:自车感知3:OBU
*/
fun showWarningTrafficLight(checkLightId: Int, lightSource: Int) {
waringProviderApi?.showWarningTrafficLight(checkLightId, lightSource)
}
/**
* 关闭红绿灯预警
*/
fun disableWarningTrafficLight() {
waringProviderApi?.disableWarningTrafficLight()
}
/**
* 红绿灯是否展示
*/
fun isWarningTrafficLightShow(): Boolean {
return waringProviderApi?.isWarningTrafficLightShow() ?: false
}
/**
* 关闭红绿灯倒计时
*/
fun disableWarningTrafficLightCountDown() {
waringProviderApi?.disableWarningTrafficLightCountDown()
}
/**
* 修改红灯倒计时
*/
fun changeCountdownRed(redNum: Int) {
waringProviderApi?.changeCountdownRed(redNum)
}
/**
* 修改黄灯倒计时
*/
fun changeCountdownYellow(yellowNum: Int) {
waringProviderApi?.changeCountdownYellow(yellowNum)
}
/**
* 修改绿灯倒计时
*/
fun changeCountdownGreen(greenNum: Int) {
waringProviderApi?.changeCountdownGreen(greenNum)
}
/**
* @param readNum 红灯倒计时
* @param yellowNum 黄灯倒计时
* @param greenNum 绿灯倒计时
*/
fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int) {
waringProviderApi?.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
}
/**
* 展示指定方位上的红框预警
* @param direction
@@ -279,14 +203,6 @@ object CallerHmiManager {
waringProviderApi?.hideSmallFragment()
}
/**
* 设置 红绿灯 代理View
* @param view
*/
fun setProxyTrafficLightView(view: IViewTrafficLight) {
waringProviderApi?.setProxyTrafficLightView(view)
}
/**
* 展示工控机监控上报数据
* @param errorReportList 错误级别上报数据列表
@@ -327,20 +243,6 @@ object CallerHmiManager {
waringProviderApi?.updateStatusBarLeftView(insert, tag, viewGroup)
}
/**
* 设置司机端消息盒子是否展示
*/
fun updateDriverMsgBoxTipView(show: Boolean = false) {
waringProviderApi?.updateDriverMsgBoxTipView(show)
}
/**
* 设置乘客端消息盒子是否展示
*/
fun updatePassengerMsgBoxTipView(show: Boolean = false) {
waringProviderApi?.updatePassengerMsgBoxTipView(show)
}
/**
* 更新(添加/删除)状态栏右侧元素
*/

View File

@@ -1,14 +1,12 @@
package com.mogo.eagle.core.function.call.map
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
import com.mogo.eagle.core.function.call.base.CallerBase
import java.util.concurrent.ConcurrentHashMap
/**
* @author xiaoyuzhou
* 高德地图 位置改变 监听管理
* @author dongghongyu
* @date 2021/9/30 5:48 下午
* 地图 位置改变 监听管理
*/
object CallerMapLocationListenerManager : CallerBase<Any>() {

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.call.msgbox
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
import com.mogo.eagle.core.function.call.base.CallerBase
import java.util.concurrent.ConcurrentHashMap
@@ -12,19 +13,60 @@ import java.util.concurrent.ConcurrentHashMap
*/
object CallerMsgBoxEventListenerManager: CallerBase<IMsgBoxEventListener>() {
private val statusListeners: ConcurrentHashMap<String, IMsgBoxEventListener> =
ConcurrentHashMap()
/**
* 触发监听
* 触发汇总报告点击事件监听
*/
fun invokeListener(){
statusListeners.forEach {
fun invokeSummaryListener(){
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onSummaryClickEvent()
}
}
/**
* 更新消息提示View展示状态
*/
fun invokeUpdateTipListener(isShow: Boolean){
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onUpdateTipEvent(isShow)
}
}
/**
* 气泡态运营平台事件点击监听
**/
fun invokeBubbleOperationListener(msgBoxBean: MsgBoxBean){
M_LISTENERS.forEach{
val tag = it.key
val listener = it.value
listener.onBubbleOperationClickEvent(msgBoxBean)
}
}
/**
* 气泡态V2X消息事件点击监听
*/
fun invokeBubbleV2XListener(msgBoxBean: MsgBoxBean){
M_LISTENERS.forEach{
val tag = it.key
val listener = it.value
listener.onBubbleV2XClickEvent(msgBoxBean)
}
}
/**
* 气泡态上报消息事件点击监听
*/
fun invokeBubbleReportListener(msgBoxBean: MsgBoxBean){
M_LISTENERS.forEach{
val tag = it.key
val listener = it.value
listener.onBubbleReportClickEvent(msgBoxBean)
}
}
}

View File

@@ -5,18 +5,17 @@ import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider
import com.mogo.eagle.core.function.call.base.CallerBase
/**
*@author xiaoyuzhou
*@date 2021/10/11 8:30 下午
* 自研OBU管理
* @author xiaoyuzhou
* @date 2021/10/11 8:30 下午
*/
object CallerOBUManager {
object CallerObuApiManager {
private val providerApi: IMoGoObuProvider
get() = CallerBase.getApiInstance(
IMoGoObuProvider::class.java,
MogoServicePaths.PATH_V2X_OBU_MOGO
)
/**
* 重新设置OBU链接IP
*
@@ -29,7 +28,7 @@ object CallerOBUManager {
/**
* 断开OBU连接
*/
fun disConnectObu(){
fun disConnectObu() {
providerApi.disConnect()
}
@@ -37,7 +36,7 @@ object CallerOBUManager {
* 获取OBU连接状态
* @return boolean 连接状态
*/
fun isConnected(): Boolean{
fun isConnected(): Boolean {
return providerApi.isConnected()
}

View File

@@ -0,0 +1,59 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.function.api.obu.IMoGoObuConnectListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.GsonUtils
/**
* OBU 监听管理
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
*/
object CallerObuConnectListenerManager : CallerBase<IMoGoObuConnectListener>() {
/**
* 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
*/
private var mObuStatusInfo: ObuStatusInfo = ObuStatusInfo()
/**
* 查询 OBU状态
*/
fun getObuStatusInfo(): ObuStatusInfo {
return mObuStatusInfo
}
/**
* 查询 OBU状态
*/
fun getObuStatusInfoJsonString(): String {
return GsonUtils.toJson(mObuStatusInfo)
}
override fun doSomeAfterAddListener(tag: String, listener: IMoGoObuConnectListener) {
listener.onConnectStatus(mObuStatusInfo)
}
/**
* 触发 OBU状态 监听
*/
fun invokeObuConnectListener() {
invokeObuConnectListener(mObuStatusInfo)
}
/**
* 触发 OBU状态 监听
* @param obuStatusInfo 当前OBU连接状态信息
*/
fun invokeObuConnectListener(obuStatusInfo: ObuStatusInfo) {
mObuStatusInfo = obuStatusInfo
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onConnectStatus(mObuStatusInfo)
}
}
}

View File

@@ -1,80 +0,0 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.GsonUtils
/**
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
* OBU 监听管理
*/
object CallerObuListenerManager : CallerBase<IMoGoObuStatusListener>() {
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
private var mObuStatusInfo: ObuStatusInfo = ObuStatusInfo()
/**
* 查询 OBU状态
*/
fun getObuStatusInfo(): ObuStatusInfo {
return mObuStatusInfo
}
/**
* 查询 OBU状态
*/
fun getObuStatusInfoJsonString(): String {
return GsonUtils.toJson(mObuStatusInfo)
}
override fun doSomeAfterAddListener(tag: String, listener: IMoGoObuStatusListener) {
listener.onObuStatusResponse(mObuStatusInfo)
}
/**
* 触发 OBU状态 监听
*/
fun invokeListener() {
invokeListener(mObuStatusInfo)
}
/**
* 触发 OBU状态 监听
* @param obuStatusInfo 选中状态
*/
fun invokeListener(obuStatusInfo: ObuStatusInfo) {
mObuStatusInfo = obuStatusInfo
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onObuStatusResponse(mObuStatusInfo)
}
}
fun invokeDelayTime(delayTime: Long) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onObuV2iDelayTime(delayTime)
}
}
fun invokeTrackerWarningInfo(trafficData: TrafficData){
M_LISTENERS.forEach {
val listener = it.value
listener.updateTrackerWarningInfo(trafficData)
}
}
fun removeTrackerWarningInfo(trafficData: TrafficData){
M_LISTENERS.forEach {
val listener = it.value
listener.removeTrackerWarningInfo(trafficData)
}
}
}

View File

@@ -0,0 +1,20 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.support.obu.model.MogoObuHvBasicsData
/**
* OBU HV 自车车辆基础信息数据,自车定位数据 WGS84 坐标系
*/
object CallerObuLocationWGS84ListenerManager : CallerBase<IMoGoObuLocationWGS84Listener>() {
fun invokeObuLocationWGS84(data: MogoObuHvBasicsData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onObuLocationWGS84(data)
}
}
}

View File

@@ -0,0 +1,20 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningMapListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.support.obu.ObuScene
/**
* OBU 地图匹配结果,车道线、红绿灯、建议最大车速、建议最小车速
*/
object CallerObuMapMathListenerManager : CallerBase<IMoGoObuWarningMapListener>() {
fun invokeObuMapMath(data: ObuScene.MapMatchData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuMapMath(data)
}
}
}

View File

@@ -1,25 +0,0 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener
import com.mogo.eagle.core.function.call.base.CallerBase
import java.util.concurrent.ConcurrentHashMap
object CallerObuTrafficLightListenerManager : CallerBase<IMoGoObuTrafficLightListener>() {
private val M_OBU_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap<String, IMoGoObuTrafficLightListener> =
ConcurrentHashMap()
var mLight: Int = 0
fun invokeObuTrafficLight(light: Int) {
this.mLight = light
M_OBU_TRAFFIC_LIGHT_LISTENER.forEach {
val tag = it.key
val listener = it.value
listener.onObuTrafficLight(light)
}
}
}

View File

@@ -0,0 +1,36 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* OBU 监听管理
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
*/
object CallerObuWarningListenerManager : CallerBase<IMoGoObuStatusListener>() {
fun invokeDelayTime(delayTime: Long) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onObuV2iDelayTime(delayTime)
}
}
fun invokeTrackerWarningInfo(trafficData: TrafficData) {
M_LISTENERS.forEach {
val listener = it.value
listener.updateTrackerWarningInfo(trafficData)
}
}
fun removeTrackerWarningInfo(trafficData: TrafficData) {
M_LISTENERS.forEach {
val listener = it.value
listener.removeTrackerWarningInfo(trafficData)
}
}
}

View File

@@ -0,0 +1,20 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.support.obu.ObuScene
/**
* OBU 交通事件预警
*/
object CallerObuWarningRsiListenerManager : CallerBase<IMoGoObuWarningRsiListener>() {
fun invokeObuRsiWarning(data: ObuScene.RsiWarningData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuRsiWarning(data)
}
}
}

View File

@@ -0,0 +1,20 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsmListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.support.obu.ObuScene
/**
* OBU RSM预警信息弱势交通参与者预警信息
*/
object CallerObuWarningRsmListenerManager : CallerBase<IMoGoObuWarningRsmListener>() {
fun invokeObuRsmWarning(data: ObuScene.RsmWarningData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuRsmWarning(data)
}
}
}

View File

@@ -0,0 +1,20 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRvListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.support.obu.model.MogoObuRvWarningData
/**
* OBU V2V预警信息车与车间的预警左右超车、前方车刹车、车辆事故
*/
object CallerObuWarningRvListenerManager : CallerBase<IMoGoObuWarningRvListener>() {
fun invokeObuRvWarning(data: MogoObuRvWarningData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuRvWarning(data)
}
}
}

View File

@@ -0,0 +1,20 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningSpatListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.support.obu.ObuScene
/**
* OBU 红绿灯信息
*/
object CallerObuWarningSpatListenerManager : CallerBase<IMoGoObuWarningSpatListener>() {
fun invokeObuSpatWarning(data: ObuScene.SpatWarningData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuSpatWarning(data)
}
}
}

View File

@@ -1,10 +1,12 @@
package com.mogo.eagle.core.function.call.trafficlight
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>() {
object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>() {
private var trafficLightResult: TrafficLightResult? = null
@@ -17,7 +19,6 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener
fun invokeTrafficLightStatus(trafficLightResult: TrafficLightResult) {
this.trafficLightResult = trafficLightResult
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onTrafficLightStatus(trafficLightResult)
}
@@ -30,15 +31,78 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener
}
}
fun invokeTrafficRequestError(){
M_LISTENERS.forEach{
fun invokeTrafficRequestError() {
M_LISTENERS.forEach {
val listener = it.value
listener.onTrafficRequestError()
}
}
fun resetTrafficLightData() {
fun invokeObuTrafficLightStatus(light: TrafficLightEnum) {
M_LISTENERS.forEach {
val listener = it.value
listener.onObuTrafficLightStatus(light)
}
}
/**
* 重置红绿灯状态并隐藏
*/
fun resetTrafficLightStatus(hideTrafficLight:Boolean = true) {
trafficLightResult = null
// 隐藏traffic light
if(hideTrafficLight){
disableTrafficLight()
}
}
fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) {
M_LISTENERS.forEach {
val listener = it.value
listener.showTrafficLight(checkLightId, lightSource)
}
}
fun changeCountdownTrafficLightNum(readNum: Int, yellowNum: Int, greenNum: Int) {
M_LISTENERS.forEach {
val listener = it.value
listener.changeCountdownTrafficLightNum(readNum, yellowNum, greenNum)
}
}
fun changeCountdownGreen(greenNum: Int) {
M_LISTENERS.forEach {
val listener = it.value
listener.changeCountdownGreen(greenNum)
}
}
fun changeCountdownYellow(yellowNum: Int) {
M_LISTENERS.forEach {
val listener = it.value
listener.changeCountdownYellow(yellowNum)
}
}
fun changeCountdownRed(redNum: Int) {
M_LISTENERS.forEach {
val listener = it.value
listener.changeCountdownRed(redNum)
}
}
fun disableTrafficLight() {
M_LISTENERS.forEach {
val listener = it.value
listener.disableTrafficLight()
}
}
fun disableTrafficLightCountDown() {
M_LISTENERS.forEach {
val listener = it.value
listener.disableTrafficLightCountDown()
}
}
}