[2.12.0] bus司机端给外屏接口调整

This commit is contained in:
wangmingjun
2022-10-26 12:13:21 +08:00
parent 314a0899d6
commit f33a63cb64
2 changed files with 36 additions and 21 deletions

View File

@@ -481,6 +481,7 @@ public class BusOrderModel {
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.END_TRIP
, busRoutesResult.getName()
,""
,""
,false);
}
}
@@ -490,16 +491,27 @@ public class BusOrderModel {
* 服务端返回的OchBusRoutesResult逻辑 离开站为当前站, 到达下一站后才会将下一站置为当前站,
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
*/
private void leaveStationSuccess(int leaveIndex) {
private void leaveStationSuccess(int leaveIndex,String leaveStation,String nextStation) {
onStartAutopilot(leaveIndex);
leaveTTSTips(nextStation);
if (busRoutesResult != null){
boolean isLastStop = false;
if (leaveIndex + 1 == stationList.size() -1){
isLastStop = true;
}
//给bus外屏发送
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.LEAVE_STATION
, busRoutesResult.getName()
,busRoutesResult.getSites().get(leaveIndex).getName()
,false);
,leaveStation
,nextStation
,isLastStop);
}
}
private void onStartAutopilot(int leaveIndex) {
//开启自动驾驶 2.10.0: 如果自动驾驶状态下开启, 非自动驾驶状态下不开启,需手动点击自动驾驶按钮开启
isGoingToNextStation = true;
if (CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState()
@@ -605,6 +617,7 @@ public class BusOrderModel {
}
int arrivedStationIndex = backgroundCurrentStationIndex + 1;
String arriveStation = stationList.get(arrivedStationIndex).getName();
String departureStopName = stationList.get(backgroundCurrentStationIndex).getName();
CallerLogger.INSTANCE.d(M_BUS + TAG,"arriveSiteStation-currentStationIndex = "+ arrivedStationIndex);
BusServiceManager.arriveSiteStation(mContext ,
@@ -617,11 +630,7 @@ 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));
arriveStationSuccess(arrivedStationIndex,departureStopName,arriveStation);
//5s轮询核销乘客
startOrStopQueryPassengerWriteOff(true);
@@ -642,20 +651,23 @@ public class BusOrderModel {
});
}
private void arriveStationSuccess(int arrivedStationIndex) {
private void arriveStationSuccess(int arrivedStationIndex,String departureStopName,String arriveStation) {
if (busRoutesResult != null){
boolean isLastStop;
boolean isLastStop = false;
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()
,departureStopName
,arriveStation
,isLastStop);
}
ttsTips(String.format(mContext
.getString(R.string.bus_arrived_station_tip),
arriveStation));
}
/**
@@ -681,8 +693,7 @@ public class BusOrderModel {
//需要更改当前站和下一站的状态 然后渲染
startOrStopQueryPassengerWriteOff(false);
queryBusRoutes();
leaveStationSuccess(backgroundCurrentStationIndex);
leaveTTSTips(finalNextStationName);
leaveStationSuccess(backgroundCurrentStationIndex,currentStationName,finalNextStationName);
}
@Override
public void onFail(int code, String failMsg) {
@@ -774,7 +785,7 @@ public class BusOrderModel {
&& !stationList.get(0).isLeaving()){ //默认是第一站到站查询
if (busRoutesResult != null){ // 第一站到站也是行程开始的时候
BusSendTripInfoManager.INSTANCE.sendBusTripInfo(BusSendTripInfoManager.START_TRIP
,busRoutesResult.getName(),"",false);
,busRoutesResult.getName(),"","",false);
}
startOrStopQueryPassengerWriteOff(true);
}

View File

@@ -19,13 +19,17 @@ object BusSendTripInfoManager{
* 行程信息
* @param type 事件类型, 1:行程开始, 2:行程结束, 3:出站, 4:进站, 5:城市占道施工预警
* @param lineName 路线名, for type 1, 2
* @param stopName 站点名, for type 3, 4
* @param isLastStop 是否终点站
* @param departureStopName 出站站点名, for type 3, 4
* @param arrivalStopName 下一站到达站点名, for type 3, 4
* @param isLastStop 是否终点站(下一站或者要到达站)
* @return
*/
fun sendBusTripInfo(type: Int, lineName: String, stationName: String, isLastStop: Boolean) {
fun sendBusTripInfo(type: Int, lineName: String,
departureStopName: String,
arrivalStopName: String,
isLastStop: Boolean) {
d(SceneConstant.M_BUS + "BusSendTripInfoManager", "type: "+ type
+", lineName: "+ lineName + ", stationName: "+stationName+", isLastStop: "+isLastStop)
CallerAutoPilotManager.sendTripInfo(type,lineName,stationName, "", isLastStop)
+", lineName: "+ lineName + ", stationName: "+arrivalStopName+", isLastStop: "+isLastStop)
CallerAutoPilotManager.sendTripInfo(type,lineName,departureStopName, arrivalStopName, isLastStop)
}
}