修改福州实训问题

This commit is contained in:
joylink_zhangsai 2021-10-14 14:30:12 +08:00
parent 38848dbd14
commit c319250093
8 changed files with 54 additions and 10 deletions

View File

@ -12,7 +12,7 @@ import club.joylink.rtss.vo.client.training.TrainingStepVO;
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
import club.joylink.rtss.vo.client.training.definition.OperatePlaceholderVO;
import club.joylink.rtss.vo.client.training.definition.OperateStepVO;
import club.joylink.rtss.vo.map.*;
import club.joylink.rtss.vo.map.MapVO;
import club.joylink.rtss.vo.map.graph.MapAutomaticRouteButtonVO;
import club.joylink.rtss.vo.map.graph.MapCycleButtonVO;
import club.joylink.rtss.vo.map.graph.MapTotalGuideLockButtonVO;
@ -121,7 +121,9 @@ public interface GeneratorNew {
if (MapElement.DeviceType.ROUTE.equals(mapDevice.getDeviceType())) {
stepList.get(0).setDeviceCode(((Route) mapDevice).getStart().getCode());
} else {
stepList.get(0).setDeviceCode(mapDevice.getCode());
if (!"bar".equals(stepList.get(0).getDeviceType())) { //为处理转为站控实训操作正确但结束实训判为错误的bug
stepList.get(0).setDeviceCode(mapDevice.getCode());
}
}
}
Map<String, OperatePlaceholderVO> placeholderVOMap = operateDefinitionVO.getPlaceholderVOMap();

View File

@ -213,6 +213,7 @@ public class SignalGeneratorNew implements GeneratorNew {
}
this.deviceStatusModifyTool.openRouteDirect(simulation, route);
this.deviceStatusModifyTool.closeSignalDirectly(route.getStart());
signal.setForbidden(true);
trainingVOList.add(this.build(config, simulation, signal,null, operateDefinitionVO));
// 仿真重置
this.resetSimulation(simulation);

View File

