add new func of dispatch to uploading routing and fix bug of read vip info

This commit is contained in:
zhongchao
2021-11-18 22:00:13 +08:00
parent f934439f19
commit b96cd51281
6 changed files with 172 additions and 35 deletions

View File

@@ -10,12 +10,16 @@ import android.os.Handler;
import android.os.Message;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener;
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.service.dispatch.bean.DispatchAdasAutoPilotLocReceiverBean;
@@ -32,7 +36,7 @@ import java.util.List;
//负责监听自动驾驶状态并进行状态上报,自动驾驶路线上报,接收调度指令展示指令弹窗
public class DispatchAutoPilotManager implements IMogoOnMessageListener<DispatchAdasAutoPilotLocReceiverBean>
, IDispatchRemindClickListener
, IMogoCarLocationChangedListener2, IMogoAdasOCHCallback, IMoGoCheckAutoPilotBtnListener {
, IMogoCarLocationChangedListener2, IMogoAdasOCHCallback, IMoGoCheckAutoPilotBtnListener, IMoGoAutopilotPlanningListener {
private static final String TAG = "DispatchAutoPilotManager";
private static volatile DispatchAutoPilotManager instance;
@@ -97,6 +101,7 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
mApis.getAdasControllerApi()
.addAdasOCHCallback(this);
CallerHmiListenerManager.INSTANCE.addCheckAutoPilotBtnListener(TAG, this);
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this);
dispatchDialogManager = DispatchDialogManager.getInstance(context);
dispatchDialogManager.addIDispatchRemindListener(this);
handler.sendEmptyMessageDelayed(MSG_TYPE_UPLOAD_AUTOPILOT_STATUS, 1000L);
@@ -140,7 +145,7 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
AutopilotControlParameters currentAutopilot = new AutopilotControlParameters();
currentAutopilot.isSpeakVoice = false;
List<AutopilotControlParameters.AutoPilotLonLat> wayLatLon = new ArrayList<>();
if (receiverBean!=null && receiverBean.getStopsList()!= null){
if (receiverBean != null && receiverBean.getStopsList() != null) {
for (MogoLatLng mogoLatLng : receiverBean.getStopsList()) {
wayLatLon.add(new AutopilotControlParameters.AutoPilotLonLat(mogoLatLng.lat, mogoLatLng.lon));
}
@@ -278,4 +283,17 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
}
});
}
@Override
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
}
@Override
public void onAutopilotRotting(AutopilotRouteInfo autopilotRoute) {
if (autopilotRoute == null || autopilotRoute.getModels() == null || autopilotRoute.getModels().size() == 0) {
return;
}
DispatchServiceModel.getInstance().uploadAutopilotRoute(autopilotRoute.getModels());
}
}