diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java b/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java index 527142d8e..4752ced6b 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2RuleService.java @@ -10,6 +10,7 @@ import club.joylink.rtss.simulation.cbtc.SimulationService; import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement; import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Stand; +import club.joylink.rtss.simulation.cbtc.data.map.Switch; import club.joylink.rtss.vo.training2.rule.BgSceneStatusRule; import club.joylink.rtss.vo.training2.rule.MapLocationRule; import club.joylink.rtss.vo.training2.rule.Training2Rule; @@ -82,8 +83,7 @@ public class Training2RuleService { } List training2WithBLOBs = new ArrayList<>(deviceList.size()); for (MapNamedElement device : deviceList) { - simulation.reset(); - simulation.getRepository().vrDeviceReset(); + simulationService.reset(groupId); training2WithBLOBs.add(training2Rule.convert2BO(simulation, device)); } // 新数据入库 @@ -100,7 +100,7 @@ public class Training2RuleService { public void test(String groupId) { Simulation simulation = simulationManager.getById(groupId , Simulation.class); - Stand stand = simulation.getRepository().getByCode("PF55602", Stand.class); - System.out.println(MapLocationRule.STATION_MAP_LOCATION.doHandle(simulation,stand)); + Switch aSwitch = simulation.getRepository().getByCode("W32728", Switch.class); + System.out.println(aSwitch.isSingleLock()); } } diff --git a/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java b/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java index 20721956d..124113fb8 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java +++ b/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java @@ -125,7 +125,6 @@ public enum MapDeviceRule { if (aSwitch.isSingleLock()) { return false; } - aSwitch.setSingleLock(false); return true; }).collect(Collectors.toList()); return generateRandomElement(switchList, 1); @@ -144,7 +143,6 @@ public enum MapDeviceRule { if (aSwitch.isSingleLock()) { return false; } - aSwitch.setSingleLock(false); return true; }).collect(Collectors.toList()); return generateRandomElement(switchList, 1);