[code_opt_3.3.0] split autopilot status and param

This commit is contained in:
zhongchao
2023-06-12 14:08:23 +08:00
parent df55cd543b
commit ef689a9685
36 changed files with 742 additions and 783 deletions

View File

@@ -31,8 +31,8 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
}
}
private var status: Int by Delegates.observable(0){_, oldValue, newValue ->
if(oldValue != newValue){
private var autopilotState: Int by Delegates.observable(0) { _, oldValue, newValue ->
if (oldValue != newValue) {
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotStatusResponse(newValue)
@@ -40,12 +40,38 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
}
}
private var dockerV: String by Delegates.observable("") { _, oldValue, newValue ->
if (!oldValue.contentEquals(newValue)) {
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotDockerInfo(newValue)
}
}
}
private var connectStatus:Boolean by Delegates.observable(false){_, oldValue, newValue ->
if(oldValue != newValue){
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotConnectInfo(newValue)
}
}
}
@Volatile
private var autoPilotMessageCode: String = ""
@Volatile
private var autoPilotMessageContent: String = ""
override fun doSomeAfterAddListener(tag: String, listener: IMoGoAutopilotStatusListener) {
listener.onAutopilotStatusResponse(mAutopilotStatusInfo)
listener.onAutopilotStatusResponse(autopilotState)
if(dockerV.isNotEmpty()){
listener.onAutopilotDockerInfo(dockerV)
}
}
/**
* 查询AutoPilot状态
*/
@@ -61,10 +87,21 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
return lineId ?: 0L
}
fun getDockerInfo(): String? {
fun getDockerVersion():String?{
return mAutopilotStatusInfo.dockVersion
}
fun getConnectStates():Boolean{
return mAutopilotStatusInfo.connectStatus
}
/**
* 获取当前时刻WGS84 卫星时间
*/
fun getCurWgs84SatelliteTime(): Double {
return mAutopilotStatusInfo.satelliteTime
}
/**
* 查询AutoPilot状态
*/
@@ -87,21 +124,17 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
invokeAutoPilotStatus()
}
fun updateAutoPilotStatus(state: Int, autopilotMode: Int) {
mAutopilotStatusInfo.state = state
fun updateAutoPilotStatus(autopilotState: Int, autopilotMode: Int) {
this.autopilotState = autopilotState
mAutopilotStatusInfo.state = autopilotState
mAutopilotStatusInfo.pilotmode = autopilotMode
invokeAutoPilotStatus()
}
/**
* 获取当前时刻WGS84 卫星时间
*/
fun getCurWgs84SatelliteTime(): Double {
return mAutopilotStatusInfo.satelliteTime
}
override fun doSomeAfterAddListener(tag: String, listener: IMoGoAutopilotStatusListener) {
listener.onAutopilotStatusResponse(mAutopilotStatusInfo)
fun updateAutoPilotDockerInfo(dockerV: String) {
this.dockerV = dockerV
mAutopilotStatusInfo.dockVersion = dockerV
invokeAutoPilotStatus()
}
/**
@@ -109,6 +142,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
*/
@Synchronized
fun invokeAutoPilotStatus() {
connectStatus = mAutopilotStatusInfo.connectStatus
invokeAutoPilotStatus(mAutopilotStatusInfo)
}

View File

@@ -1,11 +1,12 @@
package com.mogo.eagle.core.function.call.msgbox
import android.content.Context
import android.util.Log
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import com.zhjt.service.chain.ChainLog
object CallerMsgBoxManager {
@@ -24,6 +25,12 @@ object CallerMsgBoxManager {
/**
* 存储数据到消息盒子
*/
@ChainLog(
linkChainLog = ChainConstant.CHAIN_TYPE_V2X,
linkCode = ChainConstant.CHAIN_SOURCE_CLOUD,
nodeAliasCode = ChainConstant.CHAIN_CODE_MSG_BOX,
paramIndexes = [0]
)
fun saveMsgBox(bean: MsgBoxBean) {
providerApi?.saveMsg(bean)
}