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

This commit is contained in:
donghongyu
2023-02-15 16:37:39 +08:00
95 changed files with 1149 additions and 1038 deletions

View File

@@ -7,6 +7,9 @@ import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.GsonUtils
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import system_master.*
import java.util.concurrent.ConcurrentHashMap
import kotlin.properties.Delegates
import system_master.SystemStatusInfo
/**
@@ -20,6 +23,20 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
@Volatile
private var mAutopilotStatusInfo: AutopilotStatusInfo = AutopilotStatusInfo()
private var lineId: Long? by Delegates.observable(0) { _, _, newValue ->
if(newValue == null){
return@observable
}
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotRouteLineId(newValue)
}
}
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotStatusListener> =
ConcurrentHashMap()
@Volatile
private var autoPilotMessageCode: String = ""
@@ -167,6 +184,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
*/
fun updateAutopilotControlParameters(autopilotControlParameters: AutopilotControlParameters? = null) {
mAutopilotStatusInfo.autopilotControlParameters = autopilotControlParameters
lineId = autopilotControlParameters?.autoPilotLine?.lineId
invokeAutoPilotStatus(mAutopilotStatusInfo)
}
}

View File

@@ -3,13 +3,14 @@ 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
import mogo.telematics.pad.MessagePad
/**
* OBU HV 自车车辆基础信息数据,自车定位数据 WGS84 坐标系
*/
object CallerObuLocationWGS84ListenerManager : CallerBase<IMoGoObuLocationWGS84Listener>() {
fun invokeObuLocationWGS84(data: MogoObuHvBasicsData) {
fun invokeObuLocationWGS84(data: MessagePad.GnssInfo) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value

View File

@@ -0,0 +1,14 @@
package com.mogo.eagle.core.function.call.telematic
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerTelematicListenerManager: CallerBase<IReceivedMsgListener>() {
fun invokeReceivedMsg(type: Int, byteArray: ByteArray) {
M_LISTENERS.forEach {
val listener = it.value
listener.onReceivedMsg(type, byteArray)
}
}
}

View File

@@ -34,4 +34,20 @@ object CallerTelematicManager {
fun getServerToken(): String {
return providerApi?.getServerToken() ?: ""
}
/**
* 发送数据给所有客户端
* type保存在TelematicConstant中
*/
fun sendMsgToAllClients(type: Int, byteArray: ByteArray) {
providerApi?.sendMsgToAllClients(type, byteArray)
}
/**
* 发送数据给服务端
* type保存在TelematicConstant中
*/
fun sendMsgToServer(type: Int, byteArray: ByteArray) {
providerApi?.sendMsgToServer(type, byteArray)
}
}

View File

@@ -45,6 +45,13 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>
}
}
fun invokeTrafficLightDisapper() {
M_LISTENERS.forEach {
val listener = it.value
listener.onObuTrafficLightDisapper()
}
}
/**
* 重置红绿灯状态并隐藏
*/