Merge branch 'dev_robotaxi-d-app-module_2110_220915_2.11.0' into dev_robotaxi-d-app-module_2110_yangyakun_2.11.0
This commit is contained in:
@@ -14,8 +14,8 @@ public class BusPassengerOperationStatusResponse extends BaseData {
|
||||
|
||||
public static class Result {
|
||||
private String sn; //司机屏sn
|
||||
private String phone; //司机手机号
|
||||
public String plateNumber; //车牌号
|
||||
public int serviceStatus;//0:已收车,1:已出车
|
||||
public int businessType;// 车辆类型: taxi/bus
|
||||
public int driverStatus;//0:已收车,1:已出车
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class BusPassengerModel {
|
||||
public void onSuccess(BusPassengerOperationStatusResponse data) {
|
||||
if (data == null || data.data == null) return;
|
||||
if(mDriverStatusCallback != null){
|
||||
mDriverStatusCallback.changeOperationStatus(data.data.serviceStatus == 1);
|
||||
mDriverStatusCallback.changeOperationStatus(data.data.driverStatus == 1);
|
||||
mDriverStatusCallback.updatePlateNumber(data.data.plateNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BusPassengerModelLoopManager {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private Disposable mHeartbeatDisposable; //心跳轮询
|
||||
private Disposable mQueryLineDisposable; //心跳轮询
|
||||
private CompositeDisposable mRouteWipeDisposable;
|
||||
private CompositeDisposable mCalculateRouteDisposable; //每隔2s计算一次剩余里程和时间
|
||||
|
||||
@@ -78,11 +78,11 @@ public class BusPassengerModelLoopManager {
|
||||
}
|
||||
|
||||
public void startQueryDriverLineLoop() {
|
||||
if (mHeartbeatDisposable != null && !mHeartbeatDisposable.isDisposed()) {
|
||||
if (mQueryLineDisposable != null && !mQueryLineDisposable.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_BUS_P + TAG, "startQueryDriverLineLoop()");
|
||||
mHeartbeatDisposable = Observable.interval(LOOP_DELAY,
|
||||
mQueryLineDisposable = Observable.interval(LOOP_DELAY,
|
||||
LOOP_LINE_2S, TimeUnit.MILLISECONDS)
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -91,10 +91,10 @@ public class BusPassengerModelLoopManager {
|
||||
}
|
||||
|
||||
public void stopQueryDriverLineLoop() {
|
||||
if (mHeartbeatDisposable != null) {
|
||||
if (mQueryLineDisposable != null) {
|
||||
CallerLogger.INSTANCE.i(M_BUS_P + TAG, "stopQueryDriverLineLoop()");
|
||||
mHeartbeatDisposable.dispose();
|
||||
mHeartbeatDisposable = null;
|
||||
mQueryLineDisposable.dispose();
|
||||
mQueryLineDisposable = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,12 +27,14 @@ interface BusPassengerServiceApi {
|
||||
Observable<BusPassengerRoutesResponse> queryDriverSiteByCoordinate(@Header("appId") String appId, @Header("ticket") String ticket, @Body BusPassengerQueryLineRequest request);
|
||||
|
||||
/**
|
||||
* 查询司机端出车/收车状态
|
||||
* 查询司机端的登陆状态
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@GET("/autopilot-car-hailing/car/v2/driver/bus/passenger/takeOrderStatus/query")
|
||||
// @GET("/autopilot-car-hailing/car/v2/driver/bus/passenger/takeOrderStatus/query")
|
||||
@GET("/autopilot-car-hailing/operation/v1/driver/bus/passenger/loginStatus")
|
||||
Observable<BusPassengerOperationStatusResponse> queryDriverOperationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class BusCloseTaskRequest {
|
||||
|
||||
private String sn;
|
||||
private int taskId;
|
||||
public BusCloseTaskRequest(int taskId) {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,13 @@ package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/22
|
||||
*
|
||||
* 根据车机行驶线路站点信息
|
||||
*/
|
||||
class BusQueryLineStationsRequest {
|
||||
public class BusQueryLineStationsRequest {
|
||||
|
||||
private String sn;
|
||||
private double lat;
|
||||
|
||||
@@ -15,6 +15,7 @@ public class BusRoutesResult {
|
||||
private String description;
|
||||
private int status;
|
||||
private long taskTime; //线路时间班次
|
||||
private int taskId;// 线路班次id
|
||||
|
||||
//线路轨迹相关字段
|
||||
public String csvFileUrl = ""; //轨迹文件下载的cos url,默认“”
|
||||
@@ -33,6 +34,10 @@ public class BusRoutesResult {
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public int getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -12,16 +12,14 @@ import com.mogo.commons.network.Utils;
|
||||
public class BusUpdateSiteStatusRequest {
|
||||
|
||||
public String sn;
|
||||
public int taskId;
|
||||
public int seq;//站点序号
|
||||
public int siteId;//站点id
|
||||
public double lon;
|
||||
public double lat;
|
||||
|
||||
public BusUpdateSiteStatusRequest(int seq, int siteId, double lon, double lat) {
|
||||
public BusUpdateSiteStatusRequest(int taskId,int siteId,int seq) {
|
||||
this.sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
this.seq = seq;
|
||||
this.siteId = siteId;
|
||||
this.lon = lon;
|
||||
this.lat = lat;
|
||||
this.taskId = taskId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,5 +75,9 @@ class BusConst {
|
||||
|
||||
//围栏到站 暂定10米
|
||||
const val ARRIVE_AT_END_STATION_DISTANCE = 10
|
||||
|
||||
// 轮询
|
||||
const val LOOP_PASSENGER_2S = 2 * 1000L
|
||||
const val LOOP_PASSENGER_1S = 1 * 1000L
|
||||
}
|
||||
}
|
||||
@@ -492,7 +492,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
if ((int)mSwitchLine.getTag() == 0){//切换路线
|
||||
Intent intent = new Intent(getContext(), BusSwitchLineActivity.class);
|
||||
startActivity(intent);
|
||||
}else {//结束路线
|
||||
}else {//结束任务
|
||||
OCHCommitDialog.Builder builder = new OCHCommitDialog.Builder();
|
||||
OCHCommitDialog closeLineConfirmDialog = builder
|
||||
.title(getString(R.string.bus_dialog_title))
|
||||
@@ -503,7 +503,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
closeLineConfirmDialog.setClickListener(new OCHCommitDialog.ClickListener() {
|
||||
@Override
|
||||
public void confirm() {
|
||||
mPresenter.resetCurrentLineStatus();
|
||||
mPresenter.abortTask();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -85,6 +85,7 @@ import mogo.telematics.pad.MessagePad;
|
||||
public class BusOrderModel {
|
||||
private final String TAG = BusOrderModel.class.getSimpleName();
|
||||
private int currentLineId = -1;
|
||||
private int currentTaskId = -1;
|
||||
private int backgroundCurrentStationIndex = 0;//A->B 此处值是A站点索引
|
||||
|
||||
private static volatile BusOrderModel sInstance;
|
||||
@@ -335,6 +336,7 @@ public class BusOrderModel {
|
||||
mBusOrdersDisposable.dispose();
|
||||
}
|
||||
startOrStopOrderLoop(false);
|
||||
startOrStopQueryPassengerWriteOff(false);
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
@@ -500,13 +502,13 @@ public class BusOrderModel {
|
||||
/**
|
||||
* 重置路线站点状态--结束路线,当前路线恢复到始发站
|
||||
*/
|
||||
public void resetCurrentLineStatus() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "结束当前路线");
|
||||
BusServiceManager.getInstance().resetCurrentLineStatus(mContext, currentLineId
|
||||
, new IBusServiceCallback<BusRoutesResponse>() {
|
||||
public void abortTask() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "结束当前路线abortTask");
|
||||
BusServiceManager.getInstance().abortTask(mContext, currentTaskId
|
||||
, new IBusServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BusRoutesResponse o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "结束当前路线成功: " + o);
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "abortTask success: " + o);
|
||||
isGoingToNextStation = false;
|
||||
if (o.code == 0){ // 重置成功
|
||||
queryBusRoutes();
|
||||
@@ -521,42 +523,6 @@ public class BusOrderModel {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 离站上报
|
||||
*/
|
||||
public void leaveStation(boolean isOneWayOver,boolean isRestart){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"leaveStation-backgroundCurrentStationIndex = "+backgroundCurrentStationIndex);
|
||||
BusServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq()
|
||||
, stationList.get(backgroundCurrentStationIndex).getSiteId(), new IBusServiceCallback<BusRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(BusRoutesResponse o) {
|
||||
if ( o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
isArrivedStation = false;
|
||||
if (!isOneWayOver){
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "自动驾驶开启开往下一站====" );
|
||||
//需要更改当前站和下一站的状态 然后渲染
|
||||
leaveStationSuccess(o.getResult(),isRestart);
|
||||
}else {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "单程真的结束了====" );
|
||||
isGoingToNextStation = false;
|
||||
backgroundCurrentStationIndex = 0;
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
queryBusRoutes();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else{
|
||||
ToastUtils.showShort("离站上报失败:"+failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 离站上报成功后渲染站点
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
@@ -570,9 +536,7 @@ public class BusOrderModel {
|
||||
paramIndexes = {0},
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private void leaveStationSuccess(BusRoutesResult result, boolean isRestart) {
|
||||
|
||||
updateBusStatus(result);
|
||||
private void leaveStationSuccess(boolean isRestart) {
|
||||
|
||||
//开启自动驾驶 2.10.0: 如果自动驾驶状态下开启, 非自动驾驶状态下不开启,需手动点击自动驾驶按钮开启
|
||||
if (isRestart || CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
|
||||
@@ -631,6 +595,21 @@ public class BusOrderModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 到站查询核销乘客
|
||||
*/
|
||||
public void queryPassengerWriteOff(){
|
||||
//todo 查询接口拿到核销乘客波播报
|
||||
}
|
||||
|
||||
private void startOrStopQueryPassengerWriteOff(boolean isStart){
|
||||
if (isStart){
|
||||
BusModelLoopManager.getInstance().startQueryPassengerWriteOffLoop();
|
||||
}else {
|
||||
BusModelLoopManager.getInstance().stopQueryPassengerWriteOffLoop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 到站后重置站点状态
|
||||
*/
|
||||
@@ -645,25 +624,56 @@ public class BusOrderModel {
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+ arrivedStationIndex);
|
||||
|
||||
BusServiceManager.getInstance().arriveSiteStation(mContext
|
||||
, stationList.get(arrivedStationIndex).getSeq(), stationList.get(arrivedStationIndex).getSiteId()
|
||||
, new IBusServiceCallback<BaseData>() {
|
||||
BusServiceManager.getInstance().arriveSiteStation(mContext ,
|
||||
stationList.get(arrivedStationIndex).getSeq(),
|
||||
stationList.get(arrivedStationIndex).getSiteId(),
|
||||
currentTaskId ,
|
||||
new IBusServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation success");
|
||||
if (!isRestart){
|
||||
arrivedBusStationSuccess();
|
||||
//todo 开始轮询到站核销的乘客
|
||||
startOrStopQueryPassengerWriteOff(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
// if (!NetworkUtils.isConnected(mContext)) {
|
||||
// ToastUtils.showShort("网络异常,请稍后重试");
|
||||
// }else {
|
||||
// ToastUtils.showShort("离站上报失败:"+failMsg);
|
||||
// }
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 离站上报
|
||||
*/
|
||||
public void leaveStation(boolean isRestart){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"leaveStation-backgroundCurrentStationIndex = "+backgroundCurrentStationIndex);
|
||||
BusServiceManager.getInstance().leaveStation(mContext,
|
||||
stationList.get(backgroundCurrentStationIndex).getSeq(),
|
||||
stationList.get(backgroundCurrentStationIndex).getSiteId(),
|
||||
currentTaskId,
|
||||
new IBusServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
isArrivedStation = false;
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "自动驾驶开启开往下一站====" );
|
||||
//需要更改当前站和下一站的状态 然后渲染
|
||||
leaveStationSuccess(isRestart);
|
||||
queryBusRoutes();
|
||||
startOrStopQueryPassengerWriteOff(false);
|
||||
}
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else{
|
||||
ToastUtils.showShort("离站上报失败:"+failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -722,13 +732,13 @@ public class BusOrderModel {
|
||||
/**
|
||||
* 开启自动驾驶到下一站
|
||||
*/
|
||||
public void autoDriveToNextStation( boolean isRestart ) {
|
||||
public void autoDriveToNextStation(boolean isRestart) {
|
||||
if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) {
|
||||
// 当前站是最后一站,结束当前行程
|
||||
travelOver();
|
||||
return;
|
||||
}
|
||||
leaveStation(false,isRestart);
|
||||
leaveStation(isRestart);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -741,6 +751,7 @@ public class BusOrderModel {
|
||||
if (result == null) return;
|
||||
busRoutesResult = result;
|
||||
List<BusStationBean> site = result.getSites();
|
||||
currentTaskId = result.getTaskId();
|
||||
currentLineId = result.getLineId();
|
||||
stationList.clear();
|
||||
stationList.addAll( site );
|
||||
@@ -801,25 +812,6 @@ public class BusOrderModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单状态、获取下一站靠站的的站点
|
||||
*
|
||||
* @return -1 当前已是最后一个站点
|
||||
*/
|
||||
private int getNextStopStation() {
|
||||
if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) {
|
||||
return -1;
|
||||
}
|
||||
int nextStationIndex = backgroundCurrentStationIndex + 1;
|
||||
for ( ; nextStationIndex < stationList.size() - 1; nextStationIndex++ ) {
|
||||
if ( stationList.get( nextStationIndex ).getIfStop() == 1 ) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return nextStationIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* 延时查询站点信心
|
||||
*/
|
||||
@@ -832,7 +824,7 @@ public class BusOrderModel {
|
||||
*/
|
||||
public void restartAutopilot() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "重启自动驾驶===" + isGoingToNextStation );
|
||||
autoDriveToNextStation( true );
|
||||
autoDriveToNextStation(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -890,7 +882,33 @@ public class BusOrderModel {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "单程结束====" );
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见" );
|
||||
leaveStation(true,true);
|
||||
|
||||
endTask();
|
||||
}
|
||||
|
||||
/**
|
||||
* task正常结束
|
||||
*/
|
||||
private void endTask() {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "任务正常走完endTask()");
|
||||
BusServiceManager.getInstance().endTask(mContext, currentTaskId
|
||||
, new IBusServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "endTask success: " + o);
|
||||
if (o.code == 0){
|
||||
isGoingToNextStation = false;
|
||||
backgroundCurrentStationIndex = 0;
|
||||
queryBusRoutes();// 重新获取任务
|
||||
startOrStopQueryPassengerWriteOff(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
ToastUtils.showShort(failMsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -915,16 +933,18 @@ public class BusOrderModel {
|
||||
CallerLogger.INSTANCE.d( M_BUS + TAG, "到站====currentStationIndex=" + backgroundCurrentStationIndex);
|
||||
isGoingToNextStation = false;
|
||||
|
||||
queryStationLeaveAwayPassengers();
|
||||
UiThreadHandler.postDelayed(new Runnable() {// 先查询下车乘客,再上报到站,便于后台筛查下车订单
|
||||
@Override
|
||||
public void run() {
|
||||
if (!hadQueryLeaveAwayPassager){
|
||||
arriveSiteStation(false);
|
||||
}
|
||||
hadQueryLeaveAwayPassager = false;
|
||||
}
|
||||
},1500);
|
||||
arriveSiteStation(false);
|
||||
|
||||
// queryStationLeaveAwayPassengers();// 2.11.0不再播报乘客下车
|
||||
// UiThreadHandler.postDelayed(new Runnable() {// 先查询下车乘客,再上报到站,便于后台筛查下车订单
|
||||
// @Override
|
||||
// public void run() {
|
||||
// if (!hadQueryLeaveAwayPassager){
|
||||
// arriveSiteStation(false);
|
||||
// }
|
||||
// hadQueryLeaveAwayPassager = false;
|
||||
// }
|
||||
// },1500);
|
||||
}
|
||||
|
||||
public boolean isGoingToNextStation() {
|
||||
|
||||
@@ -10,9 +10,9 @@ import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.bean.BusCloseTaskRequest;
|
||||
import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.BusResetLineStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
|
||||
@@ -82,17 +82,31 @@ public class BusServiceManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束当前路线,当前路线状态重置到始发站
|
||||
* 中断当前任务
|
||||
* @param context
|
||||
* @param lineId
|
||||
* @param taskId
|
||||
* @param callback
|
||||
*/
|
||||
public void resetCurrentLineStatus(Context context, int lineId, IBusServiceCallback<BusRoutesResponse> callback){
|
||||
mService.resetCurrentLineStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
public void abortTask(Context context, int taskId, IBusServiceCallback<BaseData> callback){
|
||||
mService.abortTask(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new BusResetLineStatusRequest())
|
||||
,new BusCloseTaskRequest(taskId))
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"resetCurrentLineStatus"));
|
||||
.subscribe(getSubscribeImpl(context,callback,"abortTask"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 正常结束任务
|
||||
* @param context
|
||||
* @param taskId
|
||||
* @param callback
|
||||
*/
|
||||
public void endTask(Context context, int taskId, IBusServiceCallback<BaseData> callback){
|
||||
mService.endTask(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new BusCloseTaskRequest(taskId))
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"endTask"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,11 +116,10 @@ public class BusServiceManager {
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
public void leaveStation(Context context, int seq, int siteId, IBusServiceCallback<BusRoutesResponse> callback){
|
||||
public void leaveStation(Context context, int seq, int siteId,int taskId, IBusServiceCallback<BaseData> callback){
|
||||
mService.leaveStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new BusUpdateSiteStatusRequest(seq,siteId, BusOrderModel.getInstance().mLongitude
|
||||
, BusOrderModel.getInstance().mLatitude))
|
||||
,new BusUpdateSiteStatusRequest(taskId,siteId,seq))
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
|
||||
@@ -119,11 +132,11 @@ public class BusServiceManager {
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
public void arriveSiteStation(Context context, int seq, int siteId, IBusServiceCallback<BaseData> callback){
|
||||
public void arriveSiteStation(Context context, int seq, int siteId,int taskId,
|
||||
IBusServiceCallback<BaseData> callback){
|
||||
mService.arriveSiteStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new BusUpdateSiteStatusRequest(seq,siteId
|
||||
, BusOrderModel.getInstance().mLongitude, BusOrderModel.getInstance().mLatitude))
|
||||
,new BusUpdateSiteStatusRequest(taskId,siteId,seq))
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.mogo.och.bus.net;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.bus.bean.BusCloseTaskRequest;
|
||||
import com.mogo.och.bus.bean.BusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusOrdersResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLineTaskResponse;
|
||||
import com.mogo.och.bus.bean.BusQueryLinesResponse;
|
||||
import com.mogo.och.bus.bean.BusResetLineStatusRequest;
|
||||
import com.mogo.och.bus.bean.BusRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.bus.bean.BusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
|
||||
@@ -58,9 +58,10 @@ public interface IBusApiService {
|
||||
*/
|
||||
@Headers({"Content-Type:application/json;charset=UTF-8"})
|
||||
// @POST("/autopilot-car-hailing/car/v2/bus/driving/away")
|
||||
@POST("/autopilot-car-hailing/car/v2/driver/bus/driving/away")
|
||||
// @POST("/autopilot-car-hailing/car/v2/driver/bus/driving/away")
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/leave")
|
||||
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/away")
|
||||
Observable<BusRoutesResponse> leaveStation(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusUpdateSiteStatusRequest request);
|
||||
Observable<BaseData> leaveStation(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusUpdateSiteStatusRequest request);
|
||||
|
||||
/**
|
||||
* 到站 更新到站信息
|
||||
@@ -69,7 +70,8 @@ public interface IBusApiService {
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
// @POST("/autopilot-car-hailing/order/v2/bus/driving/attachSite")
|
||||
@POST("/autopilot-car-hailing/order/v2/driver/bus/driving/attachSite")
|
||||
// @POST("/autopilot-car-hailing/order/v2/driver/bus/driving/attachSite")
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/arrive")
|
||||
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/attachSite")
|
||||
Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body BusUpdateSiteStatusRequest request);
|
||||
|
||||
@@ -126,8 +128,29 @@ public interface IBusApiService {
|
||||
@POST( "/autopilot-car-hailing/location/v2/driver/bus/saveLineCoordinate" )
|
||||
Observable<BaseData> updateOrderRoute(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusRoutePlanningUpdateReqBean data);
|
||||
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
// @Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
// @POST("/autopilot-car-hailing/operation/v1/driver/bus/line/resetStart")
|
||||
// Observable<BusRoutesResponse> resetCurrentLineStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusResetLineStatusRequest data);
|
||||
|
||||
/**
|
||||
* 中止任务
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/abortTask")
|
||||
Observable<BusRoutesResponse> resetCurrentLineStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusResetLineStatusRequest data);
|
||||
Observable<BaseData> abortTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
|
||||
|
||||
/**
|
||||
* 任务正常跑完结束
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST("/autopilot-car-hailing/cab/flow/v1/bus/driver/bus/endTask")
|
||||
Observable<BaseData> endTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Body BusCloseTaskRequest data);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.mogo.och.bus.presenter;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.och.bus.constant.BusConst.LOOP_DELAY;
|
||||
import static com.mogo.och.bus.constant.BusConst.LOOP_PASSENGER_2S;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
@@ -31,6 +33,28 @@ public class BusModelLoopManager {
|
||||
}
|
||||
|
||||
private Disposable mHeartbeatDisposable; //心跳轮询
|
||||
private Disposable mQueryPassengerDisposable; //查询核销乘客
|
||||
|
||||
public void startQueryPassengerWriteOffLoop() {
|
||||
if (mQueryPassengerDisposable != null && !mQueryPassengerDisposable.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_BUS + TAG, "startQueryPassengerWriteOffLoop()");
|
||||
mQueryPassengerDisposable = Observable.interval(LOOP_DELAY,
|
||||
LOOP_PASSENGER_2S, TimeUnit.MILLISECONDS)
|
||||
.map((aLong -> aLong + 1))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> BusOrderModel.getInstance().queryPassengerWriteOff());
|
||||
}
|
||||
|
||||
public void stopQueryPassengerWriteOffLoop() {
|
||||
if (mQueryPassengerDisposable != null) {
|
||||
CallerLogger.INSTANCE.i(M_BUS + TAG, "stopQueryPassengerWriteOffLoop()");
|
||||
mQueryPassengerDisposable.dispose();
|
||||
mQueryPassengerDisposable = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void startHeartbeatLoop() {
|
||||
if (mHeartbeatDisposable != null && !mHeartbeatDisposable.isDisposed()) {
|
||||
|
||||
@@ -89,8 +89,8 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
BusOrderModel.getInstance().queryBusRoutes();
|
||||
}
|
||||
|
||||
public void resetCurrentLineStatus() {
|
||||
BusOrderModel.getInstance().resetCurrentLineStatus();
|
||||
public void abortTask() {
|
||||
BusOrderModel.getInstance().abortTask();
|
||||
}
|
||||
|
||||
public void autoDriveToNextStation(boolean isRestart) {
|
||||
|
||||
@@ -5,7 +5,7 @@ apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
|
||||
android {
|
||||
compileSdkVersion 31
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
buildToolsVersion "30.0.2"
|
||||
|
||||
defaultConfig {
|
||||
|
||||
@@ -94,12 +94,19 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
* 开启自动驾驶 自驾模式
|
||||
*/
|
||||
public void startAutoPilot() {
|
||||
TaxiModel.getInstance().startAutoPilot();
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工模式
|
||||
*/
|
||||
public void startManualDrive(){
|
||||
TaxiModel.getInstance().startServicePilotDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳过乘客验证环节
|
||||
*/
|
||||
|
||||
@@ -21,9 +21,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.mogo.cloud.httpdns.util.L;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
@@ -388,13 +386,11 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
public void onCheckPilotConditionSafe(boolean isSafe){
|
||||
updateCtvAutopilotStatusTag(isSafe);
|
||||
if (isSafe){
|
||||
ToastUtils.showLong(getResources().getString(
|
||||
R.string.module_och_taxi_order_choose_start_autopilot_tip));
|
||||
updateOrderUI();
|
||||
updateOrderBottomBtnUI();
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void updateOrderUI();
|
||||
protected abstract void updateOrderBottomBtnUI();
|
||||
|
||||
private AnimatorDrawableUtil animatorDrawableUtil = null;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager;
|
||||
@@ -62,19 +61,14 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
private OrderQueryRespBean.Result mCurrentOrder = null;
|
||||
private boolean isFirstStartAutopilotDone = true;
|
||||
|
||||
public static TaxiBeingServerdOrdersFragment newInstance(Activity activity, TaxiFragment taxiFragment) {
|
||||
mActivity = activity;
|
||||
mTaxiFragment = taxiFragment;
|
||||
Bundle args = new Bundle();
|
||||
|
||||
TaxiBeingServerdOrdersFragment fragment = new TaxiBeingServerdOrdersFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
private TextView mOrderStatus;
|
||||
private ImageView mOrderCancel;
|
||||
|
||||
private TextView mOrderServerStatus;
|
||||
private ConstraintLayout mOrderStartModeBtn;
|
||||
private TextView mAutoPilotBtn;
|
||||
private TextView mManualBtn;
|
||||
|
||||
private ConstraintLayout mBeingOrderLayout;
|
||||
private ConstraintLayout mContentModule3;
|
||||
private ConstraintLayout mContentModule2;
|
||||
@@ -103,6 +97,16 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
|
||||
private volatile int saveOrderState = -1;
|
||||
|
||||
public static TaxiBeingServerdOrdersFragment newInstance(Activity activity, TaxiFragment taxiFragment) {
|
||||
mActivity = activity;
|
||||
mTaxiFragment = taxiFragment;
|
||||
Bundle args = new Bundle();
|
||||
|
||||
TaxiBeingServerdOrdersFragment fragment = new TaxiBeingServerdOrdersFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.taxi_being_order;
|
||||
@@ -112,7 +116,12 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
protected void initViews(View view) {
|
||||
mOrderStatus = view.findViewById(R.id.module_och_taxi_order_status);
|
||||
mOrderCancel = view.findViewById(R.id.module_och_taxi_order_cancel_iv);
|
||||
|
||||
mOrderServerStatus = view.findViewById(R.id.module_och_taxi_order_server_status_tv);
|
||||
mOrderStartModeBtn = view.findViewById(R.id.taxi_start_mode_btn);
|
||||
mAutoPilotBtn = view.findViewById(R.id.taxi_start_by_auto);
|
||||
mManualBtn = view.findViewById(R.id.taxi_start_by_manual);
|
||||
|
||||
mBeingOrderLayout = view.findViewById(R.id.module_och_taxi_being_order_content);
|
||||
mContentModule2 = view.findViewById(R.id.module_och_taxi_order_status_station_2);
|
||||
mContentModule3 = view.findViewById(R.id.module_och_taxi_order_status_station_3);
|
||||
@@ -136,16 +145,22 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
|
||||
mNoDatasTv = view.findViewById(R.id.no_order_data_tv);
|
||||
mNoDataView = view.findViewById(R.id.being_no_data_view);
|
||||
mOrderCancel.setOnClickListener(this);
|
||||
mOrderServerStatus.setOnClickListener(this);
|
||||
|
||||
initOnClickListener();
|
||||
|
||||
initNaviView(view);
|
||||
|
||||
isHaveBeingOrder(false);
|
||||
|
||||
// if (DebugConfig.isDebug()) { //任意模式下调试信息都打开
|
||||
initOrderTestBar(view);
|
||||
// }
|
||||
//任意模式下调试信息都打开
|
||||
initOrderTestBar(view);
|
||||
}
|
||||
|
||||
private void initOnClickListener() {
|
||||
mOrderCancel.setOnClickListener(this);
|
||||
mOrderServerStatus.setOnClickListener(this);
|
||||
mAutoPilotBtn.setOnClickListener(this);
|
||||
mManualBtn.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -175,29 +190,34 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
mOrderNo = order.orderNo;
|
||||
onOrderStatusChanged(order);
|
||||
if (TaxiOrderStatusEnum.ArriveAtEnd.getCode() == order.orderStatus) {
|
||||
|
||||
showOrHideOrderModeBtn(false);
|
||||
|
||||
mTaxiFragment.queryCurOrderRouteInfo();
|
||||
mContentModule3.setVisibility(View.GONE);
|
||||
mContentModule2.setVisibility(View.VISIBLE);
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "已经达到终点");
|
||||
mOrderStatus.setText(R.string.module_och_taxi_arrive_at_end_station2);
|
||||
mOrderServerStatus.setText(R.string.module_och_taxi_order_server_end);
|
||||
mOrderServerStatus.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
GradientDrawable background = (GradientDrawable) mOrderServerStatus.getBackground();//GradientDrawable是Drawable的子类
|
||||
background.setColor(Color.parseColor("#FF1D5EF3"));
|
||||
mOrderServerStatus.setClickable(true);
|
||||
updateOrderBottomBtn(getString(R.string.module_och_taxi_order_server_end),
|
||||
Color.parseColor("#FFFFFF"),
|
||||
Color.parseColor("#FF1D5EF3"),
|
||||
true);
|
||||
mTitleTV2.setText("送乘客至");
|
||||
mStationTv2.setText(order.endSiteAddr);
|
||||
|
||||
} else if (TaxiOrderStatusEnum.OnTheWayToEnd.getCode() == order.orderStatus) {
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "已经去往终点");
|
||||
|
||||
showOrHideOrderModeBtn(false);
|
||||
|
||||
mContentModule3.setVisibility(View.GONE);
|
||||
mContentModule2.setVisibility(View.VISIBLE);
|
||||
mOrderStatus.setText(R.string.module_och_taxi_on_the_way_2_end_station);
|
||||
mOrderServerStatus.setText(R.string.module_och_taxi_order_server_end);
|
||||
mOrderServerStatus.setTextColor(Color.parseColor("#4DFFFFFF"));
|
||||
GradientDrawable background = (GradientDrawable) mOrderServerStatus.getBackground();//GradientDrawable是Drawable的子类
|
||||
background.setColor(Color.parseColor("#4D1D5EF3"));
|
||||
mOrderServerStatus.setClickable(false);
|
||||
|
||||
updateOrderBottomBtn(getString(R.string.module_och_taxi_order_server_end),
|
||||
Color.parseColor("#4DFFFFFF"),
|
||||
Color.parseColor("#4D1D5EF3"),
|
||||
false);
|
||||
|
||||
mTitleTV2.setText("送乘客至");
|
||||
mStationTv2.setText(order.endSiteAddr);
|
||||
@@ -240,21 +260,25 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
mPassengerNum.setText(order.passengerNum + "人");
|
||||
mPassengerPhone.setText(order.passengerPhone);
|
||||
mOrderStatus.setText(R.string.module_och_taxi_waiting);
|
||||
mOrderServerStatus.setText(R.string.module_och_taxi_order_server_start_wait_check);
|
||||
mOrderServerStatus.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
GradientDrawable background = (GradientDrawable) mOrderServerStatus.getBackground();//GradientDrawable是Drawable的子类
|
||||
background.setColor(Color.parseColor("#FF1D5EF3"));
|
||||
mOrderServerStatus.setClickable(true);
|
||||
|
||||
updateOrderBottomBtn(getString(R.string.module_och_taxi_order_server_start_wait_check),
|
||||
Color.parseColor("#FFFFFF"),
|
||||
Color.parseColor("#FF1D5EF3"),
|
||||
true);
|
||||
|
||||
showOrHideOrderModeBtn(false);
|
||||
}else if (TaxiOrderStatusEnum.UserArriveAtStart.getCode() == order.orderStatus ){
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "乘客已上车验证成功");
|
||||
|
||||
mPassengerInfoLayout.setVisibility(View.GONE);
|
||||
mOrderStatus.setText(R.string.module_och_taxi_user_check_success);
|
||||
mOrderServerStatus.setText(R.string.module_och_taxi_order_server_start);
|
||||
GradientDrawable background = (GradientDrawable) mOrderServerStatus.getBackground();//GradientDrawable是Drawable的子类
|
||||
background.setColor(Color.parseColor("#FF1D5EF3"));
|
||||
mOrderServerStatus.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
mOrderServerStatus.setClickable(true);
|
||||
|
||||
updateOrderBottomBtn(getString(R.string.module_och_taxi_order_server_start),
|
||||
Color.parseColor("#FFFFFF"),
|
||||
Color.parseColor("#FF1D5EF3"),
|
||||
true);
|
||||
|
||||
showOrHideOrderModeBtn(true);
|
||||
}
|
||||
|
||||
}else if (TaxiModel.getInstance().checkCurrentOCHOrder()) {
|
||||
@@ -270,11 +294,14 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
mPassengerNum.setText(order.passengerNum + "人");
|
||||
mPassengerPhone.setText(order.passengerPhone);
|
||||
mOrderStatus.setText(R.string.module_och_taxi_new_order);
|
||||
mOrderServerStatus.setText(R.string.module_och_taxi_order_server_start);
|
||||
mOrderServerStatus.setTextColor(Color.parseColor("#4DFFFFFF"));
|
||||
GradientDrawable background = (GradientDrawable) mOrderServerStatus.getBackground();//GradientDrawable是Drawable的子类
|
||||
background.setColor(Color.parseColor("#4D1D5EF3"));
|
||||
mOrderServerStatus.setClickable(false);
|
||||
|
||||
showOrHideOrderModeBtn(false);
|
||||
|
||||
updateOrderBottomBtn(getString(R.string.module_och_taxi_order_server_start),
|
||||
Color.parseColor("#4DFFFFFF"),
|
||||
Color.parseColor("#4D1D5EF3"),
|
||||
false);
|
||||
|
||||
mGoAheadStationTitleTv31.setText("前往");
|
||||
mCatchStationTitleTv31.setText("接乘客");
|
||||
mStationTv31.setText(order.startSiteAddr);
|
||||
@@ -302,6 +329,16 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
}
|
||||
}
|
||||
|
||||
private void showOrHideOrderModeBtn(boolean isShow) {
|
||||
if (isShow){
|
||||
mOrderStartModeBtn.setVisibility(View.VISIBLE);
|
||||
mOrderServerStatus.setVisibility(View.GONE);
|
||||
}else {
|
||||
mOrderStartModeBtn.setVisibility(View.GONE);
|
||||
mOrderServerStatus.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
private void startNaviToStartStation(boolean isShow, double orderStartStationLat, double orderStartStationLng) {
|
||||
NaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "currentLatLng=" + mTaxiFragment.mCurLatitude + " " + mTaxiFragment.mCurLongitude);
|
||||
@@ -523,6 +560,14 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
if (mTaxiFragment != null) {
|
||||
showNaviToStartStationFragment(true);
|
||||
}
|
||||
} else if (v.getId() == R.id.taxi_start_by_auto){//自驾模式
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "自驾模式");
|
||||
mOrderStartModeBtn.setTag(0);
|
||||
startOrEndService();
|
||||
} else if (v.getId() == R.id.taxi_start_by_manual){//人工模式
|
||||
CallerLogger.INSTANCE.d(M_TAXI + TAG, "人工模式");
|
||||
mOrderStartModeBtn.setTag(1);
|
||||
mTaxiFragment.confirmAutopilotConditionByDriver();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,20 +697,30 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment implement
|
||||
}
|
||||
}
|
||||
|
||||
public void updateOrderUI() {
|
||||
public void updateOrderBottomBtnUI() {
|
||||
try {
|
||||
updateOrderBottomBtn();
|
||||
if ((int)mOrderStartModeBtn.getTag() == 1){//人工
|
||||
mTaxiFragment.startManualDirve();
|
||||
return;
|
||||
}
|
||||
ToastUtils.showLong(getResources().getString(
|
||||
R.string.module_och_taxi_order_choose_start_autopilot_tip));
|
||||
showOrHideOrderModeBtn(false);
|
||||
updateOrderBottomBtn(getString(R.string.module_och_taxi_order_server_wait_passenger_start),
|
||||
Color.parseColor("#4DFFFFFF"),
|
||||
Color.parseColor("#FF1D5EF3"),
|
||||
false);
|
||||
}catch (NullPointerException e){
|
||||
mTaxiFragment.confirmAutopilotConditionByDriver();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateOrderBottomBtn(){
|
||||
mOrderServerStatus.setText(R.string.module_och_taxi_order_server_wait_passenger_start);
|
||||
mOrderServerStatus.setTextColor(Color.parseColor("#4DFFFFFF"));
|
||||
public void updateOrderBottomBtn(String txt, int txtColorId, int bgColorId,boolean isClickable){
|
||||
mOrderServerStatus.setText(txt);
|
||||
mOrderServerStatus.setTextColor(txtColorId);
|
||||
GradientDrawable background = (GradientDrawable) mOrderServerStatus.getBackground();//GradientDrawable是Drawable的子类
|
||||
background.setColor(Color.parseColor("#FF1D5EF3"));
|
||||
mOrderServerStatus.setClickable(false);
|
||||
background.setColor(bgColorId);
|
||||
mOrderServerStatus.setClickable(isClickable);
|
||||
}
|
||||
/**
|
||||
* END
|
||||
|
||||
@@ -245,6 +245,10 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
mPresenter.completeOrderService();
|
||||
}
|
||||
|
||||
public void startManualDirve(){
|
||||
mPresenter.startManualDrive();
|
||||
}
|
||||
|
||||
public void cancelCurOrder(int reasonType, String reaso) {
|
||||
mPresenter.cancelCurOrder(reasonType, reaso);
|
||||
}
|
||||
@@ -265,9 +269,9 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateOrderUI() {
|
||||
protected void updateOrderBottomBtnUI() {
|
||||
if (null == serverOrdersFragment) return;
|
||||
serverOrdersFragment.updateOrderUI();
|
||||
serverOrdersFragment.updateOrderBottomBtnUI();
|
||||
}
|
||||
|
||||
public void onNewBookingOrderGot(OrderQueryRespBean.Result order) {
|
||||
|
||||
@@ -213,8 +213,8 @@ public class TaxiServerOrdersFragment extends BaseTaxiUIFragment {
|
||||
beingServerdOrdersFragment.onCurrentOrderRouteInfoGot(routeInfo);
|
||||
}
|
||||
|
||||
public void updateOrderUI() {
|
||||
public void updateOrderBottomBtnUI() {
|
||||
if (null == beingServerdOrdersFragment) return;
|
||||
beingServerdOrdersFragment.updateOrderUI();
|
||||
beingServerdOrdersFragment.updateOrderBottomBtnUI();
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/module_och_taxi_panel_width"
|
||||
android:layout_height="130px"
|
||||
android:id="@+id/taxi_start_mode_btn"
|
||||
android:visibility="gone"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@drawable/order_drive_mode_bg">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/taxi_start_by_auto"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginLeft="@dimen/dp_40"
|
||||
android:text="@string/och_taxi_auto_txt"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="24sp"/>
|
||||
<TextView
|
||||
android:id="@+id/taxi_start_by_manual"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="@string/och_taxi_manual_txt"
|
||||
android:layout_marginRight="@dimen/dp_40"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="24sp"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -275,6 +275,13 @@
|
||||
android:textColor="#4DFFFFFF"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<include layout="@layout/auto_or_manual_btn_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="130px"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<include
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
<string name="module_och_taxi_order_cancel_tip">出现异常情况时,可选择原因无责取消订单:</string>
|
||||
<string name="module_och_taxi_order_cancel_commit">确认</string>
|
||||
<string name="module_och_taxi_order_server_start">开始服务</string>
|
||||
<string name="och_taxi_auto_txt">自驾模式</string>
|
||||
<string name="och_taxi_manual_txt">人工模式</string>
|
||||
<string name="module_och_taxi_order_server_start_wait_check">跳过乘客验证</string>
|
||||
<string name="module_och_taxi_order_server_wait_passenger_start">等待乘客开始行程</string>
|
||||
<string name="module_och_taxi_order_choose_start_autopilot_tip">请等待乘客启动自动驾驶,或您自行启动</string>
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.util.Log
|
||||
import androidx.annotation.RequiresPermission
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.toAutoPilotLine
|
||||
import com.mogo.eagle.core.data.autopilot.toRouteInfo
|
||||
@@ -29,6 +28,7 @@ import com.mogo.eagle.core.function.autopilot.adapter.MoGoHandAdasMsgManager
|
||||
import com.mogo.eagle.core.function.autopilot.server.AsyncDataToAutopilotServer
|
||||
import com.mogo.eagle.core.function.autopilot.telematic.IMsgHandler
|
||||
import com.mogo.eagle.core.function.autopilot.telematic.TeleMsgHandler
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
@@ -51,9 +51,7 @@ import com.zhidao.support.adas.high.OnMultiDeviceListener
|
||||
import com.zhidao.support.adas.high.common.Constants
|
||||
import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils
|
||||
import com.zhidao.support.adas.high.common.MessageType
|
||||
import com.zhidao.support.adas.high.common.MogoReport
|
||||
import com.zhidao.support.adas.high.subscribe.SubscribeInterfaceOptions
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
import io.netty.channel.Channel
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.autopilot.adapter
|
||||
|
||||
import android.location.Location
|
||||
import android.util.Log
|
||||
import chassis.VehicleStateOuterClass
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
@@ -310,6 +311,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
header: MessagePad.Header,
|
||||
carConfigResp: MessagePad.CarConfigResp?
|
||||
) {
|
||||
Log.d("Upgrade", "isMapLoaded = " + HdMapBuildConfig.isMapLoaded + "___carConfigResp = " + carConfigResp)
|
||||
if (HdMapBuildConfig.isMapLoaded && carConfigResp != null) {
|
||||
AppConfigInfo.plateNumber = carConfigResp.plateNumber//车牌号
|
||||
AppConfigInfo.iPCMacAddress = carConfigResp.macAddress//工控机MAC地址
|
||||
|
||||
@@ -5,13 +5,13 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
@@ -19,6 +19,8 @@ import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -60,6 +62,15 @@ public class MoGoHandAdasMsgManager implements
|
||||
private int brakeLight = -1;
|
||||
|
||||
|
||||
public void getConfig() {
|
||||
com.elegant.utils.UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerAutoPilotManager.INSTANCE.getCarConfig();
|
||||
}
|
||||
},0);
|
||||
}
|
||||
|
||||
private int setTurnLightState(int turn_light) {
|
||||
if (turn_light == 0) {
|
||||
if (isOnTurnLight) {
|
||||
@@ -106,6 +117,7 @@ public class MoGoHandAdasMsgManager implements
|
||||
@Override
|
||||
public void onAutopilotCarConfig(@NotNull MessagePad.CarConfigResp carConfigResp) {
|
||||
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.getMacAddress())) {
|
||||
Log.d("Upgrade", "onAutopilotCarConfig carConfigResp.getMacAddress() = " + carConfigResp.getMacAddress());
|
||||
CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfigResp.getMacAddress(), MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
}
|
||||
}
|
||||
@@ -166,4 +178,5 @@ public class MoGoHandAdasMsgManager implements
|
||||
public void onAutopilotBrake(float brake) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -73,7 +73,6 @@ class TeleMsgHandler : IMsgHandler {
|
||||
TextFormat.printer().escapingNonAscii(false).printToString(carConfig)
|
||||
}"
|
||||
)
|
||||
// Log.d("liyz", "TeleMsgHandler macAddress = " + carConfig.macAddress)
|
||||
CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(
|
||||
carConfig.macAddress,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
|
||||
@@ -59,12 +59,11 @@ public class UpgradeAppNetWorkManager {
|
||||
* 获取app升级信息
|
||||
*/
|
||||
public void getAppUpgradeInfo(Context context, String mac, String screenType) {
|
||||
String sn = "X20202203105S688HZ";
|
||||
// String sn = "X20202203105S688HZ";
|
||||
// String mac = "48:b0:2d:3a:bc:78";
|
||||
// String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
|
||||
int versionCode = AppUtils.getAppVersionCode();
|
||||
|
||||
//TODO 不能写死
|
||||
Log.d("Upgrade", "mac = " + mac + "---type = " + screenType + "---sn = " + sn );
|
||||
UpgradeAppRequest request = new UpgradeAppRequest(sn, mac, screenType);
|
||||
RequestBody requestBody = RequestBody.create(MediaType.get("application/json;charset=UTF-8"), GsonUtil.jsonFromObject(request));
|
||||
mUpgradeApiService.getUpgradeInfo(requestBody)
|
||||
@@ -81,7 +80,7 @@ public class UpgradeAppNetWorkManager {
|
||||
CallerLogger.INSTANCE.d(TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode());
|
||||
Log.d(TAG, "UpgradeAppInfo url = " + info.result.getAppUrl() + "----code = " + info.result.getVersionCode() + "--versionCode =" + versionCode + "--info.result = " + info.result);
|
||||
if (info.result.getVersionCode() > versionCode) {
|
||||
CallerHmiManager.INSTANCE.showUpgradeDialog(info.result.getAppUrl().substring(info.result.getAppUrl().lastIndexOf("/")+1), info.result.getAppUrl());
|
||||
CallerHmiManager.INSTANCE.showUpgradeDialog(info.result.getAppUrl().substring(info.result.getAppUrl().lastIndexOf("/")+1), info.result.getAppUrl(), info.result.getInstallTitle(), info.result.getInstallContent());
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "onNext info == null");
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.function.api.bindingcar.BindingcarCallBack;
|
||||
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingcarProvider;
|
||||
import com.mogo.eagle.core.function.appupgrade.network.UpgradeAppNetWorkManager;
|
||||
import com.mogo.eagle.core.function.bindingcar.network.BindingcarNetWorkManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.ipcupgrade.IPCUpgradeManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
@@ -57,6 +58,7 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
*/
|
||||
@Override
|
||||
public void getBindingcarInfo(String macAddress, String widevineIDWithMd5) {
|
||||
Log.d("Upgrade", "getBindingcarInfo mAddress = " + macAddress + "--widevineIDWithMd5 = " + widevineIDWithMd5);
|
||||
mAddress = macAddress;
|
||||
mWidevineIDWithMd5 = widevineIDWithMd5;
|
||||
if (getScreenType() == 1) { //司机屏
|
||||
@@ -172,7 +174,6 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
|
||||
*/
|
||||
@Override
|
||||
public void queryAppUpgrade() {
|
||||
Log.d("Upgrade", "mac = " + mAddress + "---type = " + getCarScreenType() );
|
||||
UpgradeAppNetWorkManager.getInstance().getAppUpgradeInfo(mContext, mAddress, getCarScreenType());
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ class UpgradeManager : IDownload {
|
||||
if (downloadUrl != null) {
|
||||
AppUtils.installApp(Config.downLoadPath + downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1))
|
||||
}
|
||||
|
||||
findKey(downloadUrl) {
|
||||
CallerDevaToolsUpgradeListenerManager.invokeUpgradeFinish(it)
|
||||
}
|
||||
|
||||
@@ -1306,11 +1306,11 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
/**
|
||||
* 升级app弹框
|
||||
*/
|
||||
override fun showUpgradeDialog(name: String, url: String) {
|
||||
override fun showUpgradeDialog(name: String, url: String, title: String, content: String) {
|
||||
if (upgradeAppDialog == null) {
|
||||
upgradeAppDialog = UpgradeAppDialog(requireContext())
|
||||
}
|
||||
upgradeAppDialog!!.showUpgradeAppDialog(name, url)
|
||||
upgradeAppDialog!!.showUpgradeAppDialog(name, url, title, content)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1374,6 +1374,7 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
HmiBuildConfig.isShowSnBindingView = isOpen
|
||||
}
|
||||
|
||||
private var takeOver = false
|
||||
|
||||
/**
|
||||
* 工控机监控节点上报
|
||||
@@ -1381,31 +1382,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
guardianInfo?.let {
|
||||
when (it.code) {
|
||||
EXIT_AUTOPILOT_FOR_PLANNING,
|
||||
EXIT_AUTOPILOT_FOR_LOCATION,
|
||||
EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||
EXIT_AUTOPILOT_FOR_DISTANCE -> {
|
||||
showWarningV2X(
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.content,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.tts,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
clTakeOverView.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
clTakeOverView.visibility = View.GONE
|
||||
}
|
||||
},
|
||||
true,
|
||||
6000L
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
@@ -1418,6 +1394,38 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
)
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
|
||||
if(FunctionBuildConfig.isDemoMode){
|
||||
return@let
|
||||
}
|
||||
if(takeOver){
|
||||
return@let
|
||||
}
|
||||
when (it.code) {
|
||||
EXIT_AUTOPILOT_FOR_PLANNING,
|
||||
EXIT_AUTOPILOT_FOR_LOCATION,
|
||||
EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||
EXIT_AUTOPILOT_FOR_DISTANCE -> {
|
||||
showWarningV2X(
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.content,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.tts,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
takeOver = true
|
||||
clTakeOverView.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
takeOver = false
|
||||
clTakeOverView.visibility = View.GONE
|
||||
}
|
||||
},
|
||||
true,
|
||||
6000L
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,20 +21,17 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
private val TAG = "UpgradeAppDialog"
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancleTv: TextView? = null
|
||||
private var upgradeTitleTv: TextView? = null
|
||||
private var upgradeContentTv: TextView? = null
|
||||
private var tag: String? = null
|
||||
private var downloarUrl: String? = null
|
||||
|
||||
private var mServiceApis: IMogoServiceApis? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_upgrade_app)
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
upgradeTitleTv = findViewById(R.id.tv_upgrade_title)
|
||||
upgradeContentTv = findViewById(R.id.tv_upgrade_content)
|
||||
confirmTv = findViewById(R.id.tv_upgrade_confirm)
|
||||
cancleTv = findViewById(R.id.tv_upgrade_cancel)
|
||||
|
||||
@@ -61,12 +58,16 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
super.dismiss()
|
||||
}
|
||||
|
||||
fun showUpgradeAppDialog(name: String, url: String) {
|
||||
fun showUpgradeAppDialog(name: String, url: String, title: String, content: String) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
tag = name
|
||||
downloarUrl = url
|
||||
|
||||
upgradeTitleTv?.text = title
|
||||
upgradeContentTv?.text = content
|
||||
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.text.Html
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
@@ -21,7 +22,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import chassis.Chassis
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.*
|
||||
@@ -57,7 +57,6 @@ import com.mogo.eagle.core.function.call.map.CallerSmpManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
|
||||
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
|
||||
@@ -633,33 +632,20 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 初始化 GSP数据源 数据
|
||||
rgGpsProvider.check(
|
||||
when (FunctionBuildConfig.gpsProvider) {
|
||||
0 -> {
|
||||
R.id.rbGpsProviderAndroid
|
||||
}
|
||||
1 -> {
|
||||
R.id.rbGpsProviderRTK
|
||||
}
|
||||
2 -> {
|
||||
R.id.rbGpsProviderOBU
|
||||
}
|
||||
0 -> R.id.rbGpsProviderAndroid
|
||||
1 -> R.id.rbGpsProviderRTK
|
||||
2 -> R.id.rbGpsProviderOBU
|
||||
else -> R.id.rbGpsProviderAndroid
|
||||
}
|
||||
)
|
||||
rgGpsProvider.setOnCheckedChangeListener { _, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.rbGpsProviderAndroid -> {
|
||||
FunctionBuildConfig.gpsProvider = 0
|
||||
}
|
||||
R.id.rbGpsProviderRTK -> {
|
||||
FunctionBuildConfig.gpsProvider = 1
|
||||
}
|
||||
R.id.rbGpsProviderOBU -> {
|
||||
FunctionBuildConfig.gpsProvider = 2
|
||||
}
|
||||
R.id.rbGpsProviderAndroid -> FunctionBuildConfig.gpsProvider = 0
|
||||
R.id.rbGpsProviderRTK -> FunctionBuildConfig.gpsProvider = 1
|
||||
R.id.rbGpsProviderOBU -> FunctionBuildConfig.gpsProvider = 2
|
||||
}
|
||||
}
|
||||
|
||||
@@ -690,22 +676,18 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
trackerIPCProvider.check(
|
||||
when (FunctionBuildConfig.trackerIPCProvider) {
|
||||
0 -> R.id.trackerIPCUnion
|
||||
1 -> R.id.trackerIPCObu
|
||||
2 -> R.id.trackerIPCV2N
|
||||
1 -> R.id.trackerIPC
|
||||
2 -> R.id.trackerIPCObu
|
||||
3 -> R.id.trackerIPCV2I
|
||||
else -> R.id.trackerIPCUnion
|
||||
}
|
||||
)
|
||||
trackerProvider.setOnCheckedChangeListener{ _, checkedId ->
|
||||
when(checkedId){
|
||||
R.id.trackerIPCUnion -> {
|
||||
FunctionBuildConfig.trackerIPCProvider = 0
|
||||
}
|
||||
R.id.trackerIPCObu -> {
|
||||
FunctionBuildConfig.trackerIPCProvider = 1
|
||||
}
|
||||
R.id.trackerIPCV2N -> {
|
||||
FunctionBuildConfig.trackerIPCProvider = 2
|
||||
}
|
||||
trackerIPCProvider.setOnCheckedChangeListener { _, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.trackerIPCUnion -> FunctionBuildConfig.trackerIPCProvider = 0
|
||||
R.id.trackerIPC -> FunctionBuildConfig.trackerIPCProvider = 1
|
||||
R.id.trackerIPCObu -> FunctionBuildConfig.trackerIPCProvider = 2
|
||||
R.id.trackerIPCV2I -> FunctionBuildConfig.trackerIPCProvider = 3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,16 +4,20 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Process;
|
||||
import android.util.Log;
|
||||
|
||||
import com.bytedance.boost_multidex.BoostMultiDex;
|
||||
import com.elegant.utils.UiThreadHandler;
|
||||
import com.kwai.koom.base.DefaultInitTask;
|
||||
import com.mogo.cloud.socket.SocketBuildConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoHandAdasMsgManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.notice.PushUIConstants;
|
||||
@@ -27,6 +31,7 @@ import com.mogo.map.MapApiPath;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo;
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo;
|
||||
@@ -71,12 +76,22 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
}
|
||||
|
||||
private void queryAppUpgrade() {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.e("Upgrade", "queryAppUpgrade isConnectAutopilot = " + AppConfigInfo.INSTANCE.isConnectAutopilot());
|
||||
if (AppConfigInfo.INSTANCE.isConnectAutopilot()) {
|
||||
MoGoHandAdasMsgManager.getInstance(getBaseContext()).getConfig();
|
||||
}
|
||||
}
|
||||
},8000);
|
||||
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CallerBindingcarManager.getBindingcarProvider().queryAppUpgrade();
|
||||
}
|
||||
},5000);
|
||||
},10000);
|
||||
}
|
||||
|
||||
private void checkMonitorDb() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="840px"
|
||||
android:layout_height="470px"
|
||||
android:layout_height="530px"
|
||||
android:background="@color/dialog_bg_color"
|
||||
app:roundLayoutRadius="32px">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
android:id="@+id/tv_upgrade_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50px"
|
||||
android:layout_marginTop="30px"
|
||||
android:text="@string/application_upgrade"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="56px"
|
||||
@@ -22,7 +22,7 @@
|
||||
android:id="@+id/tv_upgrade_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50px"
|
||||
android:layout_marginTop="30px"
|
||||
android:text="@string/application_upgrade_confirm"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="43px"
|
||||
@@ -30,15 +30,32 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_upgrade_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="130px"
|
||||
android:layout_marginStart="50px"
|
||||
android:layout_marginTop="20px"
|
||||
android:layout_marginEnd="50px"
|
||||
android:layout_marginBottom="15px"
|
||||
android:text=""
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="36px"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toTopOf="@id/view_horizontal_line"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_tips" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_horizontal_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2px"
|
||||
android:layout_marginTop="80px"
|
||||
android:layout_marginTop="20px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_tips" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_upgrade_content" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_vertical_line"
|
||||
|
||||
@@ -1796,6 +1796,16 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="融合全部感知数据"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/trackerIPC"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="融合感知数据"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
@@ -1811,12 +1821,12 @@
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/trackerIPCV2N"
|
||||
android:id="@+id/trackerIPCV2I"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="融合V2N感知数据"
|
||||
android:text="融合V2I感知数据"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
package com.mogo.eagle.core.function.map.identify
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.text.TextUtils
|
||||
import androidx.collection.ArraySet
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.data.traffic.threatLevelColor
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.map.MogoMarkerManager
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.*
|
||||
import mogo.telematics.pad.MessagePad.PlanningObject
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -23,20 +16,12 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* @date 2021/10/19 10:45 上午
|
||||
* 域控制器识别信息绘制
|
||||
*/
|
||||
class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
class IdentifyOriginDataDrawer : Identify {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "IdentifyDataDrawer"
|
||||
}
|
||||
|
||||
init {
|
||||
// 添加 ADAS状态 监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var mAutopilotStatus: Int = 0 //自动驾驶状态
|
||||
|
||||
/**
|
||||
* 上一帧数据的缓存
|
||||
*/
|
||||
@@ -54,58 +39,13 @@ class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
@SuppressLint("NewApi")
|
||||
private val mFilterTrafficData = HashMap<String, TrackedObject>()
|
||||
|
||||
/**
|
||||
* planning 感知物预警缓存,用于重置color状态
|
||||
*/
|
||||
private val pncWarningTrafficData = ConcurrentHashMap<String, PlanningTrack>()
|
||||
|
||||
/**
|
||||
* obu 感知物预警缓存,用于重置color状态
|
||||
*/
|
||||
private val obuWarningTrafficData = ConcurrentHashMap<String, TrafficData>()
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
override fun renderPlanningWarningObj(planningObjects: List<MessagePad.PlanningObject>?) {
|
||||
pncWarningTrafficData.clear()
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || mAutopilotStatus == 2) {
|
||||
if (planningObjects == null) {
|
||||
return
|
||||
}
|
||||
planningObjects.forEach { planningObj ->
|
||||
val trackId = planningObj.uuid.toString()
|
||||
if (mMarkersCaches.containsKey(trackId)) {
|
||||
val trackObj = mMarkersCaches[trackId]
|
||||
if (planningObj.type == 0) {
|
||||
//0是leading障碍物,障碍物车身红色提示
|
||||
trackObj?.let {
|
||||
pncWarningTrafficData[trackId] = PlanningTrack(
|
||||
"#D65D5AFF",
|
||||
CallerAutoPilotStatusListenerManager.getCurWgs84SatelliteTime()
|
||||
)
|
||||
}
|
||||
} else if (planningObj.type == 1) {
|
||||
//1是避障和择机的障碍物,障碍物车身黄色提示
|
||||
trackObj?.let {
|
||||
pncWarningTrafficData[trackId] = PlanningTrack(
|
||||
"#E4DD94FF",
|
||||
CallerAutoPilotStatusListenerManager.getCurWgs84SatelliteTime()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun renderPlanningWarningObj(planningObjects: List<PlanningObject>?) {
|
||||
WarningHelper.renderPlanningOriginWarningObj(planningObjects, mMarkersCaches)
|
||||
}
|
||||
|
||||
override fun renderOBUWarningObj(exist: Boolean, obuTrafficData: TrafficData) {
|
||||
if (obuTrafficData.uuid.isNullOrEmpty()) {
|
||||
return
|
||||
}
|
||||
if (exist) {
|
||||
obuWarningTrafficData[obuTrafficData.uuid!!] = obuTrafficData
|
||||
} else {
|
||||
obuWarningTrafficData.remove(obuTrafficData.uuid!!)
|
||||
}
|
||||
WarningHelper.renderOBUWarningObj(exist, obuTrafficData)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +69,7 @@ class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
//清除缓存
|
||||
for (data in resultList) {
|
||||
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("" + data.uuid)) {
|
||||
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type) {
|
||||
if (TrackerSourceHelper.filterData(data)) {
|
||||
continue
|
||||
}
|
||||
trafficDataUuidList.remove("" + data.uuid)
|
||||
@@ -165,7 +105,7 @@ class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
trafficDataUuidList.clear()
|
||||
for (data in trafficData) {
|
||||
// 过滤掉未知感知数据
|
||||
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type) {
|
||||
if (TrackerSourceHelper.filterData(data)) {
|
||||
continue
|
||||
}
|
||||
var temp: TrackedObject = data
|
||||
@@ -173,38 +113,8 @@ class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
//首次过来的数据不添加,首次未添加的感知物在调用完绘制方法后再塞入cache map
|
||||
val cacheData = mMarkersCaches[uuid]
|
||||
if (cacheData != null) {
|
||||
|
||||
//OBU数据颜色标记
|
||||
val first = data.trackedSourceList.stream()
|
||||
.filter { trackedSource: TrackedSource -> trackedSource.source == 4 }
|
||||
.findFirst()
|
||||
if (first.isPresent) {
|
||||
val subFirst = first.get().subSourceList.stream()
|
||||
.filter { subSource: SubSource -> subSource.source == 1 }
|
||||
.findFirst()
|
||||
if (subFirst.isPresent) {
|
||||
val subID = subFirst.get().id
|
||||
if (!TextUtils.isEmpty(subID)) {
|
||||
temp = data.toBuilder().setColor("#36D3FE").build()
|
||||
if (obuWarningTrafficData.containsKey(subID)) {
|
||||
temp = data.toBuilder()
|
||||
.setColor(obuWarningTrafficData[subID]!!.threatLevelColor())
|
||||
.build()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//预警颜色变化
|
||||
if (pncWarningTrafficData.containsKey(uuid)) {
|
||||
val planningTrack = pncWarningTrafficData[uuid]
|
||||
if (!timeOut(planningTrack!!.time)) {
|
||||
temp = data.toBuilder().setColor(planningTrack.color).build()
|
||||
} else {
|
||||
pncWarningTrafficData.remove(uuid)
|
||||
}
|
||||
}
|
||||
|
||||
val color = TrackerSourceHelper.getDefaultColor(data)
|
||||
temp = data.toBuilder().setColor(color).build()
|
||||
mFilterTrafficData[uuid] = temp
|
||||
}
|
||||
mMarkersCaches[uuid] = temp
|
||||
@@ -223,17 +133,7 @@ class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
.removeMarker(uuid)
|
||||
}
|
||||
trafficDataUuidList.clear()
|
||||
pncWarningTrafficData.clear()
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
mAutopilotStatus = autoPilotStatusInfo.state
|
||||
}
|
||||
|
||||
private fun timeOut(time: Double): Boolean {
|
||||
val duration =
|
||||
(CallerAutoPilotStatusListenerManager.getCurWgs84SatelliteTime() * 1000).toLong() - (time * 1000).toLong()
|
||||
return duration >= 500
|
||||
WarningHelper.clear()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,8 +9,6 @@ import androidx.annotation.RequiresApi;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficDataKt;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
@@ -22,7 +20,6 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -64,57 +61,13 @@ public class TrackManager {
|
||||
@SuppressLint("NewApi")
|
||||
private final HashMap<String, MessagePad.TrackedObject> mFilterTrafficData = new HashMap<>();
|
||||
|
||||
//感知物预警各自先以帧数更新保持,不做同一个集合的融合处理(以卫星时间做判断先后,可能会出现不同ip节点间的回溯问题)
|
||||
/**
|
||||
* planning 感知物预警缓存,用于重置color状态
|
||||
*/
|
||||
private final ConcurrentHashMap<String, PlanningTrack> pncWarningTrafficData = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* obu 感知物预警缓存,用于重置color状态
|
||||
*/
|
||||
private final ConcurrentHashMap<String, TrafficData> obuWarningTrafficData = new ConcurrentHashMap<>();
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public synchronized void renderPlanningWarningObj(List<MessagePad.PlanningObject> planningObjects) {
|
||||
pncWarningTrafficData.clear();
|
||||
//处于美化模式或者自动驾驶状态下展示
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() == 2) {
|
||||
if (planningObjects == null) {
|
||||
return;
|
||||
}
|
||||
planningObjects.forEach(planningObj -> {
|
||||
String trackId = "" + planningObj.getUuid();
|
||||
if (mMarkersCaches.containsKey(trackId)) {
|
||||
TrackObj trackObj = mMarkersCaches.get(trackId);
|
||||
if (trackObj == null) {
|
||||
return;
|
||||
}
|
||||
if (planningObj.getType() == 0) {
|
||||
pncWarningTrafficData.put(trackId, new PlanningTrack(
|
||||
"#D65D5AFF",
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84SatelliteTime()
|
||||
));
|
||||
} else if (planningObj.getType() == 1) {
|
||||
pncWarningTrafficData.put(trackId, new PlanningTrack(
|
||||
"#E4DD94FF",
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84SatelliteTime()
|
||||
));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
WarningHelper.INSTANCE.renderPlanningWarningObj(planningObjects, mMarkersCaches);
|
||||
}
|
||||
|
||||
public synchronized void renderOBUWarningObj(boolean exist, TrafficData obuTrafficData) {
|
||||
if (obuTrafficData.getUuid() == null || obuTrafficData.getUuid().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (exist) {
|
||||
obuWarningTrafficData.put(obuTrafficData.getUuid(), obuTrafficData);
|
||||
} else {
|
||||
obuWarningTrafficData.remove(obuTrafficData.getUuid());
|
||||
}
|
||||
WarningHelper.INSTANCE.renderOBUWarningObj(exist, obuTrafficData);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,39 +79,14 @@ public class TrackManager {
|
||||
mFilterTrafficData.clear();
|
||||
//进入过滤机制的感知物体,首先从缓存队列中进行查找 uuid
|
||||
for (MessagePad.TrackedObject data : trafficData) {
|
||||
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && data.getType() == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.getType()) {
|
||||
if (TrackerSourceHelper.INSTANCE.filterData(data)) {
|
||||
continue;
|
||||
}
|
||||
String uuid = "" + data.getUuid();
|
||||
TrackObj trackObj = mMarkersCaches.get(uuid);
|
||||
|
||||
//OBU数据颜色标记
|
||||
Optional<MessagePad.TrackedSource> first = data.getTrackedSourceList().stream()
|
||||
.filter(trackedSource -> trackedSource.getSource() == 4).findFirst();
|
||||
if (first.isPresent()) {
|
||||
Optional<MessagePad.SubSource> subFirst = first.get().getSubSourceList().stream().filter(subSource -> subSource.getSource() == 1).findFirst();
|
||||
if (subFirst.isPresent()) {
|
||||
String subID = subFirst.get().getId();
|
||||
if (!TextUtils.isEmpty(subID)) {
|
||||
data = data.toBuilder().setColor("#36D3FE").build();
|
||||
if (obuWarningTrafficData.containsKey(subID)) {
|
||||
data = data.toBuilder()
|
||||
.setColor(TrafficDataKt.threatLevelColor(obuWarningTrafficData.get(subID)))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 判断物体是否与预警信息
|
||||
if (pncWarningTrafficData.containsKey(uuid)) {
|
||||
PlanningTrack planningTrack = pncWarningTrafficData.get(uuid);
|
||||
if (planningTrack != null && !timeOut(planningTrack.getTime())) {
|
||||
data = data.toBuilder().setColor(planningTrack.getColor()).build();
|
||||
} else {
|
||||
pncWarningTrafficData.remove(uuid);
|
||||
}
|
||||
}
|
||||
String color = TrackerSourceHelper.INSTANCE.getDefaultColor(data);
|
||||
data = data.toBuilder().setColor(color).build();
|
||||
|
||||
if (trackObj != null) {
|
||||
trackObj.updateObj(data);
|
||||
@@ -178,7 +106,7 @@ public class TrackManager {
|
||||
if (cache != null) {
|
||||
//相对静止物体并且非obu数据,则不改变,为感知融合同位置物体,使用缓存数据做覆盖
|
||||
if (cacheTrack.relativeStatic()) {
|
||||
if(data.getColor()!= null && !data.getColor().isEmpty()){
|
||||
if (data.getColor() != null && !data.getColor().isEmpty()) {
|
||||
cache = cache.toBuilder().setColor(data.getColor()).build();
|
||||
}
|
||||
data = cache;
|
||||
@@ -206,7 +134,7 @@ public class TrackManager {
|
||||
//过滤现有元素
|
||||
for (MessagePad.TrackedObject data : resultList) {
|
||||
String uuid = "" + data.getUuid();
|
||||
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && data.getType() == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.getType()) {
|
||||
if (TrackerSourceHelper.INSTANCE.filterData(data)) {
|
||||
continue;
|
||||
}
|
||||
if (trafficDataUuid.size() > 0) {
|
||||
@@ -234,13 +162,8 @@ public class TrackManager {
|
||||
@SuppressLint("NewApi")
|
||||
public void clearAll() {
|
||||
trafficDataUuid.clear();
|
||||
pncWarningTrafficData.clear();
|
||||
WarningHelper.INSTANCE.clear();
|
||||
mMarkersCaches.forEach((uuid, trackObj) -> removeKey(uuid));
|
||||
}
|
||||
|
||||
private Boolean timeOut(Double time) {
|
||||
long duration = (long) (CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84SatelliteTime() * 1000) - (long) (time * 1000);
|
||||
return duration >= 500;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.mogo.eagle.core.function.map.identify
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import mogo.telematics.pad.MessagePad.*
|
||||
|
||||
object TrackerSourceHelper {
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
fun filterData(data: TrackedObject): Boolean {
|
||||
if (!FunctionBuildConfig.isDrawUnknownIdentifyData
|
||||
&& data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
|
||||
) {
|
||||
return true
|
||||
}
|
||||
var trackIPCFilter = true
|
||||
when (FunctionBuildConfig.trackerIPCProvider) {
|
||||
0 -> trackIPCFilter = false
|
||||
1 -> if (isIPC(data)) {
|
||||
trackIPCFilter = false
|
||||
}
|
||||
2 -> {
|
||||
if (isObu(data).second) {
|
||||
trackIPCFilter = false
|
||||
}
|
||||
}
|
||||
3 -> {
|
||||
if (isV2I(data).second) {
|
||||
trackIPCFilter = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return trackIPCFilter
|
||||
}
|
||||
|
||||
fun getDefaultColor(data: TrackedObject): String {
|
||||
var color = ""
|
||||
if (!FunctionBuildConfig.isDrawUnknownIdentifyData
|
||||
&& data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
|
||||
) {
|
||||
return ""
|
||||
}
|
||||
|
||||
if (isV2I(data).second) {
|
||||
color = "#00AEFF"
|
||||
}
|
||||
|
||||
//等级最高
|
||||
if (isObu(data).second) {
|
||||
color = "#36D3FE"
|
||||
// obu预警
|
||||
isObu(data).first?.let {
|
||||
val obuColor = WarningHelper.getObuColor(it.id)
|
||||
if (obuColor.isNotBlank()) {
|
||||
color = obuColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// pnc预警
|
||||
val pncColor = WarningHelper.getPncColor(data.uuid.toString())
|
||||
if (pncColor.isNotBlank()) {
|
||||
color = pncColor
|
||||
}
|
||||
return color
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤所有 工控感知数据 all match
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
fun isIPC(data: TrackedObject): Boolean {
|
||||
val source = data.trackedSourceList.stream().allMatch {
|
||||
it.source != 4
|
||||
}
|
||||
return source
|
||||
}
|
||||
|
||||
/**
|
||||
* any match 任何一个匹配到OBU,则认为是存在obu数据
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
fun isObu(data: TrackedObject): Pair<SubSource?, Boolean> {
|
||||
val source = data.trackedSourceList.stream().anyMatch {
|
||||
it.source == 4
|
||||
}
|
||||
if (source) {
|
||||
val first = data.trackedSourceList.stream()
|
||||
.filter { trackedSource: TrackedSource -> trackedSource.source == 4 }.findFirst()
|
||||
if (first.isPresent) {
|
||||
val subObu = first.get().subSourceList.stream().anyMatch {
|
||||
it.source == 1
|
||||
}
|
||||
if (subObu) {
|
||||
val subFirst = first.get().subSourceList.stream()
|
||||
.filter { subSource: SubSource -> subSource.source == 1 }
|
||||
.findFirst()
|
||||
if (subFirst.isPresent) {
|
||||
return Pair(subFirst.get(), true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Pair(null, false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤所有 v2i 感知数据 all match
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
fun isV2I(data: TrackedObject): Pair<SubSource?, Boolean> {
|
||||
val source = data.trackedSourceList.stream().allMatch {
|
||||
it.source == 4
|
||||
}
|
||||
if (source) {
|
||||
val first = data.trackedSourceList.stream()
|
||||
.filter { trackedSource: TrackedSource -> trackedSource.source == 4 }.findFirst()
|
||||
if (first.isPresent) {
|
||||
val subV2I = first.get().subSourceList.stream().allMatch {
|
||||
it.source == 6
|
||||
}
|
||||
if (subV2I) {
|
||||
val subFirst = first.get().subSourceList.stream()
|
||||
.filter { subSource: SubSource -> subSource.source == 6 }
|
||||
.findFirst()
|
||||
if (subFirst.isPresent) {
|
||||
return Pair(subFirst.get(), true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Pair(null, false)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.mogo.eagle.core.function.map.identify
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.data.traffic.threatLevelColor
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84SatelliteTime
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.PlanningObject
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.function.Consumer
|
||||
|
||||
object WarningHelper {
|
||||
|
||||
//感知物预警各自先以帧数更新保持,不做同一个集合的融合处理(以卫星时间做判断先后,可能会出现不同ip节点间的回溯问题)
|
||||
/**
|
||||
* planning 感知物预警缓存,用于重置color状态
|
||||
*/
|
||||
private val pncWarningBeautyTrafficData = ConcurrentHashMap<String, PlanningTrack>()
|
||||
|
||||
/**
|
||||
* planning 感知物预警缓存,用于重置color状态
|
||||
*/
|
||||
private val pncWarningOriginTrafficData = ConcurrentHashMap<String, PlanningTrack>()
|
||||
|
||||
/**
|
||||
* obu 感知物预警缓存,用于重置color状态
|
||||
*/
|
||||
private val obuWarningTrafficData = ConcurrentHashMap<String, TrafficData>()
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
fun renderPlanningWarningObj(
|
||||
planningObjects: List<PlanningObject>?,
|
||||
mMarkersCaches: ConcurrentHashMap<String, TrackObj>
|
||||
) {
|
||||
pncWarningBeautyTrafficData.clear()
|
||||
//处于美化模式或者自动驾驶状态下展示
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || getAutoPilotStatusInfo().state == 2) {
|
||||
if (planningObjects == null) {
|
||||
return
|
||||
}
|
||||
planningObjects.forEach(Consumer { planningObj: PlanningObject ->
|
||||
val trackId = "" + planningObj.uuid
|
||||
if (mMarkersCaches.containsKey(trackId)) {
|
||||
mMarkersCaches[trackId] ?: return@Consumer
|
||||
if (planningObj.type == 0) { //0是leading障碍物,障碍物车身红色提示
|
||||
pncWarningBeautyTrafficData[trackId] = PlanningTrack(
|
||||
"#D65D5AFF",
|
||||
getCurWgs84SatelliteTime()
|
||||
)
|
||||
} else if (planningObj.type == 1) { //1是避障和择机的障碍物,障碍物车身黄色提示
|
||||
pncWarningBeautyTrafficData[trackId] = PlanningTrack(
|
||||
"#E4DD94FF",
|
||||
getCurWgs84SatelliteTime()
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
fun renderPlanningOriginWarningObj(
|
||||
planningObjects: List<PlanningObject>?,
|
||||
mMarkersCaches: ConcurrentHashMap<String, MessagePad.TrackedObject>
|
||||
) {
|
||||
pncWarningOriginTrafficData.clear()
|
||||
//处于美化模式或者自动驾驶状态下展示
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || getAutoPilotStatusInfo().state == 2) {
|
||||
if (planningObjects == null) {
|
||||
return
|
||||
}
|
||||
planningObjects.forEach(Consumer { planningObj: PlanningObject ->
|
||||
val trackId = "" + planningObj.uuid
|
||||
if (mMarkersCaches.containsKey(trackId)) {
|
||||
mMarkersCaches[trackId] ?: return@Consumer
|
||||
if (planningObj.type == 0) { //0是leading障碍物,障碍物车身红色提示
|
||||
pncWarningOriginTrafficData[trackId] = PlanningTrack(
|
||||
"#D65D5AFF",
|
||||
getCurWgs84SatelliteTime()
|
||||
)
|
||||
} else if (planningObj.type == 1) { //1是避障和择机的障碍物,障碍物车身黄色提示
|
||||
pncWarningOriginTrafficData[trackId] = PlanningTrack(
|
||||
"#E4DD94FF",
|
||||
getCurWgs84SatelliteTime()
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fun renderOBUWarningObj(exist: Boolean, obuTrafficData: TrafficData) {
|
||||
if (obuTrafficData.uuid == null || obuTrafficData.uuid!!.isEmpty()) {
|
||||
return
|
||||
}
|
||||
if (exist) {
|
||||
obuWarningTrafficData[obuTrafficData.uuid!!] = obuTrafficData
|
||||
} else {
|
||||
obuWarningTrafficData.remove(obuTrafficData.uuid)
|
||||
}
|
||||
}
|
||||
|
||||
fun getObuColor(uuid: String): String {
|
||||
if (obuWarningTrafficData.containsKey(uuid)) {
|
||||
return obuWarningTrafficData[uuid]!!.threatLevelColor()
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
fun getPncColor(uuid: String): String {
|
||||
if (FunctionBuildConfig.isBeautyMode) {
|
||||
// 判断物体是否有预警信息
|
||||
if (pncWarningBeautyTrafficData.containsKey(uuid)) {
|
||||
val planningTrack = pncWarningBeautyTrafficData[uuid]
|
||||
if (planningTrack != null && !timeOut(planningTrack.time)) {
|
||||
return planningTrack.color
|
||||
} else {
|
||||
pncWarningBeautyTrafficData.remove(uuid)
|
||||
}
|
||||
}
|
||||
return ""
|
||||
} else {
|
||||
// 判断物体是否有预警信息
|
||||
if (pncWarningOriginTrafficData.containsKey(uuid)) {
|
||||
val planningTrack = pncWarningOriginTrafficData[uuid]
|
||||
if (planningTrack != null && !timeOut(planningTrack.time)) {
|
||||
return planningTrack.color
|
||||
} else {
|
||||
pncWarningOriginTrafficData.remove(uuid)
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
pncWarningBeautyTrafficData.clear()
|
||||
pncWarningOriginTrafficData.clear()
|
||||
obuWarningTrafficData.clear()
|
||||
}
|
||||
|
||||
private fun timeOut(time: Double): Boolean {
|
||||
val duration = (getCurWgs84SatelliteTime() * 1000).toLong() - (time * 1000).toLong()
|
||||
return duration >= 500
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ object FunctionBuildConfig {
|
||||
var debugTrackerProvider = 0
|
||||
|
||||
/**
|
||||
* 感知物识别使用的数据来源 0 = 默认输出 1 = 只显示工控硬件数据感知来源 2 = 只显示V2V数据来源 3 = 只显示V2N数据来源
|
||||
* 感知物识别使用的数据来源 0 = 默认输出 1 = 只显示工控硬件数据感知来源 2 = 只显示V2V数据来源 3 = 只显示V2I数据来源
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
|
||||
@@ -222,7 +222,7 @@ interface IMoGoWaringProvider : IMoGoHmiViewProxy {
|
||||
/**
|
||||
* 展示升级app弹框
|
||||
*/
|
||||
fun showUpgradeDialog(name: String, url: String)
|
||||
fun showUpgradeDialog(name: String, url: String, title: String, content: String)
|
||||
|
||||
/**
|
||||
* 呈现工控机升级确认框
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.devatools
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import com.mogo.eagle.core.data.config.*
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
@@ -145,6 +146,7 @@ object CallerDevaToolsManager {
|
||||
*/
|
||||
fun downLoadPackage(downloadKey: String, downloadUrl: String) {
|
||||
devaToolsProviderApi?.downLoadPackage(downloadKey, downloadUrl)
|
||||
// devaToolsProviderApi?.downLoadPackage("IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk", "https://scm-1255510688.cos.ap-beijing.myqcloud.com/test/com.mogo.launcher.f/2.9.0.1002/IntelligentPilot_v2.9.0.1002_20220725_[fPadLenovoOchBus-launcher-qa]_debug.apk")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -292,8 +292,8 @@ object CallerHmiManager : CallerBase() {
|
||||
waringProviderApi?.showModifyBindingcarDialog()
|
||||
}
|
||||
|
||||
fun showUpgradeDialog(name: String, url: String) {
|
||||
waringProviderApi?.showUpgradeDialog(name, url)
|
||||
fun showUpgradeDialog(name: String, url: String, title: String, content: String) {
|
||||
waringProviderApi?.showUpgradeDialog(name, url, title, content)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -154,11 +154,9 @@ public class DownloadService implements InitThread.InitCallBack, DownloadCallBac
|
||||
|
||||
@Override
|
||||
public void threadDownLoadFinished(String url, ThreadBean threadBean) {
|
||||
Log.e(DOWN_LOAD_TAG, "threadDownLoadFinished 1 : " + url);
|
||||
IDownload iDownload = callBacks.get(url);
|
||||
Log.d(DOWN_LOAD_TAG, "iDownload = " + iDownload);
|
||||
if (iDownload != null) {
|
||||
Log.e(DOWN_LOAD_TAG, "threadDownLoadFinished 2 : " + url);
|
||||
iDownload.onFinished(url, threadBean);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.mogo.eagle.core.utilcode.breakpoint.thread;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.breakpoint.Config.DOWN_LOAD_TAG;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.bean.FileBean;
|
||||
import com.mogo.eagle.core.utilcode.breakpoint.event.DownloadData;
|
||||
|
||||
@@ -41,6 +45,7 @@ public class InitThread extends Thread {
|
||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
|
||||
fileLength = connection.getContentLength();
|
||||
}
|
||||
Log.d(DOWN_LOAD_TAG, "InitThread fileLength = " + fileLength + "---connection.getResponseCode() = " + connection.getResponseCode());
|
||||
if (fileLength <= 0) return;
|
||||
File dir = new File(fileBean.getSavePath());
|
||||
if (!dir.exists()) {
|
||||
@@ -52,6 +57,7 @@ public class InitThread extends Thread {
|
||||
fileBean.setLength(fileLength);
|
||||
this.initCallBack.initSuccess(fileBean);
|
||||
} catch (Exception e) {
|
||||
Log.e(DOWN_LOAD_TAG, "InitThread e = " + e);
|
||||
DownloadData downloadData = new DownloadData();
|
||||
downloadData.setUrl(fileBean.getUrl());
|
||||
downloadData.setMsg(e.getMessage());
|
||||
|
||||
@@ -13,6 +13,7 @@ import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_CONNEC
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -363,8 +363,8 @@ enum class EventTypeEnum(
|
||||
tts = ""
|
||||
),
|
||||
|
||||
TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯请优先通行"),
|
||||
TYPE_VIP_ERROR_IDENTIFICATION("10023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败请稍后重试"),
|
||||
TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯,请优先通行"),
|
||||
TYPE_VIP_ERROR_IDENTIFICATION("10023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败,请稍后重试"),
|
||||
|
||||
TYPE_OPTIMAL_ROUTE_RECOMMEND("2000", "", "", R.drawable.icon_warning_v2x_optimal_route, "为您推荐最优路线", "已为您选择最优路线");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user