[6.4.0][启自驾指引] 部分代码提交
This commit is contained in:
@@ -92,6 +92,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
public boolean isAnimateRunning = false;
|
||||
|
||||
|
||||
/**
|
||||
* 滑动按钮触发的事件
|
||||
*/
|
||||
@@ -123,7 +124,15 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
// tvOperationStatus = findViewById(R.id.module_mogo_och_operation_status);
|
||||
tvArrived = findViewById(R.id.module_mogo_och_arrived_tv);
|
||||
|
||||
mTrafficDataView = (TrafficDataView) findViewById(R.id.bus_arc);
|
||||
// mTrafficDataView = (TrafficDataView) findViewById(R.id.bus_arc);
|
||||
|
||||
|
||||
FrameLayout flSpeed = findViewById(R.id.fl_speed);
|
||||
if (flSpeed != null) {
|
||||
CallerDevaToolsManager.INSTANCE.attachAutopilotBeforeLaunchView(flSpeed.getContext(), flSpeed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
|
||||
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
|
||||
|
||||
@@ -19,22 +19,32 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!-- <FrameLayout-->
|
||||
<!-- android:id="@+id/fl_speed"-->
|
||||
<!-- android:layout_width="@dimen/dp_616"-->
|
||||
<!-- android:layout_height="@dimen/dp_320"-->
|
||||
<!-- android:layout_marginLeft="@dimen/dp_13"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_40"-->
|
||||
<!-- android:visibility="visible"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent">-->
|
||||
|
||||
<!-- <com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView-->
|
||||
<!-- android:id="@+id/bus_arc"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent" />-->
|
||||
|
||||
<!-- </FrameLayout>-->
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speed"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="@dimen/dp_320"
|
||||
android:layout_marginLeft="@dimen/dp_13"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_width="@dimen/dp_560"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:layout_marginLeft="@dimen/dp_39"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficDataView
|
||||
android:id="@+id/bus_arc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
|
||||
@@ -29,12 +29,13 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
<!--车速档位加速度-->
|
||||
<com.magic.mogo.och.charter.view.carstatus.CarStatusView
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speed"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="@dimen/dp_320"
|
||||
android:layout_marginLeft="@dimen/dp_13"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_width="@dimen/dp_560"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:layout_marginLeft="@dimen/dp_39"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
@@ -73,7 +73,7 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
|
||||
private FrameLayout flStationPanelContainer;
|
||||
private BizMapView mapBizView;
|
||||
private Group groupTestPanel;
|
||||
private ShuttleTrafficDataView mTrafficDataView;
|
||||
// private ShuttleTrafficDataView mTrafficDataView;
|
||||
// private BusTrafficLightView mTrafficLightView;
|
||||
|
||||
//远景和中景的切换
|
||||
@@ -122,7 +122,11 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
|
||||
// tvOperationStatus = findViewById(R.id.module_mogo_och_operation_status);
|
||||
tvArrived = findViewById(R.id.module_mogo_och_arrived_tv);
|
||||
|
||||
mTrafficDataView = (ShuttleTrafficDataView) findViewById(R.id.bus_arc);
|
||||
// mTrafficDataView = (ShuttleTrafficDataView) findViewById(R.id.bus_arc);
|
||||
FrameLayout flSpeed = findViewById(R.id.fl_speed);
|
||||
if (flSpeed != null) {
|
||||
CallerDevaToolsManager.INSTANCE.attachAutopilotBeforeLaunchView(flSpeed.getContext(), flSpeed);
|
||||
}
|
||||
|
||||
LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
|
||||
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
|
||||
|
||||
@@ -19,22 +19,33 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!-- <FrameLayout-->
|
||||
<!-- android:id="@+id/fl_speed"-->
|
||||
<!-- android:layout_width="@dimen/dp_585"-->
|
||||
<!-- android:layout_height="@dimen/dp_304"-->
|
||||
<!-- android:layout_marginLeft="@dimen/dp_10"-->
|
||||
<!-- android:layout_marginTop="@dimen/dp_5"-->
|
||||
<!-- android:visibility="visible"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent">-->
|
||||
|
||||
<!-- <com.mogo.och.bus.ui.ShuttleTrafficDataView-->
|
||||
<!-- android:id="@+id/bus_arc"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent" />-->
|
||||
|
||||
<!-- </FrameLayout>-->
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speed"
|
||||
android:layout_width="@dimen/dp_585"
|
||||
android:layout_height="@dimen/dp_304"
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_width="@dimen/dp_560"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:layout_marginLeft="@dimen/dp_39"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.mogo.och.bus.ui.ShuttleTrafficDataView
|
||||
android:id="@+id/bus_arc"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
|
||||
@@ -77,7 +77,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
private FrameLayout flNaviPanelContainer;
|
||||
private MapBizView mapBizView;
|
||||
private Group groupTestPanel;
|
||||
private SpeedView mSpeedView;
|
||||
private FrameLayout mSpeedView;
|
||||
private ImageView mAutopilotImage;
|
||||
private TextView mAutopilotTv;
|
||||
private LinearLayout mMapswitchBtn;
|
||||
@@ -126,6 +126,9 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
// CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
|
||||
|
||||
mSpeedView = findViewById(R.id.taxi_speed_contain);
|
||||
if (mSpeedView != null) {
|
||||
CallerDevaToolsManager.INSTANCE.attachAutopilotBeforeLaunchView(mSpeedView.getContext(), mSpeedView);
|
||||
}
|
||||
mCloseNaviIcon = findViewById(R.id.taxi_close_navi_icon);
|
||||
flNaviPanelContainer = findViewById(R.id.module_mogo_och_navi_panel_container);
|
||||
mSpeedView.setLongClickable(true); //调试按钮任意模式下都开
|
||||
|
||||
@@ -21,29 +21,25 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:locationIcon3DRes="@raw/chuzuche" />
|
||||
|
||||
<com.mogo.och.taxi.ui.speed.SpeedView
|
||||
<FrameLayout
|
||||
android:id="@+id/taxi_speed_contain"
|
||||
android:layout_width="@dimen/taxi_tab_speed_width_height"
|
||||
android:layout_height="@dimen/taxi_tab_speed_width_height"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="@dimen/dp_560"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:layout_marginLeft="@dimen/dp_39"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/taxi_speed_bg"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="@dimen/taxi_tab_autoaploit_width"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="@dimen/taxi_tab_autoaploit_height"
|
||||
android:layout_marginLeft="220dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/taxi_autopilot_bg_selector"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintLeft_toLeftOf="@+id/taxi_speed_contain"
|
||||
app:layout_constraintRight_toRightOf="@+id/taxi_speed_contain"
|
||||
app:layout_constraintTop_toBottomOf="@+id/taxi_speed_contain">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/anim_flow_iv"
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.os.SystemClock
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.FrameLayout
|
||||
import androidx.fragment.app.FragmentTransaction
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
@@ -19,6 +20,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initBadCase
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showToolsView
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
@@ -45,7 +47,7 @@ import kotlinx.android.synthetic.main.taxi_base_fragment.mapBizView
|
||||
import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_autopilot_status
|
||||
import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_navi_panel_container
|
||||
import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_operation_status
|
||||
import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_speed_tv
|
||||
import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_speed_layout
|
||||
import kotlinx.android.synthetic.main.taxi_base_fragment.module_mogo_och_station_panel_container
|
||||
import kotlinx.android.synthetic.main.taxi_base_fragment.module_och_autopilot_iv
|
||||
import kotlinx.android.synthetic.main.taxi_base_fragment.module_och_autopilot_tv
|
||||
@@ -109,7 +111,18 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
|
||||
resources.getDrawable(R.drawable.taxi_autopilot_bg_selector, null)
|
||||
updateCtvAutopilotStatusTag(false)
|
||||
|
||||
module_mogo_och_speed_tv.isLongClickable = true //调试按钮任意模式下都开
|
||||
// module_mogo_och_speed_tv.isLongClickable = true //调试按钮任意模式下都开
|
||||
module_mogo_och_speed_layout?.also {
|
||||
it.setOnLongClickListener {
|
||||
if (groupTestPanel.visibility == View.VISIBLE) {
|
||||
groupTestPanel.visibility = View.GONE
|
||||
} else {
|
||||
groupTestPanel.visibility = View.VISIBLE
|
||||
}
|
||||
false
|
||||
}
|
||||
CallerDevaToolsManager.attachAutopilotBeforeLaunchView(it.context, it)
|
||||
}
|
||||
updateSwitchMapIcon()
|
||||
module_och_taxi_swich_map_layout.setOnClickListener {
|
||||
//视角切换
|
||||
@@ -170,14 +183,14 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
|
||||
|
||||
// debug下调用测试面板 长按速度值 任意模式下调试都打开
|
||||
// if (DebugConfig.isDebug()) {
|
||||
module_mogo_och_speed_tv.setOnLongClickListener {
|
||||
if (groupTestPanel.visibility == View.VISIBLE) {
|
||||
groupTestPanel.visibility = View.GONE
|
||||
} else {
|
||||
groupTestPanel.visibility = View.VISIBLE
|
||||
}
|
||||
false
|
||||
}
|
||||
// module_mogo_och_speed_tv.setOnLongClickListener {
|
||||
// if (groupTestPanel.visibility == View.VISIBLE) {
|
||||
// groupTestPanel.visibility = View.GONE
|
||||
// } else {
|
||||
// groupTestPanel.visibility = View.VISIBLE
|
||||
// }
|
||||
// false
|
||||
// }
|
||||
// }
|
||||
onAutopilotStatusChanged(getState())
|
||||
|
||||
@@ -497,11 +510,6 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
|
||||
})
|
||||
}
|
||||
|
||||
fun updateSpeedView(newSpeed: Float) {
|
||||
val speed = (abs(newSpeed) * 3.6f).toInt() // 倒车时工控机反馈定位信息中speed为负值
|
||||
module_mogo_och_speed_tv.text = speed.toString()
|
||||
}
|
||||
|
||||
override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode?) {
|
||||
}
|
||||
|
||||
|
||||
@@ -150,11 +150,11 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
|
||||
@Override
|
||||
public void onCarLocationChanged(MogoLocation location) {
|
||||
if (null != location) {
|
||||
runOnUIThread(() -> {
|
||||
mView.updateSpeedView((float) location.getGnssSpeed());
|
||||
});
|
||||
}
|
||||
// if (null != location) {
|
||||
// runOnUIThread(() -> {
|
||||
// mView.updateSpeedView((float) location.getGnssSpeed());
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,19 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_speed_layout"
|
||||
android:layout_width="@dimen/dp_560"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:layout_marginLeft="@dimen/dp_39"
|
||||
android:layout_marginTop="@dimen/dp_36"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/module_mogo_och_autopilot_status"/>
|
||||
|
||||
<!--<LinearLayout
|
||||
android:id="@+id/module_mogo_och_speed_layout"
|
||||
android:layout_width="@dimen/taxi_tab_speed_width_height"
|
||||
android:layout_height="@dimen/taxi_tab_speed_width_height"
|
||||
@@ -60,17 +72,17 @@
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="32dp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>-->
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="@dimen/taxi_tab_autoaploit_width"
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="@dimen/taxi_tab_autoaploit_height"
|
||||
android:layout_marginLeft="220dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/taxi_autopilot_bg_selector"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_mogo_och_speed_layout"
|
||||
app:layout_constraintRight_toRightOf="@+id/module_mogo_och_speed_layout"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_mogo_och_speed_layout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/anim_flow_iv"
|
||||
|
||||
@@ -59,6 +59,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.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
|
||||
@@ -66,6 +68,7 @@ import com.zhjt.mogo_core_function_devatools.upgrade.UpgradeManager.Companion.up
|
||||
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
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_DEVA_TOOLS)
|
||||
class DevaToolsProvider : IDevaToolsProvider {
|
||||
@@ -80,7 +83,6 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
|
||||
private val strictModeProvider by lazy { StrictModeProviderImpl() }
|
||||
|
||||
|
||||
private val lookAroundDataProvider by lazy { MoGoLookAroundProviderImpl() }
|
||||
|
||||
private val mofangProvider by lazy { MoGoMoFangProviderImpl() }
|
||||
@@ -94,6 +96,8 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
@Volatile
|
||||
private var mDockerVersion: String? = null
|
||||
|
||||
private var container: WeakReference<ViewGroup>? = null
|
||||
|
||||
override fun init(context: Context) {
|
||||
mContext = context
|
||||
}
|
||||
@@ -471,4 +475,20 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
override fun setNetworkMode(isDebug: Boolean) {
|
||||
WeakNetworkStrategy.setDebug(isDebug)
|
||||
}
|
||||
|
||||
override fun attachAutopilotStatusView(ctx: Context, group: ViewGroup) {
|
||||
if (group.childCount > 0) {
|
||||
if (group.visibility != View.VISIBLE) {
|
||||
group.visibility = View.VISIBLE
|
||||
}
|
||||
return
|
||||
}
|
||||
this.container = WeakReference(group)
|
||||
val child = AutoPilotLaunchBeforeView(ctx)
|
||||
group.addView(child, ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT))
|
||||
}
|
||||
|
||||
override fun getExceptionStatusBeforeLaunchAutopilot(): Int {
|
||||
return StatusManager.getExceptionStatusBeforeLaunchAutopilot()
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,12 @@ import com.zhjt.mogo_core_function_devatools.status.entity.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.model.StatusModel
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.OverViewImpl
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.AcceleratorImpl
|
||||
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.SpeedImpl
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.SteerImpl
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.can.CanImpl
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.gps.GpsImpl
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.ipc.IpcImpl
|
||||
@@ -33,17 +39,21 @@ import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.*
|
||||
import java.lang.ref.*
|
||||
import java.util.concurrent.*
|
||||
import java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy
|
||||
|
||||
|
||||
object StatusManager {
|
||||
|
||||
private const val TAG = "StatusManager"
|
||||
|
||||
private lateinit var model: StatusModel
|
||||
private var hasInit = false
|
||||
private val listeners by lazy { CopyOnWriteArrayList<IStatusListener>() }
|
||||
private val listeners by lazy { ConcurrentHashMap<String, IStatusListener>() }
|
||||
private var container: WeakReference<ViewGroup>? = null
|
||||
|
||||
private val dispatcher by lazy {
|
||||
ThreadPoolExecutor(1, 2, 1, TimeUnit.MINUTES, LinkedBlockingQueue(128), Executors.defaultThreadFactory(), DiscardOldestPolicy()).asCoroutineDispatcher() + CoroutineName("stats-manager-impl")
|
||||
}
|
||||
|
||||
private val flows: ArrayList<IFlow<out Status>> by lazy {
|
||||
ArrayList()
|
||||
}
|
||||
@@ -77,10 +87,16 @@ object StatusManager {
|
||||
is TracingStatus -> TracingImpl(ctx)
|
||||
is RTKStatus -> RTKImpl(ctx)
|
||||
is OverViewStatus -> OverViewImpl(ctx)
|
||||
is SteerStatus -> SteerImpl(ctx)
|
||||
is AcceleratorStatus -> AcceleratorImpl(ctx)
|
||||
is BrakeStatus -> BrakeImpl(ctx)
|
||||
is DoubleFlashStatus -> DoubleFlashImpl(ctx)
|
||||
is GearStatus -> GearImpl(ctx)
|
||||
is SpeedStatus -> SpeedImpl(ctx)
|
||||
}
|
||||
}.also { flows += it }
|
||||
for (f in flows) {
|
||||
ctx.lifeCycleScope.launch(Dispatchers.Default) {
|
||||
ctx.lifeCycleScope.launch(dispatcher) {
|
||||
f.asFlow().collect {
|
||||
model.update(it)
|
||||
}
|
||||
@@ -89,7 +105,7 @@ object StatusManager {
|
||||
}
|
||||
|
||||
model.status.observe(ctx.lifeCycleOwner) {
|
||||
listeners.forEach { itx ->
|
||||
listeners.values.forEach { itx ->
|
||||
itx.onStatusChanged(it.second, it.first != null)
|
||||
}
|
||||
}
|
||||
@@ -120,6 +136,30 @@ object StatusManager {
|
||||
flows.clear()
|
||||
}
|
||||
|
||||
fun addListener(tag: String, listener: IStatusListener) {
|
||||
if (listeners.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
listeners[tag] = listener
|
||||
}
|
||||
|
||||
fun removeListener(tag: String) {
|
||||
listeners.remove(tag)
|
||||
}
|
||||
|
||||
fun getExceptionStatusBeforeLaunchAutopilot(): Int {
|
||||
var ret = 0
|
||||
model.status.value?.second?.filter {
|
||||
it is IAutopilotPreLaunchStatus
|
||||
}?.forEachIndexed { index, status ->
|
||||
val shl = 1 shl index
|
||||
if (status.isException()) {
|
||||
ret = ret or shl
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
interface IStatusListener {
|
||||
fun onStatusChanged(data: List<Status>, hasException: Boolean)
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.entity
|
||||
|
||||
import com.mogo.eagle.core.data.status.StatusSummaryEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.*
|
||||
|
||||
@@ -250,7 +247,7 @@ class OverViewStatus(var hasException: Boolean = false): Status() {
|
||||
fun String.toState(msg: String?): Tracing? {
|
||||
val ss = msg?.split("|")
|
||||
var extra: Map<String, String>? = null
|
||||
if (ss != null && ss.isNotEmpty()) {
|
||||
if (!ss.isNullOrEmpty()) {
|
||||
val sb = StringBuilder()
|
||||
for (element in ss) {
|
||||
sb.append(element)
|
||||
@@ -290,3 +287,70 @@ fun String.toState(msg: String?): Tracing? {
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
interface IAutopilotPreLaunchStatus
|
||||
|
||||
/**
|
||||
* 速度
|
||||
*/
|
||||
data class SpeedStatus(val speed: Float): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘转角
|
||||
*/
|
||||
data class SteerStatus(val angle: Float, var isError: Boolean = false): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 油门
|
||||
*/
|
||||
data class AcceleratorStatus(val angle: Float, var isError: Boolean = false): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刹车
|
||||
*/
|
||||
data class BrakeStatus(val angle: Float, var isError: Boolean = false): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 双闪
|
||||
*/
|
||||
data class DoubleFlashStatus(val type: Int, var isError: Boolean = false): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 挡位
|
||||
*/
|
||||
data class GearStatus(val value: Int, var isError: Boolean = false): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_THROTTLE
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.AcceleratorStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
|
||||
internal class AcceleratorImpl(ctx: Context): IFlow<AcceleratorStatus>(ctx), IMoGoChassisThrottleStateListener, IMoGoAutopilotActionsListener {
|
||||
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AcceleratorImpl"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var last: Float? = null
|
||||
|
||||
@Volatile
|
||||
private var isError: Boolean = false
|
||||
|
||||
override fun onCreate() {
|
||||
CallerChassisThrottleStateListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotActionsListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerChassisThrottleStateListenerManager.removeListener(TAG)
|
||||
CallerAutopilotActionsListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotThrottle(throttle: Float) {
|
||||
super.onAutopilotThrottle(throttle)
|
||||
if (last != throttle) {
|
||||
send(AcceleratorStatus(throttle, isError))
|
||||
last = throttle
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotAbility(isAutopilotAbility: Boolean, unableLaunchData: UnableLaunchData?, unableAutopilotReasons: ArrayList<UnableLaunchReason>?) {
|
||||
Logger.d(TAG, "onAutopilotAbility->($isAutopilotAbility, $unableLaunchData, ${unableAutopilotReasons?.joinToString(",")}")
|
||||
if (!isAutopilotAbility && unableAutopilotReasons != null && unableAutopilotReasons.find { it.unableType == CHASSIS_THROTTLE } != null) {
|
||||
isError = true
|
||||
send(AcceleratorStatus(last ?: 0.0f, true))
|
||||
} else {
|
||||
isError = false
|
||||
send(AcceleratorStatus(last ?: 0.0f, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_BRAKE
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_THROTTLE
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.AcceleratorStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.BrakeStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.autopilot.AcceleratorImpl.Companion
|
||||
|
||||
internal class BrakeImpl(ctx: Context): IFlow<BrakeStatus>(ctx), IMoGoChassisBrakeStateListener, IMoGoAutopilotActionsListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "BrakeImpl"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var last: Float = 0.0f
|
||||
|
||||
@Volatile
|
||||
private var isError: Boolean = false
|
||||
|
||||
override fun onCreate() {
|
||||
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotActionsListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerChassisBrakeStateListenerManager.removeListener(TAG)
|
||||
CallerAutopilotActionsListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotBrake(brake: Float) {
|
||||
super.onAutopilotBrake(brake)
|
||||
|
||||
if (last != brake) {
|
||||
send(BrakeStatus(brake, isError))
|
||||
last = brake
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotAbility(isAutopilotAbility: Boolean, unableLaunchData: UnableLaunchData?, unableAutopilotReasons: ArrayList<UnableLaunchReason>?) {
|
||||
Logger.d(TAG, "onAutopilotAbility->($isAutopilotAbility, $unableLaunchData, ${unableAutopilotReasons?.joinToString(",")}")
|
||||
if (!isAutopilotAbility && unableAutopilotReasons != null && unableAutopilotReasons.find { it.unableType == CHASSIS_BRAKE } != null) {
|
||||
isError = true
|
||||
send(BrakeStatus(last, true))
|
||||
} else {
|
||||
isError = false
|
||||
send(BrakeStatus(last, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
|
||||
|
||||
import android.content.Context
|
||||
import chassis.Chassis.LightSwitch
|
||||
import chassis.Chassis.LightSwitch.LIGHT_FLASH
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_HAZARD_LIGHTS
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_THROTTLE
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.AcceleratorStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.DoubleFlashStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
|
||||
internal class DoubleFlashImpl(ctx: Context): IFlow<DoubleFlashStatus>(ctx), IMoGoChassisLamplightListener, IMoGoAutopilotActionsListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "DoubleFlashImpl"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var isError: Boolean = false
|
||||
|
||||
override fun onCreate() {
|
||||
CallerChassisLamplightListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotActionsListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
CallerAutopilotActionsListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: LightSwitch?) {
|
||||
super.onAutopilotLightSwitchData(lightSwitch)
|
||||
Logger.d(TAG, "-- onAutopilotLightSwitchData --: $lightSwitch")
|
||||
if (lightSwitch == LIGHT_FLASH) {
|
||||
send(DoubleFlashStatus(lightSwitch.number, isError))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotAbility(isAutopilotAbility: Boolean, unableLaunchData: UnableLaunchData?, unableAutopilotReasons: ArrayList<UnableLaunchReason>?) {
|
||||
Logger.d(TAG, "onAutopilotAbility->($isAutopilotAbility, $unableLaunchData, ${unableAutopilotReasons?.joinToString(",")}")
|
||||
if (!isAutopilotAbility && unableAutopilotReasons != null && unableAutopilotReasons.find { it.unableType == CHASSIS_HAZARD_LIGHTS } != null) {
|
||||
isError = true
|
||||
send(DoubleFlashStatus(LIGHT_FLASH.number, true))
|
||||
} else {
|
||||
isError = false
|
||||
send(DoubleFlashStatus(LIGHT_FLASH.number, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
|
||||
|
||||
import android.content.Context
|
||||
import chassis.Chassis.GearPosition
|
||||
import chassis.Chassis.GearPosition.GEAR_NONE
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_GEAR
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.GearStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
|
||||
internal class GearImpl(ctx: Context): IFlow<GearStatus>(ctx), IMoGoChassisGearStateListener, IMoGoAutopilotActionsListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "GeerImpl"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var last: GearPosition = GEAR_NONE
|
||||
|
||||
@Volatile
|
||||
private var isError: Boolean = false
|
||||
|
||||
override fun onCreate() {
|
||||
CallerChassisGearStateListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotActionsListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerChassisGearStateListenerManager.removeListener(TAG)
|
||||
CallerAutopilotActionsListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotGearData(gear: GearPosition) {
|
||||
if (last != gear) {
|
||||
send(GearStatus(gear.number, isError))
|
||||
last = gear
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotAbility(isAutopilotAbility: Boolean, unableLaunchData: UnableLaunchData?, unableAutopilotReasons: ArrayList<UnableLaunchReason>?) {
|
||||
Logger.d(TAG, "onAutopilotAbility->($isAutopilotAbility, $unableLaunchData, ${unableAutopilotReasons?.joinToString(",")}")
|
||||
if (!isAutopilotAbility && unableAutopilotReasons != null && unableAutopilotReasons.find { it.unableType == CHASSIS_GEAR } != null) {
|
||||
isError = true
|
||||
send(GearStatus(last.number, true))
|
||||
} else {
|
||||
isError = false
|
||||
send(GearStatus(last.number, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_THROTTLE
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.AcceleratorStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.SpeedStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
|
||||
internal class SpeedImpl(ctx: Context): IFlow<SpeedStatus>(ctx), IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SpeedImpl"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var last: Float? = null
|
||||
|
||||
override fun onCreate() {
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
|
||||
if (last != mogoLocation?.gnssSpeed) {
|
||||
send(SpeedStatus(mogoLocation?.gnssSpeed ?: 0f))
|
||||
last = mogoLocation?.gnssSpeed
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_STEERING
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.SteerStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
|
||||
internal class SteerImpl(ctx: Context): IFlow<SteerStatus>(ctx), IMoGoChassisSteeringStateListener, IMoGoAutopilotActionsListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SteerImpl"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var last: Float = 0f
|
||||
|
||||
override fun onCreate() {
|
||||
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotActionsListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerChassisSteeringStateListenerManager.removeListener(TAG)
|
||||
CallerAutopilotActionsListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotSteeringData(steering: Float) {
|
||||
if (last != steering) {
|
||||
send(SteerStatus(steering))
|
||||
last = steering
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotAbility(isAutopilotAbility: Boolean, unableLaunchData: UnableLaunchData?, unableAutopilotReasons: ArrayList<UnableLaunchReason>?) {
|
||||
Logger.d(TAG, "onAutopilotAbility->($isAutopilotAbility, $unableLaunchData, ${unableAutopilotReasons?.joinToString(",")}")
|
||||
if (!isAutopilotAbility && unableAutopilotReasons != null && unableAutopilotReasons.find { it.unableType == CHASSIS_STEERING } != null) {
|
||||
send(SteerStatus(last, true))
|
||||
} else {
|
||||
send(SteerStatus(last, false))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import androidx.lifecycle.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.*
|
||||
//import com.zhjt.mogo_core_function_devatools.status.entity.NetStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.UNKNOWN
|
||||
import java.util.concurrent.atomic.*
|
||||
import kotlin.Pair
|
||||
|
||||
@@ -21,6 +20,12 @@ internal class StatusModel : ViewModel() {
|
||||
it += RTKStatus("", -1)
|
||||
// it += NetStatus(false)
|
||||
// it += GpsStatus(enabled = false, isGranted = false)
|
||||
it += SteerStatus(0.0f)
|
||||
it += AcceleratorStatus(0.0f)
|
||||
it += BrakeStatus(0.0f)
|
||||
it += DoubleFlashStatus(0)
|
||||
it += GearStatus(0)
|
||||
it += SpeedStatus(0f)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import chassis.Chassis.GearPosition
|
||||
import chassis.Chassis.GearPosition.GEAR_D
|
||||
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.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
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.AcceleratorStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.BrakeStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.DoubleFlashStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.GearStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.IAutopilotPreLaunchStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.SpeedStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.SteerStatus
|
||||
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.gear_d
|
||||
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.gear_n
|
||||
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.gear_p
|
||||
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.gear_r
|
||||
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.iv_brake_or_accelerator
|
||||
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.iv_double_flash
|
||||
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.iv_steer
|
||||
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.speed
|
||||
import kotlinx.android.synthetic.main.layout_autopilot_launch_before.view.tv_brake_or_accelerator
|
||||
|
||||
class AutoPilotLaunchBeforeView: LinearLayout, IStatusListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AutoPilotLaunchBeforeView"
|
||||
}
|
||||
|
||||
constructor(context: Context?) : this(context, null)
|
||||
constructor(context: Context?, attrs: AttributeSet?) : this(context, attrs, 0)
|
||||
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_autopilot_launch_before, this, true)
|
||||
background = ContextCompat.getDrawable(context!!, R.drawable.bg_autopilot_launch_before)
|
||||
}
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
StatusManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
StatusManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onStatusChanged(data: List<Status>, hasException: Boolean) {
|
||||
data.filter { it is IAutopilotPreLaunchStatus }.forEach { status ->
|
||||
when(status) {
|
||||
is GearStatus -> {
|
||||
val position = try { GearPosition.valueOf(status.value) } catch (ignore: Throwable) { GEAR_NONE }
|
||||
gear_n?.isPressed = false
|
||||
gear_n?.isSelected = false
|
||||
gear_p?.isPressed = false
|
||||
gear_p?.isSelected =false
|
||||
gear_r?.isPressed = false
|
||||
gear_r?.isSelected = false
|
||||
gear_d?.isPressed = false
|
||||
gear_d?.isSelected = false
|
||||
if (position != GEAR_NONE) {
|
||||
val isError = status.isError
|
||||
when(position) {
|
||||
GEAR_N -> if (isError) gear_n?.isPressed = true else gear_n?.isSelected = true
|
||||
GEAR_R -> if (isError) gear_r?.isPressed = true else gear_r?.isSelected = true
|
||||
GEAR_P -> if (isError) gear_p?.isPressed = true else gear_p?.isSelected = true
|
||||
GEAR_D -> if (isError) gear_d?.isPressed = true else gear_d?.isSelected = true
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
is AcceleratorStatus -> {
|
||||
val isError = status.isError
|
||||
val angle = status.angle
|
||||
iv_brake_or_accelerator?.isSelected = isError
|
||||
tv_brake_or_accelerator?.text = "a: $angle"
|
||||
}
|
||||
is BrakeStatus -> {
|
||||
val isError = status.isError
|
||||
val angle = status.angle
|
||||
iv_brake_or_accelerator?.isSelected = isError
|
||||
tv_brake_or_accelerator?.text = "a: -$angle"
|
||||
}
|
||||
is DoubleFlashStatus -> {
|
||||
val isError = status.isError
|
||||
iv_double_flash?.isSelected = isError
|
||||
}
|
||||
is SteerStatus -> {
|
||||
val isError = status.isError
|
||||
iv_steer?.isSelected = isError
|
||||
}
|
||||
is SpeedStatus -> {
|
||||
speed?.text = "${status.speed.toInt()}"
|
||||
}
|
||||
else -> {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import androidx.recyclerview.widget.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.rv.divider.*
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.IAutopilotPreLaunchStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
import com.zhjt.mogo_core_function_devatools.status.model.StatusModel
|
||||
import com.zhjt.mogo_core_function_devatools.status.ui.adapter.StatusAdapter
|
||||
@@ -47,12 +48,13 @@ internal class StatusView(private val model: StatusModel, ctx: Context): Constra
|
||||
.horizontalInnerSpace(10.PX)
|
||||
.build()
|
||||
)
|
||||
val adapter = model.status.value?.let { data -> StatusAdapter(context, data.second) }?.also { adapter -> itx.adapter = adapter }
|
||||
val adapter = model.status.value?.let { data -> StatusAdapter(context, data.second.filter { it !is IAutopilotPreLaunchStatus }) }?.also { adapter -> itx.adapter = adapter }
|
||||
adapter?.let { _ ->
|
||||
model.status.observeForever(Observer<Pair<Status?, ArrayList<Status>>> { data ->
|
||||
val old = adapter.data
|
||||
val result = DiffUtil.calculateDiff(StatusDiffCallback(old, data.second))
|
||||
adapter.data = data.second
|
||||
val update = data.second.filter { it !is IAutopilotPreLaunchStatus }
|
||||
val result = DiffUtil.calculateDiff(StatusDiffCallback(old, update))
|
||||
adapter.data = update
|
||||
result.dispatchUpdatesTo(adapter)
|
||||
}.also { observer = it })
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing
|
||||
import com.zhjt.mogo_core_function_devatools.status.ui.adapter.StatusAdapter.StatusViewHolder
|
||||
import me.jessyan.autosize.AutoSizeCompat
|
||||
|
||||
internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): RecyclerView.Adapter<StatusViewHolder>() {
|
||||
internal class StatusAdapter(val ctx: Context, var data: List<Status>): RecyclerView.Adapter<StatusViewHolder>() {
|
||||
|
||||
companion object {
|
||||
const val TAG = "StatusAdapter"
|
||||
@@ -169,6 +169,9 @@ internal class StatusAdapter(val ctx: Context, var data: ArrayList<Status>): Rec
|
||||
is OverViewStatus -> {
|
||||
""
|
||||
}
|
||||
else -> {
|
||||
throw AssertionError()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.zhjt.mogo_core_function_devatools.status.ui.diff
|
||||
import androidx.recyclerview.widget.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
|
||||
internal class StatusDiffCallback(private val old: ArrayList<Status>, private val update: ArrayList<Status>): DiffUtil.Callback() {
|
||||
internal class StatusDiffCallback(private val old: List<Status>, private val update: List<Status>): DiffUtil.Callback() {
|
||||
|
||||
override fun getOldListSize(): Int = old.size
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/white" android:state_selected="true" />
|
||||
<item android:color="#F73B3C" android:state_pressed="true" />
|
||||
<item android:color="#343C63" />
|
||||
</selector>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_selected="true" android:drawable="@drawable/icon_brake_or_accelerator_red" />
|
||||
<item android:drawable="@drawable/icon_brake_or_accelerator_blue" />
|
||||
</selector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_selected="true" android:drawable="@drawable/icon_double_flash_red" />
|
||||
<item android:drawable="@drawable/icon_double_flash_blue" />
|
||||
</selector>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:width="@dimen/dp_560" android:height="@dimen/dp_200">
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:startColor="#387BD4"
|
||||
android:centerColor="#0D1578"
|
||||
android:endColor="#387BD4"
|
||||
android:angle="-45"/>
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/dp_66"
|
||||
android:bottomRightRadius="@dimen/dp_66"
|
||||
android:topRightRadius="@dimen/dp_26"
|
||||
android:bottomLeftRadius="@dimen/dp_26"/>
|
||||
</shape>
|
||||
|
||||
</item>
|
||||
|
||||
<item android:width="@dimen/dp_556" android:height="@dimen/dp_196" android:left="@dimen/dp_2" android:top="@dimen/dp_2">
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#000936" />
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/dp_66"
|
||||
android:bottomRightRadius="@dimen/dp_66"
|
||||
android:topRightRadius="@dimen/dp_26"
|
||||
android:bottomLeftRadius="@dimen/dp_26"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_selected="true" android:drawable="@drawable/icon_steer_red" />
|
||||
<item android:drawable="@drawable/icon_steer_blue" />
|
||||
</selector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#141B47" />
|
||||
<corners android:radius="@dimen/dp_60" />
|
||||
</shape>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="@dimen/dp_184" android:height="@dimen/dp_200">
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/dp_66"
|
||||
android:bottomRightRadius="@dimen/dp_66"
|
||||
android:topRightRadius="@dimen/dp_26"
|
||||
android:bottomLeftRadius="@dimen/dp_26"/>
|
||||
<gradient
|
||||
android:startColor="#9FC8FF"
|
||||
android:centerColor="#1F318E"
|
||||
android:endColor="#9FC8FF"
|
||||
android:angle="-90"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:width="@dimen/dp_180" android:height="@dimen/dp_196" android:left="@dimen/dp_2" android:top="@dimen/dp_2">
|
||||
<shape
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:topLeftRadius="@dimen/dp_65"
|
||||
android:bottomRightRadius="@dimen/dp_65"
|
||||
android:topRightRadius="@dimen/dp_25"
|
||||
android:bottomLeftRadius="@dimen/dp_25"/>
|
||||
|
||||
<gradient
|
||||
android:startColor="#231CDE"
|
||||
android:centerColor="#000936"
|
||||
android:endColor="#892B5AD7"
|
||||
android:angle="-90"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<color xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/white">
|
||||
|
||||
</color>
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:parentTag="android.widget.LinearLayout"
|
||||
tools:layout_width="wrap_content"
|
||||
tools:layout_height="wrap_content"
|
||||
tools:orientation="horizontal"
|
||||
tools:background="@drawable/bg_autopilot_launch_before">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/speed_chart_parent"
|
||||
android:layout_width="@dimen/dp_184"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_speed_chart">
|
||||
<TextView
|
||||
android:id="@+id/speed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_74"
|
||||
android:textColor="@color/white"
|
||||
tools:text="65"
|
||||
android:layout_marginBottom="@dimen/dp_2"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:text="Km/h"
|
||||
android:textColor="@color/white"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="@dimen/dp_34"
|
||||
android:background="@drawable/bg_geer_position"
|
||||
android:paddingStart="@dimen/dp_53"
|
||||
android:paddingEnd="@dimen/dp_53"
|
||||
android:paddingTop="@dimen/dp_6"
|
||||
android:paddingBottom="@dimen/dp_6">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gear_p"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="P"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:layout_marginEnd="@dimen/dp_32"
|
||||
android:textColor="@color/color_geer_position_selector"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gear_r"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="R"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:layout_marginEnd="@dimen/dp_32"
|
||||
android:textColor="@color/color_geer_position_selector"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gear_n"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="N"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:layout_marginEnd="@dimen/dp_32"
|
||||
android:textColor="@color/color_geer_position_selector"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gear_d"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="D"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textColor="@color/color_geer_position_selector"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_34"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp_23">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_steer"
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:src="@drawable/bg_autopilot_steer"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_double_flash"
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:src="@drawable/bg_autopilot_double_flash"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_brake_or_accelerator"
|
||||
android:layout_width="@dimen/dp_55"
|
||||
android:layout_height="@dimen/dp_55"
|
||||
android:src="@drawable/bg_autopilot_brake_or_accelerator"
|
||||
android:layout_marginEnd="@dimen/dp_14"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_brake_or_accelerator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_34"
|
||||
android:layout_marginTop="-1dp"
|
||||
android:textColor="@color/white"
|
||||
tools:text="a:0.0"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</merge>
|
||||
@@ -291,4 +291,8 @@ interface IDevaToolsProvider : IProvider {
|
||||
fun usage(): IMoGoCpuUsageProvider?
|
||||
|
||||
fun setNetworkMode(isDebug: Boolean)
|
||||
|
||||
fun attachAutopilotStatusView(ctx: Context, group: ViewGroup)
|
||||
|
||||
fun getExceptionStatusBeforeLaunchAutopilot(): Int
|
||||
}
|
||||
@@ -351,4 +351,8 @@ object CallerDevaToolsManager {
|
||||
fun setNetworkMode(isDebug: Boolean) {
|
||||
devaToolsProviderApi?.setNetworkMode(isDebug)
|
||||
}
|
||||
|
||||
fun attachAutopilotBeforeLaunchView(ctx: Context, group: ViewGroup) {
|
||||
devaToolsProviderApi?.attachAutopilotStatusView(ctx, group)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user