[290 bus/taxi]bus司机端优化轨迹计算
This commit is contained in:
@@ -157,6 +157,7 @@ public class BusPassengerModel {
|
||||
BusPassengerStation station = stations.get(i);
|
||||
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){
|
||||
mRouteLineInfoCallback.updateStationsInfo(stations,i+1,false);
|
||||
mTwoStationsRouts.clear();
|
||||
if(mNextStationIndex != i+1){
|
||||
startRemainRouteInfo();
|
||||
}
|
||||
@@ -299,6 +300,8 @@ public class BusPassengerModel {
|
||||
}
|
||||
};
|
||||
|
||||
private volatile int mPreAutoStatus = -1;
|
||||
|
||||
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener(){
|
||||
|
||||
@Override
|
||||
@@ -314,17 +317,27 @@ public class BusPassengerModel {
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
// if (autopilotStatusInfo == null) return;
|
||||
// int state = autopilotStatusInfo.getState();
|
||||
// CallerLogger.INSTANCE.d( M_BUS_P + TAG, "state = %s", state );
|
||||
// if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
// //2022.7.20 自动驾驶更换成带档位的
|
||||
//// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
// } else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
//// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
|
||||
// } else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
//// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
|
||||
// }
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
//2022.7.20 自动驾驶更换成带档位的
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
if(state != mPreAutoStatus){
|
||||
mTwoStationsRouts.clear();
|
||||
}
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotEnable();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
|
||||
if(state != mPreAutoStatus){
|
||||
mTwoStationsRouts.clear();
|
||||
}
|
||||
// if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotDisable();
|
||||
}else if (state == IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING){
|
||||
if(state != mPreAutoStatus){
|
||||
mTwoStationsRouts.clear();
|
||||
}
|
||||
}
|
||||
mPreAutoStatus = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -107,13 +107,13 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
if (currentIndex == 0){
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title_init));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip_init));
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
removeProgressBar();
|
||||
return;
|
||||
}
|
||||
if (isArrived){
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_station_title));
|
||||
mCurrentArriveTip.setText(getResources().getString(R.string.bus_p_cur_station_arrived_tip));
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
removeProgressBar();
|
||||
}else {
|
||||
mCurrentArriveStationTitle.setText(getResources().getString(R.string.bus_p_cur_next_station_title));
|
||||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
@@ -122,6 +122,12 @@ public abstract class BusPassengerBaseFragment<V extends IView, P extends Presen
|
||||
|
||||
}
|
||||
|
||||
private void removeProgressBar() {
|
||||
mProgressBar.setProgress(0);
|
||||
mProgressBar.setMax(0);
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void updateRoutePlanningToNextStation(long meters, long timeInSecond){
|
||||
//更新进度条
|
||||
updateProgressBar(meters);
|
||||
|
||||
Reference in New Issue
Block a user