[290 taxi司机端] opt

This commit is contained in:
wangmingjun
2022-07-21 20:48:30 +08:00
parent 33087401be
commit cc0478bf42
67 changed files with 122 additions and 7 deletions

View File

@@ -17,4 +17,7 @@ public interface ITaxiADASStatusCallback {
// 自动驾驶运行中
void onAutopilotRunning();
//人机共驾
void onManMachineCoDriving();
}

View File

@@ -80,5 +80,7 @@ class TaxiConst {
const val TYPE_MARKER_TAXI_ORDER = "TYPE_MARKER_TAXI_ORDER"
const val TIMER_START_AUTOPILOT_INTERVAL = 20 * 1000L
const val MAN_MACHINE_CO_DRIVING = 3
}
}

View File

@@ -1078,7 +1078,9 @@ public class TaxiModel {
int state = autopilotStatusInfo.getState();
CallerLogger.INSTANCE.d(M_TAXI + TAG, "state = %s", state);
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
if (state != mPrevAPStatus && mADASStatusCallback != null){
mADASStatusCallback.onAutopilotRunning();
}
if (mCurrentOCHOrder != null
&& getCurOrderStatus() == TaxiOrderStatusEnum.UserArriveAtStart
&& state != mPrevAPStatus) {
@@ -1105,6 +1107,9 @@ public class TaxiModel {
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr, mCurrentOCHOrder.orderNo);
}
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
if (state != mPrevAPStatus && mADASStatusCallback != null){
mADASStatusCallback.onAutopilotEnable();
}
mPrevAPStatus = state;
if (FunctionBuildConfig.isDemoMode
&& checkCurrentOCHOrder()
@@ -1112,8 +1117,11 @@ public class TaxiModel {
// 当美化模式演示模式开启时且有订单、且为去往目的地状态维持自动驾驶icon开启状态
return;
}
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
if (state != mPrevAPStatus && mADASStatusCallback != null){
mADASStatusCallback.onAutopilotDisable();
}
mPrevAPStatus = state;
if (FunctionBuildConfig.isDemoMode
&& checkCurrentOCHOrder()
@@ -1121,7 +1129,12 @@ public class TaxiModel {
// 当美化模式演示模式开启时且有订单、且为去往目的地状态维持自动驾驶icon开启状态
return;
}
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
}else if (state == TaxiConst.MAN_MACHINE_CO_DRIVING){
if (state != mPrevAPStatus && mADASStatusCallback != null){
mADASStatusCallback.onManMachineCoDriving();
}
mPrevAPStatus = state;
}
}

View File

@@ -15,6 +15,7 @@ import com.mogo.commons.mvp.Presenter;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.taxi.constant.TaxiConst;
import com.mogo.och.taxi.constant.TaxiOrderStatusEnum;
import com.mogo.och.taxi.bean.OrderQueryRespBean;
import com.mogo.och.taxi.bean.OrderQueryRouteInfoRespBean;
@@ -181,6 +182,11 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING));
}
@Override
public void onManMachineCoDriving() {
runOnUIThread(() -> mView.onManMachineCoDriving(TaxiConst.MAN_MACHINE_CO_DRIVING));
}
@Override
public void onCarStatusChanged(boolean inOperation, String role) {
runOnUIThread(() -> mView.updateOperationStatus(inOperation,role));

View File

@@ -218,6 +218,9 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
);
findViewById(R.id.btnAutopilotmanco).setOnClickListener(view ->
onAutopilotStatusChanged(TaxiConst.MAN_MACHINE_CO_DRIVING));
tvOperationStatus.setOnClickListener(view -> {
onChangeOperationStatus();
});
@@ -290,7 +293,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
// 3. 其他过程直接更新
startOrStopLoadingAnim(false);
AutopilotStatusAnimchanged(status);
autopilotStatusAnimchanged(status);
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == mPrevAPStatus) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE == status) {
// 2->1
@@ -304,6 +307,13 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
});
}
public void onManMachineCoDriving(int manMachineCoDriving){
if (mPrevAPStatus != manMachineCoDriving){
autopilotStatusAnimchanged(manMachineCoDriving);
}
mPrevAPStatus = manMachineCoDriving;
}
public void updateCtvAutopilotStatusTag(boolean tag){
ctvAutopilotStatus.setTag(tag);
}
@@ -321,7 +331,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
private AnimationDrawable animationDrawable;
public void AutopilotStatusAnimchanged(int status) {
public void autopilotStatusAnimchanged(int status) {
if (IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
// ctvAutopilotStatus.setClickable(true);
mAutopilotTv.setText("自动驾驶");
@@ -347,7 +357,21 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
ctvAutopilotStatus.setBackground(getResources().getDrawable(R.drawable.taxi_autopilot_bg_selector));
animationDrawable = null;
} else {
} else if (TaxiConst.MAN_MACHINE_CO_DRIVING == status){
mAutopilotTv.setText("远程代驾");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_normal));
mAutopilotImage.setImageResource(R.drawable.taxi_ic_autopilot);
if (animationDrawable == null) {
ctvAutopilotStatus.setBackground(getResources().getDrawable(R.drawable.anmi_flow_man_co));
animationDrawable = (AnimationDrawable) ctvAutopilotStatus.getBackground();
}
if (animationDrawable.isRunning()) {
return;
}
animationDrawable.selectDrawable(0);
animationDrawable.start();
}else {
// ctvAutopilotStatus.setClickable(false);
mAutopilotTv.setText("自动驾驶");
mAutopilotTv.setTextColor(getResources().getColor(R.color.taxi_autopilot_text_color_disable));
@@ -509,5 +533,4 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
CallerSmpManager.showPanel();//显示小地图
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/anim_flow_man_co_00000" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00001" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00002" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00003" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00004" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00005" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00006" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00007" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00008" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00009" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00010" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00011" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00012" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00013" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00014" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00015" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00016" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00017" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00018" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00019" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00020" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00021" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00022" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00023" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00024" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00025" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00026" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00027" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00028" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00029" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00030" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00031" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00032" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00033" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00034" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00035" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00036" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00037" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00038" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00039" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00040" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00041" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00042" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00043" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00044" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00045" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00046" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00047" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00048" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00049" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00050" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00051" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00052" android:duration="100"></item>
<item android:drawable="@drawable/anim_flow_man_co_00053" android:duration="100"></item>
</animation-list>

View File

@@ -222,6 +222,15 @@
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" />
<Button
android:id="@+id/btnAutopilotmanco"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="模拟 自动驾驶Running"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="@id/btnAutopilotRunning"
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
<androidx.constraintlayout.widget.Group
android:id="@+id/groupTestPanel"