【实训仿真初始化修改】

This commit is contained in:
weizhihong 2022-12-08 11:27:50 +08:00
parent 0d19ea6db8
commit f2a0c89213
2 changed files with 4 additions and 6 deletions

View File

@ -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<PublishedTraining2WithBLOBs> 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());
}
}

View File

@ -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);