[6.4.0][启自驾指引] 添加下载状态ui

This commit is contained in:
renwj
2024-04-18 16:37:58 +08:00
parent dfd4a016f7
commit 033df02a24
20 changed files with 337 additions and 6 deletions

View File

@@ -20,6 +20,7 @@ import com.mogo.commons.module.intent.IMogoIntentListener;
import com.mogo.commons.module.intent.IntentManager;
import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager;
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager;
@@ -481,6 +482,11 @@ public class BusPassengerModel {
};
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){
@Override
public void onAutopilotTrajectoryDownloadReq(@NonNull AutopilotControlParameters.AutoPilotLine autoPilotLine, int downloadType) {
}
@Override
public void onSsmReceiveTimeout(boolean isTimeout) {
// IMoGoAutopilotStatusListener.super.onSsmReceiveTimeout(isTimeout);

View File

@@ -13,6 +13,7 @@ import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.commons.storage.SharedPrefsMgr;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
@@ -786,4 +787,9 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
public void onSsmReceiveTimeout(boolean isTimeout) {
}
@Override
public void onAutopilotTrajectoryDownloadReq(@NonNull AutopilotControlParameters.AutoPilotLine autoPilotLine, int downloadType) {
}
}

View File

@@ -10,6 +10,7 @@ import androidx.lifecycle.LifecycleOwner;
import com.amap.api.maps.model.LatLng;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
@@ -464,4 +465,8 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
public void onSsmReceiveTimeout(boolean isTimeout) {
}
@Override
public void onAutopilotTrajectoryDownloadReq(@NonNull AutopilotControlParameters.AutoPilotLine autoPilotLine, int downloadType) {
}
}

View File