@ -7,7 +7,6 @@ import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
import club.joylink.rtss.simulation.cbtc.ATS.service.AtsSectionService;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter;
import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool;
import club.joylink.rtss.vo.client.training.TrainingNewVO;
import club.joylink.rtss.vo.client.training.definition.OperateDefinitionVO;
@ -97,12 +96,13 @@ public class SwitchGeneratorNew implements GeneratorNew {
break;
}
case Switch_Axle_Pre_Reset:{
aSwitch.setPreReset(false);
VirtualRealitySectionAxleCounter virtualAxleCounter = aSwitch.getA().getParent().getVirtualAxleCounter();
virtualAxleCounter.setOccupy(true);
virtualAxleCounter.setPreReset(false);
virtualAxleCounter.setLeftCount(3);
virtualAxleCounter.setRightCount(3);
Switch.SwitchFault.AXLE_FAULT.apply(aSwitch);
// aSwitch.setPreReset(false);
// VirtualRealitySectionAxleCounter virtualAxleCounter = aSwitch.getA().getParent().getVirtualAxleCounter();
// virtualAxleCounter.setOccupy(true);
// virtualAxleCounter.setPreReset(false);
// virtualAxleCounter.setLeftCount(0);
// virtualAxleCounter.setRightCount(3);
break;
}
case Switch_Confirm_Axis_Valid:{

View File

@ -250,7 +250,7 @@ public class CiApiServiceImpl2 implements CiApiService {
@Override
public void switchSectionFaultUnlock(Simulation simulation, String switchCode) {
Switch aSwitch = simulation.getRepository().getByCode(switchCode, Switch.class);
if (!aSwitch.isLocked())
if (!aSwitch.isLocked() && aSwitch.getAllSections().stream().noneMatch(Section::isFaultLock))
return;
List<Route> lockedRouteList = simulation.getRepository().queryAllLockedRoute();
Route lockedRoute = null;

View File

@ -4,6 +4,7 @@ import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.MayOutOfOrderDevice;
import club.joylink.rtss.simulation.cbtc.data.map.Route;
import club.joylink.rtss.simulation.cbtc.data.map.Section;
import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer;
import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer;
@ -34,6 +35,8 @@ public class StorageSection extends StorageDelayUnlockDevice {
@JsonDeserialize(using = Boolean2NumDeserializer.class)
private Boolean routeLock;
private String route;
/**
* 锁闭方向
*/
@ -129,6 +132,11 @@ public class StorageSection extends StorageDelayUnlockDevice {
change = true;
storageSection.setRouteLock(section.isRouteLock());
}
Route route = section.getRoute();
if (route != null) {
change = true;
storageSection.setRoute(route.getCode());
}
if (section.isLockRight()) {
change = true;
storageSection.setLockRight(section.isLockRight());
@ -185,6 +193,7 @@ public class StorageSection extends StorageDelayUnlockDevice {
Section section = (Section) element;
section.setBlockade(blockade != null ? blockade : false);
section.setRouteLock(routeLock != null ? routeLock : false);
section.setRoute(route == null ? null : repository.getByCode(route, Route.class));
section.setLockRight(lockRight != null ? lockRight : false);
section.setOverlapLock(overlapLock != null ? overlapLock : false);
section.setCtOccupied(ctOccupied != null ? ctOccupied : false);

View File

@ -56,6 +56,10 @@ public class StorageSignal extends StorageDelayUnlockDevice {
private SignalAspect aspect;
@JsonSerialize(using = Boolean2NumSerializer.class)
@JsonDeserialize(using = Boolean2NumDeserializer.class)
private Boolean forbidden;
/**
* 绿灯开放
*/
@ -122,6 +126,10 @@ public class StorageSignal extends StorageDelayUnlockDevice {
change = true;
storageSignal.setAspect(signal.getAspect());
}
if (signal.isForbidden()) {
change = true;
storageSignal.setForbidden(signal.isForbidden());
}
if (signal.getRemain() > 0) {
change = true;
storageSignal.saveFrom(signal);
@ -154,6 +162,7 @@ public class StorageSignal extends StorageDelayUnlockDevice {
if (aspect != null) {
signal.setAspect(aspect);
}
signal.setForbidden(this.forbidden == null ? false : this.forbidden);
if (this.getRemain() > 0) {
this.recoverTo(signal, repository);
}

View File

@ -5,6 +5,7 @@ import club.joylink.rtss.simulation.cbtc.constant.SwitchIndication;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
import club.joylink.rtss.simulation.cbtc.data.map.MayOutOfOrderDevice;
import club.joylink.rtss.simulation.cbtc.data.map.Route;
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
import club.joylink.rtss.util.jsonSerialize.Boolean2NumDeserializer;
import club.joylink.rtss.util.jsonSerialize.Boolean2NumSerializer;
@ -40,6 +41,8 @@ public class StorageSwitch extends StorageDelayUnlockDevice {
@JsonDeserialize(using = Boolean2NumDeserializer.class)
private Boolean routeLock;
private String route;
/**
* 是否进路侧防锁闭
*/
@ -92,6 +95,11 @@ public class StorageSwitch extends StorageDelayUnlockDevice {
change = true;
storageSwitch.setRouteLock(s.isRouteLock());
}
Route route = s.getRoute();
if (route != null) {
change = true;
storageSwitch.setRoute(route.getCode());
}
if (s.isFpLock()) {
change = true;
storageSwitch.setFpLock(s.isFpLock());
@ -133,6 +141,7 @@ public class StorageSwitch extends StorageDelayUnlockDevice {
s.setSingleLock(singleLock != null ? singleLock : false);
s.setBlockade(blockade != null ? blockade : false);
s.setRouteLock(routeLock != null ? routeLock : false);
s.setRoute(route == null ? null : repository.getByCode(route, Route.class));
s.setOverlapLock(overlapLock != null ? overlapLock : false);
s.setMasterGuideLock(masterGuideLock != null ? masterGuideLock : false);
if (pos != null) {

View File

@ -39,6 +39,16 @@ public class StorageVirtualRealityTrain extends StorageVirtualRealityDeviceStatu
*/
private DriveMode driveMode;
/**
* 临时预选模式
*/
private VirtualRealityTrain.PreselectionMode tempPreselectionMode;
/**
* 预选模式
*/
private VirtualRealityTrain.PreselectionMode preselectionMode;
/**
* 服务号
*/
@ -257,6 +267,8 @@ public class StorageVirtualRealityTrain extends StorageVirtualRealityDeviceStatu
this.groupNumber = train.getGroupNumber();
this.runLevel = train.getRunLevel();
this.driveMode = train.getDriveMode();
this.tempPreselectionMode = train.getTempPreselectionMode();
this.preselectionMode = train.getPreselectionMode();
this.serviceNumber = train.getServiceNumber();
this.tripNumber = train.getTripNumber();
this.destinationCode = train.getDestinationCode();
@ -331,6 +343,8 @@ public class StorageVirtualRealityTrain extends StorageVirtualRealityDeviceStatu
VirtualRealityTrain train = (VirtualRealityTrain) vrDevice;
train.setRunLevel(runLevel);
train.setDriveMode(driveMode);
train.setTempPreselectionMode(tempPreselectionMode);
train.setPreselectionMode(preselectionMode);
train.setServiceNumber(serviceNumber);
train.setTripNumber(tripNumber);
train.setDestinationCode(destinationCode);