[2.15.0] bus乘客屏增加同步路线信息

This commit is contained in:
wangmingjun
2023-04-13 20:09:49 +08:00
parent 7a1933055c
commit 1076cccb77
3 changed files with 87 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
package com.mogo.och.bus.passenger;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI_P;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import android.content.Context;
@@ -64,18 +64,18 @@ public class MogoOCHBusPassenger implements IMogoOCH {
* 进入鹰眼模式,设置手势缩放地图失效
*/
private void stepIntoVrMode() {
CallerLogger.INSTANCE.d( M_TAXI_P + TAG, "进入vr模式" );
CallerLogger.INSTANCE.d( M_BUS_P + TAG, "进入vr模式" );
CallerMoGoUiSettingManager.INSTANCE.stepInDayMode();//白天模式 状态栏字体颜色变黑
}
private void showFragment() {
if (mPassengerFragment == null) {
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "准备add fragment======");
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "准备add fragment======");
mPassengerFragment = new BusPassengerRouteFragment();
mActivity.getSupportFragmentManager().beginTransaction().add(mContainerId, mPassengerFragment).commitAllowingStateLoss();
return;
}
CallerLogger.INSTANCE.d(M_TAXI_P + TAG, "准备show fragment");
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "准备show fragment");
mActivity.getSupportFragmentManager().beginTransaction().show(mPassengerFragment).commitAllowingStateLoss();
}

View File

@@ -46,6 +46,18 @@ public class BusPassengerRoutesResult {
return runningDur;
}
public String csvFileUrl = ""; //轨迹文件下载的cos url默认“”
public String csvFileMd5 = ""; //轨迹文件md5默认“”
public String txtFileUrl = ""; //打点文件下载的cos url默认“”
public String txtFileMd5 = ""; //轨迹文件md5默认“”
public long contrailSaveTime; //上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
public String carModel = ""; //[optional] 车型号如红旗H9默认“”暂不加入校验逻辑、用于人工排查问题
public String csvFileUrlDPQP = ""; //轨迹文件下载的cos url默认“”
public String csvFileMd5DPQP = ""; //轨迹文件md5默认“”
public String txtFileUrlDPQP = ""; //打点文件下载的cos url默认“”
public String txtFileMd5DPQP = ""; //轨迹文件md5默认“”
public long contrailSaveTimeDPQP; //上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
@Override
public String toString() {
return "BusPassengerRoutesResult{" +
@@ -56,6 +68,18 @@ public class BusPassengerRoutesResult {
", description='" + description + '\'' +
", status=" + status +
", runningDur='" + runningDur + '\'' +
", taskTime=" + taskTime +
", csvFileUrl='" + csvFileUrl + '\'' +
", csvFileMd5='" + csvFileMd5 + '\'' +
", txtFileUrl='" + txtFileUrl + '\'' +
", txtFileMd5='" + txtFileMd5 + '\'' +
", contrailSaveTime=" + contrailSaveTime +
", carModel='" + carModel + '\'' +
", csvFileUrlDPQP='" + csvFileUrlDPQP + '\'' +
", csvFileMd5DPQP='" + csvFileMd5DPQP + '\'' +
", txtFileUrlDPQP='" + txtFileUrlDPQP + '\'' +
", txtFileMd5DPQP='" + txtFileMd5DPQP + '\'' +
", contrailSaveTimeDPQP=" + contrailSaveTimeDPQP +
'}';
}

View File

@@ -21,6 +21,7 @@ import com.mogo.commons.module.intent.IntentManager;
import com.mogo.commons.module.status.IMogoStatusChangedListener;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.commons.module.status.StatusDescriptor;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLocation;
@@ -53,6 +54,7 @@ import com.mogo.och.bus.passenger.network.BusPassengerServiceManager;
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
import com.mogo.och.common.module.utils.PinYinUtil;
import org.jetbrains.annotations.NotNull;
@@ -215,21 +217,24 @@ public class BusPassengerModel {
mStations.addAll(stations);
for (int i = 0; i< stations.size(); i++){
BusPassengerStation station = stations.get(i);
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){
if (station.getDrivingStatus() == STATION_STATUS_STOPPED && station.isLeaving() && i+1 < stations.size()){ //离站
mRouteLineInfoCallback.updateStationsInfo(stations,i+1,false);
if(mNextStationIndex != i+1){
mTwoStationsRouts.clear();
startRemainRouteInfo();
}
mNextStationIndex = i+1;
updateAutopilotControlParameters(result,i);
return;
}else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){
}else if (station.getDrivingStatus() == STATION_STATUS_STOPPED && !station.isLeaving()){ //到站
if (i == 0){
startOrStopRouteAndWipe(false);
}
mPreRouteIndex = 0;
startOrStopCalculateRouteInfo(false);
mRouteLineInfoCallback.updateStationsInfo(stations,i,true);
clearAutopilotControlParameters();
return;
}
}
@@ -238,6 +243,58 @@ public class BusPassengerModel {
}
private void updateAutopilotControlParameters(BusPassengerRoutesResult busRoutesResult,
int leaveIndex) {
AutopilotControlParameters parameters = initAutopilotControlParameters(busRoutesResult,leaveIndex);
if (null == parameters) {
CallerLogger.INSTANCE.e(M_BUS_P + TAG, "AutopilotControlParameters is empty.");
return;
}
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "AutopilotControlParameters is update.");
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(parameters);
}
private void clearAutopilotControlParameters() {
CallerLogger.INSTANCE.d(M_BUS_P + TAG, "AutopilotControlParameters is clear.");
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(null);
}
private AutopilotControlParameters initAutopilotControlParameters(BusPassengerRoutesResult busRoutesResult,
int leaveIndex) {
if (busRoutesResult.getSites() == null){ return null ;}
List<BusPassengerStation> stations = busRoutesResult.getSites();
if (leaveIndex + 1 > stations.size() - 1) {
CallerLogger.INSTANCE.e(M_BUS_P + TAG, "行程日志-mismatch condition1.");
return null;
}
BusPassengerStation currentStation = stations.get(leaveIndex);
BusPassengerStation nextStation = stations.get(leaveIndex + 1);
AutopilotControlParameters parameters = new AutopilotControlParameters();
parameters.routeID = busRoutesResult.getLineId();
parameters.routeName = busRoutesResult.getName();
parameters.startName = PinYinUtil.getPinYinHeadChar(currentStation.getName());
parameters.endName = PinYinUtil.getPinYinHeadChar(nextStation.getName());
parameters.startLatLon = new AutopilotControlParameters
.AutoPilotLonLat(currentStation.getLat(), currentStation.getLon());
parameters.endLatLon = new AutopilotControlParameters
.AutoPilotLonLat(nextStation.getLat(), nextStation.getLon());
parameters.vehicleType = 10;
if (parameters.autoPilotLine == null) {
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
busRoutesResult.getLineId(),
busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5,
busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5,
busRoutesResult.contrailSaveTime, busRoutesResult.carModel,
busRoutesResult.csvFileUrlDPQP, busRoutesResult.csvFileMd5DPQP,
busRoutesResult.txtFileUrlDPQP, busRoutesResult.txtFileMd5DPQP,
busRoutesResult.contrailSaveTimeDPQP);
}
return parameters;
}
public void release() {
releaseListeners();
startOrStopCalculateRouteInfo(false);