|
|
|
|
@@ -170,6 +170,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean isSpeakedEndingNotice = false;
|
|
|
|
|
/**
|
|
|
|
|
* 初始化订单信息
|
|
|
|
|
*/
|
|
|
|
|
@@ -180,7 +181,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|
|
|
|
slidePanelView.setVisibility( View.VISIBLE );
|
|
|
|
|
slidePanelView.setText( getString( R.string.module_och_taxi_arrive_at_end_station ) );
|
|
|
|
|
mOrderStatus.setText( R.string.module_och_taxi_arrive_at_end_station2 );
|
|
|
|
|
showNotice( getString( R.string.module_och_taxi_order_complete_1) );
|
|
|
|
|
SpeakNoticeOnce();
|
|
|
|
|
} else if ( MogoOCHTaxiModel.getInstance().isOnTheWay2EndStation() ) {
|
|
|
|
|
Logger.d( TAG, "已经去往终点" );
|
|
|
|
|
slidePanelView.setVisibility( View.GONE );
|
|
|
|
|
@@ -188,15 +189,6 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|
|
|
|
} else if ( MogoOCHTaxiModel.getInstance().isArriveAtStartStation() ) {
|
|
|
|
|
Logger.d( TAG, "已经达到起点" );
|
|
|
|
|
mOrderStatus.setText( R.string.module_och_taxi_waiting );
|
|
|
|
|
// if ( MogoOCHTaxiModel.getInstance().isUserArriveAtStartStation() ) {
|
|
|
|
|
// Logger.d( TAG, "乘客已上车" );
|
|
|
|
|
// slidePanelView.setVisibility( View.VISIBLE );
|
|
|
|
|
//// if ( MogoApisHandler.getInstance().getApis().getAdasControllerApi().getAutopilotStatus() == IMogoAdasOCHCallback.STATUS_AUTOPILOT_ENABLE ) {
|
|
|
|
|
//// } else {
|
|
|
|
|
//// slidePanelView.setVisibility( View.GONE );
|
|
|
|
|
//// }
|
|
|
|
|
// slidePanelView.setText( getString( R.string.module_och_taxi_arrive_at_start_station ) );
|
|
|
|
|
// }
|
|
|
|
|
slidePanelView.setVisibility( View.VISIBLE );
|
|
|
|
|
slidePanelView.setText( getString( R.string.module_och_taxi_arrive_at_start_station ) );
|
|
|
|
|
} else if ( MogoOCHTaxiModel.getInstance().checkCurrentOCHOrder() ) {
|
|
|
|
|
@@ -206,6 +198,13 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public synchronized void SpeakNoticeOnce(){
|
|
|
|
|
if (!isSpeakedEndingNotice){
|
|
|
|
|
isSpeakedEndingNotice = true;
|
|
|
|
|
showNotice( getString( R.string.module_och_taxi_order_complete_1) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 更新订单基本信息
|
|
|
|
|
*/
|
|
|
|
|
@@ -378,17 +377,17 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|
|
|
|
calculateTravelDistance( location );
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
//坐标转换
|
|
|
|
|
MogoLocation loc = new MogoLocation();
|
|
|
|
|
loc.setTime(loc.getTime());
|
|
|
|
|
loc.setAccuracy(location.getAccuracy());
|
|
|
|
|
loc.setSpeed(location.getSpeed());
|
|
|
|
|
loc.setLongitude(location.getLongitude());
|
|
|
|
|
loc.setLatitude(location.getLatitude());
|
|
|
|
|
loc.setAltitude(location.getAltitude());
|
|
|
|
|
loc.setBearing(location.getBearing());
|
|
|
|
|
loc.setProvider(location.getProvider());
|
|
|
|
|
mogoLocation = loc;
|
|
|
|
|
// //坐标转换
|
|
|
|
|
// MogoLocation loc = new MogoLocation();
|
|
|
|
|
// loc.setTime(loc.getTime());
|
|
|
|
|
// loc.setAccuracy(location.getAccuracy());
|
|
|
|
|
// loc.setSpeed(location.getSpeed());
|
|
|
|
|
// loc.setLongitude(location.getLongitude());
|
|
|
|
|
// loc.setLatitude(location.getLatitude());
|
|
|
|
|
// loc.setAltitude(location.getAltitude());
|
|
|
|
|
// loc.setBearing(location.getBearing());
|
|
|
|
|
// loc.setProvider(location.getProvider());
|
|
|
|
|
// mogoLocation = loc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -400,21 +399,26 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|
|
|
|
if ( location == null ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ( !MogoOCHTaxiModel.getInstance().isOnTheWay2EndStation() ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if ( MogoOCHTaxiModel.getInstance().isArriveAtEndStation() ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if ( !MogoOCHTaxiModel.getInstance().isOnTheWay2EndStation() ) {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// if ( MogoOCHTaxiModel.getInstance().isArriveAtEndStation() ) {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if ( mLocation == null ) {
|
|
|
|
|
mLocation = location;
|
|
|
|
|
}
|
|
|
|
|
double distance = CoordinateUtils.calculateLineDistance(
|
|
|
|
|
location.getLongitude(), location.getLatitude(),
|
|
|
|
|
mLocation.getLongitude(), mLocation.getLatitude()
|
|
|
|
|
);
|
|
|
|
|
if ( MogoOCHTaxiModel.getInstance().checkCurrentOCHOrder() ) {
|
|
|
|
|
MogoOCHTaxiModel.getInstance().getCurrentOCHOrder().decreaseTravelDistance( distance );
|
|
|
|
|
// double distance = CoordinateUtils.calculateLineDistance(
|
|
|
|
|
// location.getLongitude(), location.getLatitude(),
|
|
|
|
|
// mLocation.getLongitude(), mLocation.getLatitude()
|
|
|
|
|
// );
|
|
|
|
|
// Logger.e("lianglihui","calculateTravelDistance:"+distance);
|
|
|
|
|
|
|
|
|
|
if ( MogoOCHTaxiModel.getInstance().isOnTheWay2EndStation() &&
|
|
|
|
|
MogoOCHTaxiModel.getInstance().checkCurrentOCHOrder() &&
|
|
|
|
|
!MogoOCHTaxiModel.getInstance().isArriveAtEndStation()) {
|
|
|
|
|
MogoOCHTaxiModel.getInstance().calculateTravelDistance(location);
|
|
|
|
|
// MogoOCHTaxiModel.getInstance().getCurrentOCHOrder().decreaseTravelDistance( distance );
|
|
|
|
|
updateOrderBaseStatusInfo();
|
|
|
|
|
}
|
|
|
|
|
mLocation = location;
|
|
|
|
|
@@ -451,6 +455,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|
|
|
|
}else {
|
|
|
|
|
getPanelView().setVisibility(View.VISIBLE);
|
|
|
|
|
changeOperationViewVisible(View.INVISIBLE);
|
|
|
|
|
OCHTaxiUiController.getInstance().setOCHTaxiArriveCallback( this );
|
|
|
|
|
}
|
|
|
|
|
updateOrderStatus();
|
|
|
|
|
});
|
|
|
|
|
@@ -460,11 +465,11 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|
|
|
|
@Override
|
|
|
|
|
public void routeResult(List<MogoLatLng> routeList) {
|
|
|
|
|
if (routeList == null ) return;
|
|
|
|
|
double distance = calculateTravelDistance(mogoLocation,routeList);
|
|
|
|
|
if ( MogoOCHTaxiModel.getInstance().checkCurrentOCHOrder() ) {
|
|
|
|
|
MogoOCHTaxiModel.getInstance().getCurrentOCHOrder().decreaseTravelDistance( distance );
|
|
|
|
|
updateOrderBaseStatusInfo();
|
|
|
|
|
}
|
|
|
|
|
// double distance = calculateTravelDistance(mogoLocation,routeList);
|
|
|
|
|
// if ( MogoOCHTaxiModel.getInstance().checkCurrentOCHOrder() ) {
|
|
|
|
|
// MogoOCHTaxiModel.getInstance().getCurrentOCHOrder().decreaseTravelDistance( distance );
|
|
|
|
|
// updateOrderBaseStatusInfo();
|
|
|
|
|
// }
|
|
|
|
|
// Logger.d("lianglihui","routeResult 剩余导航距离:"+distance);
|
|
|
|
|
// if (routeList != null && routeList.size() >0){
|
|
|
|
|
// Logger.d("lianglihui","routeResult:"+routeList.size());
|
|
|
|
|
@@ -506,7 +511,6 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
|
|
|
|
public void onArriveAt(AdasOCHData data) {
|
|
|
|
|
Logger.d( TAG, "行程结束");
|
|
|
|
|
MogoApisHandler.getInstance().getApis().getAdasControllerApi().cancelAutopilot();
|
|
|
|
|
// AIAssist.getInstance( getContext() ).speakTTSVoice( "即将到达目的地,请您携带好随身物品,安全下车。" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|