Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
9fbffe7f84
@ -292,7 +292,7 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService {
|
||||
element.setOn(stands.stream().allMatch(Stand::isEmergencyClosed) || sd);
|
||||
break;
|
||||
case gmLight:
|
||||
element.setOn(stands.stream().allMatch(stand -> stand.getPsd().isClose()) || sd);
|
||||
element.setOn(stands.stream().allMatch(stand -> stand.getPsd().isCloseAndLock()) || sd);
|
||||
break;
|
||||
case kmLight:
|
||||
element.setOn(!stands.stream().allMatch(stand -> stand.getPsd().isClose()) || sd);
|
||||
|
@ -255,13 +255,18 @@ public class AtsStationService {
|
||||
} else {
|
||||
deviceStation = station.getDeviceStation();
|
||||
}
|
||||
//确认控制权现在属于该成员
|
||||
BusinessExceptionAssertEnum.INVALID_OPERATION.assertTrue((member.isDispatcher() && station.isCenterControl())
|
||||
|| (member.isStationSupervisor() && station.isStandControl()),
|
||||
String.format("车站[%s]所属设备集中站[%s]当前控制权不在成员[%s]手中", station.getCode(), deviceStation.getCode(), member.getId()));
|
||||
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
Set<Station> stations = repository.getStationsByDeviceStations(deviceStation);
|
||||
boolean canSurrender = false;
|
||||
if (member.isDispatcher() && deviceStation.isCenterControl()) {
|
||||
canSurrender = true;
|
||||
} else if (member.isStationSupervisor() && deviceStation.isLocalControl()) {
|
||||
if (stations.stream().anyMatch(sta -> Objects.equals(sta, member.getDevice()))) {
|
||||
canSurrender = true;
|
||||
}
|
||||
}
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(canSurrender,
|
||||
String.format("成员[%s]无权交出设备集中站[%s]的控制权", member.getId(), deviceStation.debugStr()));
|
||||
stations.forEach(Station::surrenderControl);
|
||||
}
|
||||
|
||||
@ -279,18 +284,34 @@ public class AtsStationService {
|
||||
} else {
|
||||
deviceStation = station.getDeviceStation();
|
||||
}
|
||||
List<SimulationMember> dispatchers = simulation.querySimulationMembersOfRole(SimulationMember.Type.DISPATCHER);
|
||||
if (!CollectionUtils.isEmpty(dispatchers)) {
|
||||
boolean allDispatchersAreRobots = dispatchers.stream().allMatch(SimulationMember::isRobot);
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED
|
||||
.assertTrue(allDispatchersAreRobots,
|
||||
String.format("车站[%s]控制权未交出", deviceStation.debugStr()));
|
||||
if ((member.isDispatcher() && deviceStation.isCenterControl())
|
||||
|| (member.isStationSupervisor() && deviceStation.isLocalControl())) { //已是期望的控制模式
|
||||
return;
|
||||
}
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
Set<Station> stations = repository.getStationsByDeviceStations(deviceStation);
|
||||
|
||||
if (member.isDispatcher()) {
|
||||
if (!deviceStation.isSurrenderControl()) {
|
||||
List<SimulationMember> stationMember = simulation.getSimulationMembersByDevice(deviceStation);
|
||||
if (!CollectionUtils.isEmpty(stationMember)) {
|
||||
boolean allDispatchersAreRobots = stationMember.stream().allMatch(SimulationMember::isRobot);
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED
|
||||
.assertTrue(allDispatchersAreRobots,
|
||||
String.format("车站[%s]控制权未交出", deviceStation.debugStr()));
|
||||
}
|
||||
}
|
||||
stations.forEach(Station::occControl);
|
||||
} else if (member.isStationSupervisor()) {
|
||||
if (!deviceStation.isSurrenderControl()) {
|
||||
List<SimulationMember> dispatchers = simulation.querySimulationMembersOfRole(SimulationMember.Type.DISPATCHER);
|
||||
if (!CollectionUtils.isEmpty(dispatchers)) {
|
||||
boolean allDispatchersAreRobots = dispatchers.stream().allMatch(SimulationMember::isRobot);
|
||||
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED
|
||||
.assertTrue(allDispatchersAreRobots,
|
||||
String.format("车站[%s]控制权未交出", deviceStation.debugStr()));
|
||||
}
|
||||
}
|
||||
stations.forEach(Station::localControl);
|
||||
}
|
||||
}
|
||||
|
@ -717,7 +717,10 @@ public class AtsTrainLoadService {
|
||||
// 排列好进路
|
||||
Route aheadRoute = routePath.selectDefaultRouteOfStart(route.getStart(), train.isCommunicable(), repository.getConfig());
|
||||
if (aheadRoute != null) {
|
||||
this.deviceStatusModifyTool.openRouteDirect(simulation, aheadRoute);
|
||||
Route.CheckFailMessage message = ciApiService.routeSettingCheck(simulation, aheadRoute.getCode());
|
||||
if (message == null) {
|
||||
this.deviceStatusModifyTool.openRouteDirect(simulation, aheadRoute);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package club.joylink.rtss.simulation.cbtc.CI.device;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.constant.SignalAspect;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -145,7 +144,7 @@ public class CiService {
|
||||
}
|
||||
// 道岔位置一致检查
|
||||
for (SwitchElement element : route.getSwitchList()) {
|
||||
if (!element.isOnPosition()) {
|
||||
if (!element.isOnPosition() || !element.getASwitch().isRouteLockBy(route)) {
|
||||
// log.debug("进路{}连锁条件检查失败:道岔{}位置{}",
|
||||
// route.debugStr(),
|
||||
// element.getASwitch().debugStr(), element.getASwitch().getPos());
|
||||
|
@ -1,7 +1,8 @@
|
||||
package club.joylink.rtss.simulation.cbtc.CI.device;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.*;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.SwitchElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySwitch;
|
||||
import club.joylink.rtss.simulation.cbtc.device.virtual.VirtualRealityDeviceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -100,7 +101,7 @@ public class CiSwitchControlService {
|
||||
if (vrSwitch.isPosN()) {
|
||||
return this.turn2ReversePosition(simulation, aSwitch);
|
||||
} else if (vrSwitch.isPosR()) {
|
||||
return this.turn2ReversePosition(simulation, aSwitch);
|
||||
return this.turn2NormalPosition(simulation, aSwitch);
|
||||
}
|
||||
}
|
||||
return this.turn2NormalPosition(simulation, aSwitch);
|
||||
|
@ -13,7 +13,6 @@ import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@ -475,7 +474,7 @@ public class Station extends MayOutOfOrderDevice {
|
||||
/**
|
||||
* 是否站控
|
||||
*/
|
||||
public boolean isStandControl() {
|
||||
public boolean isLocalControl() {
|
||||
return Objects.equals(ControlMode.Local, this.controlMode);
|
||||
}
|
||||
|
||||
@ -498,11 +497,11 @@ public class Station extends MayOutOfOrderDevice {
|
||||
*/
|
||||
public boolean underStandControl() {
|
||||
if (isCentralized())
|
||||
return isStandControl();
|
||||
return isLocalControl();
|
||||
if (hasControlMode) {
|
||||
return isStandControl();
|
||||
return isLocalControl();
|
||||
} else {
|
||||
return deviceStation.isStandControl();
|
||||
return deviceStation.isLocalControl();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ public class Switch extends DelayUnlockDevice {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isRouteLockBy(Route route) {
|
||||
public boolean isRouteLockBy(Route route) {
|
||||
return this.routeLock && this.route.equals(route);
|
||||
}
|
||||
|
||||
|
@ -63,8 +63,7 @@ public class VirtualRealitySignal extends ControllableVrDevice<SignalAspect> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// this.aspect = command;
|
||||
this.aspect = SignalAspect.R;
|
||||
this.aspect = command;
|
||||
}
|
||||
|
||||
public enum Fault {
|
||||
|
@ -154,10 +154,10 @@ public class DeviceStatusModifyTool {
|
||||
private void batchSetRouteSwitchPositionAndLock(Route route, List<SwitchElement> switchList, boolean routeLock) {
|
||||
if (!CollectionUtils.isEmpty(switchList)) {
|
||||
for (SwitchElement switchElement : switchList) {
|
||||
if (switchElement.getASwitch().isOverlapLock() &&
|
||||
switchElement.isOnPosition()) {
|
||||
continue;
|
||||
}
|
||||
// if (switchElement.getASwitch().isOverlapLock() &&
|
||||
// switchElement.isOnPosition()) {
|
||||
// continue;
|
||||
// }
|
||||
// switchElement.getASwitch().ciUse(switchElement.isNormal());
|
||||
this.setSingleSwitchPositionDirectly(switchElement.getASwitch(), switchElement.isNormal());
|
||||
if (routeLock) {
|
||||
|
Loading…
Reference in New Issue
Block a user