[2.12.0] 1、bus司机端增加通知外屏的行程信息 2、taxi 司机屏送驾导航优化

This commit is contained in:
wangmingjun
2022-10-25 14:18:50 +08:00
parent b20d8e20b0
commit 0e8cf29171
6 changed files with 82 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ import com.mogo.och.bus.bean.BusRoutesResponse;
import com.mogo.och.bus.callback.IBusLinesCallback;
import com.mogo.och.bus.net.BusServiceManager;
import com.mogo.och.bus.ui.BusSwitchLineActivity;
import com.mogo.och.bus.util.BusSendTripInfoManager;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
/**

View File

@@ -49,6 +49,7 @@ import com.mogo.och.bus.constant.BusConst;
import com.mogo.och.bus.net.BusServiceManager;
import com.mogo.och.bus.presenter.BusModelLoopManager;
import com.mogo.och.bus.util.BusAnalyticsManager;
import com.mogo.och.bus.util.BusSendTripInfoManager;
import com.mogo.och.bus.util.BusTrajectoryManager;
import com.mogo.och.common.module.biz.constant.OchCommonConst;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
@@ -67,7 +68,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.disposables.Disposable;
import io.reactivex.exceptions.UndeliverableException;
import io.reactivex.functions.Consumer;
import io.reactivex.plugins.RxJavaPlugins;
@@ -454,7 +454,7 @@ public class BusOrderModel {
@Override
public void onSuccess(BaseData o) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "abortTask success: " + o);
clearNativeTag();
endOrAbortTaskSuccess();
if (o.code == 0){ // 重置成功
queryBusRoutes();
startOrStopQueryPassengerWriteOff(false);
@@ -469,9 +469,20 @@ public class BusOrderModel {
}
private void clearNativeTag() {
/**
* 中断或者正常结束任务后的处理
*/
private void endOrAbortTaskSuccess() {
isGoingToNextStation = false;
backgroundCurrentStationIndex = 0;
if (busRoutesResult != null){
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.END_TRIP
, busRoutesResult.getName()
,""
,false);
}
}
/**
@@ -480,6 +491,15 @@ public class BusOrderModel {
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
*/
private void leaveStationSuccess(int leaveIndex) {
if (busRoutesResult != null){
//给bus外屏发送
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.LEAVE_STATION
, busRoutesResult.getName()
,busRoutesResult.getSites().get(leaveIndex).getName()
,false);
}
//开启自动驾驶 2.10.0: 如果自动驾驶状态下开启, 非自动驾驶状态下不开启,需手动点击自动驾驶按钮开启
isGoingToNextStation = true;
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
@@ -597,6 +617,8 @@ public class BusOrderModel {
CallerLogger.INSTANCE.d(M_BUS + TAG,"行程日志-arriveSiteStation success");
queryBusRoutes();
arriveStationSuccess(arrivedStationIndex);
ttsTips(String.format(mContext
.getString(R.string.bus_arrived_station_tip),
arriveStation));
@@ -620,6 +642,22 @@ public class BusOrderModel {
});
}
private void arriveStationSuccess(int arrivedStationIndex) {
if (busRoutesResult != null){
boolean isLastStop;
if (arrivedStationIndex == busRoutesResult.getSites().size() - 1 ){
isLastStop = true;
}else {
isLastStop = false;
}
//给bus外屏发送
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.ARRIVE_STATION
, busRoutesResult.getName()
,busRoutesResult.getSites().get(arrivedStationIndex).getName()
,isLastStop);
}
}
/**
* 离站上报
*/
@@ -629,6 +667,7 @@ public class BusOrderModel {
if (backgroundCurrentStationIndex < stationList.size() - 1){
nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName();
}
final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName();
String finalNextStationName = nextStationName;
BusServiceManager.leaveStation(mContext,
stationList.get(backgroundCurrentStationIndex).getSeq(),
@@ -734,6 +773,10 @@ public class BusOrderModel {
if (backgroundCurrentStationIndex == 0 &&
stationList.get(0).getDrivingStatus() == STATION_STATUS_STOPPED
&& !stationList.get(0).isLeaving()){ //默认是第一站到站查询
if (busRoutesResult != null){ // 第一站到站也是行程开始的时候
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.START_TRIP
,busRoutesResult.getName(),"",false);
}
startOrStopQueryPassengerWriteOff(true);
}
@@ -837,7 +880,7 @@ public class BusOrderModel {
public void onSuccess(BaseData o) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "endTask success: " + o);
if (o.code == 0){
clearNativeTag();
endOrAbortTaskSuccess();
queryBusRoutes();// 重新获取任务
startOrStopQueryPassengerWriteOff(false);
ttsTips(mContext.getString(R.string.bus_end_task_tip));

View File

@@ -0,0 +1,31 @@
package com.mogo.och.bus.util
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
/**
* @author: wangmingjun
* @date: 2022/10/24
*/
object BusSendTripInfoManager{
const val START_TRIP = 1
const val END_TRIP = 2
const val LEAVE_STATION = 3
const val ARRIVE_STATION = 4
/**
* 行程信息
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
* @param lineName 路线名, for type 1, 2
* @param stopName 站点名, for type 3, 4
* @param isLastStop 是否终点站
* @return
*/
fun sendBusTripInfo(type: Int, lineName: String, stationName: String, isLastStop: Boolean) {
d(SceneConstant.M_BUS + "BusSendTripInfoManager", "type: "+ type
+", lineName: "+ lineName + ", stationName: "+stationName+", isLastStop: "+isLastStop)
CallerAutoPilotManager.sendTripInfo(type,lineName,stationName,isLastStop)
}
}

View File

@@ -1325,7 +1325,6 @@ public class TaxiModel {
}
mRoutePoints.addAll(CoordinateCalculateRouteUtil.coordinateConverterWgsToGcjListCommon(mContext, models));
startDynamicCalculateRouteInfo();
startNaviToEndStation(false);
}
public void startDynamicCalculateRouteInfo() {

View File

@@ -291,6 +291,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
});
mCloseNaviIcon.setOnClickListener(v -> {
showAmapNaviToStationFragment(false);
showRottingToStationFragment(false);
});
}
@@ -566,6 +567,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
protected void showAmapNaviToStationFragment(boolean isShow) {
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
closeAmapViewIFHadeAdd();
if (isShow) {
closeRouteViewIFHadeAdd();
// if (ochNaviFragment == null){
@@ -580,7 +582,6 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
flNaviPanelContainer.setVisibility(View.VISIBLE);
CallerSmpManager.hidePanel();//隐藏小地图
} else {
closeAmapViewIFHadeAdd();
mCloseNaviIcon.setVisibility(View.GONE);
flNaviPanelContainer.setVisibility(View.GONE);
CallerSmpManager.showPanel();//显示小地图

View File

@@ -357,6 +357,7 @@ public class CommonBeingServerdOrdersFragment extends BaseTaxiUIFragment
mNaviToEndIcon.setVisibility(View.GONE);
AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
mTaxiFragment.showAmapNaviToStationFragment(false);
mTaxiFragment.showRottingToStationFragment(false);
}
}
@@ -667,7 +668,6 @@ public class CommonBeingServerdOrdersFragment extends BaseTaxiUIFragment
mTaxiFragment.showAmapNaviToStationFragment(false);
return;
}
mTaxiFragment.showAmapNaviToStationFragment(false);
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {