merge
This commit is contained in:
@@ -101,6 +101,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
|
||||
getActivity().runOnUiThread( () -> {
|
||||
if ( stationList == null ) {
|
||||
// 获取小巴数据失败
|
||||
Logger.e("liyz", " stationList == null ");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -163,7 +164,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
|
||||
} else if ( isArriveAtStation ) {
|
||||
showSlidePanle( "滑动出发" );
|
||||
}
|
||||
|
||||
Logger.d("liyz", "renderCurrentStationStatus -----> ");
|
||||
mCurrentStationName.setText( currentStationName );
|
||||
mNextStationName.setText( nextStationName );
|
||||
mStartStationFlag.setVisibility( startStationFlagVisibility );
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.och.bus.presenter;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
@@ -94,6 +95,8 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
Log.d(TAG, "onCreate ------> ");
|
||||
Log.d("liyz", "onCreate ------> ");
|
||||
queryOperationStatus();
|
||||
queryBusRoutes();
|
||||
}
|
||||
@@ -103,6 +106,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
*/
|
||||
public void queryBusRoutes() {
|
||||
Logger.d( TAG, "查询小巴路线");
|
||||
Logger.d( "liyz", "查询小巴路线------->");
|
||||
|
||||
double lat = 40.1974932972;
|
||||
double lon = 116.7354579447;
|
||||
@@ -118,13 +122,16 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
@Override
|
||||
public void onSuccess( OchBusRoutesResponse o ) {
|
||||
super.onSuccess( o );
|
||||
Logger.d( "liyz", "-----1-------- o =" + o);
|
||||
if ( o == null
|
||||
|| o.getResult() == null
|
||||
|| o.getResult().getSite() == null
|
||||
|| o.getResult().getSite().isEmpty() ) {
|
||||
Logger.e( "liyz", "-----2-------- ");
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "获取到小巴路线数据: " + o );
|
||||
Logger.d( "liyz", "获取到小巴路线数据: " + o );
|
||||
renderBusStationsStatus( o.getResult().getSite() );
|
||||
}
|
||||
|
||||
@@ -132,6 +139,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
public void onError( Throwable e ) {
|
||||
super.onError( e );
|
||||
Logger.e( TAG, e, "获取小巴路线图失败" );
|
||||
Logger.d( "liyz", "获取小巴路线图失败 ");
|
||||
// 重复请求小巴路线,直至成功
|
||||
queryBusStationDelay();
|
||||
}
|
||||
@@ -140,6 +148,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
public void onError( String message, int code ) {
|
||||
super.onError( message, code );
|
||||
Logger.e( TAG, "获取小巴路线失败 code: " + code + " msg: " + message );
|
||||
Logger.e( "liyz", "获取小巴路线失败 code: " + code + " msg: " + message );
|
||||
// 重复请求小巴路线,直至成功
|
||||
queryBusStationDelay();
|
||||
}
|
||||
@@ -153,6 +162,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
*/
|
||||
private void renderBusStationsStatus( List< OchBusStation > site ) {
|
||||
Logger.d( TAG, "渲染站点信息");
|
||||
Logger.e( "liyz", "渲染站点信息");
|
||||
|
||||
int lastStopStation = getNextStopStation();
|
||||
|
||||
|
||||
@@ -548,6 +548,9 @@ class MogoOCHTaxiModel {
|
||||
if ( obj == null ) {
|
||||
return;
|
||||
}
|
||||
if (mOCHRHCarstatus != 1){
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "收到新订单" + GsonUtil.jsonFromObject(obj));
|
||||
mCurrentOCHOrder = obj;
|
||||
cacheOrderInfo2Native( mCurrentOCHOrder );
|
||||
@@ -616,6 +619,9 @@ class MogoOCHTaxiModel {
|
||||
if ( obj == null ) {
|
||||
return;
|
||||
}
|
||||
if (mOCHRHCarstatus != 1){
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "订单状态被改变:" + GsonUtil.jsonFromObject(obj));
|
||||
OCHOrderStatus status = OCHOrderStatus.valueOf( obj.orderDispatchType );
|
||||
switch ( status ) {
|
||||
|
||||
@@ -8,12 +8,15 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.utils.LocationUtils;
|
||||
import com.mogo.och.BaseOchFragment;
|
||||
import com.mogo.och.taxi.IMogoADASAutoPilotStatusChangedListener;
|
||||
import com.mogo.och.taxi.IMogoOCHTaxiArriveCallback;
|
||||
@@ -26,9 +29,21 @@ import com.mogo.och.taxi.R;
|
||||
import com.mogo.och.view.SlidePanelView;
|
||||
import com.mogo.service.adas.IMogoAdasOCHCallback;
|
||||
import com.mogo.service.adas.IMogoAdasRouteCallBack;
|
||||
import com.mogo.service.adas.entity.AdasOCHData;
|
||||
import com.mogo.service.adas.IMogoAdasRouteCallBack;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.RequestOptions;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -45,6 +60,7 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
IMogoADASAutoPilotStatusChangedListener,
|
||||
IOperationChangedListener,
|
||||
IMogoAdasRouteCallBack,
|
||||
IMogoAdasOCHCallback,
|
||||
IMogoCarLocationChangedListener2 {
|
||||
|
||||
public static final String TAG = "OCHTaxiFragment";
|
||||
@@ -438,16 +454,70 @@ class OCHTaxiFragment extends BaseOchFragment< OCHTaxiView, OCHTaxiPresenter > i
|
||||
});
|
||||
}
|
||||
private OCHTaxiOverlayManager ochTaxiOverlayManager;
|
||||
|
||||
@Override
|
||||
public void routeResult(List<MogoLatLng> routeList) {
|
||||
Logger.d("lianglihui","routeResult");
|
||||
if (routeList != null && routeList.size() >0){
|
||||
Logger.d("lianglihui","routeResult:"+routeList.size());
|
||||
//adas回调导航路径 绘制引导线
|
||||
if ( ochTaxiOverlayManager == null){
|
||||
ochTaxiOverlayManager = new OCHTaxiOverlayManager(this.getContext());
|
||||
if (routeList == null ) return;
|
||||
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());
|
||||
// //adas回调导航路径 绘制引导线
|
||||
// if ( ochTaxiOverlayManager == null){
|
||||
// ochTaxiOverlayManager = new OCHTaxiOverlayManager(this.getContext());
|
||||
// }
|
||||
// ochTaxiOverlayManager.draw(mogoLocation,routeList);
|
||||
// }
|
||||
}
|
||||
|
||||
public double calculateTravelDistance(MogoLocation carLocation,List<MogoLatLng> routeList){
|
||||
List<MogoLatLng> mPolylinePointList = new ArrayList<>();
|
||||
mPolylinePointList.add(new MogoLatLng(carLocation.getLatitude(), carLocation.getLongitude()));
|
||||
MogoLatLng routeLatLng;
|
||||
for (int i = 0 ; i< routeList.size() ; i++) {
|
||||
routeLatLng =routeList.get(i);
|
||||
//需要剔除已经行驶过的经纬度,这里需要比对推荐路线集合中的点是否在当前车辆行驶方向前面如果不在则抛弃
|
||||
if (LocationUtils.isPointOnCarFront(carLocation, routeLatLng)) {
|
||||
mPolylinePointList.add(routeLatLng);
|
||||
}
|
||||
ochTaxiOverlayManager.draw(mogoLocation,routeList);
|
||||
}
|
||||
MogoLatLng routeLatLng1,routeLatLng2;
|
||||
double distance = 0;
|
||||
for (int i = 0; i < mPolylinePointList.size() ; i ++){
|
||||
if (i < mPolylinePointList.size() -1 ){
|
||||
routeLatLng1 = mPolylinePointList.get(i);
|
||||
routeLatLng2 = mPolylinePointList.get(i+1);
|
||||
distance += CoordinateUtils.calculateLineDistance(
|
||||
routeLatLng1.getLon(), routeLatLng1.getLat(),
|
||||
routeLatLng2.getLon(), routeLatLng2.getLat()
|
||||
);
|
||||
}
|
||||
}
|
||||
return distance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArriveAt(AdasOCHData data) {
|
||||
Logger.d( TAG, "行程结束");
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().cancelAutopilot();
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "即将到达目的地,请您携带好随身物品,安全下车。" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChanged(int state, String reason) {
|
||||
Logger.d( TAG, "onStateChange: " + state );
|
||||
switch ( state ) {
|
||||
case IMogoAdasOCHCallback.STATUS_AUTOPILOT_ENABLE:
|
||||
hideSlidePanel();
|
||||
break;
|
||||
case IMogoAdasOCHCallback.STATUS_AUTOPILOT_RUNNING:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,19 +158,19 @@ LOGLIB_VERSION = 1.0.4
|
||||
|
||||
######## MogoAiCloudSDK Version
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.1.15
|
||||
MOGO_NETWORK_VERSION=1.1.18
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.1.15
|
||||
MOGO_PASSPORT_VERSION=1.1.18
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.1.15
|
||||
MOGO_SOCKET_VERSION=1.1.18
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.1.15
|
||||
MOGO_REALTIME_VERSION=1.1.18
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.1.15
|
||||
MOGO_TANLU_VERSION=1.1.18
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.1.15
|
||||
MOGO_LIVE_VERSION=1.1.18
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.1.15
|
||||
MOGO_TRAFFICLIVE_VERSION=1.1.18
|
||||
#ADAS HIGHT
|
||||
MOGO_ADASHIGH_VERSION=1.1.3
|
||||
|
||||
|
||||
@@ -89,3 +89,15 @@ fix crash
|
||||
8.5.49
|
||||
1.更新衡阳数据(包含38Km和城区200km)
|
||||
2.新增路牌
|
||||
|
||||
8.5.53
|
||||
修改崩溃
|
||||
|
||||
8.5.54
|
||||
1.更新衡阳数据 2. 新增路牌
|
||||
|
||||
8.5.55
|
||||
修改路牌数据以及图片
|
||||
|
||||
8.5.56
|
||||
日志:修改crash
|
||||
Reference in New Issue
Block a user