[3.3.2] saas接驳司机端适配自动驾驶状态返回变化

This commit is contained in:
wangmingjun
2023-07-11 14:34:34 +08:00
parent 514849f708
commit b8c9f7e3fb
4 changed files with 27 additions and 58 deletions

View File

@@ -204,6 +204,12 @@ public class BusPresenter extends Presenter<BusFragment>
public void startOpenAutopilot() {
//非美化模式下启动动画
runOnUIThread(() -> mView.startAutopilotAnimation());
//中间站点再次开启自驾时, 自动驾驶状态是2未改变 此次鹰眼底层不再返给业务,需优化按钮动画显示
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== CallerAutoPilotStatusListenerManager.INSTANCE.getState()){
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState());
}
}
private void runOnUIThread(Runnable executor) {

View File

@@ -60,10 +60,10 @@
<com.mogo.eagle.core.function.hmi.ui.msgbox.BusPassengerMsgBoxBubbleView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_100"
android:layout_marginRight="@dimen/dp_40"
app:layout_constraintRight_toLeftOf="@+id/bus_p_route_panel"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginLeft="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_100" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView

View File

@@ -469,9 +469,9 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
* 展示【自动驾驶】按钮
*/
public void showAutopilotBiz() {
getActivity().runOnUiThread(() -> {
ctvAutopilotStatus.setVisibility(View.VISIBLE);
});
// getActivity().runOnUiThread(() -> {
// ctvAutopilotStatus.setVisibility(View.VISIBLE);
// });
}
public SlidePanelView.OnSlidePanelMoveToEndListener getSlidePanelOnEndListener() {

View File

@@ -55,7 +55,6 @@ public class BusPresenter extends Presenter<BusFragment>
private static final String TAG = "BusPresenter";
private int currentAutopilotStatus = -1;
private List<BusStationBean> mStationList = new ArrayList<>();
private int mCurrentStation = 0;
@@ -104,16 +103,12 @@ public class BusPresenter extends Presenter<BusFragment>
}
public void autoDriveToNextStation() {
currentAutopilotStatus = -1;
OrderModel.getInstance().autoDriveToNextStation();
// isRestartAutopilot = false;
}
public void restartAutopilot() {
if (OrderModel.getInstance().isGoingToNextStation()){
currentAutopilotStatus = -1;
OrderModel.getInstance().restartAutopilot();
// isRestartAutopilot = true;
}
}
@@ -177,34 +172,7 @@ public class BusPresenter extends Presenter<BusFragment>
public void onAutopilotStatusResponse(int state) {
switch (state) {
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE:
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
// 设置UI【自动驾驶】按钮是否展示
runOnUIThread(() -> mView.onAutopilotEnableChange(true));
}
if (FunctionBuildConfig.isDemoMode
&& (
(mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1)
&& OrderModel.getInstance().isGoingToNextStation()
)
) {
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能");
return;
}
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE;
}
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus));
break;
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
OrderModel.getInstance().triggerStartServiceEvent(
OrderModel.getInstance().isRestartAutopilot(), true);
}
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus));
break;
case IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING:
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE:
if (FunctionBuildConfig.isDemoMode
&& (
@@ -215,25 +183,14 @@ public class BusPresenter extends Presenter<BusFragment>
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能");
return;
}
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE;
}
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus));
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state));
break;
case IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING:
if (FunctionBuildConfig.isDemoMode
&& (
(mCurrentStation >= 0 && mCurrentStation <= mStationList.size() - 1)
&& OrderModel.getInstance().isGoingToNextStation()
)
) {
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能");
return;
}
if (currentAutopilotStatus != IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING) {
currentAutopilotStatus = IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING;
}
runOnUIThread(() -> mView.onAutopilotStatusChanged(currentAutopilotStatus));
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING:
OrderModel.getInstance().triggerStartServiceEvent(
OrderModel.getInstance().isRestartAutopilot(), true);
// 改变UI自动驾驶状态
runOnUIThread(() -> mView.onAutopilotStatusChanged(state));
break;
default:
runOnUIThread(() -> mView.onAutopilotEnableChange(false));
@@ -257,6 +214,12 @@ public class BusPresenter extends Presenter<BusFragment>
public void startOpenAutopilot() {
//非美化模式下启动动画
runOnUIThread(() -> mView.startAutopilotAnimation());
//中间站点再次开启自驾时, 自动驾驶状态是2未改变 此次鹰眼底层不再返给业务,需优化按钮动画显示
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
== CallerAutoPilotStatusListenerManager.INSTANCE.getState()){
mView.onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getState());
}
}
private void runOnUIThread(Runnable executor) {