From f2a0c89213be848556f06656b4b776306f9e62c2 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Thu, 8 Dec 2022 11:27:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AE=9E=E8=AE=AD=E4=BB=BF=E7=9C=9F?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BF=AE=E6=94=B9=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/services/training2/Training2RuleService.java | 8 ++++---- .../joylink/rtss/vo/training2/rule/MapDeviceRule.java | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) 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);