[3.4.0][状态栏] 优化RTK数据源获取逻辑

This commit is contained in:
renwj
2023-07-17 20:55:43 +08:00
parent f3d30026ce
commit 548b51d07b

View File

@@ -52,7 +52,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
return
}
check?.takeIf { it.isActive }?.cancel()
launch(Dispatchers.Unconfined) {
launch(Dispatchers.Default) {
CallerAutoPilotControlManager.sendStatusQueryReq()
delay(5000)
isOldVersion.set(true)
@@ -87,10 +87,9 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
if (isOldVersion.get()) {
if (isRTKEnabled()) {
if ((timeOutCheck == null || timeOutCheck?.isCompleted == true) && isRTKEnabled()) {
send(RTKStatus("RTK", 0))
timeOutCheck?.takeIf { it.isActive }?.cancel()
launch(Dispatchers.Unconfined) {
launch(Dispatchers.Default) {
delay(4000)
send(RTKStatus("", -1))
}.also {