修改实训生成bug;修正加载实训时的角色选择逻辑

This commit is contained in:
joylink_zhangsai 2022-09-30 17:32:24 +08:00
parent 15780897a6
commit 689a6f433a
9 changed files with 106 additions and 105 deletions

View File

@ -19,10 +19,10 @@ import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
import club.joylink.rtss.util.JsonUtils; import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.training.*;
import club.joylink.rtss.vo.client.trainingUsage.UserTrainingListVO; import club.joylink.rtss.vo.client.trainingUsage.UserTrainingListVO;
import club.joylink.rtss.vo.client.trainingUsage.UserTrainingQueryVO; import club.joylink.rtss.vo.client.trainingUsage.UserTrainingQueryVO;
import club.joylink.rtss.vo.client.trainingUsage.UserTrainingVO; import club.joylink.rtss.vo.client.trainingUsage.UserTrainingVO;
import club.joylink.rtss.vo.client.training.*;
import club.joylink.rtss.vo.map.MapGraphDataNewVO; import club.joylink.rtss.vo.map.MapGraphDataNewVO;
import club.joylink.rtss.vo.map.graph.MapAutomaticRouteButtonVO; import club.joylink.rtss.vo.map.graph.MapAutomaticRouteButtonVO;
import club.joylink.rtss.vo.map.graph.MapCycleButtonVO; import club.joylink.rtss.vo.map.graph.MapCycleButtonVO;
@ -764,7 +764,7 @@ public class TrainingV1Service implements ITrainingV1Service {
} }
} }
if (deviceCode != null) { if (deviceCode != null) {
SimulationMember member = simulation.findMemberByDeviceCode(deviceCode); SimulationMember member = simulation.findMemberByRoleAndDeviceCode(SimulationMember.Type.STATION_SUPERVISOR, deviceCode);
if (member != null) { if (member != null) {
memberManager.playRole(simulation, accountVO.getId(), member.getId()); memberManager.playRole(simulation, accountVO.getId(), member.getId());
} }

View File

@ -42,10 +42,11 @@ public interface GeneratorNew {
* @param config * @param config
* @param mapDevice * @param mapDevice
* @param operateDefinitionVO * @param operateDefinitionVO
* @param setDeviceCode
* @return * @return
*/ */
default TrainingNewVO build(GenerateConfig config, Simulation simulation, MapElement mapDevice, Object mapButton, default TrainingNewVO build(GenerateConfig config, Simulation simulation, MapElement mapDevice, Object mapButton,
OperateDefinitionVO operateDefinitionVO) { OperateDefinitionVO operateDefinitionVO, boolean setDeviceCode) {
boolean railway = simulation.getRepository().getConfig().isRailway(); boolean railway = simulation.getRepository().getConfig().isRailway();
// 现地设置站控 // 现地设置站控
if (BusinessConsts.MapPrd.PrdType.Type01.equals(config.getPrdType())) { if (BusinessConsts.MapPrd.PrdType.Type01.equals(config.getPrdType())) {
@ -74,9 +75,10 @@ public interface GeneratorNew {
TrainingNewVO trainingVO = new TrainingNewVO(config, operateDefinitionVO); TrainingNewVO trainingVO = new TrainingNewVO(config, operateDefinitionVO);
// 设置每一步操作的设备 // 设置每一步操作的设备
List<OperateStepVO> stepList = operateDefinitionVO.getStepVOList(); List<OperateStepVO> stepList = operateDefinitionVO.getStepVOList();
if (setDeviceCode) {
if (stepList.stream().anyMatch(s -> StringUtils.hasText(s.getCodeType()))) { if (stepList.stream().anyMatch(s -> StringUtils.hasText(s.getCodeType()))) {
stepList.forEach(s -> { stepList.forEach(s -> {
if (StringUtils.hasText(s.getCodeType()) && s.getDeviceCode() == null) { if (StringUtils.hasText(s.getCodeType())) {
//根据codeType对应类型 取当前设备相关的设备code进行设置,目前仅信号机进路操作支持 //根据codeType对应类型 取当前设备相关的设备code进行设置,目前仅信号机进路操作支持
switch (TrainingConsts.CodeType.valueOf(s.getCodeType())) { switch (TrainingConsts.CodeType.valueOf(s.getCodeType())) {
case SIGNAL: case SIGNAL:
@ -137,15 +139,14 @@ public interface GeneratorNew {
}); });
} else { } else {
if (MapElement.DeviceType.ROUTE.equals(mapDevice.getDeviceType())) { if (MapElement.DeviceType.ROUTE.equals(mapDevice.getDeviceType())) {
if (!railway) {
stepList.get(0).setDeviceCode(((Route) mapDevice).getStart().getCode()); stepList.get(0).setDeviceCode(((Route) mapDevice).getStart().getCode());
}
} else { } else {
if (!"bar".equals(stepList.get(0).getDeviceType())) { //为处理转为站控实训操作正确但结束实训判为错误的bug if (!"bar".equals(stepList.get(0).getDeviceType())) { //为处理转为站控实训操作正确但结束实训判为错误的bug
stepList.get(0).setDeviceCode(mapDevice.getCode()); stepList.get(0).setDeviceCode(mapDevice.getCode());
} }
} }
} }
}
Map<String, OperatePlaceholderVO> placeholderVOMap = operateDefinitionVO.getPlaceholderVOMap(); Map<String, OperatePlaceholderVO> placeholderVOMap = operateDefinitionVO.getPlaceholderVOMap();
// 设置定位 // 设置定位
if (MapElement.DeviceType.ROUTE.equals(mapDevice.getDeviceType())) { if (MapElement.DeviceType.ROUTE.equals(mapDevice.getDeviceType())) {

View File

@ -52,7 +52,7 @@ public class ControlGeneratorNew implements GeneratorNew {
// 其他操作不生成 // 其他操作不生成
continue; continue;
} }
trainingVOList.add(build(config, simulation, station, null,operateDefinitionVO)); trainingVOList.add(build(config, simulation, station, null,operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }

View File

@ -176,7 +176,7 @@ public class SectionGeneratorNew implements GeneratorNew {
// 其他操作不生成 // 其他操作不生成
continue; continue;
} }
trainingVOList.add(this.build(config, simulation, section, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, section, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }

View File

@ -44,12 +44,12 @@ public class SignalGeneratorNew implements GeneratorNew {
simulation.getBuildParams().getMap().getGraphDataNew().getCycleButtonList() simulation.getBuildParams().getMap().getGraphDataNew().getCycleButtonList()
.stream().filter(mapCycleButtonVO -> mapCycleButtonVO.getCycleCode().equals(cycle.getCode())) .stream().filter(mapCycleButtonVO -> mapCycleButtonVO.getCycleCode().equals(cycle.getCode()))
.forEach(button -> { .forEach(button -> {
trainingVOList.add(this.build(config, simulation, cycle, button, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, cycle, button, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
}); });
continue; continue;
} else { } else {
trainingVOList.add(this.build(config, simulation, cycle, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, cycle, null, operateDefinitionVO, true));
} }
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
@ -67,12 +67,12 @@ public class SignalGeneratorNew implements GeneratorNew {
simulation.getBuildParams().getMap().getGraphDataNew().getCycleButtonList() simulation.getBuildParams().getMap().getGraphDataNew().getCycleButtonList()
.stream().filter(mapCycleButtonVO -> mapCycleButtonVO.getCycleCode().equals(cycle.getCode())) .stream().filter(mapCycleButtonVO -> mapCycleButtonVO.getCycleCode().equals(cycle.getCode()))
.forEach(button -> { .forEach(button -> {
trainingVOList.add(this.build(config, simulation, cycle, button, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, cycle, button, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
}); });
continue; continue;
} else { } else {
trainingVOList.add(this.build(config, simulation, cycle, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, cycle, null, operateDefinitionVO, true));
} }
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
@ -106,7 +106,7 @@ public class SignalGeneratorNew implements GeneratorNew {
if (route.isGuide()) { // 引导进路跳过 if (route.isGuide()) { // 引导进路跳过
continue; continue;
} }
trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -131,7 +131,7 @@ public class SignalGeneratorNew implements GeneratorNew {
stepVOList.get(0).setTip(String.format("鼠标左键点击【信号机%s】", route.getStart().getShowName())); stepVOList.get(0).setTip(String.format("鼠标左键点击【信号机%s】", route.getStart().getShowName()));
stepVOList.get(1).setTip(String.format("鼠标左键点击【信号机%s】", route.getDestination().getShowName())); stepVOList.get(1).setTip(String.format("鼠标左键点击【信号机%s】", route.getDestination().getShowName()));
} }
trainingVOList.add(this.build(config, simulation, route, mapRouteNewVO, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, route, mapRouteNewVO, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -148,7 +148,7 @@ public class SignalGeneratorNew implements GeneratorNew {
if (repository.getConfig().isSignalHumanControlBeforeSetAtsControlOrCIAutoTrigger()) { if (repository.getConfig().isSignalHumanControlBeforeSetAtsControlOrCIAutoTrigger()) {
routeList.forEach(route -> route.setAtsControl(false)); routeList.forEach(route -> route.setAtsControl(false));
} }
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
continue; continue;
} else { } else {
@ -165,7 +165,7 @@ public class SignalGeneratorNew implements GeneratorNew {
route.setAtsControl(false); route.setAtsControl(false);
} }
} }
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
@ -176,7 +176,7 @@ public class SignalGeneratorNew implements GeneratorNew {
case Signal_Close_Auto_Setting: { case Signal_Close_Auto_Setting: {
if (!CollectionUtils.isEmpty(routeList)) { if (!CollectionUtils.isEmpty(routeList)) {
if (routeLikeHa1 || operateDefinitionVO.onlyOperateSignal()) { if (routeLikeHa1 || operateDefinitionVO.onlyOperateSignal()) {
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
continue; continue;
} else { } else {
@ -189,7 +189,7 @@ public class SignalGeneratorNew implements GeneratorNew {
if (route.isGuide()) { // 引导进路跳过 if (route.isGuide()) { // 引导进路跳过
continue; continue;
} }
trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -212,7 +212,7 @@ public class SignalGeneratorNew implements GeneratorNew {
continue; continue;
} }
deviceStatusModifyTool.openRouteDirect(simulation, route); deviceStatusModifyTool.openRouteDirect(simulation, route);
trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -233,7 +233,7 @@ public class SignalGeneratorNew implements GeneratorNew {
stepVOList.get(1).setTip(String.format("鼠标左键点击【信号机%s】", route.getStart().getShowName())); stepVOList.get(1).setTip(String.format("鼠标左键点击【信号机%s】", route.getStart().getShowName()));
} }
deviceStatusModifyTool.openRouteDirect(simulation, route); deviceStatusModifyTool.openRouteDirect(simulation, route);
trainingVOList.add(this.build(config, simulation, route, mapRouteNewVO, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, route, mapRouteNewVO, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -248,7 +248,7 @@ public class SignalGeneratorNew implements GeneratorNew {
deviceStatusModifyTool.closeSignalDirectly(route.getStart()); deviceStatusModifyTool.closeSignalDirectly(route.getStart());
deviceStatusModifyTool.loadManualTrainOfGroup(simulation, "001", signal.getSection(), signal.isRight()); deviceStatusModifyTool.loadManualTrainOfGroup(simulation, "001", signal.getSection(), signal.isRight());
// todo 在接近区段设置一辆列车 // todo 在接近区段设置一辆列车
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -262,7 +262,7 @@ public class SignalGeneratorNew implements GeneratorNew {
continue; continue;
} }
this.deviceStatusModifyTool.openRouteDirect(simulation, route); this.deviceStatusModifyTool.openRouteDirect(simulation, route);
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -279,7 +279,7 @@ public class SignalGeneratorNew implements GeneratorNew {
this.deviceStatusModifyTool.openRouteDirect(simulation, route); this.deviceStatusModifyTool.openRouteDirect(simulation, route);
this.deviceStatusModifyTool.closeSignalDirectly(route.getStart()); this.deviceStatusModifyTool.closeSignalDirectly(route.getStart());
signal.setForbidden(true); signal.setForbidden(true);
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -298,7 +298,7 @@ public class SignalGeneratorNew implements GeneratorNew {
for (Route route : routeList) { for (Route route : routeList) {
route.setAtsControl(false); route.setAtsControl(false);
} }
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} else { } else {
@ -307,7 +307,7 @@ public class SignalGeneratorNew implements GeneratorNew {
continue; continue;
} }
route.setAtsControl(false); route.setAtsControl(false);
trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -329,12 +329,12 @@ public class SignalGeneratorNew implements GeneratorNew {
simulation.getBuildParams().getMap().getGraphDataNew().getAutomaticRouteButtonList() simulation.getBuildParams().getMap().getGraphDataNew().getAutomaticRouteButtonList()
.stream().filter(automaticRouteButtonVO -> automaticRouteButtonVO.getAutomaticRouteCode().equals(route.getCode())) .stream().filter(automaticRouteButtonVO -> automaticRouteButtonVO.getAutomaticRouteCode().equals(route.getCode()))
.forEach(button -> { .forEach(button -> {
trainingVOList.add(this.build(config, simulation, route.getStart(), button, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, route.getStart(), button, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
}); });
continue; continue;
} else { } else {
trainingVOList.add(this.build(config, simulation, route.getStart(), null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, route.getStart(), null, operateDefinitionVO, true));
} }
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
@ -355,12 +355,12 @@ public class SignalGeneratorNew implements GeneratorNew {
simulation.getBuildParams().getMap().getGraphDataNew().getAutomaticRouteButtonList() simulation.getBuildParams().getMap().getGraphDataNew().getAutomaticRouteButtonList()
.stream().filter(automaticRouteButtonVO -> automaticRouteButtonVO.getAutomaticRouteCode().equals(route.getCode())) .stream().filter(automaticRouteButtonVO -> automaticRouteButtonVO.getAutomaticRouteCode().equals(route.getCode()))
.forEach(button -> { .forEach(button -> {
trainingVOList.add(this.build(config, simulation, signal, button, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, button, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
}); });
continue; continue;
} else { } else {
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
} }
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
@ -378,13 +378,13 @@ public class SignalGeneratorNew implements GeneratorNew {
for (Route route : arcRouteList) { for (Route route : arcRouteList) {
route.setCiControl(true); route.setCiControl(true);
} }
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} else { } else {
for (Route route : arcRouteList) { for (Route route : arcRouteList) {
route.setCiControl(true); route.setCiControl(true);
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -415,11 +415,11 @@ public class SignalGeneratorNew implements GeneratorNew {
} }
deviceStatusModifyTool.loadManualTrainOfGroup(simulation, "001", signal.getSection(), signal.isRight()); deviceStatusModifyTool.loadManualTrainOfGroup(simulation, "001", signal.getSection(), signal.isRight());
if (operateDefinitionVO.onlyOperateSignal()) { if (operateDefinitionVO.onlyOperateSignal()) {
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
break; break;
} }
trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, route, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -483,7 +483,7 @@ public class SignalGeneratorNew implements GeneratorNew {
// 其他操作不生成 // 其他操作不生成
continue; continue;
} }
trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, signal, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }

View File

@ -35,7 +35,7 @@ public class SpeedLimitGeneratorNew implements GeneratorNew {
case Cancel_All_Limit_Speed: // 取消全线临时限速 case Cancel_All_Limit_Speed: // 取消全线临时限速
List<MapTempSpeedLimitVO> tempSpeedLimitList = simulation.getBuildParams().getMap().getGraphDataNew().getTempSpeedLimitList(); List<MapTempSpeedLimitVO> tempSpeedLimitList = simulation.getBuildParams().getMap().getGraphDataNew().getTempSpeedLimitList();
tempSpeedLimitList.forEach(mapTempSpeedLimitVO -> { tempSpeedLimitList.forEach(mapTempSpeedLimitVO -> {
trainingVOList.add(this.build(config, simulation,null,mapTempSpeedLimitVO, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation,null,mapTempSpeedLimitVO, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
}); });
break; break;
@ -44,7 +44,7 @@ public class SpeedLimitGeneratorNew implements GeneratorNew {
} }
@Override @Override
public TrainingNewVO build(GenerateConfig config, Simulation simulation, MapElement nullableDevice, Object mapButton, OperateDefinitionVO operateDefinitionVO) { public TrainingNewVO build(GenerateConfig config, Simulation simulation, MapElement nullableDevice, Object mapButton, OperateDefinitionVO operateDefinitionVO, boolean setDeviceCode) {
// 实训基本信息 // 实训基本信息
TrainingNewVO trainingVO = new TrainingNewVO(config, operateDefinitionVO); TrainingNewVO trainingVO = new TrainingNewVO(config, operateDefinitionVO);

View File

@ -104,7 +104,7 @@ public class StandGeneratorNew implements GeneratorNew {
// 其他操作不生成 // 其他操作不生成
continue; continue;
} }
trainingVOList.add(this.build(config, simulation, stand,null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, stand,null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }

View File

@ -153,7 +153,7 @@ public class StationGeneratorNew implements GeneratorNew {
simulation.getBuildParams().getMap().getGraphDataNew().getTbStrategyList() simulation.getBuildParams().getMap().getGraphDataNew().getTbStrategyList()
.stream().filter(turnBackStrategyO -> turnBackStrategyO.getStationCode().equals(station.getCode())) .stream().filter(turnBackStrategyO -> turnBackStrategyO.getStationCode().equals(station.getCode()))
.forEach(button -> { .forEach(button -> {
trainingVOList.add(this.build(config, simulation, station,button, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, station,button, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
}); });
continue; continue;
@ -181,7 +181,7 @@ public class StationGeneratorNew implements GeneratorNew {
List<Switch> collect = switchList.stream().filter( List<Switch> collect = switchList.stream().filter(
aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).collect(Collectors.toList()); aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).collect(Collectors.toList());
collect.forEach(aSwitch -> aSwitch.setFault(Switch.SwitchFault.SPLIT)); collect.forEach(aSwitch -> aSwitch.setFault(Switch.SwitchFault.SPLIT));
trainingVOList.add(this.build(config, simulation, station, button, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, station, button, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
}); });
continue; continue;
@ -210,7 +210,7 @@ public class StationGeneratorNew implements GeneratorNew {
station.setControlMode(Station.ControlMode.Local); station.setControlMode(Station.ControlMode.Local);
List<Switch> switchList1 = simulation.getRepository().getSwitchList(); List<Switch> switchList1 = simulation.getRepository().getSwitchList();
switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true)); switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true));
trainingVOList.add(this.build(config, simulation, station, button, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, station, button, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
}); });
continue; continue;
@ -219,7 +219,7 @@ public class StationGeneratorNew implements GeneratorNew {
station.setControlMode(Station.ControlMode.Local); station.setControlMode(Station.ControlMode.Local);
List<Switch> switchList1 = simulation.getRepository().getSwitchList(); List<Switch> switchList1 = simulation.getRepository().getSwitchList();
switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true)); switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true));
trainingVOList.add(this.build(config, simulation, station, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, station, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
break; break;
@ -235,7 +235,7 @@ public class StationGeneratorNew implements GeneratorNew {
station.setControlMode(Station.ControlMode.Local); station.setControlMode(Station.ControlMode.Local);
List<Switch> switchList1 = simulation.getRepository().getSwitchList(); List<Switch> switchList1 = simulation.getRepository().getSwitchList();
switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true)); switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true));
trainingVOList.add(this.build(config, simulation, station, button, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, station, button, operateDefinitionVO, true));
this.resetSimulation(simulation); this.resetSimulation(simulation);
}); });
return; return;
@ -244,7 +244,7 @@ public class StationGeneratorNew implements GeneratorNew {
station.setControlMode(Station.ControlMode.Local); station.setControlMode(Station.ControlMode.Local);
List<Switch> switchList1 = simulation.getRepository().getSwitchList(); List<Switch> switchList1 = simulation.getRepository().getSwitchList();
switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true)); switchList1.stream().filter(aSwitch -> Objects.equals(aSwitch.getDeviceStation(), station)).forEach(aSwitch -> aSwitch.setSingleLock(true));
trainingVOList.add(this.build(config, simulation, station, null, operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, station, null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }
@ -304,7 +304,7 @@ public class StationGeneratorNew implements GeneratorNew {
// 其他操作不生成 // 其他操作不生成
continue; continue;
} }
trainingVOList.add(build(config, simulation, station,null, operateDefinitionVO)); trainingVOList.add(build(config, simulation, station,null, operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }

View File

@ -125,7 +125,7 @@ public class SwitchGeneratorNew implements GeneratorNew {
// 其他操作不生成 // 其他操作不生成
continue; continue;
} }
trainingVOList.add(this.build(config, simulation, aSwitch, null,operateDefinitionVO)); trainingVOList.add(this.build(config, simulation, aSwitch, null,operateDefinitionVO, true));
// 仿真重置 // 仿真重置
this.resetSimulation(simulation); this.resetSimulation(simulation);
} }