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

This commit is contained in:
joylink_zhangsai 2022-07-26 13:22:28 +08:00
commit 8471bd9d6e
6 changed files with 29 additions and 32 deletions

View File

@ -111,11 +111,7 @@ public class AtpSectionService {
for (Section section : sectionList) { for (Section section : sectionList) {
if (section.isSwitchAxleCounterSection()) { if (section.isSwitchAxleCounterSection()) {
Section switchSection = section.getLogicList().get(0); Section switchSection = section.getLogicList().get(0);
if (switchSingleHandle && isRailway) { atpSectionList.addAll(switchSection.getSwitchAxleSectionsBySwitchPosition());
atpSectionList.addAll(handleSingleSwitchPosition(section, right));
} else {
atpSectionList.addAll(switchSection.getSwitchAxleSectionsBySwitchPosition());
}
continue; continue;
} }
if (CollectionUtils.isEmpty(section.getLogicList())) { if (CollectionUtils.isEmpty(section.getLogicList())) {

View File

@ -74,24 +74,12 @@ public class GroundAtpApiServiceImpl implements GroundAtpApiService {
section.communicateTrainOccupy(train.isRight()); section.communicateTrainOccupy(train.isRight());
} }
})); }));
// 大铁逻辑 // 非通信车占用
if (simulation.getRepository().getConfig().isRailway()) { nctSectionMap.forEach(((train, sections) -> {
// 非通信车占用 for (Section section : sections) {
nctSectionMap.forEach(((train, sections) -> { section.nonCommunicateTrainOccupy(train.isRight());
for (Section section : sections) { }
section.nonCommunicateTrainOccupy(train.isRight()); }));
if (section.equals(train.getHeadPosition().getSection())) {
break;
}
}
}));
} else {
nctSectionMap.forEach(((train, sections) -> {
for (Section section : sections) {
section.nonCommunicateTrainOccupy(train.isRight());
}
}));
}
// 信号机接近信息 // 信号机接近信息
this.atpSectionService.changeSignalModeByTrainApproach(simulation, onlineTrainList, trainAtpSectionMap); this.atpSectionService.changeSignalModeByTrainApproach(simulation, onlineTrainList, trainAtpSectionMap);

View File

@ -409,8 +409,18 @@ public class CTCLogicLoop {
private void loadSignRunPlanTrain(Simulation simulation) { private void loadSignRunPlanTrain(Simulation simulation) {
// 没有加载过计划始发计划已发送至占线板计划时间比当前时间相差5分钟 // 没有加载过计划始发计划已发送至占线板计划时间比当前时间相差5分钟
simulation.getCtcRepository().getAllRunPlanList().stream() simulation.getCtcRepository().getAllRunPlanList().stream()
.filter(r -> !r.isLoad() && r.isStartRunPlan() && r.isSign() && r.getStatus() != -1 .filter(r -> {
&& r.getDepartRunPlan().getPlanTime().isBefore(simulation.getCorrectSystemTime().plusMinutes(5))) boolean valid = !r.isLoad() && r.isStartRunPlan() && r.isSign() && r.getStatus() != -1
&& r.getDepartRunPlan().getPlanTime().isBefore(simulation.getCorrectSystemTime().plusMinutes(5));
if (valid) {
valid = !simulation.getRepository().getTrainInfoMap().values().stream()
.anyMatch(trainInfo -> r.getDepartRunPlan().getTripNumber().equals(trainInfo.getTripNumber()));
if (!valid) { // 如果列车已经上线则直接修改状态
r.setLoad(true);
}
}
return valid;
})
.sorted((r1, r2) -> r1.getDepartRunPlan().getPlanTime().isBefore(r2.getDepartRunPlan().getPlanTime()) ? -1 : 1) .sorted((r1, r2) -> r1.getDepartRunPlan().getPlanTime().isBefore(r2.getDepartRunPlan().getPlanTime()) ? -1 : 1)
.forEach(r -> { .forEach(r -> {
Section section = r.getDepartRunPlan().getTrackSection(); Section section = r.getDepartRunPlan().getTrackSection();

View File

@ -103,6 +103,7 @@ public class StorageCtcRunPlanLog {
if (this.arriveItemOtherInfo != null) { if (this.arriveItemOtherInfo != null) {
this.arriveItemOtherInfo.convertToObj(ctcStationRunPlanLog.getArriveRunPlan()); this.arriveItemOtherInfo.convertToObj(ctcStationRunPlanLog.getArriveRunPlan());
} }
ctcRepository.addRunPlanToSimulationMap(ctcStationRunPlanLog);
} }
private void setDepartAndArrive(CtcRunPlanParam ctcRunPlanParam, CtcStationRunPlanLog.RunPlanItem runPlanItem, boolean arrive) { private void setDepartAndArrive(CtcRunPlanParam ctcRunPlanParam, CtcStationRunPlanLog.RunPlanItem runPlanItem, boolean arrive) {

View File

@ -17,6 +17,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@ -51,13 +52,12 @@ public class MemberManager {
// 大铁CTC // 大铁CTC
if (simulation.getRepository().getConfig().isRailway()) { if (simulation.getRepository().getConfig().isRailway()) {
// this.addRole(simulation, SimulationMember.Type.RAIL_CTC, null, station); // this.addRole(simulation, SimulationMember.Type.RAIL_CTC, null, station);
this.addRole(simulation, SimulationMember.Type.STATION_ASSISTANT, null, station); Arrays.asList(
this.addRole(simulation, SimulationMember.Type.STATION_MASTER, null, station); SimulationMember.Type.STATION_ASSISTANT, SimulationMember.Type.STATION_MASTER,
this.addRole(simulation, SimulationMember.Type.STATION_SIGNALER, null, station); SimulationMember.Type.STATION_SIGNALER, SimulationMember.Type.STATION_PASSENGER,
this.addRole(simulation, SimulationMember.Type.STATION_PASSENGER, null, station); SimulationMember.Type.STATION_SWITCH_MAN, SimulationMember.Type.STATION_FACILITATOR,
this.addRole(simulation, SimulationMember.Type.STATION_SWITCH_MAN, null, station); SimulationMember.Type.STATION_WORKER, SimulationMember.Type.DEVICE_MANAGER
this.addRole(simulation, SimulationMember.Type.STATION_FACILITATOR, null, station); ).forEach(type -> this.addRole(simulation, type, null, station));
this.addRole(simulation, SimulationMember.Type.STATION_WORKER, null, station);
} }
} }
// 司机 // 司机

View File

@ -177,6 +177,8 @@ public class SimulationMember extends club.joylink.rtss.simulation.SimulationMem
STATION_FACILITATOR, STATION_FACILITATOR,
/*** 车站工务工*/ /*** 车站工务工*/
STATION_WORKER, STATION_WORKER,
/*** 设备管理员 **/
DEVICE_MANAGER,
} }
public enum Gender { public enum Gender {