@@ -1203,6 +1203,11 @@ public class TaxiModel {
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() {
@Override
public void onAutopilotTrajectoryDownloadReq(@NonNull AutopilotControlParameters.AutoPilotLine autoPilotLine, int downloadType) {
}
@Override
public void onSsmReceiveTimeout(boolean isTimeout) {

View File

@@ -39,6 +39,7 @@ import com.tencent.matrix.trace.config.TraceConfig
import com.zhjt.mogo_core_function_devatools.apm.*
import com.mogo.eagle.core.function.api.upgrade.*
import com.mogo.weak.network.SdtManager
import com.zhjt.mogo.adas.data.bean.ReceivedAck.Status
import com.zhjt.mogo_core_function_devatools.adas.PowerOffManager
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
@@ -59,8 +60,8 @@ import com.zhjt.mogo_core_function_devatools.perf.MoGoCpuUsageProviderImpl
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager.Companion.iPCReportManager
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
import com.zhjt.mogo_core_function_devatools.status.StatusManager
import com.zhjt.mogo_core_function_devatools.status.entity.RouteDownloadStatus
import com.zhjt.mogo_core_function_devatools.status.ui.AutoPilotLaunchBeforeView
import com.zhjt.mogo_core_function_devatools.status.ui.StatusView
import com.zhjt.mogo_core_function_devatools.strict.*
import com.zhjt.mogo_core_function_devatools.trace.TraceManager.Companion.traceManager
import com.zhjt.mogo_core_function_devatools.tts.TtsManager.Companion.ttsManager
@@ -69,6 +70,8 @@ import com.zhjt.mogo_core_function_devatools.weaknetwork.DetectResultImpl
import com.zhjt.mogo_core_function_devatools.weaknetwork.WeakNetworkStrategy
import com.zhjt.service.chain.ChainLog
import java.lang.ref.WeakReference
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList
@Route(path = MogoServicePaths.PATH_DEVA_TOOLS)
class DevaToolsProvider : IDevaToolsProvider {
@@ -98,6 +101,20 @@ class DevaToolsProvider : IDevaToolsProvider {
private var container: WeakReference<ViewGroup>? = null
private val downloadCallbacks by lazy { ConcurrentHashMap<String, ArrayList<(Int) -> Unit>>() }
private val statusListener by lazy {
object : StatusManager.IStatusListener {
override fun onStatusChanged(data: List<com.zhjt.mogo_core_function_devatools.status.entity.Status>, hasException: Boolean) {
data.filterIsInstance(RouteDownloadStatus::class.java).forEach { s ->
downloadCallbacks.values.flatten().forEach { listener ->
listener.invoke(s.state.ordinal)
}
}
}
}
}
override fun init(context: Context) {
mContext = context
}
@@ -138,6 +155,7 @@ class DevaToolsProvider : IDevaToolsProvider {
block.init(it)
block.start()
}
StatusManager.addListener(TAG, statusListener)
}
override fun checkMonitorDb() {
@@ -492,4 +510,12 @@ class DevaToolsProvider : IDevaToolsProvider {
override fun getExceptionStatusBeforeLaunchAutopilot(): Int {
return StatusManager.getExceptionStatusBeforeLaunchAutopilot()
}
override fun registerRouteDownloadListener(tag: String, block: (state: Int) -> Unit) {
downloadCallbacks.getOrPut(tag) { ArrayList() }.add(block)
}
override fun unRegisterRouteDownloadListener(tag: String) {
downloadCallbacks.remove(tag)
}
}

View File

@@ -27,6 +27,7 @@ import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.AcceleratorIm
import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.BrakeImpl
import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.DoubleFlashImpl
import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.GearImpl
import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.RouteDownloadImpl
import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.SpeedImpl
import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.SteerImpl
import com.zhjt.mogo_core_function_devatools.status.flow.can.CanImpl
@@ -40,6 +41,7 @@ import kotlinx.coroutines.flow.*
import java.lang.ref.*
import java.util.concurrent.*
import java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy
import java.util.concurrent.atomic.AtomicReference
object StatusManager {
@@ -50,6 +52,8 @@ object StatusManager {
private val listeners by lazy { ConcurrentHashMap<String, IStatusListener>() }
private var container: WeakReference<ViewGroup>? = null
private val last by lazy { AtomicReference<List<Status>>() }
private val dispatcher by lazy {
ThreadPoolExecutor(1, 2, 1, TimeUnit.MINUTES, LinkedBlockingQueue(128), Executors.defaultThreadFactory(), DiscardOldestPolicy()).asCoroutineDispatcher() + CoroutineName("stats-manager-impl")
}
@@ -93,6 +97,7 @@ object StatusManager {
is DoubleFlashStatus -> DoubleFlashImpl(ctx)
is GearStatus -> GearImpl(ctx)
is SpeedStatus -> SpeedImpl(ctx)
is RouteDownloadStatus -> RouteDownloadImpl(ctx)
}
}.also { flows += it }
for (f in flows) {
@@ -103,10 +108,37 @@ object StatusManager {
}
f.onCreate()
}
model.status.observe(ctx.lifeCycleOwner) {
listeners.values.forEach { itx ->
itx.onStatusChanged(it.second, it.first != null)
ctx.lifeCycleScope.launch(dispatcher) {
model.status.asFlow().collect {
listeners.values.forEach { itx ->
val current = it.second
val previous = last.get()
val changed = ArrayList<Status>()
if (previous == null) {
changed.addAll(current)
} else {
val l1 = current.size
val l2 = previous.size
var index = 0
while (index < l1 && index < l2) {
val d1 = current[index]
val d2 = previous[index]
if (d1 != d2) {
changed += d1
}
index++
}
while (index < l1) {
changed += current[index++]
}
}
if (changed.isNotEmpty()) {
withContext(Dispatchers.Main) {
itx.onStatusChanged(changed, it.first != null)
}
}
last.set(current)
}
}
}
}

View File

@@ -1,5 +1,7 @@
package com.zhjt.mogo_core_function_devatools.status.entity
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteFailed
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteNone
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.*
@@ -445,4 +447,41 @@ data class GearStatus(val value: Int, var isError: Boolean = false): Status(), I
}
}
enum class RouteState {
RouteNone,
RouteStart,
RouteComplete,
RouteFailed
}
/**
* 轨迹下载状态
*/
data class RouteDownloadStatus(val lineId: Long = -1, val state: RouteState = RouteNone): Status(), IAutopilotPreLaunchStatus {
override fun isException(): Boolean {
return state == RouteFailed
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as RouteDownloadStatus
if (lineId != other.lineId) return false
if (state != other.state) return false
return true
}
override fun hashCode(): Int {
var result = lineId.hashCode()
result = 31 * result + state.hashCode()
return result
}
}

View File

@@ -0,0 +1,90 @@
package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
import android.content.Context
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLine
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.zhjt.mogo.adas.data.bean.MogoReport
import com.zhjt.mogo_core_function_devatools.status.entity.RouteDownloadStatus
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteComplete
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteFailed
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteStart
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
import mogo_msg.MogoReportMsg.MogoReportMessage
import java.lang.Exception
internal class RouteDownloadImpl(ctx: Context): IFlow<RouteDownloadStatus>(ctx), IMoGoAutopilotStatusListener {
companion object {
private const val TAG = "RouteDownloadImpl"
}
@Volatile
private var toDownloadLineId: Long = Long.MIN_VALUE
override fun onCreate() {
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
}
override fun onDestroy() {
super.onDestroy()
CallerAutoPilotStatusListenerManager.removeListener(TAG)
}
override fun onAutopilotTrajectoryDownloadReq(autoPilotLine: AutoPilotLine, downloadType: Int) {
super.onAutopilotTrajectoryDownloadReq(autoPilotLine, downloadType)
if (downloadType == 0) {
toDownloadLineId = autoPilotLine.lineId
}
}
override fun onAutopilotGuardian(guardianInfo: MogoReportMessage?) {
super.onAutopilotGuardian(guardianInfo)
var lineId = -1L
if (MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_START == guardianInfo?.code ||
MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_SUCCESS == guardianInfo?.code ||
MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_FAILURE == guardianInfo?.code ||
MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_WARNING == guardianInfo?.code ||
MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_TIMEOUT == guardianInfo?.code
) {
val msg = guardianInfo.msg
try {
val regex = Regex("lineid:(\\d+)")
val matchResult = regex.find(msg)
if (matchResult != null) {
lineId = matchResult.groupValues[1].toLong()
}
} catch (ignore: Exception) { }
if (lineId == -1L) {
try {
val regex = Regex("lineID=(\\d+)")
val matchResult = regex.find(msg)
if (matchResult != null) {
lineId = matchResult.groupValues[1].toLong()
}
} catch (ignore: Exception) { }
}
}
if (toDownloadLineId != lineId) {
return
}
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters()
if (guardianInfo == null || !guardianInfo.hasCode())
return
when (guardianInfo.code) {
"ISYS_INIT_TRAJECTORY_START" -> { // 1. 轨迹管理_轨迹开始下载本地已有对应轨迹也触发
send(RouteDownloadStatus(lineId, RouteStart))
}
"ISYS_INIT_TRAJECTORY_SUCCESS" -> { // 2. 轨迹管理_轨迹下载成功本地已有对应轨迹也触发
send(RouteDownloadStatus(lineId, RouteComplete))
toDownloadLineId = Long.MIN_VALUE
}
"ISYS_INIT_TRAJECTORY_FAILURE" -> { // 3. 轨迹管理_轨迹下载失败本地无对应轨迹
send(RouteDownloadStatus(lineId, RouteFailed))
toDownloadLineId = Long.MIN_VALUE
}
}
}
}

View File

@@ -26,6 +26,7 @@ internal class StatusModel : ViewModel() {
it += DoubleFlashStatus(0)
it += GearStatus(0)
it += SpeedStatus(0f)
it += RouteDownloadStatus()
})
}

View File

@@ -11,6 +11,7 @@ import chassis.Chassis.GearPosition.GEAR_N
import chassis.Chassis.GearPosition.GEAR_NONE
import chassis.Chassis.GearPosition.GEAR_P
import chassis.Chassis.GearPosition.GEAR_R
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.zhjt.mogo_core_function_devatools.R
import com.zhjt.mogo_core_function_devatools.status.StatusManager
import com.zhjt.mogo_core_function_devatools.status.StatusManager.IStatusListener
@@ -106,7 +107,7 @@ class AutoPilotLaunchBeforeView: LinearLayout, IStatusListener {
speed?.text = "${status.speed.toInt()}"
}
else -> {
throw IllegalStateException()
Logger.d(TAG, "other state: $status")
}
}
}

View File

@@ -4,8 +4,10 @@ import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.core.content.ContextCompat
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_DEMO
@@ -15,10 +17,13 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.kotlin.scope
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import kotlinx.android.synthetic.main.view_status_bar.view.*
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.util.concurrent.CopyOnWriteArrayList
class StatusBarView @JvmOverloads constructor(
@@ -57,6 +62,28 @@ class StatusBarView @JvmOverloads constructor(
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
updateStatusBarLeftView(true, FUNC_MODE_DEMO, DemoModeView(this.context))
updateStatusBarLeftView(true, FUNC_MODE_RAIN, RainModeView(this.context))
CallerDevaToolsManager.registerRouteDownloadListener(TAG) { state ->
routeDownloadStatusRoot?.visibility = View.VISIBLE
when(state) {
1 -> {
routeDownloadStatus?.background = ContextCompat.getDrawable(context, R.drawable.bg_autopilot_route_download_start)
routeDownloadFailMark?.visibility = View.GONE
}
2 -> {
routeDownloadStatus?.background = ContextCompat.getDrawable(context, R.drawable.bg_autopilot_route_download_success)
routeDownloadFailMark?.visibility = View.GONE
scope.launch {
delay(3000)
routeDownloadStatusRoot?.visibility = View.GONE
}
}
3 -> {
routeDownloadStatus?.background = ContextCompat.getDrawable(context, R.drawable.bg_autopilot_route_download_failed)
routeDownloadFailMark?.visibility = View.VISIBLE
}
}
}
}
}
@@ -125,6 +152,7 @@ class StatusBarView @JvmOverloads constructor(
CallerHmiViewControlListenerManager.removeListener(TAG)
CallerSkinModeListenerManager.removeListener(TAG)
CallerDevaToolsManager.hideStatusBar()
CallerDevaToolsManager.unRegisterRouteDownloadListener(TAG)
}
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:startColor="#FF5A35" android:endColor="#FF0000"/>
<corners
android:radius="@dimen/dp_10"/>
</shape>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<item android:width="@dimen/dp_70" android:height="@dimen/dp_10">
<shape android:shape="rectangle">
<solid android:color="#40000000" />
<corners
android:radius="@dimen/dp_10"/>
</shape>
</item>
<item android:width="@dimen/dp_47" android:height="@dimen/dp_10">
<shape android:shape="rectangle">
<gradient
android:startColor="#35B8FF" android:endColor="#0081FF"/>
<corners
android:radius="@dimen/dp_10"/>
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:startColor="#31C2DA" android:endColor="#17CAB5"/>
<corners
android:radius="@dimen/dp_10"/>
</shape>

View File

@@ -56,6 +56,37 @@
android:textColor="@color/background_debug"
android:textSize="@dimen/dp_20" />
<LinearLayout
android:id="@+id/routeDownloadStatusRoot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/dp_15"
android:visibility="gone"
tools:visibility="visible"
tools:background="#2F4266">
<View
android:id="@+id/routeDownloadStatus"
android:layout_width="@dimen/dp_70"
android:layout_height="@dimen/dp_10"
android:layout_gravity="center_vertical"
tools:visibility="visible"
tools:background="@drawable/bg_autopilot_route_download_failed"/>
<TextView
android:id="@+id/routeDownloadFailMark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="!"
android:textStyle="bold"
tools:visibility="visible"
android:visibility="gone"
android:layout_marginStart="@dimen/dp_10"
android:textSize="@dimen/dp_28"/>
</LinearLayout>
<Space
android:layout_width="0dip"
android:layout_height="@dimen/dp_1"

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.api.autopilot
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.zhjt.mogo.adas.data.AdasConstants
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
@@ -71,6 +72,11 @@ interface IMoGoAutopilotStatusListener {
*/
fun onAutopilotRouteLineId(lineId: Long){}
/**
* 自驾路线触发下载请求回调
*/
fun onAutopilotTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) { }
companion object {
/**
* 不可自动驾驶目前场景是刚开机adas还未和工控机连接

View File

@@ -295,4 +295,8 @@ interface IDevaToolsProvider : IProvider {
fun attachAutopilotStatusView(ctx: Context, group: ViewGroup)
fun getExceptionStatusBeforeLaunchAutopilot(): Int
fun registerRouteDownloadListener(tag: String, block:(state: Int) -> Unit)
fun unRegisterRouteDownloadListener(tag: String)
}

View File

@@ -105,6 +105,7 @@ object CallerAutoPilotControlManager {
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine) {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
providerApi?.sendTrajectoryDownloadReq(autoPilotLine)
CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, 0)
}
}
@@ -115,6 +116,7 @@ object CallerAutoPilotControlManager {
fun sendTrajectoryDownloadReq(autoPilotLine: AutopilotControlParameters.AutoPilotLine, downloadType: Int) {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
providerApi?.sendTrajectoryDownloadReq(autoPilotLine, downloadType)
CallerAutoPilotStatusListenerManager.invokeTrajectoryDownloadReq(autoPilotLine, downloadType)
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLine
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
@@ -268,4 +269,10 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
lineId = autopilotControlParameters?.autoPilotLine?.lineId ?: 0
invokeAutoPilotStatus(mAutopilotStatusInfo)
}
fun invokeTrajectoryDownloadReq(autoPilotLine: AutoPilotLine, downloadType: Int) {
M_LISTENERS.forEach { itx ->
itx.value.onAutopilotTrajectoryDownloadReq(autoPilotLine, downloadType)
}
}
}

View File

@@ -355,4 +355,12 @@ object CallerDevaToolsManager {
fun attachAutopilotBeforeLaunchView(ctx: Context, group: ViewGroup) {
devaToolsProviderApi?.attachAutopilotStatusView(ctx, group)
}
fun registerRouteDownloadListener(tag: String, block:(state: Int) -> Unit) {
devaToolsProviderApi?.registerRouteDownloadListener(tag, block)
}
fun unRegisterRouteDownloadListener(tag: String) {
devaToolsProviderApi?.unRegisterRouteDownloadListener(tag)
}
}