控制权限转移修改
This commit is contained in:
parent
cf2e10b9db
commit
e6390321ae
@ -204,7 +204,7 @@ public class AtsStandService {
|
||||
public void cancelJumpStop(Simulation simulation, String standCode, String trainGroupNumber) {
|
||||
Stand stand = getStand(simulation, standCode);
|
||||
if (!stand.isJumpStop()) {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Repetition);
|
||||
return;
|
||||
}
|
||||
if (!StringUtils.hasText(trainGroupNumber)) { //如果是取消站台跳停
|
||||
stand.setAllSkip(false);
|
||||
|
@ -488,6 +488,7 @@ public class AtsStationService {
|
||||
if (agree) {
|
||||
if (station.getController() == null || Objects.equals(station.getController(), member)) {
|
||||
station.setController(station.getControlApplicant());
|
||||
station.setControlApplicant(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -181,10 +181,10 @@ public class MapConfig {
|
||||
*/
|
||||
private boolean needApproachLockBeforeSetGuide;
|
||||
|
||||
/**
|
||||
* 站台指定列车跳停仅跳停一次
|
||||
*/
|
||||
private boolean standSkipSetTrainOnlyOnce;
|
||||
// /**
|
||||
// * 站台指定列车跳停仅跳停一次
|
||||
// */
|
||||
// private boolean standSkipSetTrainOnlyOnce;
|
||||
|
||||
/**
|
||||
* 封锁命令(状态)仅在后备模式下有效
|
||||
@ -238,7 +238,7 @@ public class MapConfig {
|
||||
setSetRouteBeforeSetFlt(configVO.isSetRouteBeforeSetFlt());
|
||||
setCancelRouteWhenCancelFlt(configVO.isCancelRouteWhenCancelFlt());
|
||||
setNeedApproachLockBeforeSetGuide(configVO.isNeedApproachLockBeforeSetGuide());
|
||||
setStandSkipSetTrainOnlyOnce(configVO.isStandSkipSetTrainOnlyOnce());
|
||||
// setStandSkipSetTrainOnlyOnce(configVO.isStandSkipSetTrainOnlyOnce());
|
||||
setBlockadeCommandOnlyValidInStandbyMode(configVO.isBlockadeCommandOnlyValidInStandbyMode());
|
||||
setSomeCommandNeedInit(configVO.isSwitchBlockadeCommandNeedInit());
|
||||
setStationPreResetBeforeAxlePreReset(configVO.isStationPreResetBeforeAxlePreReset());
|
||||
|
@ -158,7 +158,7 @@ public class ATOService {
|
||||
// nextStopStandSection.getName(), nextStopStandSection.getCode()));
|
||||
boolean parking = true;
|
||||
Signal signal = target.getSignalOf(right);
|
||||
if (!train.isHold() && (train.isJump() && signal.isNormalOpen() || !train.isNextParking())) {
|
||||
if (!train.isHold() && (train.isJump() && (Objects.isNull(signal) || signal.isNormalOpen()) || !train.isNextParking())) {
|
||||
parking = false;
|
||||
}
|
||||
if (parking) {
|
||||
|
@ -215,14 +215,14 @@ public class ATPLogicLoop {
|
||||
case OPEN_DOOR: // 开门
|
||||
if (train.isJump()) { // 列车跳停,跳过开门
|
||||
train.earlyDeparture();
|
||||
if (simulation.getRepository().getConfig().isStandSkipSetTrainOnlyOnce()) {
|
||||
// if (simulation.getRepository().getConfig().isStandSkipSetTrainOnlyOnce()) {
|
||||
List<Stand> standList = train.getHeadPosition().getSection().getStandList();
|
||||
if (!CollectionUtils.isEmpty(standList)) {
|
||||
standList.stream().filter(stand -> stand.isGivenTrainSkip(train.getGroupNumber())).forEach(stand -> {
|
||||
atsApiService.cancelStandSkipSetOfTrain(simulation,train.getGroupNumber(), stand.getCode());
|
||||
});
|
||||
}
|
||||
}
|
||||
// }
|
||||
} else {
|
||||
this.atoService.syncOpenDoor(simulation, train);
|
||||
if (this.isAllDoorOpen(simulation, train)) {
|
||||
@ -665,13 +665,13 @@ public class ATPLogicLoop {
|
||||
// 列车成功越站
|
||||
this.atsApiService.handleTrainPassingStation(simulation, train.getGroupNumber(),
|
||||
nextStation.getCode(), tailSection.getCode());
|
||||
if (simulation.getRepository().getConfig().isStandSkipSetTrainOnlyOnce()) {
|
||||
List<Stand> standList = train.getHeadPosition().getSection().getStandList();
|
||||
if (CollectionUtils.isEmpty(standList)) {
|
||||
return;
|
||||
}
|
||||
standList.stream().filter(stand -> stand.isGivenTrainSkip(train.getGroupNumber())).forEach(stand -> atsApiService.cancelStandSkipSetOfTrain(simulation, train.getGroupNumber(), stand.getCode()));
|
||||
}
|
||||
// if (simulation.getRepository().getConfig().isStandSkipSetTrainOnlyOnce()) {
|
||||
// List<Stand> standList = train.getHeadPosition().getSection().getStandList();
|
||||
// if (CollectionUtils.isEmpty(standList)) {
|
||||
// return;
|
||||
// }
|
||||
// standList.stream().filter(stand -> stand.isGivenTrainSkip(train.getGroupNumber())).forEach(stand -> atsApiService.cancelStandSkipSetOfTrain(simulation, train.getGroupNumber(), stand.getCode()));
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,14 @@ import club.joylink.rtss.simulation.cbtc.driving.DrivingService;
|
||||
import club.joylink.rtss.simulation.cbtc.member.SimulationMember;
|
||||
import club.joylink.rtss.simulation.cbtc.onboard.ATO.SpeedCurve;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -38,13 +41,20 @@ public class RobotLogicLoop {
|
||||
@Autowired
|
||||
private DriverOperateHandler driverOperateHandler;
|
||||
|
||||
@Qualifier("nsExecutor")
|
||||
@Autowired
|
||||
private TaskExecutor executor;
|
||||
/**
|
||||
* 根据目标位置运行
|
||||
*/
|
||||
public void run(Simulation simulation) {
|
||||
robotDriverLogicLoop(simulation);
|
||||
executor.execute(() -> robotDriverLogicLoop(simulation));
|
||||
executor.execute(() -> robotReplyControlTransferApplicationLogicLoop(simulation));
|
||||
executor.execute(() -> robotStationControlAutoTransfer(simulation));
|
||||
|
||||
|
||||
|
||||
|
||||
robotReplyControlTransferApplicationLogicLoop(simulation);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -151,6 +161,18 @@ public class RobotLogicLoop {
|
||||
}
|
||||
}
|
||||
|
||||
/**机器人自动执行车站控制权限转移*/
|
||||
private void robotStationControlAutoTransfer(Simulation simulation) {
|
||||
if (simulation.getScript() != null && simulation.getScript().isBgSet()) {
|
||||
return;
|
||||
}
|
||||
Map<SimulationMember, List<Station>> robotControlStations = simulation.getRepository().getStationList().stream()
|
||||
.filter(station -> Objects.nonNull(station.getController()) && station.getController().isRobot() && Objects.nonNull(station.getControlApplicant())).collect(Collectors.groupingBy(Station::getController));
|
||||
robotControlStations.forEach((controler, stations) -> {
|
||||
atsStationService.transferControl(simulation, stations.stream().map(Station::getCode).collect(Collectors.toList()), true, controler);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 机器人回复控制权转换申请
|
||||
*
|
||||
|
@ -120,10 +120,10 @@ public class RealLineConfigVO {
|
||||
*/
|
||||
private boolean needApproachLockBeforeSetGuide = true;
|
||||
|
||||
/**
|
||||
* 站台指定列车跳停仅跳停一次
|
||||
*/
|
||||
private boolean standSkipSetTrainOnlyOnce;
|
||||
// /**
|
||||
// * 站台指定列车跳停仅跳停一次
|
||||
// */
|
||||
// private boolean standSkipSetTrainOnlyOnce;
|
||||
|
||||
/**
|
||||
* 封锁命令(状态)仅在后备模式下有效
|
||||
|
Loading…
Reference in New Issue
Block a user