diff --git a/OCH/mogo-och-bus/src/main/AndroidManifest.xml b/OCH/mogo-och-bus/src/main/AndroidManifest.xml
index 8f40dcf1a5..b0136c57cc 100644
--- a/OCH/mogo-och-bus/src/main/AndroidManifest.xml
+++ b/OCH/mogo-och-bus/src/main/AndroidManifest.xml
@@ -10,6 +10,10 @@
+ />
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java
index 4154e95528..0571097163 100644
--- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/OchBusProvider.java
@@ -24,7 +24,9 @@ import org.jetbrains.annotations.Nullable;
*/
@Route(path = OchBusConst.PATH)
public class OchBusProvider implements IMogoOCH {
+
private static final String TAG = "OchBusProvider";
+
private OchBusFragment busFragment;
private int containerId;
private FragmentActivity activity;
@@ -43,8 +45,10 @@ public class OchBusProvider implements IMogoOCH {
@Override
public void init(Context context) {
- MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus", StatusDescriptor.VR_MODE, statusChangedListener);
- MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus", StatusDescriptor.TOP_VIEW, statusChangedListener);
+ MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus"
+ , StatusDescriptor.VR_MODE, statusChangedListener);
+ MogoApisHandler.getInstance().getApis().getStatusManagerApi().registerStatusChangedListener("OchBus"
+ , StatusDescriptor.TOP_VIEW, statusChangedListener);
}
private void showFragment() {
@@ -74,7 +78,8 @@ public class OchBusProvider implements IMogoOCH {
} else {
hideFragment();
}
- } else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() && descriptor == StatusDescriptor.TOP_VIEW) {
+ } else if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()
+ && descriptor == StatusDescriptor.TOP_VIEW) {
// topView进行展示时推出网约车界面,但是不隐藏整个fragment
if (busFragment != null && isTrue) {
busFragment.hideOchBus();
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/BusQueryLinesResponse.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/BusQueryLinesResponse.java
new file mode 100644
index 0000000000..99ead6ee0e
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/bean/BusQueryLinesResponse.java
@@ -0,0 +1,23 @@
+package com.mogo.och.bus.bean;
+
+import com.mogo.eagle.core.data.BaseData;
+
+import java.util.List;
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/2/9
+ */
+public class BusQueryLinesResponse extends BaseData {
+ public List data;
+
+ public static class Result {
+
+ public int lineId;//线路id
+ public String name;//线路名字
+ public int choose; // 1:绑定 2:未被绑定
+ public String startSiteName;//始发站名称
+ public String endSiteName;//终点名称
+
+ }
+}
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/BusLinesCallback.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/BusLinesCallback.java
new file mode 100644
index 0000000000..9f35270323
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/callback/BusLinesCallback.java
@@ -0,0 +1,12 @@
+package com.mogo.och.bus.callback;
+
+import com.mogo.och.bus.bean.BusQueryLinesResponse;
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/2/9
+ */
+public interface BusLinesCallback {
+ void onBusLinesChange(BusQueryLinesResponse lines);
+ void onChangeLineIdSuccess();
+}
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseOchBusTabFragment.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseOchBusTabFragment.java
index 5423cd0db1..3b7f99d334 100644
--- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseOchBusTabFragment.java
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/fragment/BaseOchBusTabFragment.java
@@ -67,6 +67,7 @@ public abstract class BaseOchBusTabFragment {
- if (groupTestPanel.getVisibility() == View.VISIBLE) {
- groupTestPanel.setVisibility(View.GONE);
- } else {
- groupTestPanel.setVisibility(View.VISIBLE);
- }
- return true;
- });
- }
+ // debug下调用测试面板 2022.2.25修改到 长按当前站点名字
+// if (DebugConfig.isDebug()) {
+// ctvAutopilotStatus.setOnLongClickListener(v -> {
+// debugTestBar();
+// return true;
+// });
+// }
onAutopilotStatusChanged(CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState(),false);
// 模拟 不可自动驾驶,目前场景是刚开机,adas还未和工控机连接
findViewById(R.id.btnAutopilotDisable).setOnClickListener(view ->
@@ -222,7 +219,6 @@ public abstract class BaseOchBusTabFragment implements SlidePanelView.OnSlidePanelMoveToEndListener {
+public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBusPresenter >
+ implements SlidePanelView.OnSlidePanelMoveToEndListener, View.OnClickListener {
private static final String TAG = "OchBusFragment";
private TextView mCurrentStationName;
private TextView mStartStationFlag;
private TextView mNextStationName;
private TextView mEndStationFlag;
- private TextView mDebugArrive;
+// private TextView mDebugArrive;
+ private TextView mSwitchLine; //切换路线
+ private int mCurrentStation = 0;
private View mBus;
@@ -58,8 +66,8 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
mStartStationFlag = findViewById( R.id.module_och_bus_start_station_tag );
mNextStationName = findViewById( R.id.module_och_bus_order_end_station );
mEndStationFlag = findViewById( R.id.module_och_bus_end_station_tag );
-
- mDebugArrive = findViewById(R.id.module_och_bus_arrive_station);
+ mSwitchLine = findViewById(R.id.switch_line_btn);
+// mDebugArrive = findViewById(R.id.module_och_bus_arrive_station);
if ( DebugConfig.isDebug() ) {
mBus.setOnClickListener( view -> {
@@ -71,25 +79,12 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
getActivity().finish();
return true;
} );
-
+ //debug下调用测试面板
+ mCurrentStationName.setOnLongClickListener(v -> {
+ debugTestBar();
+ return true;
+ });
}
- mCurrentStationName.setOnLongClickListener(new View.OnLongClickListener() {
- @Override
- public boolean onLongClick(View v) {
-// if (DebugConfig.isDebug()){
- if (mDebugArrive.getVisibility() == View.VISIBLE){
- mDebugArrive.setVisibility(View.GONE);
- }else {
- mDebugArrive.setVisibility(View.VISIBLE);
- }
-// }
- return false;
- }
- });
-
- findViewById(R.id.module_och_bus_arrive_station).setOnClickListener(view ->{ //到站
- mPresenter.onAutopilotArriveAtStation(null);
- });
Logger.d( TAG, "initView: " + CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState());
// 初始化的时候设置 UI 按钮状态
@@ -108,6 +103,7 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
default:
break;
}
+ mSwitchLine.setOnClickListener(this);
}
@Override
@@ -132,8 +128,10 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
* @param stationList 车站列表信息
* @param currentStation 当前站点
* @param nextStation 下个站点
+ * @param isArrived 是否都站
*/
public void refreshBusStations( List< OchBusStation > stationList, int currentStation, int nextStation ,boolean isArrived) {
+ mCurrentStation = currentStation;
if ( getActivity() == null ) {
return;
}
@@ -149,9 +147,10 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
}
/**
- * 重新刷新站点信息
+ * 重新刷新站点信息 isArrived 是否到站
*/
- private void renderCurrentStationStatus( List< OchBusStation > stationList, int currentStation, int nextStation ,boolean isArrived) {
+ private void renderCurrentStationStatus( List< OchBusStation > stationList, int currentStation
+ , int nextStation ,boolean isArrived) {
Log.d("MapMaker= ","currentStation="+currentStation+",nextStation="+nextStation+"isArrived="+isArrived);
String currentStationName = null;
String nextStationName = null;
@@ -172,27 +171,35 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
if ( currentStation == 0 ) {
startStationFlagVisibility = View.VISIBLE;
isArriveAtStartStation = true;
- mStartStationFlag.setText( "始" );
+ mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_start));
// Log.d("MapMaker= ","起点=");
- setOrRemoveMapMaker(true, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat(),startStation.getLon(),R.drawable.icon_station_start_end);
- setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end);
+ setOrRemoveMapMaker(true, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat()
+ ,startStation.getLon(),R.drawable.icon_station_start_end);
+ setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat()
+ ,endStation.getLon(),R.drawable.icon_station_start_end);
} else if ( currentStation > 0 && currentStation < stationList.size() - 1 ) {// 是否到达站点
// Log.d("MapMaker= ","中间=");
isArriveAtStation = true;
- setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat(),startStation.getLon(),R.drawable.icon_station_start_end);
- setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end);
+// mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_start1));
+ setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat()
+ ,startStation.getLon(),R.drawable.icon_station_start_end);
+ setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat()
+ ,endStation.getLon(),R.drawable.icon_station_start_end);
} else if ( currentStation == stationList.size() - 1 ) {// 是否到达终点
// Log.d("MapMaker= ","终点=");
isArriveEndStation = true;
nextStationName = "--";
- mStartStationFlag.setText( "终" );
+ mStartStationFlag.setText(getResources().getString(R.string.bus_arrive_to_end_end));
startStationFlagVisibility = View.VISIBLE;
endStationFlagVisibility = View.INVISIBLE;
- setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat(),startStation.getLon(),R.drawable.icon_station_start_end);
+ setOrRemoveMapMaker(false, OchBusConst.BUS_START_MAP_MAKER,startStation.getLat()
+ ,startStation.getLon(),R.drawable.icon_station_start_end);
if (isArrived){
- setOrRemoveMapMaker(false, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end);
+ setOrRemoveMapMaker(false, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat()
+ ,endStation.getLon(),R.drawable.icon_station_start_end);
}else {
- setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat(),endStation.getLon(),R.drawable.icon_station_start_end);
+ setOrRemoveMapMaker(true, OchBusConst.BUS_END_MAP_MAKER,endStation.getLat()
+ ,endStation.getLon(),R.drawable.icon_station_start_end);
}
}
@@ -302,6 +309,7 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
mRootView.setVisibility(isVRMode ? View.VISIBLE : View.GONE);
}
}
+
/**
* 绘制地图起点终点
* @param isAdd
@@ -319,13 +327,34 @@ public class OchBusFragment extends BaseOchBusTabFragment< OchBusFragment, OchBu
options.icon(bitmap);
options.latitude(lat);
options.longitude(longi);
- MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).addMarker(uuid, options);
+ MogoApisHandler.getInstance().getApis().getMapServiceApi()
+ .getMarkerManager(AbsMogoApplication.getApp()).addMarker(uuid, options);
}else {
Log.d("RemoveMapMaker=",uuid+"=latitude="+lat+",longitude="+longi);
- MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).removeMarkers(uuid);
+ MogoApisHandler.getInstance().getApis().getMapServiceApi()
+ .getMarkerManager(AbsMogoApplication.getApp()).removeMarkers(uuid);
}
}
+
public void debugAutoPilotStatus(int status){
mPresenter.debugAutoPilotStatus(status);
}
+
+ @Override
+ public void onClick(View v) {
+ if (v.getId() == R.id.switch_line_btn ){//切换路线条件: 自动驾驶过程中,点击则toast提示:自动驾驶中,不可切换路线
+ //本次行程未结束,不支持切换路线。点击则toast提示:当前行程未完成,不可切换路线
+ if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
+ == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
+ TipToast.longTip(getResources().getString(R.string.bus_switch_line_btn_warning1));
+ return;
+ }
+ if (mCurrentStation > 0){
+ TipToast.longTip(getResources().getString(R.string.bus_switch_line_btn_warning2));
+ return;
+ }
+ Intent intent = new Intent(getContext(), BusSwitchLineActivity.class);
+ startActivity(intent);
+ }
+ }
}
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/IOchBusApiService.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/IOchBusApiService.java
index 8c0ab8181a..d3a65f66b1 100644
--- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/IOchBusApiService.java
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/IOchBusApiService.java
@@ -1,5 +1,6 @@
package com.mogo.och.bus.net;
import com.mogo.eagle.core.data.BaseData;
+import com.mogo.och.bus.bean.BusQueryLinesResponse;
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
import com.mogo.och.bus.bean.OchBusOperationStatusRequest;
import com.mogo.och.bus.bean.OchBusQueryLineStationsRequest;
@@ -14,6 +15,7 @@ import com.mogo.och.bus.bean.OchBusUpdateSiteStatusRequest;
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,7 +28,6 @@ import retrofit2.http.Query;
* wiki: http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=48970072
*/
public interface IOchBusApiService {
-
/**
* 根据车机坐标获取所在区域全部站点信息
*
@@ -34,9 +35,10 @@ public interface IOchBusApiService {
* @return 接口返回数据
*/
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
- @POST( "/autopilot-car-hailing/bus/api/lineDataWithDriver/query" )
+// @POST( "/autopilot-car-hailing/bus/api/lineDataWithDriver/query" )
+ @POST( "/autopilot-car-hailing/line/v2/lineDataWithDriver/query" )
// @POST( "/mock/268/autopilot-car-hailing/bus/api/lineDataWithDriver/query" )
- Observable< OchBusRoutesResponse > querySiteByCoordinate(@Body OchBusQueryLineStationsRequest request);
+ Observable< OchBusRoutesResponse > querySiteByCoordinate(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusQueryLineStationsRequest request);
/**
* 重置巴士路线: 点击小巴车tab 或者出车后会使用
@@ -45,9 +47,10 @@ public interface IOchBusApiService {
* @return 返回值是重置后的车站列表
*/
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
- @POST( "/autopilot-car-hailing/bus/api/drivingLine/reset" )
+// @POST( "/autopilot-car-hailing/bus/api/drivingLine/reset" )
+ @POST( "/autopilot-car-hailing/car/v2/bus/drivingLine/reset" )
// @POST( "/mock/268/autopilot-car-hailing/bus/api/drivingLine/reset" )
- Observable< OchBusRoutesResponse > debugResetStationStatus(@Body OchBusResetDrivingLineRequest request);
+ Observable< OchBusRoutesResponse > resetStationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Body OchBusResetDrivingLineRequest request);
/**
* 离站,通知服务器
@@ -55,9 +58,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-Type:application/json;charset=UTF-8"})
- @POST("/autopilot-car-hailing/bus/api/driving/away")
+// @POST("/autopilot-car-hailing/bus/api/driving/away")
+ @POST("/autopilot-car-hailing/car/v2/bus/driving/away")
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/away")
- Observable< OchBusRoutesResponse > leaveStation(@Body OchBusUpdateSiteStatusRequest request);
+ Observable< OchBusRoutesResponse > leaveStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusUpdateSiteStatusRequest request);
/**
* 到站 更新到站信息
@@ -65,9 +69,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-type:application/json;charset=UTF-8"})
- @POST("/autopilot-car-hailing/bus/api/driving/attachSite")
+// @POST("/autopilot-car-hailing/bus/api/driving/attachSite")
+ @POST("/autopilot-car-hailing/order/v2/bus/driving/attachSite")
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/attachSite")
- Observable< BaseData > arriveSiteStation(@Body OchBusUpdateSiteStatusRequest request);
+ Observable< BaseData > arriveSiteStation(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusUpdateSiteStatusRequest request);
/**
@@ -76,9 +81,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-type:application/json;charset=UTF-8"})
- @POST("/autopilot-car-hailing/bus/api/driving/siteArrivedOrders")
+// @POST("/autopilot-car-hailing/bus/api/driving/siteArrivedOrders")
+ @POST("/autopilot-car-hailing/order/v2/bus/driving/siteArrivedOrders")
// @POST("/mock/268/autopilot-car-hailing/bus/api/driving/siteArrivedOrders")
- Observable< QueryLeaveAwayPassengersResponse > queryStationLeaveAwayPassengers(@Body QueryLeaveAwayPassengersRequest request);
+ Observable< QueryLeaveAwayPassengersResponse > queryStationLeaveAwayPassengers(@Header ("appId") String appId,@Header("ticket") String ticket,@Body QueryLeaveAwayPassengersRequest request);
/**
* 出车
@@ -86,9 +92,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers( {"Content-type:application/json;charset=UTF-8"} )
- @POST("/autopilot-car-hailing/bus/api/startTakeOrder")
+// @POST("/autopilot-car-hailing/bus/api/startTakeOrder")
+ @POST("/autopilot-car-hailing/car/v2/bus/startTakeOrder")
// @POST("/mock/268/autopilot-car-hailing/bus/api/startTakeOrder")
- Observable startTakeOrder(@Body OchBusOperationStatusRequest request);
+ Observable startTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusOperationStatusRequest request);
/**
* 收车
@@ -96,9 +103,10 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-type:application/json;charset=UTF-8"})
- @POST("/autopilot-car-hailing/bus/api/stopTakeOrder")
+// @POST("/autopilot-car-hailing/bus/api/stopTakeOrder")
+ @POST("/autopilot-car-hailing/car/v2/bus/stopTakeOrder")
// @POST("/mock/268/autopilot-car-hailing/bus/api/stopTakeOrder")
- Observable stopTakeOrder(@Body OchBusOperationStatusRequest request);
+ Observable stopTakeOrder(@Header ("appId") String appId,@Header("ticket") String ticket,@Body OchBusOperationStatusRequest request);
/**
* 查询小巴出车/收车状态
@@ -106,14 +114,16 @@ public interface IOchBusApiService {
* @return
*/
@Headers({"Content-type:application/json;charset=UTF-8"})
- @GET("/autopilot-car-hailing/bus/api/takeOrderStatus/query")
+// @GET("/autopilot-car-hailing/bus/api/takeOrderStatus/query")
+ @GET("/autopilot-car-hailing/car/v2/bus/takeOrderStatus/query")
// @GET("/mock/268/autopilot-car-hailing/bus/api/takeOrderStatus/query")
- Observable queryOperationStatus(@Query("sn") String sn);
+ Observable queryOperationStatus(@Header ("appId") String appId,@Header("ticket") String ticket,@Query("sn") String sn);
@Headers({"Content-type:application/json;charset=UTF-8"})
- @GET("/autopilot-car-hailing/bus/api/servicingOrders/query")
+// @GET("/autopilot-car-hailing/bus/api/servicingOrders/query")
+ @GET("/autopilot-car-hailing/order/v2/bus/servicingOrders/query")
// @GET("/mock/268/autopilot-car-hailing/bus/api/servicingOrders/query")
- Observable queryBusOrders(@Query("sn") String sn);
+ Observable queryBusOrders(@Header ("appId") String appId,@Header("ticket") String ticket,@Query("sn") String sn);
/**
* 车机端上传心跳数据(只在出车状态时上传):包含高德坐标系经纬度
@@ -121,6 +131,11 @@ public interface IOchBusApiService {
* @return
*/
@Headers( {"Content-type:application/json;charset=UTF-8"} )
- @POST( "/autopilot-car-hailing/api/v1/driver/heartbeat" )
- Observable runCarHeartbeat(@Body CarHeartbeatReqBean data);
+// @POST( "/autopilot-car-hailing/api/v1/driver/heartbeat" )
+ @POST( "/autopilot-car-hailing/location/v2/driver/heartbeat" )
+ Observable runCarHeartbeat(@Header ("appId") String appId,@Header("ticket") String ticket,@Body CarHeartbeatReqBean data);
+
+ @GET("/autopilot-car-hailing/line/v2/driver/bindLine/query")
+ Observable queryBusLines(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
}
+
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/OCHBusServiceManager.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/OCHBusServiceManager.java
index b5de475b95..3fc23505e5 100644
--- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/OCHBusServiceManager.java
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/net/OCHBusServiceManager.java
@@ -8,6 +8,7 @@ import com.mogo.eagle.core.network.RequestOptions;
import com.mogo.eagle.core.network.SubscribeImpl;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
import com.mogo.module.common.MogoApisHandler;
+import com.mogo.och.bus.bean.BusQueryLinesResponse;
import com.mogo.och.bus.bean.CarHeartbeatReqBean;
import com.mogo.och.bus.bean.OchBusOperationStatusRequest;
import com.mogo.och.bus.bean.OchBusOperationStatusResponse;
@@ -29,18 +30,22 @@ import io.reactivex.schedulers.Schedulers;
* @date: 2021/10/20
*/
public class OCHBusServiceManager {
- private static final String TAG = OCHBusServiceManager.class.getSimpleName();
- private IOchBusApiService mService;
+ private static final String TAG = OCHBusServiceManager.class.getSimpleName();
+
+ private IOchBusApiService mService;
private String baseUrl = OchBusConst.getBaseUrl();
+
private static final class SingletonHolder {
private static final OCHBusServiceManager INSTANCE = new OCHBusServiceManager();
}
+
public static OCHBusServiceManager getInstance(){
return SingletonHolder.INSTANCE;
}
+
private OCHBusServiceManager(){
- mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
+ mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
/**
@@ -54,7 +59,10 @@ public class OCHBusServiceManager {
}
//获取当前高德坐标
- mService.querySiteByCoordinate( new OchBusQueryLineStationsRequest(OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude,true))
+ mService.querySiteByCoordinate(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken()
+ , new OchBusQueryLineStationsRequest(OchBusOrderModel.getInstance().mLongitude
+ ,OchBusOrderModel.getInstance().mLatitude,true))
.subscribeOn( Schedulers.io() ).observeOn( AndroidSchedulers.mainThread() )
.subscribe( getSubscribeImpl(context,callback,"querySiteByCoordinate"));
}
@@ -65,11 +73,12 @@ public class OCHBusServiceManager {
* @param lineId
* @param callback
*/
- public void debugResetStationStatus(Context context,int lineId,OCHServiceCallback callback){
+ public void resetStationStatus(Context context, int lineId, OCHServiceCallback callback){
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
- mService.debugResetStationStatus(new OchBusResetDrivingLineRequest(lineId))
+ mService.resetStationStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken(),new OchBusResetDrivingLineRequest(lineId))
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(getSubscribeImpl(context,callback,"debugResetStationStatus"));
}
@@ -85,7 +94,10 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
- mService.leaveStation(new OchBusUpdateSiteStatusRequest(seq,siteId,OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
+ mService.leaveStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken()
+ ,new OchBusUpdateSiteStatusRequest(seq,siteId,OchBusOrderModel.getInstance().mLongitude
+ ,OchBusOrderModel.getInstance().mLatitude))
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
@@ -102,7 +114,10 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
- mService.arriveSiteStation(new OchBusUpdateSiteStatusRequest(seq,siteId,OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
+ mService.arriveSiteStation(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken()
+ ,new OchBusUpdateSiteStatusRequest(seq,siteId
+ ,OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe(getSubscribeImpl(context,callback,"leaveStation"));
@@ -115,11 +130,13 @@ public class OCHBusServiceManager {
* @param siteId
* @param callback
*/
- public void queryStationLeaveAwayPassengers(Context context,int seq,int siteId,OCHServiceCallback callback){
+ public void queryStationLeaveAwayPassengers(Context context,int seq,int siteId
+ ,OCHServiceCallback callback){
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
- mService.queryStationLeaveAwayPassengers( new QueryLeaveAwayPassengersRequest(seq,siteId))
+ mService.queryStationLeaveAwayPassengers( MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken(),new QueryLeaveAwayPassengersRequest(seq,siteId))
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe(getSubscribeImpl(context,callback,"queryStationLeaveAwayPassengers"));
@@ -134,7 +151,10 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
- mService.stopTakeOrder(new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
+ mService.stopTakeOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken()
+ ,new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude
+ ,OchBusOrderModel.getInstance().mLatitude))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(getSubscribeImpl(context,callback,"stopTakeOrder"));
@@ -149,7 +169,10 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
- mService.startTakeOrder(new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude,OchBusOrderModel.getInstance().mLatitude))
+ mService.startTakeOrder(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken()
+ ,new OchBusOperationStatusRequest(OchBusOrderModel.getInstance().mLongitude
+ ,OchBusOrderModel.getInstance().mLatitude))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(getSubscribeImpl(context,callback,"startTakeOrder"));
@@ -164,7 +187,8 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
- mService.queryOperationStatus(MoGoAiCloudClientConfig.getInstance().getSn())
+ mService.queryOperationStatus(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe(getSubscribeImpl(context,callback,"queryOperationStatus"));
@@ -179,12 +203,24 @@ public class OCHBusServiceManager {
if (mService == null){
mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create( IOchBusApiService.class, baseUrl);
}
- mService.queryBusOrders(MoGoAiCloudClientConfig.getInstance().getSn())
+ mService.queryBusOrders(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(getSubscribeImpl(context,callback,"queryBusOrders"));
}
+ public void queryBusLines(Context context, OCHServiceCallback callback){
+ if (mService == null){
+ mService = MogoApisHandler.getInstance().getApis().getNetworkApi().create(IOchBusApiService.class,baseUrl);
+ }
+ mService.queryBusLines(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken(),MoGoAiCloudClientConfig.getInstance().getSn())
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(getSubscribeImpl(context,callback,"queryBusLines"));
+ }
+
/**
* 车机端上传心跳数据(只在出车状态时上传):包含高德坐标系经纬度
* @param context
@@ -198,7 +234,8 @@ public class OCHBusServiceManager {
mService = MogoApisHandler.getInstance().getApis().getNetworkApi()
.create(IOchBusApiService.class, baseUrl);
}
- mService.runCarHeartbeat(new CarHeartbeatReqBean(
+ mService.runCarHeartbeat(MoGoAiCloudClientConfig.getInstance().getServiceAppId()
+ ,MoGoAiCloudClientConfig.getInstance().getToken(),new CarHeartbeatReqBean(
MoGoAiCloudClientConfig.getInstance().getSn(), lon, lat))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusLineModel.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusLineModel.java
new file mode 100644
index 0000000000..c176a5eab2
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusLineModel.java
@@ -0,0 +1,78 @@
+package com.mogo.och.bus.presenter;
+
+import android.content.Context;
+
+import com.mogo.commons.AbsMogoApplication;
+import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
+import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
+import com.mogo.och.bus.bean.BusQueryLinesResponse;
+import com.mogo.och.bus.bean.OchBusRoutesResponse;
+import com.mogo.och.bus.callback.BusLinesCallback;
+import com.mogo.och.bus.net.OCHBusServiceManager;
+import com.mogo.och.bus.net.OCHServiceCallback;
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/2/9
+ */
+public class OchBusLineModel {
+ private static volatile OchBusLineModel sInstance;
+ private Context mContext;
+ private BusLinesCallback mBusLinesCallback;
+ public static OchBusLineModel getInstance() {
+ if ( sInstance == null ) {
+ synchronized ( OchBusLineModel.class ) {
+ if ( sInstance == null ) {
+ sInstance = new OchBusLineModel();
+ }
+ }
+ }
+ return sInstance;
+ }
+ private OchBusLineModel() {
+
+ }
+ public void init() {
+ mContext = AbsMogoApplication.getApp();
+ }
+ public void setBusLinesCallback(BusLinesCallback callback){
+ mBusLinesCallback = callback;
+ }
+ public void queryBusLines(){
+ OCHBusServiceManager.getInstance().queryBusLines(mContext, new OCHServiceCallback() {
+ @Override
+ public void onSuccess(BusQueryLinesResponse data) {
+ if (null == data && mBusLinesCallback != null) {
+ mBusLinesCallback.onBusLinesChange(null);
+ return;
+ }
+
+ if (mBusLinesCallback != null){
+ mBusLinesCallback.onBusLinesChange(data);
+ }
+ }
+
+ @Override
+ public void onFail(String failMsg) {
+
+ }
+ });
+ }
+
+ public void commitSwitchLineId(int lineId){
+ OCHBusServiceManager.getInstance().resetStationStatus(mContext,lineId, new OCHServiceCallback() {
+ @Override
+ public void onSuccess(OchBusRoutesResponse o) {
+ if (mBusLinesCallback != null){
+ mBusLinesCallback.onChangeLineIdSuccess();
+ }
+ }
+
+ @Override
+ public void onFail(String failMsg) {
+ TipToast.longTip("切换路线失败");
+ }
+ });
+ }
+
+}
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusLinePresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusLinePresenter.java
new file mode 100644
index 0000000000..de2289284a
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusLinePresenter.java
@@ -0,0 +1,61 @@
+package com.mogo.och.bus.presenter;
+
+import androidx.annotation.NonNull;
+import androidx.lifecycle.LifecycleOwner;
+
+import com.mogo.commons.mvp.Presenter;
+import com.mogo.och.bus.bean.BusQueryLinesResponse;
+import com.mogo.och.bus.callback.BusLinesCallback;
+import com.mogo.och.bus.ui.BusSwitchLineActivity;
+import com.mogo.och.bus.ui.BusSwitchLineView;
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/2/9
+ */
+public class OchBusLinePresenter extends Presenter implements BusLinesCallback {
+
+ public OchBusLinePresenter(BusSwitchLineView view) {
+ super(view);
+ OchBusLineModel.getInstance().init();
+ OchBusOrderModel.getInstance().init();
+ }
+
+ @Override
+ public void onCreate(@NonNull LifecycleOwner owner) {
+ super.onCreate(owner);
+ initListener();
+ }
+
+ private void initListener() {
+ OchBusLineModel.getInstance().setBusLinesCallback(this);
+ }
+
+ @Override
+ public void onBusLinesChange(BusQueryLinesResponse lines) {
+ mView.onBusLinesChange(lines);
+ }
+
+ @Override
+ public void onChangeLineIdSuccess() {
+ mView.onChangeLineIdSuccess();
+ }
+
+ public void queryBusLines(){
+ OchBusLineModel.getInstance().queryBusLines();
+ }
+
+ public void commitSwitchLineId(int lineId){
+ OchBusLineModel.getInstance().commitSwitchLineId(lineId);
+ }
+
+ public void queryBusRoutes(){
+ OchBusOrderModel.getInstance().queryBusRoutes();
+ }
+
+ @Override
+ public void onDestroy(@NonNull LifecycleOwner owner) {
+ super.onDestroy(owner);
+ OchBusLineModel.getInstance().setBusLinesCallback(null);
+ }
+}
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java
index 28ffdba68d..3fb034c010 100644
--- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusOrderModel.java
@@ -107,6 +107,7 @@ public class OchBusOrderModel {
return false;
}
});
+
public static OchBusOrderModel getInstance() {
if ( sInstance == null ) {
synchronized ( OchBusOrderModel.class ) {
@@ -121,6 +122,7 @@ public class OchBusOrderModel {
private OchBusOrderModel() {
}
+
public void init() {
mContext = AbsMogoApplication.getApp();
// 2021/10/20 衡阳小巴业务,使用LenovoPad时需要此app自己获取坐标并上传
@@ -138,7 +140,8 @@ public class OchBusOrderModel {
//2022.1.28
// 调用Disposable.dispose() 时候会出现InterruptedException 导致出现崩溃
- // The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the excTeption has nowhere to go to begin with
+ // The exception could not be delivered to the consumer because it has already canceled/disposed
+ // the flow or the excTeption has nowhere to go to begin with
RxJavaPlugins.setErrorHandler(new Consumer() {
@Override
public void accept(Throwable e) {
@@ -179,15 +182,19 @@ public class OchBusOrderModel {
public void setCarOperationStatusCallback(CarOperationStatusCallback callback){
this.carOperationStatusCallback = callback;
}
+
public void setRefreshBusStationsCallback(RefreshBusStationsCallback callback){
this.refreshBusStationsCallback = callback;
}
+
public void setSlidePannelHideCallback(SlidePannelHideCallback callback){
this.slidePannelHideCallback = callback;
}
+
public void setControllerStatusCallback(IOCHBusControllerStatusCallback callback) {
this.mControllerStatusCallback = callback;
}
+
/**
* 轮询bus待服务订单
*/
@@ -224,7 +231,8 @@ public class OchBusOrderModel {
tailNum = order.getPassengerPhone();
}
Logger.d(TAG, "TTS:" + tailNum);
- AIAssist.getInstance(mContext).speakTTSVoice("接到新订单,尾号 " + tailNum + " 上车站点为 " + order.getStartStationName());
+ AIAssist.getInstance(mContext).speakTTSVoice("接到新订单,尾号 " + tailNum
+ + " 上车站点为 " + order.getStartStationName());
prevBusOrderIds.add(order.getOrderId());
} catch (Exception e) {
e.printStackTrace();
@@ -256,10 +264,12 @@ public class OchBusOrderModel {
.getRegisterCenterApi()
.unregisterCarLocationChangedListener(TAG, mCarLocationChangedListener2);
}
+
private Object readResolve() {
// 阻止反序列化,必须实现 Serializable 接口
return sInstance;
}
+
private IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
// VR mode变更回调
@Override
@@ -271,6 +281,7 @@ public class OchBusOrderModel {
}
}
};
+
// 自车定位
private IMogoCarLocationChangedListener2 mCarLocationChangedListener2 = new IMogoCarLocationChangedListener2() {
@@ -303,6 +314,7 @@ public class OchBusOrderModel {
}
}
};
+
/**
* 查询小巴路线
*/
@@ -334,7 +346,8 @@ public class OchBusOrderModel {
*/
public void debugResetStationStatus() {
Logger.d( TAG, "测试、重置站点状态");
- OCHBusServiceManager.getInstance().debugResetStationStatus(mContext, currentLineId, new OCHServiceCallback() {
+ OCHBusServiceManager.getInstance().resetStationStatus(mContext, currentLineId
+ , new OCHServiceCallback() {
@Override
public void onSuccess(OchBusRoutesResponse o) {
Logger.d(TAG, "获取到小巴路线数据: " + o);
@@ -353,12 +366,14 @@ public class OchBusOrderModel {
});
}
+
/**
* 离站上报
*/
public void leaveStation(boolean isOneWayOver,boolean isRestart){
Log.d(TAG,"leaveStation-backgroundCurrentStationIndex = "+backgroundCurrentStationIndex);
- OCHBusServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq(), stationList.get(backgroundCurrentStationIndex).getSiteId(), new OCHServiceCallback() {
+ OCHBusServiceManager.getInstance().leaveStation(mContext, stationList.get(backgroundCurrentStationIndex).getSeq()
+ , stationList.get(backgroundCurrentStationIndex).getSiteId(), new OCHServiceCallback() {
@Override
public void onSuccess(OchBusRoutesResponse o) {
if ( o.getResult() == null || o.getResult().getSites() == null || o.getResult().getSites().isEmpty() ) {
@@ -385,6 +400,7 @@ public class OchBusOrderModel {
}
});
}
+
/**
* 离站上报成功后渲染站点
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
@@ -405,6 +421,10 @@ public class OchBusOrderModel {
AIAssist.getInstance( mContext ).speakTTSVoice( "欢迎乘坐’蘑菇车联‘无人驾驶小巴车,请您坐好,注意乘车安全,行程即将开始" );
}
+ /**
+ * 开启自动驾驶
+ * @param isRestart
+ */
private void startAutopilot(boolean isRestart) {
OchBusStation currentStation = stationList.get( currentStationIndex -1);
OchBusStation nextStation = stationList.get( currentStationIndex);
@@ -417,8 +437,10 @@ public class OchBusOrderModel {
currentAutopilot.isSpeakVoice = !isRestart;
currentAutopilot.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName());
currentAutopilot.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName());
- currentAutopilot.startLatLon = new AutopilotControlParameters.AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
- currentAutopilot.endLatLon = new AutopilotControlParameters.AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
+ currentAutopilot.startLatLon = new AutopilotControlParameters
+ .AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
+ currentAutopilot.endLatLon = new AutopilotControlParameters
+ .AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
currentAutopilot.vehicleType = VEHICLE_TYPE;
Logger.d( TAG, "开启自动驾驶====" + currentAutopilot.toString()
+" startLatLon="+currentStation.getName()+",endLatLon="+nextStation.getName());
@@ -433,7 +455,8 @@ public class OchBusOrderModel {
*/
private void arriveSiteStation(boolean isRestart) {
Log.d(TAG,"arriveSiteStation-currentStationIndex = "+currentStationIndex);
- OCHBusServiceManager.getInstance().arriveSiteStation(mContext, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
+ OCHBusServiceManager.getInstance().arriveSiteStation(mContext
+ , stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
, new OCHServiceCallback() {
@Override
public void onSuccess(BaseData o) {
@@ -457,7 +480,8 @@ public class OchBusOrderModel {
if (site != null && site.size() > 0){
backgroundCurrentStationIndex = currentStationIndex;
if (refreshBusStationsCallback != null){
- refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation(),true);
+ refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex
+ , getNextStopStation(),true);
}
}
}
@@ -468,7 +492,8 @@ public class OchBusOrderModel {
private void queryStationLeaveAwayPassengers() {
Logger.d( TAG, "查询到站下车乘客");
- OCHBusServiceManager.getInstance().queryStationLeaveAwayPassengers(mContext, stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
+ OCHBusServiceManager.getInstance().queryStationLeaveAwayPassengers(mContext
+ , stationList.get(currentStationIndex).getSeq(), stationList.get(currentStationIndex).getSiteId()
, new OCHServiceCallback() {
@Override
public void onSuccess(QueryLeaveAwayPassengersResponse o) {
@@ -485,6 +510,7 @@ public class OchBusOrderModel {
}
});
}
+
/**
* 收车
*/
@@ -506,6 +532,7 @@ public class OchBusOrderModel {
}
});
}
+
/**
* 出车
*/
@@ -516,7 +543,8 @@ public class OchBusOrderModel {
mIsWorking = !mIsWorking;
startOrStopOrderLoop(mIsWorking);
if ( stationList != null && stationList.size() > 0 ) {
- AIAssist.getInstance( mContext ).speakTTSVoice( "车辆已整备完毕,请前往" + stationList.get( currentStationIndex ).getName() + "站点" );
+ AIAssist.getInstance( mContext ).speakTTSVoice( "车辆已整备完毕,请前往"
+ + stationList.get( currentStationIndex ).getName() + "站点" );
}
carOperationStatusCallback.changeOperationStatus(isWorking());
queryBusRoutes();
@@ -531,12 +559,14 @@ public class OchBusOrderModel {
}
});
}
+
/**
* 查询运营状态
*/
public void queryOperationStatus() {
Logger.d( TAG, "查询运营状态");
- OCHBusServiceManager.getInstance().queryOperationStatus(mContext, new OCHServiceCallback() {
+ OCHBusServiceManager.getInstance().queryOperationStatus(mContext
+ , new OCHServiceCallback() {
@Override
public void onSuccess(OchBusOperationStatusResponse o) {
if ( o.data != null ) {
@@ -554,6 +584,7 @@ public class OchBusOrderModel {
}
});
}
+
/**
* 开启自动驾驶到下一站
*/
@@ -565,6 +596,7 @@ public class OchBusOrderModel {
}
leaveStation(false,isRestart);
}
+
/**
* 渲染站点信息
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
@@ -592,12 +624,16 @@ public class OchBusOrderModel {
}
backgroundCurrentStationIndex = currentStationIndex;
OchBusStation currentStation = stationList.get(currentStationIndex);
- Logger.d( TAG, "渲染站点信息服务端currentStationIndex="+currentStationIndex+" isLeaving()="+currentStation.isLeaving());
- if (currentStationIndex == 0 && !currentStation.isLeaving()){//当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态,订单开始站下在始发站的状态流转有问题
+ Logger.d( TAG, "渲染站点信息服务端currentStationIndex="+currentStationIndex
+ +" isLeaving()="+currentStation.isLeaving());
+ //当前站点是始发站,告诉服务端到达始发站。 如果没有这个节点, 服务器不知道始发站到达状态
+ // ,订单开始站下在始发站的状态流转有问题
+ if (currentStationIndex == 0 && !currentStation.isLeaving()){
arriveSiteStation(true);
}
// 美化是否开始
- if (FunctionBuildConfig.isDemoMode && ((currentStationIndex > 0 && currentStationIndex < stationList.size()-1)
+ if (FunctionBuildConfig.isDemoMode && ((currentStationIndex > 0
+ && currentStationIndex < stationList.size()-1)
|| (stationList.get(0).isLeaving() || stationList.get(stationList.size() -1).isLeaving()))){//行驶过程中设置美化
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;
Logger.d(TAG, "美化模式-ignore:置为true(每次滑动出发)");
@@ -605,9 +641,11 @@ public class OchBusOrderModel {
if (refreshBusStationsCallback != null){
if (currentStation.isLeaving()){//如果服务端的当前站是leaving状态,展示当前站需要+1
currentStationIndex ++;
- refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation(),false);
+ refreshBusStationsCallback.refreshBusStations(stationList
+ , currentStationIndex, getNextStopStation(),false);
}else{
- refreshBusStationsCallback.refreshBusStations(stationList, currentStationIndex, getNextStopStation(),true);
+ refreshBusStationsCallback.refreshBusStations(stationList
+ , currentStationIndex, getNextStopStation(),true);
}
}
if ( currentStation.isLeaving() && slidePannelHideCallback != null) {
@@ -635,6 +673,7 @@ public class OchBusOrderModel {
autoDriveToNextStation( true );
}
}
+
/**
* 根据订单状态、获取下一站靠站的的站点
*
@@ -653,6 +692,7 @@ public class OchBusOrderModel {
}
return nextStationIndex;
}
+
/**
* 延时查询站点信心
*/
@@ -669,6 +709,7 @@ public class OchBusOrderModel {
autoDriveToNextStation( true );
}
}
+
/**
* 播报下车乘客信息
*
@@ -686,7 +727,8 @@ public class OchBusOrderModel {
if ( !station.endsWith( "站" ) ) {
builder.append( "站" );
}
- if ( awayPassengersResponse == null || awayPassengersResponse.data == null || awayPassengersResponse.data.orders == null || awayPassengersResponse.data.orders.isEmpty() ) {
+ if ( awayPassengersResponse == null || awayPassengersResponse.data == null
+ || awayPassengersResponse.data.orders == null || awayPassengersResponse.data.orders.isEmpty() ) {
Logger.d( TAG, "播报下车乘客信息为null");
} else {
builder.append( ",请尾号为 " );
@@ -709,6 +751,7 @@ public class OchBusOrderModel {
Logger.d(TAG, "TTS:" + builder.toString());
AIAssist.getInstance( mContext ).speakTTSVoice( builder.toString() );
}
+
/**
* 修改小巴运营状态
*/
@@ -720,6 +763,7 @@ public class OchBusOrderModel {
startTakeOrder();
}
}
+
/**
* 行程结束
*/
@@ -735,9 +779,11 @@ public class OchBusOrderModel {
AIAssist.getInstance( mContext ).speakTTSVoice( "感谢您体验'蘑菇车联'无人驾驶小巴车,请您携带好随身物品,我们下次再见" );
leaveStation(true,true);
}
+
public boolean isWorking() {
return mIsWorking;
}
+
/**
* 到站
* @param data
@@ -766,6 +812,7 @@ public class OchBusOrderModel {
}
},1500);
}
+
public boolean isGoingToNextStation() {
return isGoingToNextStation;
}
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java
index f5a0301b04..6b741f08cf 100644
--- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/presenter/OchBusPresenter.java
@@ -33,8 +33,12 @@ import java.util.List;
*
* @author tongchenfei
*/
-public class OchBusPresenter extends Presenter< OchBusFragment > implements CarOperationStatusCallback, RefreshBusStationsCallback, SlidePannelHideCallback, IMoGoAutopilotStatusListener, IOCHBusControllerStatusCallback {
+public class OchBusPresenter extends Presenter< OchBusFragment >
+ implements CarOperationStatusCallback, RefreshBusStationsCallback, SlidePannelHideCallback
+ , IMoGoAutopilotStatusListener, IOCHBusControllerStatusCallback {
+
private static final String TAG = "OchBusPresenter";
+
private int currentAutopilotStatus = -1;
private boolean isAnimateRunning = false;
private List mStationList = new ArrayList<>();
@@ -54,38 +58,46 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements CarO
OchBusOrderModel.getInstance().queryBusRoutes();
initModelListener();
}
+
@Override
public void onDestroy(@NonNull LifecycleOwner owner) {
super.onDestroy(owner);
OchBusOrderModel.getInstance().release();
releaseListener();
}
+
public void initModelListener(){
OchBusOrderModel.getInstance().setCarOperationStatusCallback(this);
OchBusOrderModel.getInstance().setRefreshBusStationsCallback(this);
OchBusOrderModel.getInstance().setSlidePannelHideCallback(this);
OchBusOrderModel.getInstance().setControllerStatusCallback(this);
}
+
public void releaseListener(){
OchBusOrderModel.getInstance().setCarOperationStatusCallback(null);
OchBusOrderModel.getInstance().setRefreshBusStationsCallback(null);
OchBusOrderModel.getInstance().setSlidePannelHideCallback(null);
OchBusOrderModel.getInstance().setControllerStatusCallback(null);
}
+
public void queryBusRoutes(){
OchBusOrderModel.getInstance().queryBusRoutes();
}
+
public void debugResetStationStatus(){
OchBusOrderModel.getInstance().debugResetStationStatus();
}
+
public void autoDriveToNextStation(boolean isRestart){
currentAutopilotStatus = -1;
OchBusOrderModel.getInstance().autoDriveToNextStation(isRestart);
}
+
public void restartAutopilot(){
currentAutopilotStatus = -1;
OchBusOrderModel.getInstance().restartAutopilot();
}
+
public void onChangeOperationStatus(){
OchBusOrderModel.getInstance().onChangeOperationStatus();
}
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.java
new file mode 100644
index 0000000000..6dc465f911
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineActivity.java
@@ -0,0 +1,295 @@
+package com.mogo.och.bus.ui;
+
+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.mogo.toast.TipToast;
+import com.mogo.och.bus.R;
+import com.mogo.och.bus.bean.BusQueryLinesResponse;
+import com.mogo.och.bus.presenter.OchBusLinePresenter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/2/8
+ */
+public class BusSwitchLineActivity extends MvpActivity
+ implements View.OnClickListener, BusSwitchLineView {
+
+ private ImageView mClose;
+ private ConstraintLayout mNoDatasView;
+ private RecyclerView mLinesListView;
+ private TextView mLineCommitBtn;
+ private SwitchLineAdapter mAdapter;
+ private List mData = new ArrayList<>();
+ private int mSelectLineId = -1;
+
+ @Override
+ protected int getLayoutId() {
+ return R.layout.activity_bus_switch_line;
+ }
+
+ @NonNull
+ @Override
+ protected OchBusLinePresenter createPresenter() {
+ return new OchBusLinePresenter(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(this,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(BusQueryLinesResponse 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 -1){
+ mPresenter.commitSwitchLineId(mSelectLineId);
+ }else {
+ finish();
+ }
+ return;
+ }
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ if (mAdapter != null){
+ mAdapter.setOnLineItemClickListener(null);
+ }
+ }
+
+ /**
+ * 路线列表adapter
+ */
+ static class SwitchLineAdapter extends RecyclerView.Adapter{
+
+ private Context mContext;
+ private List mData;
+ // RecyclerView设置点击事件
+ private LineItemClickListener mItemClickListener ;
+ private int clickPos = -1;
+
+ public SwitchLineAdapter(Context context, List data){
+ mContext = context;
+ mData = data;
+ }
+
+ @NonNull
+ @Override
+ public SwitchLineViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(mContext).inflate(R.layout.bus_switch_line_list_item
+ ,parent,false);
+ SwitchLineViewHolder viewHolder = new SwitchLineViewHolder(view);
+ return viewHolder;
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull SwitchLineViewHolder holder, int position) {
+ BusQueryLinesResponse.Result line = mData.get(position);
+ holder.lineName.setText(mContext.getString(R.string.bus_switch_line_name)+" "+line.name);
+ holder.lineStartName.setText(mContext.getString(R.string.bus_line_start)+" "+line.startSiteName);
+ holder.lineEndName.setText(mContext.getString(R.string.bus_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.bus_selected_btn);
+ }else {
+ holder.selectIv.setImageResource(R.drawable.bus_unselect_btn);
+ }
+ }else {
+ if (line.choose == 1){//1:绑定 2:未绑定 默认绑定
+ holder.selectIv.setImageResource(R.drawable.bus_selected_btn);
+ }else {
+ holder.selectIv.setImageResource(R.drawable.bus_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) ;
+ }
+}
diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineView.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineView.java
new file mode 100644
index 0000000000..febd6429b1
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/ui/BusSwitchLineView.java
@@ -0,0 +1,15 @@
+package com.mogo.och.bus.ui;
+
+import com.mogo.commons.mvp.IView;
+import com.mogo.och.bus.bean.BusQueryLinesResponse;
+
+/**
+ * @author: wangmingjun
+ * @date: 2022/2/10
+ */
+public interface BusSwitchLineView extends IView {
+
+ void onBusLinesChange(BusQueryLinesResponse data);
+ void onChangeLineIdSuccess();
+}
+
diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_selected_btn.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_selected_btn.png
new file mode 100644
index 0000000000..3f05565483
Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_selected_btn.png differ
diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_switch_line_close.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_switch_line_close.png
new file mode 100644
index 0000000000..370b61de38
Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_switch_line_close.png differ
diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_unselect_btn.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_unselect_btn.png
new file mode 100644
index 0000000000..0114bb4f2b
Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1440/bus_unselect_btn.png differ
diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_selected_btn.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_selected_btn.png
new file mode 100644
index 0000000000..3f05565483
Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_selected_btn.png differ
diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_switch_line_close.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_switch_line_close.png
new file mode 100644
index 0000000000..370b61de38
Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_switch_line_close.png differ
diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_unselect_btn.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_unselect_btn.png
new file mode 100644
index 0000000000..0114bb4f2b
Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi-2560x1600/bus_unselect_btn.png differ
diff --git a/OCH/mogo-och-bus/src/main/res/drawable-xhdpi/no_order_data.png b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi/no_order_data.png
new file mode 100644
index 0000000000..0e61996d3f
Binary files /dev/null and b/OCH/mogo-och-bus/src/main/res/drawable-xhdpi/no_order_data.png differ
diff --git a/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_status_bg.xml b/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_status_bg.xml
index a830539009..9a276b035d 100644
--- a/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_status_bg.xml
+++ b/OCH/mogo-och-bus/src/main/res/drawable/bus_autopilot_status_bg.xml
@@ -2,43 +2,43 @@
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
-
-
+
-
-
+
-
-
+
-
-
+
diff --git a/OCH/mogo-och-bus/src/main/res/drawable/bus_checkbox_selector.xml b/OCH/mogo-och-bus/src/main/res/drawable/bus_checkbox_selector.xml
new file mode 100644
index 0000000000..d95e931160
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/res/drawable/bus_checkbox_selector.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/drawable/bus_panel_bkg.xml b/OCH/mogo-och-bus/src/main/res/drawable/bus_panel_bkg.xml
index 204c5fc692..d7937835a0 100644
--- a/OCH/mogo-och-bus/src/main/res/drawable/bus_panel_bkg.xml
+++ b/OCH/mogo-och-bus/src/main/res/drawable/bus_panel_bkg.xml
@@ -2,7 +2,7 @@
-
-
+
@@ -12,7 +12,7 @@
android:right="3px"
android:top="3px">
-
+
diff --git a/OCH/mogo-och-bus/src/main/res/drawable/bus_switch_line_btn.xml b/OCH/mogo-och-bus/src/main/res/drawable/bus_switch_line_btn.xml
new file mode 100644
index 0000000000..8062bcf093
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/res/drawable/bus_switch_line_btn.xml
@@ -0,0 +1,12 @@
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/drawable/bus_switch_line_btn_commit.xml b/OCH/mogo-och-bus/src/main/res/drawable/bus_switch_line_btn_commit.xml
new file mode 100644
index 0000000000..324b9ece10
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/res/drawable/bus_switch_line_btn_commit.xml
@@ -0,0 +1,16 @@
+
+
+ -
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/drawable/bus_switch_line_btn_un_commit.xml b/OCH/mogo-och-bus/src/main/res/drawable/bus_switch_line_btn_un_commit.xml
new file mode 100644
index 0000000000..d0ea7fa041
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/res/drawable/bus_switch_line_btn_un_commit.xml
@@ -0,0 +1,16 @@
+
+
+ -
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/layout/activity_bus_switch_line.xml b/OCH/mogo-och-bus/src/main/res/layout/activity_bus_switch_line.xml
new file mode 100644
index 0000000000..0c04f9c833
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/res/layout/activity_bus_switch_line.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/layout/bus_no_data_common_view.xml b/OCH/mogo-och-bus/src/main/res/layout/bus_no_data_common_view.xml
new file mode 100644
index 0000000000..b5a80553d0
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/res/layout/bus_no_data_common_view.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/layout/bus_switch_line_list_item.xml b/OCH/mogo-och-bus/src/main/res/layout/bus_switch_line_list_item.xml
new file mode 100644
index 0000000000..273b53d516
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/res/layout/bus_switch_line_list_item.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml b/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml
index 84e1495b9c..558429d9ec 100644
--- a/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml
+++ b/OCH/mogo-och-bus/src/main/res/layout/fragment_och_bus.xml
@@ -1,24 +1,35 @@
-
-
+ android:background="@drawable/bus_panel_bkg">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ android:textStyle="bold"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintRight_toRightOf="parent"/>
+ android:paddingBottom="@dimen/module_och_bus_order_status_stationInfo_paddingBottom"
+ app:layout_constraintTop_toBottomOf="@+id/module_och_bus_tag"
+ app:layout_constraintLeft_toLeftOf="parent">
-
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1440/dimens.xml b/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1440/dimens.xml
index 0a257a4014..3ef9d9d932 100644
--- a/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1440/dimens.xml
+++ b/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1440/dimens.xml
@@ -87,7 +87,7 @@
30px
466px
- 414px
+ 446px
36px
@@ -116,4 +116,12 @@
50px
60px
+
+ 46px
+ 700px
+ 120px
+ 86px
+
+ 20px
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1600/dimens.xml b/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1600/dimens.xml
index b4b6ec1da2..8f068b0633 100644
--- a/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1600/dimens.xml
+++ b/OCH/mogo-och-bus/src/main/res/values-xhdpi-2560x1600/dimens.xml
@@ -87,7 +87,7 @@
30px
466px
- 414px
+ 446px
36px
@@ -116,4 +116,9 @@
50px
60px
+ 46px
+ 700px
+ 120px
+ 86px
+ 50px
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/values/attrs.xml b/OCH/mogo-och-bus/src/main/res/values/attrs.xml
index 33fc037d9c..396db92f74 100644
--- a/OCH/mogo-och-bus/src/main/res/values/attrs.xml
+++ b/OCH/mogo-och-bus/src/main/res/values/attrs.xml
@@ -9,4 +9,5 @@
+
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/values/colors.xml b/OCH/mogo-och-bus/src/main/res/values/colors.xml
index d00508078d..a702d05967 100644
--- a/OCH/mogo-och-bus/src/main/res/values/colors.xml
+++ b/OCH/mogo-och-bus/src/main/res/values/colors.xml
@@ -32,5 +32,10 @@
#3E77F6
#323C6F
+ #2966EC
+ #F0151D41
+
+ #19FFFFFF
+ #FFFFFF
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/values/dimens.xml b/OCH/mogo-och-bus/src/main/res/values/dimens.xml
index 6fcc61920c..49e258a5e0 100644
--- a/OCH/mogo-och-bus/src/main/res/values/dimens.xml
+++ b/OCH/mogo-och-bus/src/main/res/values/dimens.xml
@@ -132,4 +132,9 @@
35px
822px
+ 30px
+ 450px
+ 72px
+ 52px
+ 20px
\ No newline at end of file
diff --git a/OCH/mogo-och-bus/src/main/res/values/strings.xml b/OCH/mogo-och-bus/src/main/res/values/strings.xml
index 7c837211af..8ebaa40023 100644
--- a/OCH/mogo-och-bus/src/main/res/values/strings.xml
+++ b/OCH/mogo-och-bus/src/main/res/values/strings.xml
@@ -5,4 +5,22 @@
启动成功
启动失败
自动驾驶
+ 路线列表
+ 路线:
+ 起点:
+ 终点:
+ 确认
+ 切换路线
+ 自动驾驶中,不可切换路线
+ 当前行程未完成,不可切换路线
+ 当前车辆无路线\n请联系运营人员绑定
+ 起点:
+ 终点:
+ 更换路线成功
+ 更换路线失败
+
+ 始
+
+ 终
+
diff --git a/OCH/mogo-och-bus/src/main/res/values/style.xml b/OCH/mogo-och-bus/src/main/res/values/style.xml
new file mode 100644
index 0000000000..36d7ef0d93
--- /dev/null
+++ b/OCH/mogo-och-bus/src/main/res/values/style.xml
@@ -0,0 +1,23 @@
+
+
+
+
diff --git a/gradle.properties b/gradle.properties
index 4fc8fbe279..94f8099b08 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -91,7 +91,7 @@ applicationId=com.mogo.launcer
applicationName=IntelligentPilot
# RoboBus司机端:2.5.1;RoboTaxi司机端:2.5.1;RoboTaxi乘客端:1.0.0
versionCode=80008
-versionName=2.5.1
+versionName=2.5.2
################# 新架构模块Maven版本管理 #################
MOGO_CORE_FUNCTION_AUTOPILOT_VERSION=0.0.58.10