[清扫车]删除无用的代码和资源文件
@@ -1,9 +0,0 @@
|
||||
package com.mogo.och.sweeper.callback;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface ISlidePannelHideCallback {
|
||||
void hideSlidePanel();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.mogo.och.sweeper.callback;
|
||||
|
||||
import com.mogo.och.sweeper.bean.SweeperQueryLinesResponse;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public interface ISweeperLinesCallback {
|
||||
void onBusLinesChange(SweeperQueryLinesResponse lines);
|
||||
void onChangeLineIdSuccess();
|
||||
}
|
||||
@@ -27,14 +27,6 @@ class SweeperConst {
|
||||
|
||||
// 测试用的广播
|
||||
const val BROADCAST_TEST_SWEEPER_CONTROL_TYPE_EXTRA_KEY = "sceneType"
|
||||
// 无状态
|
||||
const val STATION_STATUS_IDLE = 0
|
||||
// 已过站(历史站)
|
||||
const val STATION_STATUS_LEAVING = 1
|
||||
// 到站(当前站)
|
||||
const val STATION_STATUS_STOPPED = 2
|
||||
// 未到站(未到站)
|
||||
const val STATION_STATUS_ARRIVING = 3
|
||||
|
||||
// 上报心跳轮询ms
|
||||
const val LOOP_PERIOD_60S = 60 * 1000L
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
package com.mogo.och.sweeper.model;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.sweeper.bean.SweeperQueryLinesResponse;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutesResponse;
|
||||
import com.mogo.och.sweeper.callback.ISweeperLinesCallback;
|
||||
import com.mogo.och.sweeper.net.SweeperServiceManager;
|
||||
import com.mogo.och.sweeper.net.ISweeperServiceCallback;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public class SweeperLineModel {
|
||||
private static volatile SweeperLineModel sInstance;
|
||||
private Context mContext;
|
||||
private ISweeperLinesCallback mBusLinesCallback;
|
||||
public static SweeperLineModel getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( SweeperLineModel.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new SweeperLineModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
private SweeperLineModel() {
|
||||
|
||||
}
|
||||
public void init() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
}
|
||||
public void setBusLinesCallback(ISweeperLinesCallback callback){
|
||||
mBusLinesCallback = callback;
|
||||
}
|
||||
public void queryBusLines(){
|
||||
SweeperServiceManager.getInstance().queryBusLines(mContext, new ISweeperServiceCallback<SweeperQueryLinesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperQueryLinesResponse data) {
|
||||
if (null == data && mBusLinesCallback != null) {
|
||||
mBusLinesCallback.onBusLinesChange(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mBusLinesCallback != null){
|
||||
mBusLinesCallback.onBusLinesChange(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else {
|
||||
ToastUtils.showShort("查询所有绑定路线失败:"+failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void commitSwitchLineId(int lineId){
|
||||
SweeperServiceManager.getInstance().resetStationStatus(mContext,lineId, new ISweeperServiceCallback<SweeperRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperRoutesResponse o) {
|
||||
if (mBusLinesCallback != null){
|
||||
mBusLinesCallback.onChangeLineIdSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
}else {
|
||||
ToastUtils.showShort("切换路线失败:"+failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,6 @@
|
||||
package com.mogo.och.sweeper.model;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
import static com.mogo.och.sweeper.constant.SweeperConst.STATION_STATUS_STOPPED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
@@ -15,7 +9,6 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
@@ -28,35 +21,31 @@ import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.sweeper.bean.QueryLeaveAwayPassengersResponse;
|
||||
import com.mogo.och.sweeper.bean.SweeperOperationStatusResponse;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutesResponse;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutesResult;
|
||||
import com.mogo.och.sweeper.bean.SweeperStationBean;
|
||||
import com.mogo.och.sweeper.callback.ICarOperationStatusCallback;
|
||||
import com.mogo.och.sweeper.callback.IRefreshSweeperStationsCallback;
|
||||
import com.mogo.och.sweeper.callback.ISlidePannelHideCallback;
|
||||
import com.mogo.och.sweeper.callback.ISweeperControllerStatusCallback;
|
||||
import com.mogo.och.sweeper.constant.SweeperConst;
|
||||
import com.mogo.och.sweeper.net.ISweeperServiceCallback;
|
||||
import com.mogo.och.sweeper.net.SweeperServiceManager;
|
||||
import com.mogo.och.sweeper.presenter.SweeperModelLoopManager;
|
||||
import com.mogo.och.sweeper.util.SweeperAnalyticsManager;
|
||||
import com.mogo.och.sweeper.util.SweeperTrajectoryManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import io.reactivex.exceptions.UndeliverableException;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.plugins.RxJavaPlugins;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/23
|
||||
@@ -67,10 +56,6 @@ public class SweeperOrderModel {
|
||||
private final String TAG = SweeperOrderModel.class.getSimpleName();
|
||||
private int currentLineId = -1;
|
||||
private int backgroundCurrentStationIndex = 0;//A->B 此处值是A站点索引
|
||||
/**
|
||||
* 运营状态、后端更具运营状态来判断车辆是否派单
|
||||
*/
|
||||
private boolean mIsWorking = false;
|
||||
private static volatile SweeperOrderModel sInstance;
|
||||
public double mLongitude = 0;
|
||||
public double mLatitude = 0;
|
||||
@@ -81,14 +66,9 @@ public class SweeperOrderModel {
|
||||
* 用来表示是否正在开往下一站
|
||||
*/
|
||||
private boolean isGoingToNextStation = false;
|
||||
// 运营类型
|
||||
private static final int VEHICLE_TYPE = 10;
|
||||
private static final int MSG_QUERY_BUS_STATION = 1001;
|
||||
private static final long QUERY_BUS_STATION_DELAY = 5000;
|
||||
|
||||
private ICarOperationStatusCallback carOperationStatusCallback;
|
||||
private IRefreshSweeperStationsCallback refreshBusStationsCallback;
|
||||
private ISlidePannelHideCallback slidePannelHideCallback;
|
||||
private boolean mIsWorking = false;
|
||||
|
||||
private ISweeperControllerStatusCallback mControllerStatusCallback; //Model->Presenter:VR mode等
|
||||
|
||||
List<SweeperRoutePlanningUpdateReqBean.Result> points = new ArrayList<>();//全路径信息
|
||||
@@ -97,14 +77,6 @@ public class SweeperOrderModel {
|
||||
|
||||
private volatile boolean isArrivedStation = false;
|
||||
|
||||
private final Handler handler = new Handler(msg -> {
|
||||
if (msg.what == MSG_QUERY_BUS_STATION) {
|
||||
SweeperOrderModel.getInstance().querySweeperRoutes();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
public static SweeperOrderModel getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (SweeperOrderModel.class) {
|
||||
@@ -119,11 +91,13 @@ public class SweeperOrderModel {
|
||||
private SweeperOrderModel() {
|
||||
|
||||
}
|
||||
|
||||
public boolean isGoingToNextStation() {
|
||||
return isGoingToNextStation;
|
||||
}
|
||||
public void init() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener);
|
||||
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
@@ -169,19 +143,6 @@ public class SweeperOrderModel {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void setCarOperationStatusCallback(ICarOperationStatusCallback callback) {
|
||||
this.carOperationStatusCallback = callback;
|
||||
}
|
||||
|
||||
public void setRefreshBusStationsCallback(IRefreshSweeperStationsCallback callback) {
|
||||
this.refreshBusStationsCallback = callback;
|
||||
}
|
||||
|
||||
public void setSlidePannelHideCallback(ISlidePannelHideCallback callback) {
|
||||
this.slidePannelHideCallback = callback;
|
||||
}
|
||||
|
||||
public void setControllerStatusCallback(ISweeperControllerStatusCallback callback) {
|
||||
this.mControllerStatusCallback = callback;
|
||||
}
|
||||
@@ -199,7 +160,8 @@ public class SweeperOrderModel {
|
||||
|
||||
};
|
||||
|
||||
public static List<SweeperRoutePlanningUpdateReqBean.Result> coordinateConverterWgsToGcjList(Context mContext, List<MessagePad.Location> mogoLatLngList) {
|
||||
public static List<SweeperRoutePlanningUpdateReqBean.Result> coordinateConverterWgsToGcjList(Context mContext,
|
||||
List<MessagePad.Location> mogoLatLngList) {
|
||||
List<SweeperRoutePlanningUpdateReqBean.Result> points = new ArrayList<>();
|
||||
for (MessagePad.Location m : mogoLatLngList) {
|
||||
LatLng mogoLatLng = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(mContext, m);
|
||||
@@ -248,7 +210,7 @@ public class SweeperOrderModel {
|
||||
startOrStopOrderLoop(false);
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
// 注销定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG,false);
|
||||
CallerMapLocationListenerManager.INSTANCE.removeListener(TAG, false);
|
||||
|
||||
//自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
@@ -290,7 +252,7 @@ public class SweeperOrderModel {
|
||||
};
|
||||
|
||||
//根据围栏判断,是否到达起点
|
||||
private void judgeStartStation(MessagePad.GnssInfo location) {
|
||||
private void judgeStartStation(MessagePad.GnssInfo location) {
|
||||
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
|
||||
return;
|
||||
@@ -312,121 +274,11 @@ public class SweeperOrderModel {
|
||||
}
|
||||
|
||||
if (distance <= SweeperConst.ARRIVE_AT_END_STATION_DISTANCE) {
|
||||
onArriveAt(null); //无自动驾驶到站信息传null
|
||||
//onArriveAt(null); //无自动驾驶到站信息传null
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小巴路线
|
||||
*/
|
||||
public void querySweeperRoutes() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "查询小巴路线");
|
||||
SweeperServiceManager.getInstance().queryBusRoutes(mContext, new ISweeperServiceCallback<SweeperRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperRoutesResponse data) {
|
||||
if (data == null
|
||||
|| data.getResult() == null
|
||||
|| data.getResult().getSites() == null
|
||||
|| data.getResult().getSites().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data);
|
||||
renderBusStationsStatus(data.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
// 重复请求小巴路线,直至成功
|
||||
queryBusStationDelay();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试、重置站点状态
|
||||
*/
|
||||
public void debugResetStationStatus() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "测试、重置站点状态");
|
||||
SweeperServiceManager.getInstance().resetStationStatus(mContext, currentLineId
|
||||
, new ISweeperServiceCallback<SweeperRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperRoutesResponse o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + o);
|
||||
isGoingToNextStation = false;
|
||||
if (o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
renderBusStationsStatus(o.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
// 重复请求小巴路线,直至成功
|
||||
queryBusStationDelay();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 离站上报
|
||||
*/
|
||||
public void leaveStation(boolean isOneWayOver, boolean isRestart) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
|
||||
SweeperServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq()
|
||||
, stationList.get(backgroundCurrentStationIndex).getSiteId(), new ISweeperServiceCallback<SweeperRoutesResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperRoutesResponse 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();
|
||||
querySweeperRoutes();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
} else {
|
||||
ToastUtils.showShort("离站上报失败:" + failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 离站上报成功后渲染站点
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
|
||||
*/
|
||||
private void leaveStationSuccess(SweeperRoutesResult result, boolean isRestart) {
|
||||
renderBusStationsStatus(result);
|
||||
if (slidePannelHideCallback != null) {
|
||||
slidePannelHideCallback.hideSlidePanel();
|
||||
}
|
||||
//开启自动驾驶
|
||||
startAutopilot(isRestart);
|
||||
if (isGoingToNextStation) {
|
||||
// 为了避免恢复自动驾驶时重复的接口请求
|
||||
return;
|
||||
}
|
||||
isGoingToNextStation = true;
|
||||
AIAssist.getInstance(mContext).speakTTSVoice("欢迎乘坐’蘑菇车联‘无人驾驶小巴车,请您坐好,注意乘车安全,行程即将开始");
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*
|
||||
@@ -474,80 +326,9 @@ public class SweeperOrderModel {
|
||||
mControllerStatusCallback.startOpenAutopilot();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 到站后重置站点状态
|
||||
*/
|
||||
private void arriveSiteStation(boolean isRestart) {
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) { //到站短时间内调用多次
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "数组越界");
|
||||
return;
|
||||
}
|
||||
int arrivedStationIndex = 0;
|
||||
if (!isRestart) {
|
||||
arrivedStationIndex = backgroundCurrentStationIndex + 1;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
|
||||
|
||||
SweeperServiceManager.getInstance().arriveSiteStation(mContext
|
||||
, stationList.get(arrivedStationIndex).getSeq(), stationList.get(arrivedStationIndex).getSiteId()
|
||||
, new ISweeperServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation success");
|
||||
if (!isRestart) {
|
||||
renderArriveBusStation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
// if (!NetworkUtils.isConnected(mContext)) {
|
||||
// ToastUtils.showShort("网络异常,请稍后重试");
|
||||
// }else {
|
||||
// ToastUtils.showShort("离站上报失败:"+failMsg);
|
||||
// }
|
||||
|
||||
}
|
||||
});
|
||||
public boolean isWorking() {
|
||||
return mIsWorking;
|
||||
}
|
||||
|
||||
private void renderArriveBusStation() {
|
||||
List<SweeperStationBean> site = sweeperRoutesResult.getSites();
|
||||
if (site != null && site.size() > 0) {
|
||||
backgroundCurrentStationIndex++;
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.refreshBusStations(sweeperRoutesResult.getName(), stationList, backgroundCurrentStationIndex
|
||||
, getNextStopStation(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 收车
|
||||
*/
|
||||
public void stopTakeOrder() {
|
||||
SweeperServiceManager.getInstance().stopTakeOrder(mContext, new ISweeperServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
mIsWorking = !mIsWorking;
|
||||
closeBeautificationMode();
|
||||
carOperationStatusCallback.changeOperationStatus(isWorking());
|
||||
startOrStopOrderLoop(mIsWorking);
|
||||
SweeperTrajectoryManager.getInstance().stopTrajReqLoop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
} else {
|
||||
ToastUtils.showShort("收车失败:" + failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭美化模式
|
||||
*/
|
||||
@@ -558,168 +339,6 @@ public class SweeperOrderModel {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false(收车)");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 出车
|
||||
*/
|
||||
public void startTakeOrder() {
|
||||
SweeperServiceManager.getInstance().startTakeOrder(mContext, new ISweeperServiceCallback<BaseData>() {
|
||||
@Override
|
||||
public void onSuccess(BaseData o) {
|
||||
mIsWorking = !mIsWorking;
|
||||
startOrStopOrderLoop(mIsWorking);
|
||||
if (stationList != null && stationList.size() > 0) {
|
||||
AIAssist.getInstance(mContext).speakTTSVoice("车辆已整备完毕,请前往"
|
||||
+ stationList.get(backgroundCurrentStationIndex).getName() + "站点");
|
||||
}
|
||||
carOperationStatusCallback.changeOperationStatus(isWorking());
|
||||
querySweeperRoutes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
} else {
|
||||
ToastUtils.showShort("出车失败:" + failMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运营状态
|
||||
*/
|
||||
public void queryOperationStatus() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "查询运营状态");
|
||||
SweeperServiceManager.getInstance().queryOperationStatus(mContext
|
||||
, new ISweeperServiceCallback<SweeperOperationStatusResponse>() {
|
||||
@Override
|
||||
public void onSuccess(SweeperOperationStatusResponse o) {
|
||||
if (o.data != null) {
|
||||
mIsWorking = o.data.serviceStatus == 1;
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "查询运营状态 result.status: " + o.data.serviceStatus);
|
||||
startOrStopOrderLoop(mIsWorking);
|
||||
}
|
||||
carOperationStatusCallback.changeOperationStatus(isWorking());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(String failMsg) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
} else {
|
||||
ToastUtils.showShort("出车收车状态查询:" + failMsg);
|
||||
}
|
||||
// queryOperationStatus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶到下一站
|
||||
*/
|
||||
public void autoDriveToNextStation(boolean isRestart) {
|
||||
// if ( backgroundCurrentStationIndex >= stationList.size() - 1 ) {
|
||||
// // 当前站是最后一站,结束当前行程
|
||||
// travelOver();
|
||||
// return;
|
||||
// }
|
||||
// leaveStation(false,isRestart);
|
||||
startAutopilot(isRestart);
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染站点信息
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示 离开站为当前站点,前往站为下一站, 下一站到站后在置为当前站
|
||||
*
|
||||
* @param result
|
||||
*/
|
||||
private void renderBusStationsStatus(SweeperRoutesResult result) {
|
||||
if (result == null) return;
|
||||
sweeperRoutesResult = result;
|
||||
List<SweeperStationBean> site = result.getSites();
|
||||
currentLineId = result.getLineId();
|
||||
stationList.clear();
|
||||
stationList.addAll(site);
|
||||
for (int i = 0; i < stationList.size(); i++) {
|
||||
SweeperStationBean s = stationList.get(i);
|
||||
|
||||
CallerLogger.INSTANCE.d(M_BUS + "renderBusStationsStatus--",
|
||||
"Index=" + i + " ,name = " + s.getName() + " ," + s.isLeaving() + "," + s.getDrivingStatus());
|
||||
|
||||
// 是否正在开往下一站
|
||||
if (s.isLeaving()) {
|
||||
isGoingToNextStation = true;
|
||||
}
|
||||
// 当前站点信息
|
||||
if (s.getDrivingStatus() == STATION_STATUS_STOPPED) {
|
||||
backgroundCurrentStationIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
SweeperStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
|
||||
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,
|
||||
"渲染站点信息服务端currentStationIndex=" + backgroundCurrentStationIndex
|
||||
+ " isLeaving()=" + currentStation.isLeaving());
|
||||
|
||||
//当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态
|
||||
// ,订单开始站下在始发站的状态流转有问题
|
||||
if (backgroundCurrentStationIndex == 0 && !currentStation.isLeaving()) {
|
||||
arriveSiteStation(true);
|
||||
}
|
||||
|
||||
// 美化是否开始
|
||||
if (FunctionBuildConfig.isDemoMode && (backgroundCurrentStationIndex >= 0
|
||||
&& backgroundCurrentStationIndex <= stationList.size() - 1)
|
||||
&& stationList.get(backgroundCurrentStationIndex).isLeaving()) {//行驶过程中设置美化
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(true);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为true(每次滑动出发)");
|
||||
}
|
||||
|
||||
if (refreshBusStationsCallback != null) {
|
||||
refreshBusStationsCallback.refreshBusStations(result.getName(), stationList
|
||||
, backgroundCurrentStationIndex, getNextStopStation(), !currentStation.isLeaving());
|
||||
}
|
||||
|
||||
if (currentStation.isLeaving() && slidePannelHideCallback != null) {
|
||||
slidePannelHideCallback.hideSlidePanel();
|
||||
}
|
||||
|
||||
//需放在currentStationIndex赋值之后
|
||||
SweeperTrajectoryManager.getInstance().syncTrajectoryInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单状态、获取下一站靠站的的站点
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 延时查询站点信心
|
||||
*/
|
||||
private void queryBusStationDelay() {
|
||||
handler.sendEmptyMessageDelayed(MSG_QUERY_BUS_STATION, QUERY_BUS_STATION_DELAY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在踩刹车、控制方向盘等操作后,会停止自动驾驶,重启自动驾驶的话相当于重新设置自动驾驶目的地
|
||||
*/
|
||||
@@ -729,110 +348,6 @@ public class SweeperOrderModel {
|
||||
//直接开启自动驾驶
|
||||
startAutopilot(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 播报下车乘客信息
|
||||
*
|
||||
* @param awayPassengersResponse
|
||||
*/
|
||||
private void playLeavePassengersMsg(QueryLeaveAwayPassengersResponse awayPassengersResponse) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "播报下车乘客信息currentStationIndex="
|
||||
+ String.valueOf(backgroundCurrentStationIndex + 1));
|
||||
|
||||
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
|
||||
return;
|
||||
}
|
||||
String station = stationList.get(backgroundCurrentStationIndex + 1).getName();
|
||||
StringBuilder builder = new StringBuilder("已到达");
|
||||
builder.append(station);
|
||||
if (!station.endsWith("站")) {
|
||||
builder.append("站");
|
||||
}
|
||||
if (awayPassengersResponse == null || awayPassengersResponse.data == null
|
||||
|| awayPassengersResponse.data.orders == null || awayPassengersResponse.data.orders.isEmpty()) {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "播报下车乘客信息为null");
|
||||
} else {
|
||||
builder.append(",请尾号为 ");
|
||||
for (QueryLeaveAwayPassengersResponse.LeaveAwayPassenger leaveAwayPassenger : awayPassengersResponse.data.orders) {
|
||||
if (leaveAwayPassenger == null) {
|
||||
continue;
|
||||
}
|
||||
String tailNum = null;
|
||||
try {
|
||||
tailNum = leaveAwayPassenger.passengerPhone.substring(leaveAwayPassenger.passengerPhone.length() - 4);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
tailNum = leaveAwayPassenger.passengerPhone;
|
||||
}
|
||||
builder.append(tailNum).append("。");
|
||||
}
|
||||
builder.append("的乘客下车");
|
||||
}
|
||||
builder.append(",带好随身物品,下车请注意安全");
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "TTS:" + builder.toString());
|
||||
AIAssist.getInstance(mContext).speakTTSVoice(builder.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小巴运营状态
|
||||
*/
|
||||
public void onChangeOperationStatus() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "修改小巴运营状态");
|
||||
if (isWorking()) {//收车
|
||||
stopTakeOrder();
|
||||
} else {//出车
|
||||
startTakeOrder();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 行程结束
|
||||
*/
|
||||
private void travelOver() {
|
||||
|
||||
if (backgroundCurrentStationIndex >= stationList.size()) {
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG, "travel over index out of station list");
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束====");
|
||||
CallerAutoPilotManager.INSTANCE.cancelAutoPilot();
|
||||
AIAssist.getInstance(mContext).speakTTSVoice("感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见");
|
||||
leaveStation(true, true);
|
||||
}
|
||||
|
||||
public boolean isWorking() {
|
||||
return mIsWorking;
|
||||
}
|
||||
|
||||
/**
|
||||
* 到站
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
public void onArriveAt(MessagePad.ArrivalNotification data) {
|
||||
// if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) {
|
||||
// CallerLogger.INSTANCE.e( M_BUS + TAG, "到站异常,取消后续操作结束" );
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (isArrivedStation) return;
|
||||
isArrivedStation = true;
|
||||
|
||||
if (FunctionBuildConfig.isDemoMode && backgroundCurrentStationIndex <= stationList.size() - 1) {//到达一站结束美化
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore:置为false(到最后一站)");
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "到站====currentStationIndex=" + backgroundCurrentStationIndex);
|
||||
isGoingToNextStation = false;
|
||||
|
||||
// arriveSiteStation(false);//到站上报
|
||||
}
|
||||
|
||||
public boolean isGoingToNextStation() {
|
||||
return isGoingToNextStation;
|
||||
}
|
||||
|
||||
// 车机端上传心跳数据(只在出车状态时上传)
|
||||
public void runCarHeartbeat() {
|
||||
SweeperServiceManager.getInstance().runCarHeartbeat(mContext, mLongitude, mLatitude,
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
package com.mogo.och.sweeper.net;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.sweeper.bean.SweeperOperationStatusRequest;
|
||||
import com.mogo.och.sweeper.bean.SweeperQueryLinesResponse;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutesResponse;
|
||||
import com.mogo.och.sweeper.bean.CarHeartbeatReqBean;
|
||||
import com.mogo.och.sweeper.bean.SweeperQueryLineStationsRequest;
|
||||
import com.mogo.och.sweeper.bean.SweeperOperationStatusResponse;
|
||||
import com.mogo.och.sweeper.bean.SweeperResetDrivingLineRequest;
|
||||
import com.mogo.och.sweeper.bean.SweeperUpdateSiteStatusRequest;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Header;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* 小巴车相关接口
|
||||
@@ -26,92 +18,19 @@ import retrofit2.http.Query;
|
||||
* wiki: http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48970072
|
||||
*/
|
||||
public interface ISweeperApiService {
|
||||
/**
|
||||
* 根据车机坐标获取所在区域全部站点信息
|
||||
*
|
||||
* @param request 请求参数
|
||||
* @return 接口返回数据
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/line/v2/driver/bus/lineDataWithDriver/query" )
|
||||
Observable<SweeperRoutesResponse> querySiteByCoordinate(@Header ("appId") String appId, @Header("ticket") String ticket, @Body SweeperQueryLineStationsRequest request);
|
||||
|
||||
/**
|
||||
* 重置巴士路线: 点击小巴车tab 或者出车后会使用
|
||||
*
|
||||
* @param request 请求参数{"destLine":1,"sn":"F803EB2046PZD00229"} 这个接口是重置bus线路的, 不是重置线路中站点的
|
||||
* @return 返回值是重置后的车站列表
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/car/v2/driver/bus/drivingLine/reset" )
|
||||
Observable<SweeperRoutesResponse> resetStationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Body SweeperResetDrivingLineRequest request);
|
||||
|
||||
/**
|
||||
* 离站,通知服务器
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-Type:application/json;charset=UTF-8"})
|
||||
@POST("/autopilot-car-hailing/car/v2/driver/bus/driving/away")
|
||||
Observable<SweeperRoutesResponse> leaveStation(@Header ("appId") String appId, @Header("ticket") String ticket, @Body SweeperUpdateSiteStatusRequest request);
|
||||
|
||||
/**
|
||||
* 到站 更新到站信息
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/autopilot-car-hailing/order/v2/driver/bus/driving/attachSite")
|
||||
Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body SweeperUpdateSiteStatusRequest request);
|
||||
|
||||
/**
|
||||
* 出车
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST("/autopilot-car-hailing/car/v2/driver/bus/startTakeOrder")
|
||||
Observable<BaseData> startTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body SweeperOperationStatusRequest request);
|
||||
|
||||
/**
|
||||
* 收车
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/autopilot-car-hailing/car/v2/driver/bus/stopTakeOrder")
|
||||
Observable<BaseData> stopTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body SweeperOperationStatusRequest request);
|
||||
|
||||
/**
|
||||
* 查询小巴出车/收车状态
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@GET("/autopilot-car-hailing/car/v2/driver/bus/takeOrderStatus/query")
|
||||
Observable<SweeperOperationStatusResponse> queryOperationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
/**
|
||||
* 车机端上传心跳数据(只在出车状态时上传):包含高德坐标系经纬度
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/location/v2/driver/bus/heartbeat" )
|
||||
Observable<BaseData> runCarHeartbeat(@Header ("appId") String appId,@Header("ticket") String ticket,@Body CarHeartbeatReqBean data);
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/autopilot-car-hailing/location/v2/driver/bus/heartbeat")
|
||||
Observable<BaseData> runCarHeartbeat(@Header("appId") String appId, @Header("ticket") String ticket, @Body CarHeartbeatReqBean data);
|
||||
|
||||
/**
|
||||
* 查询车辆配置的所有路线
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
@GET("/autopilot-car-hailing/line/v2/driver/bus/bindLine/query")
|
||||
Observable<SweeperQueryLinesResponse> queryBusLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
|
||||
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/autopilot-car-hailing/location/v2/driver/bus/saveLineCoordinate" )
|
||||
Observable<BaseData> updateOrderRoute(@Header ("appId") String appId, @Header("ticket") String ticket, @Body SweeperRoutePlanningUpdateReqBean data);
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/autopilot-car-hailing/location/v2/driver/bus/saveLineCoordinate")
|
||||
Observable<BaseData> updateOrderRoute(@Header("appId") String appId, @Header("ticket") String ticket,
|
||||
@Body SweeperRoutePlanningUpdateReqBean data);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,121 +48,6 @@ public class SweeperServiceManager {
|
||||
mService = MoGoRetrofitFactory.getInstance(SweeperConst.getBaseUrl()).create(ISweeperApiService.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小巴车线路
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void queryBusRoutes(Context context, ISweeperServiceCallback<SweeperRoutesResponse> callback) {
|
||||
//获取当前高德坐标
|
||||
|
||||
mService.querySiteByCoordinate(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
, new SweeperQueryLineStationsRequest(SweeperOrderModel.getInstance().mLongitude
|
||||
, SweeperOrderModel.getInstance().mLatitude,true))
|
||||
.subscribeOn( Schedulers.io() ).observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( getSubscribeImpl(context,callback,"querySiteByCoordinate"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置线路站点
|
||||
* @param context
|
||||
* @param lineId
|
||||
* @param callback
|
||||
*/
|
||||
public void resetStationStatus(Context context, int lineId, ISweeperServiceCallback<SweeperRoutesResponse> callback){
|
||||
mService.resetStationStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),new SweeperResetDrivingLineRequest(lineId))
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"debugResetStationStatus"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 离站上报
|
||||
* @param context
|
||||
* @param seq
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
public void leaveStation(Context context, int seq, int siteId, ISweeperServiceCallback<SweeperRoutesResponse> callback){
|
||||
mService.leaveStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new SweeperUpdateSiteStatusRequest(seq,siteId, SweeperOrderModel.getInstance().mLongitude
|
||||
, SweeperOrderModel.getInstance().mLatitude))
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 到站更新站点状态
|
||||
* @param context
|
||||
* @param seq
|
||||
* @param siteId
|
||||
* @param callback
|
||||
*/
|
||||
public void arriveSiteStation(Context context, int seq, int siteId, ISweeperServiceCallback<BaseData> callback){
|
||||
mService.arriveSiteStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new SweeperUpdateSiteStatusRequest(seq,siteId
|
||||
, SweeperOrderModel.getInstance().mLongitude, SweeperOrderModel.getInstance().mLatitude))
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 收车
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void stopTakeOrder(Context context, ISweeperServiceCallback<BaseData> callback){
|
||||
mService.stopTakeOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new SweeperOperationStatusRequest(SweeperOrderModel.getInstance().mLongitude
|
||||
, SweeperOrderModel.getInstance().mLatitude))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"stopTakeOrder"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 出车
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void startTakeOrder(Context context, ISweeperServiceCallback<BaseData> callback){
|
||||
mService.startTakeOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken()
|
||||
,new SweeperOperationStatusRequest(SweeperOrderModel.getInstance().mLongitude
|
||||
, SweeperOrderModel.getInstance().mLatitude))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"startTakeOrder"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出车/收车状态
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
public void queryOperationStatus(Context context, ISweeperServiceCallback<SweeperOperationStatusResponse> callback){
|
||||
mService.queryOperationStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe(getSubscribeImpl(context,callback,"queryOperationStatus"));
|
||||
}
|
||||
|
||||
|
||||
public void queryBusLines(Context context, ISweeperServiceCallback<SweeperQueryLinesResponse> callback){
|
||||
mService.queryBusLines(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
|
||||
,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(getSubscribeImpl(context,callback,"queryBusLines"));
|
||||
}
|
||||
|
||||
public void updateOrderRoute(Context context,int lineId, int startSiteId, int endSiteId
|
||||
, List< SweeperRoutePlanningUpdateReqBean.Result > points
|
||||
, ISweeperServiceCallback<BaseData> callback){
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
package com.mogo.och.sweeper.presenter;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.sweeper.bean.SweeperQueryLinesResponse;
|
||||
import com.mogo.och.sweeper.callback.ISweeperLinesCallback;
|
||||
import com.mogo.och.sweeper.model.SweeperLineModel;
|
||||
import com.mogo.och.sweeper.model.SweeperOrderModel;
|
||||
import com.mogo.och.sweeper.ui.SweeperSwitchLineView;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/9
|
||||
*/
|
||||
public class SweeperLinePresenter extends Presenter<SweeperSwitchLineView> implements ISweeperLinesCallback {
|
||||
|
||||
public SweeperLinePresenter(SweeperSwitchLineView view) {
|
||||
super(view);
|
||||
SweeperLineModel.getInstance().init();
|
||||
SweeperOrderModel.getInstance().init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||
super.onCreate(owner);
|
||||
initListener();
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
SweeperLineModel.getInstance().setBusLinesCallback(this);
|
||||
}
|
||||
|
||||
private void runOnUIThread( Runnable executor ) {
|
||||
if ( executor == null ) {
|
||||
return;
|
||||
}
|
||||
if ( Looper.myLooper() != Looper.getMainLooper() ) {
|
||||
UiThreadHandler.post( executor );
|
||||
} else {
|
||||
executor.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBusLinesChange(SweeperQueryLinesResponse lines) {
|
||||
runOnUIThread(() -> mView.onBusLinesChange(lines));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeLineIdSuccess() {
|
||||
runOnUIThread(() -> mView.onChangeLineIdSuccess());
|
||||
}
|
||||
|
||||
public void queryBusLines(){
|
||||
SweeperLineModel.getInstance().queryBusLines();
|
||||
}
|
||||
|
||||
public void commitSwitchLineId(int lineId){
|
||||
SweeperLineModel.getInstance().commitSwitchLineId(lineId);
|
||||
}
|
||||
|
||||
public void removeListener(){
|
||||
SweeperLineModel.getInstance().setBusLinesCallback(null);
|
||||
}
|
||||
|
||||
public void queryBusRoutes(){
|
||||
SweeperOrderModel.getInstance().querySweeperRoutes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy(@NonNull LifecycleOwner owner) {
|
||||
super.onDestroy(owner);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,14 @@
|
||||
package com.mogo.och.sweeper.presenter;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
|
||||
import android.os.Looper;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.sweeper.bean.SweeperStationBean;
|
||||
import com.mogo.och.sweeper.callback.ISweeperControllerStatusCallback;
|
||||
import com.mogo.och.sweeper.callback.ICarOperationStatusCallback;
|
||||
import com.mogo.och.sweeper.callback.IRefreshSweeperStationsCallback;
|
||||
import com.mogo.och.sweeper.callback.ISlidePannelHideCallback;
|
||||
import com.mogo.och.sweeper.callback.ISweeperControllerStatusCallback;
|
||||
import com.mogo.och.sweeper.fragment.SweeperFragment;
|
||||
import com.mogo.och.sweeper.model.SweeperOrderModel;
|
||||
import com.mogo.och.sweeper.util.SweeperTrajectoryManager;
|
||||
@@ -58,8 +50,6 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
|
||||
@Override
|
||||
public void onCreate(@NonNull LifecycleOwner owner) {
|
||||
super.onCreate(owner);
|
||||
SweeperOrderModel.getInstance().queryOperationStatus();
|
||||
SweeperOrderModel.getInstance().querySweeperRoutes();
|
||||
initModelListener();
|
||||
}
|
||||
|
||||
@@ -75,35 +65,14 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
|
||||
}
|
||||
|
||||
public void releaseListener() {
|
||||
SweeperOrderModel.getInstance().setCarOperationStatusCallback(null);
|
||||
SweeperOrderModel.getInstance().setRefreshBusStationsCallback(null);
|
||||
SweeperOrderModel.getInstance().setSlidePannelHideCallback(null);
|
||||
SweeperOrderModel.getInstance().setControllerStatusCallback(null);
|
||||
}
|
||||
|
||||
public void querySweepersRoutes() {
|
||||
SweeperOrderModel.getInstance().querySweeperRoutes();
|
||||
}
|
||||
|
||||
public void debugResetStationStatus() {
|
||||
SweeperOrderModel.getInstance().debugResetStationStatus();
|
||||
}
|
||||
|
||||
public void autoDriveToNextStation(boolean isRestart) {
|
||||
currentAutopilotStatus = -1;
|
||||
SweeperOrderModel.getInstance().autoDriveToNextStation(isRestart);
|
||||
isRestartAutopilot = false;
|
||||
}
|
||||
|
||||
public void restartAutopilot() {
|
||||
currentAutopilotStatus = -1;
|
||||
SweeperOrderModel.getInstance().restartAutopilot();
|
||||
isRestartAutopilot = true;
|
||||
}
|
||||
|
||||
public void onChangeOperationStatus() {
|
||||
SweeperOrderModel.getInstance().onChangeOperationStatus();
|
||||
}
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autopilotStatusInfo) {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
|
||||
@@ -39,7 +39,6 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import chassis.Chassis;
|
||||
import chassis.ChassisStatesOuterClass;
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass;
|
||||
import planning.RoboSweeperTaskIndexOuterClass;
|
||||
|
||||
@@ -1,300 +0,0 @@
|
||||
package com.mogo.och.sweeper.ui;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.commons.mvp.MvpActivity;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.sweeper.R;
|
||||
import com.mogo.och.sweeper.bean.SweeperQueryLinesResponse;
|
||||
import com.mogo.och.sweeper.presenter.SweeperLinePresenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/8
|
||||
*/
|
||||
public class SweeperSwitchLineActivity extends MvpActivity<SweeperSwitchLineView, SweeperLinePresenter>
|
||||
implements View.OnClickListener, SweeperSwitchLineView {
|
||||
|
||||
private ImageView mClose;
|
||||
private ConstraintLayout mNoDatasView;
|
||||
private RecyclerView mLinesListView;
|
||||
private TextView mLineCommitBtn;
|
||||
private SwitchLineAdapter mAdapter;
|
||||
private List<SweeperQueryLinesResponse.Result> mData = new ArrayList<>();
|
||||
private int mSelectLineId = -1;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_sweeper_switch_line;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected SweeperLinePresenter createPresenter() {
|
||||
return new SweeperLinePresenter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
initWH();
|
||||
initView();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
initDatas();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化view
|
||||
*/
|
||||
private void initView() {
|
||||
mClose = findViewById(R.id.switch_line_close);
|
||||
mClose.setOnClickListener(this);
|
||||
mNoDatasView = findViewById(R.id.no_order_data_view);
|
||||
|
||||
mLineCommitBtn = findViewById(R.id.switch_line_btn_commit);
|
||||
mLineCommitBtn.setOnClickListener(this);
|
||||
|
||||
mLinesListView = findViewById(R.id.switch_line_rv);
|
||||
mLinesListView.setLayoutManager(new LinearLayoutManager(this));
|
||||
mAdapter = new SwitchLineAdapter(getApplicationContext(),mData);
|
||||
mLinesListView.setAdapter(mAdapter);
|
||||
//设置item 点击事件
|
||||
mAdapter.setOnLineItemClickListener(new LineItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(int position) {
|
||||
if (mData.size() > position && !TextUtils.isEmpty(mData.get(position).startSiteName )
|
||||
&& !TextUtils.isEmpty(mData.get(position).endSiteName)){
|
||||
mSelectLineId = mData.get(position).lineId;
|
||||
}else {
|
||||
mSelectLineId = -1;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置布局宽高
|
||||
*/
|
||||
private void initWH() {
|
||||
|
||||
Window window = getWindow();
|
||||
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
WindowManager windowManager = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
|
||||
Point point = new Point();
|
||||
windowManager.getDefaultDisplay().getSize(point);//用于获取屏幕高度
|
||||
|
||||
params.width = (int)(point.x * 0.375);
|
||||
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
window.setAttributes(params);
|
||||
window.setGravity(Gravity.LEFT|Gravity.BOTTOM);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
private void initDatas() {
|
||||
mPresenter.queryBusLines();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询返回绑定路线集合
|
||||
* @param data
|
||||
*/
|
||||
@Override
|
||||
public void onBusLinesChange(SweeperQueryLinesResponse data){
|
||||
if (null == data){
|
||||
showNoData(true);
|
||||
return;
|
||||
}
|
||||
if (data.data != null && data.data.size() > 0){
|
||||
showNoData(false);
|
||||
mData.clear();
|
||||
mData.addAll(data.data);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
changeCommitBtnBg();
|
||||
}else {
|
||||
showNoData(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据路线选中情况设置提交按钮样式
|
||||
*/
|
||||
private void changeCommitBtnBg() {
|
||||
for (int i=0; i<mData.size();i++){
|
||||
if (mData.get(i).choose == 1){
|
||||
mLineCommitBtn.setBackgroundResource(R.drawable.sweeper_switch_line_btn_commit);
|
||||
mLineCommitBtn.setTextColor(getResources().getColor(R.color.sweeper_white));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeLineIdSuccess(){
|
||||
ToastUtils.showLong(getResources().getString(R.string.sweeper_change_line_commit_tip_s));
|
||||
mPresenter.queryBusRoutes();
|
||||
if (mAdapter != null){
|
||||
mAdapter.setOnLineItemClickListener(null);
|
||||
}
|
||||
mPresenter.removeListener();
|
||||
finish();
|
||||
}
|
||||
|
||||
/**
|
||||
* 有无数据UI显示
|
||||
* @param b
|
||||
*/
|
||||
private void showNoData(boolean b) {
|
||||
if (b){
|
||||
mLinesListView.setVisibility(View.GONE);
|
||||
mLineCommitBtn.setVisibility(View.GONE);
|
||||
mNoDatasView.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
mLinesListView.setVisibility(View.VISIBLE);
|
||||
mLineCommitBtn.setVisibility(View.VISIBLE);
|
||||
mNoDatasView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
//关闭dialog
|
||||
if (v.getId() == R.id.switch_line_close){
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
//切换路线提交
|
||||
if (v.getId() == R.id.switch_line_btn_commit){
|
||||
if (mSelectLineId > -1){
|
||||
mPresenter.commitSwitchLineId(mSelectLineId);
|
||||
}else {
|
||||
finish();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* 路线列表adapter
|
||||
*/
|
||||
static class SwitchLineAdapter extends RecyclerView.Adapter<SwitchLineViewHolder>{
|
||||
|
||||
private Context mContext;
|
||||
private List<SweeperQueryLinesResponse.Result> mData;
|
||||
// RecyclerView设置点击事件
|
||||
private LineItemClickListener mItemClickListener ;
|
||||
private int clickPos = -1;
|
||||
|
||||
public SwitchLineAdapter(Context context, List<SweeperQueryLinesResponse.Result> data){
|
||||
mContext = context;
|
||||
mData = data;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SwitchLineViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.sweeper_switch_line_list_item
|
||||
,parent,false);
|
||||
SwitchLineViewHolder viewHolder = new SwitchLineViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull SwitchLineViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
SweeperQueryLinesResponse.Result line = mData.get(position);
|
||||
holder.lineName.setText(mContext.getString(R.string.sweeper_switch_line_name)+" "+line.name);
|
||||
holder.lineStartName.setText(mContext.getString(R.string.sweeper_line_start)+" "+line.startSiteName);
|
||||
holder.lineEndName.setText(mContext.getString(R.string.sweeper_line_end)+" "+line.endSiteName);
|
||||
|
||||
//设置item点击事件
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mItemClickListener != null){
|
||||
mItemClickListener.onItemClick(position);
|
||||
clickPos = position;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
});
|
||||
//选中绑定
|
||||
if (clickPos > -1){
|
||||
if (clickPos == position){
|
||||
holder.selectIv.setImageResource(R.drawable.sweeper_selected_btn);
|
||||
}else {
|
||||
holder.selectIv.setImageResource(R.drawable.sweeper_unselect_btn);
|
||||
}
|
||||
}else {
|
||||
if (line.choose == 1){//1:绑定 2:未绑定 默认绑定
|
||||
if (mItemClickListener != null) {
|
||||
mItemClickListener.onItemClick(position);
|
||||
}
|
||||
holder.selectIv.setImageResource(R.drawable.sweeper_selected_btn);
|
||||
}else {
|
||||
holder.selectIv.setImageResource(R.drawable.sweeper_unselect_btn);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mData.size();
|
||||
}
|
||||
public void setOnLineItemClickListener(LineItemClickListener itemClickListener){
|
||||
this.mItemClickListener = itemClickListener ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static class SwitchLineViewHolder extends RecyclerView.ViewHolder{
|
||||
|
||||
private ImageView selectIv;
|
||||
private TextView lineName; //线路名称
|
||||
private TextView lineStartName; //起点
|
||||
private TextView lineEndName; //终点
|
||||
|
||||
public SwitchLineViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
selectIv = itemView.findViewById(R.id.switch_line_item_select_iv);
|
||||
lineName = itemView.findViewById(R.id.switch_line_name);
|
||||
lineStartName = itemView.findViewById(R.id.switch_line_start_station);
|
||||
lineEndName = itemView.findViewById(R.id.switch_line_end_station);
|
||||
}
|
||||
}
|
||||
|
||||
public interface LineItemClickListener {
|
||||
void onItemClick(int position) ;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.mogo.och.sweeper.ui;
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.och.sweeper.bean.SweeperQueryLinesResponse;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2022/2/10
|
||||
*/
|
||||
public interface SweeperSwitchLineView extends IView {
|
||||
|
||||
void onBusLinesChange(SweeperQueryLinesResponse data);
|
||||
void onChangeLineIdSuccess();
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 323 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/sweeper_selected_btn" android:state_checked="true"/>
|
||||
<item android:drawable="@drawable/sweeper_unselect_btn" android:state_checked="false"/>
|
||||
<item android:drawable="@drawable/sweeper_unselect_btn"/>
|
||||
|
||||
</selector>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<corners android:radius="60dp"/>
|
||||
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:type="linear"
|
||||
android:startColor="#029DFF"
|
||||
android:endColor="#0056FF" />
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
<corners android:radius="60dp"/>
|
||||
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:type="linear"
|
||||
android:startColor="#11457C"
|
||||
android:endColor="#102F7C" />
|
||||
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -1,75 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/sweeper_switch_line_bg">
|
||||
|
||||
<View
|
||||
android:id="@+id/switch_line_1"
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_marginLeft="@dimen/dp_80"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/sweeper_lint_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sweeper_lint_title"
|
||||
android:background="@color/switch_line"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sweeper_lint_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sweeper_switch_line_title"
|
||||
android:layout_marginLeft="@dimen/dp_113"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_97"
|
||||
android:textColor="@android:color/white"
|
||||
android:text="@string/sweeper_switch_line_title"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switch_line_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_67"
|
||||
android:layout_marginRight="@dimen/dp_40"
|
||||
android:src="@drawable/sweeper_switch_line_close"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/switch_line_rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/switch_line_1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/switch_line_1"
|
||||
app:layout_constraintBottom_toTopOf="@+id/switch_line_btn_commit"
|
||||
android:requiresFadingEdge="vertical"
|
||||
android:fadingEdgeLength="40dp"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
android:layout_marginLeft="@dimen/dp_80"
|
||||
android:layout_marginRight="@dimen/dp_80"
|
||||
android:layout_marginBottom="@dimen/dp_30"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/switch_line_btn_commit"
|
||||
android:layout_width="@dimen/sweeper_switch_line_btn_width"
|
||||
android:layout_height="@dimen/sweeper_switch_line_btn_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginBottom="@dimen/sweeper_switch_line_btn_margin_b"
|
||||
android:textSize="@dimen/dp_42"
|
||||
android:textColor="@color/sweeper_switch_btn_bg_half"
|
||||
android:text="@string/sweeper_switch_line_btn_txt"
|
||||
android:visibility="gone"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/sweeper_switch_line_btn_un_commit"/>
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
layout="@layout/sweeper_no_data_common_view"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -46,7 +46,7 @@
|
||||
android:id="@+id/viewTaskListLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/sweeper_line_dividing_line1_selector"
|
||||
android:background="@drawable/sweeper_task_dividing_line1_selector"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sweeperListTitle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -55,7 +55,7 @@
|
||||
android:id="@+id/viewTaskListLine1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/sweeper_line_dividing_line2_selector"
|
||||
android:background="@drawable/sweeper_task_dividing_line2_selector"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewTaskListLine"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
android:id="@+id/viewTaskInfoLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/sweeper_line_dividing_line1_selector"
|
||||
android:background="@drawable/sweeper_task_dividing_line1_selector"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTaskTime"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -73,7 +73,7 @@
|
||||
android:id="@+id/viewTaskInfoLine1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@drawable/sweeper_line_dividing_line2_selector"
|
||||
android:background="@drawable/sweeper_task_dividing_line2_selector"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewTaskInfoLine"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/dp_80">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switch_line_item_select_iv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sweeper_checkbox_selector"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/switch_line_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/switch_line_item_select_iv"
|
||||
android:layout_marginLeft="@dimen/dp_33"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@android:color/white"
|
||||
android:text="@string/sweeper_switch_line_name"
|
||||
android:textSize="@dimen/dp_42" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/switch_line_start_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_17"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="@string/sweeper_switch_line_start"
|
||||
android:textColor="#B9C3E9"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/switch_line_name"
|
||||
app:layout_constraintLeft_toRightOf="@+id/switch_line_start_greenDot"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switch_line_start_greenDot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/sweeper_icon_current_subtask"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/switch_line_start_station"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/switch_line_name"
|
||||
app:layout_constraintTop_toTopOf="@+id/switch_line_start_station" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switch_line_end_dotLine"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/sweeper_och_dot_line"
|
||||
app:layout_constraintBottom_toTopOf="@+id/switch_line_end_blueDot"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/switch_line_start_greenDot"
|
||||
app:layout_constraintRight_toRightOf="@+id/switch_line_start_greenDot"
|
||||
app:layout_constraintTop_toBottomOf="@+id/switch_line_start_greenDot" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/switch_line_end_blueDot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/sweeper_icon_arriving_station"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/switch_line_end_station"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/switch_line_name"
|
||||
app:layout_constraintTop_toTopOf="@+id/switch_line_end_station" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/switch_line_end_station"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_17"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="@string/sweeper_switch_line_end"
|
||||
android:textColor="#B9C3E9"
|
||||
android:textSize="@dimen/dp_36"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/switch_line_end_blueDot"
|
||||
app:layout_constraintTop_toBottomOf="@+id/switch_line_start_station"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -32,9 +32,6 @@
|
||||
<color name="arc_speed">#3E77F6</color>
|
||||
<color name="sweeper_switch_map_bg_c">#323C6F</color>
|
||||
|
||||
<color name="switch_line">#2966EC</color>
|
||||
<color name="sweeper_switch_line_bg">#F0151D41</color>
|
||||
|
||||
<color name="sweeper_switch_btn_bg_half">#19FFFFFF</color>
|
||||
<color name="sweeper_white">#FFFFFF</color>
|
||||
|
||||
|
||||