[2.13.0-arch-opt] merge 2.14.0 line id func

This commit is contained in:
zhongchao
2023-02-14 15:17:40 +08:00
parent 5f363baab6
commit 4f25b0fd43
15 changed files with 171 additions and 1 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)
}
}