Merge branch 'test-training2' of https://git.code.tencent.com/lian-cbtc/rtss-server into test-training2-xzb1

This commit is contained in:
xzb 2022-12-08 13:58:50 +08:00
commit 070dcd41ec
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);