Merge remote-tracking branch 'origin/test2' into test2

This commit is contained in:
joylink_zhangsai 2021-12-08 11:01:14 +08:00
commit bed44dc77f

View File

@ -7,6 +7,7 @@ import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
import club.joylink.rtss.simulation.cbtc.constant.SimulationModule; import club.joylink.rtss.simulation.cbtc.constant.SimulationModule;
import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Route;
import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Section;
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.map.Station;
import club.joylink.rtss.simulation.cbtc.data.plan.SchedulingTrainPlan; import club.joylink.rtss.simulation.cbtc.data.plan.SchedulingTrainPlan;
import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; import club.joylink.rtss.simulation.cbtc.data.support.RoutePath;
@ -69,6 +70,7 @@ public class DepotService {
}); });
stationListMap.clear(); stationListMap.clear();
outboundPlanList.clear(); outboundPlanList.clear();
inboundPlanList.clear();
simulation.getRepository().getSchedulingTrainPlanList().stream(). simulation.getRepository().getSchedulingTrainPlanList().stream().
sorted(Comparator.comparing(schedulingTrainPlan -> schedulingTrainPlan.getOutDepotTrip().getStartTime().toSecondOfDay())) sorted(Comparator.comparing(schedulingTrainPlan -> schedulingTrainPlan.getOutDepotTrip().getStartTime().toSecondOfDay()))
.forEach(schedulingTrainPlan -> { .forEach(schedulingTrainPlan -> {
@ -104,7 +106,8 @@ public class DepotService {
LocalDateTime systemTime = simulation.getSystemTime(); LocalDateTime systemTime = simulation.getSystemTime();
stationListMap.forEach((section, list) -> { stationListMap.forEach((section, list) -> {
SchedulingTrainPlan schedulingTrainPlan = list.peek(); SchedulingTrainPlan schedulingTrainPlan = list.peek();
if (schedulingTrainPlan.getOutDepotTrip().getStartTime().minusMinutes(10).isBefore(systemTime.toLocalTime())) { if (!schedulingTrainPlan.getOutDepotTrip().isDeparture()
&& schedulingTrainPlan.getOutDepotTrip().getStartTime().minusMinutes(10).isBefore(systemTime.toLocalTime())) {
if (!outboundPlanList.contains(schedulingTrainPlan)) { if (!outboundPlanList.contains(schedulingTrainPlan)) {
outboundPlanList.add(schedulingTrainPlan); outboundPlanList.add(schedulingTrainPlan);
list.add(list.poll()); list.add(list.poll());
@ -190,16 +193,21 @@ public class DepotService {
return; return;
} }
RoutePath routePath = routePaths.get(0); RoutePath routePath = routePaths.get(0);
for (Route route : routePath.getRouteList()) {
if (route.isSetting()) {
continue;
}
if (route.isLock()) {
continue;
}
ciRouteService.setRoute(simulation, route);
}
Section lastSection = routePath.getEnd(); Section lastSection = routePath.getEnd();
train.setRobotTargetPosition(new SectionPosition(lastSection, lastSection.getStopPointByDirection(routePath.isRight()))); train.setRobotTargetPosition(new SectionPosition(lastSection, lastSection.getStopPointByDirection(routePath.isRight())));
for (Signal signal : routePath.getSignalList()) {
for (Route route : signal.getRouteList()) {
if (routePath.getRouteList().contains(route)) {
if (route.isSetting()) {
return;
}
if (route.isLock()) {
break;
}
ciRouteService.setRoute(simulation, route);
return;
}
}
}
} }
} }