【半自动操作:事故按钮、闭塞、复原操作】(未测试)

This commit is contained in:
weizhihong 2022-05-05 18:14:01 +08:00
parent e63664b6d2
commit 0e950db851
7 changed files with 310 additions and 86 deletions

View File

@ -861,7 +861,11 @@ public class Operation {
/** /**
* 按下复原按钮 * 按下复原按钮
*/ */
ASSIST_PRESS_RESTORE ASSIST_PRESS_RESTORE,
/**
* 事故按钮
*/
ASSIST_PRESS_ACCIDENT,
} }
/** /**

View File

@ -63,7 +63,7 @@ public class StationDirectionOperateHandler {
@OperateHandlerMapping(type = Operation.Type.ASSIST_PRESS_RECEIVE_ASSIST) @OperateHandlerMapping(type = Operation.Type.ASSIST_PRESS_RECEIVE_ASSIST)
public void pressReceiveAssist(Simulation simulation, String stationCode, DirectionLabelEnum labelEnum) { public void pressReceiveAssist(Simulation simulation, String stationCode, DirectionLabelEnum labelEnum) {
stationDirectionService.changeButtonAspect(simulation, stationCode, labelEnum, StationDirection.ButtonTypeEnum.RECEIVE_ASSIST stationDirectionService.changeButtonAspect(simulation, stationCode, labelEnum, StationDirection.ButtonTypeEnum.RECEIVE_ASSIST
, Boolean.TRUE, stationDirectionService.turnAssistValid, stationDirectionService.receiveAssistThen); , Boolean.TRUE, stationDirectionService.receiveAssistValid, stationDirectionService.receiveAssistThen);
} }
/** /**
@ -88,8 +88,8 @@ public class StationDirectionOperateHandler {
*/ */
@OperateHandlerMapping(type = Operation.Type.ASSIST_PRESS_BLOCK) @OperateHandlerMapping(type = Operation.Type.ASSIST_PRESS_BLOCK)
public void pressBlockBtn(Simulation simulation, String stationCode, DirectionLabelEnum labelEnum) { public void pressBlockBtn(Simulation simulation, String stationCode, DirectionLabelEnum labelEnum) {
stationDirectionService.changeButtonAspect(simulation, stationCode, labelEnum, StationDirection.ButtonTypeEnum.BLOCK stationDirectionService.changeButtonAspect(simulation, stationCode, labelEnum, StationDirection.ButtonTypeEnum.OCCLUSION
, Boolean.TRUE, null, null); , Boolean.TRUE, null, stationDirectionService.turnBlockThen);
} }
/** /**
@ -101,7 +101,21 @@ public class StationDirectionOperateHandler {
*/ */
@OperateHandlerMapping(type = Operation.Type.ASSIST_PRESS_RESTORE) @OperateHandlerMapping(type = Operation.Type.ASSIST_PRESS_RESTORE)
public void pressRestoreBtn(Simulation simulation, String stationCode, DirectionLabelEnum labelEnum) { public void pressRestoreBtn(Simulation simulation, String stationCode, DirectionLabelEnum labelEnum) {
stationDirectionService.changeButtonAspect(simulation, stationCode, labelEnum, StationDirection.ButtonTypeEnum.BLOCK stationDirectionService.changeButtonAspect(simulation, stationCode, labelEnum, StationDirection.ButtonTypeEnum.RESTORE
, Boolean.TRUE, null, stationDirectionService.turnRestoreThen); , Boolean.TRUE, stationDirectionService.turnRestoreValid, stationDirectionService.turnRestoreThen);
}
/**
* 按下事故按钮
*
* @param simulation 仿真数据
* @param stationCode 车站编码
* @param labelEnum 运行方向
* @param pressDown 按下1抬起0
*/
@OperateHandlerMapping(type = Operation.Type.ASSIST_PRESS_ACCIDENT)
public void pressAccidentBtn(Simulation simulation, String stationCode, DirectionLabelEnum labelEnum, Integer pressDown) {
stationDirectionService.changeButtonAspect(simulation, stationCode, labelEnum, StationDirection.ButtonTypeEnum.ACCIDENT
, (pressDown == 1), null, null);
} }
} }

View File

@ -3,10 +3,7 @@ package club.joylink.rtss.simulation.cbtc.ATS.service.assist;
import club.joylink.rtss.constants.DirectionLabelEnum; import club.joylink.rtss.constants.DirectionLabelEnum;
import club.joylink.rtss.entity.DraftMapStationDirection; import club.joylink.rtss.entity.DraftMapStationDirection;
import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.*;
import club.joylink.rtss.simulation.cbtc.data.map.Stand;
import club.joylink.rtss.simulation.cbtc.data.map.Station;
import club.joylink.rtss.simulation.cbtc.data.map.StationDirection;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
@ -98,8 +95,7 @@ public class StationDirectionService {
standList = stationDirection.getStation().getLdStandList(); standList = stationDirection.getStation().getLdStandList();
} }
// 获取靠停列车 // 获取靠停列车
List<String> sectionCodeList = simulation.getRepository().getOnlineTrainList() List<String> sectionCodeList = simulation.getRepository().getOnlineTrainList().stream()
.stream()
.filter(VirtualRealityTrain::isStop) .filter(VirtualRealityTrain::isStop)
.map(trainInfo -> trainInfo.getHeadPosition().getSection().getCode()) .map(trainInfo -> trainInfo.getHeadPosition().getSection().getCode())
.collect(Collectors.toList()); .collect(Collectors.toList());
@ -110,7 +106,7 @@ public class StationDirectionService {
}; };
/** /**
* 发辅助按钮操作校验 * 发辅助按钮操作校验
*/ */
public ButtonValidInterface turnAssistValid = (simulation, stationDirection) -> { public ButtonValidInterface turnAssistValid = (simulation, stationDirection) -> {
if (!stationDirection.isMainAssistStatus()) { if (!stationDirection.isMainAssistStatus()) {
@ -118,6 +114,36 @@ public class StationDirectionService {
} }
}; };
/**
* 接辅助按钮操作校验
*/
public ButtonValidInterface receiveAssistValid = (simulation, stationDirection) -> {
// 判断总辅助
this.turnAssistValid.valid(simulation, stationDirection);
// 获取邻站实体
Optional<Station> nextStationOptional = getAdjacentStationOptional(simulation, stationDirection);
// 存在邻站
if (nextStationOptional.isPresent()) {
// 方向标签
DirectionLabelEnum relativeDirectionLabelEnum = stationDirection.getRelativeDirectionLabelEnum();
if (DirectionLabelEnum.NO.equals(relativeDirectionLabelEnum)) {
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:无对应方向");
} else {
// 发车方向
StationDirection deliverDirection = nextStationOptional.get().getStationDirectionMap().get(relativeDirectionLabelEnum);
if (deliverDirection == null) {
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:无对应方向");
} else {
// 邻站发辅助是否按下
if (!deliverDirection.isDeliverAssistStatus()) {
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:邻站未按下发辅助");
}
}
}
} else {
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:邻站不存在");
}
};
/** /**
* 总辅助后续操作 * 总辅助后续操作
@ -155,7 +181,16 @@ public class StationDirectionService {
* 复原按钮操作验证 * 复原按钮操作验证
*/ */
public ButtonValidInterface turnRestoreValid = (simulation, stationDirection) -> { public ButtonValidInterface turnRestoreValid = (simulation, stationDirection) -> {
// 接车方向需要判断是否已过信号机内方第一道岔区段
if (StationDirection.DirectionRunModel.S.equals(stationDirection.getRunModel())
&& StationDirection.ReceiveAndDeliverModel.R.equals(stationDirection.getRunStatus())) {
Section section = stationDirection.getSignal().getSection();
Section nextSection = section.getNextSection(stationDirection.getSignal().isRight());
// 判断信号机所在下一个区段是否锁闭,判断
if (section.isRouteLock() || nextSection.isRouteLock()) {
throw new SimulationException(SimulationExceptionType.Operation_Cannot_handed, "操作异常:区段未解锁");
}
}
}; };
/** /**
@ -168,23 +203,18 @@ public class StationDirectionService {
&& StationDirection.ReceiveAndDeliverModel.R.equals(stationDirection.getRunStatus())) { && StationDirection.ReceiveAndDeliverModel.R.equals(stationDirection.getRunStatus())) {
// 将本方向接发车状态恢复 // 将本方向接发车状态恢复
stationDirection.reset(); stationDirection.reset();
// 接车进路方向朝向 // 获取邻站实体
boolean right = stationDirection.getReceiveRouteList().stream().findFirst().stream().anyMatch(Route::isRight); Optional<Station> adjacentStationOptional = getAdjacentStationOptional(simulation, stationDirection);
// 寻找车站位置用于获取邻站 // 存在邻站
List<Station> stationList = simulation.getRepository().getStationList(); if (adjacentStationOptional.isPresent()) {
int index = stationList.indexOf(stationDirection.getStation()); // 方向标签
// 范围内 DirectionLabelEnum relativeDirectionLabelEnum = stationDirection.getRelativeDirectionLabelEnum();
if (index != 0 && index != stationList.size() - 1) { // 发车方向
index = right ? index + 1 : index - 1; StationDirection deliverDirection = adjacentStationOptional.get().getStationDirectionMap().get(relativeDirectionLabelEnum);
Station adjacentStation = stationList.get(index); // 发车方向还原
if (adjacentStation != null) { if (deliverDirection != null) {
adjacentStation.getStationDirectionMap().values() deliverDirection.reset();
.stream()
.filter(sd -> StationDirection.DirectionRunModel.S.equals(sd.getRunModel()))
.filter(sd -> sd.getDeliverRouteList().stream().anyMatch(route -> route.isRight() == right))
.forEach(sd -> sd.reset());
} }
} }
} }
} finally { } finally {
@ -193,6 +223,33 @@ public class StationDirectionService {
} }
}; };
/**
* 闭塞按钮操作
*/
public ButtonThenInterface turnBlockThen = (simulation, stationDirection) -> {
// 获取邻站实体
Optional<Station> adjacentStationOptional = getAdjacentStationOptional(simulation, stationDirection);
// 存在邻站
if (adjacentStationOptional.isPresent()) {
// 方向标签
DirectionLabelEnum relativeDirectionLabelEnum = stationDirection.getRelativeDirectionLabelEnum();
// 发车方向
StationDirection adjacentDirection = adjacentStationOptional.get().getStationDirectionMap().get(relativeDirectionLabelEnum);
if (adjacentDirection != null) {
// 如果存在闭塞说明本站是接车站
if (adjacentDirection.isBlockStatus()) {
// 预备状态
stationDirection.setReadyStatus(true);
adjacentDirection.setReadyStatus(true);
} else { // 不存在闭塞则本站是发车进路
// 将本站邻站接发状态设置为预备状态
stationDirection.setRunStatus(StationDirection.ReceiveAndDeliverModel.D);
adjacentDirection.setRunStatus(StationDirection.ReceiveAndDeliverModel.R);
}
}
}
};
/** /**
* 获取当前车站实体 * 获取当前车站实体
* *
@ -214,4 +271,23 @@ public class StationDirectionService {
} }
return station; return station;
} }
/**
* 获取接车进路的邻站
* 接车进路
*
* @param simulation 仿真实体数据
* @param stationDirection 方向实体
* @return 车站
*/
private Optional<Station> getAdjacentStationOptional(Simulation simulation, StationDirection stationDirection) {
// 获取接进路的方向
boolean right = stationDirection.getReceiveRouteList().stream().findAny().get().isRight();
// 找上一个车站序号
int index = stationDirection.getStation().getSn() + (right ? -1 : 1);
Optional<Station> adjacentStationOptional = simulation.getRepository().getStationList().stream()
.filter(station -> station.getSn() == index)
.findFirst();
return adjacentStationOptional;
}
} }

View File

@ -18,7 +18,6 @@ import java.util.concurrent.atomic.AtomicInteger;
@Getter @Getter
@Slf4j @Slf4j
public class StationDirection extends MapNamedElement { public class StationDirection extends MapNamedElement {
/** /**
* 发辅助默认倒计时 25s * 发辅助默认倒计时 25s
*/ */
@ -109,6 +108,16 @@ public class StationDirection extends MapNamedElement {
*/ */
private boolean restoreStatus; private boolean restoreStatus;
/**
* 预备状态
*/
private boolean readyStatus;
/**
* 事故
*/
private boolean accidentStatus;
/** /**
* 接车进路以指示灯为起点的进路 * 接车进路以指示灯为起点的进路
*/ */
@ -216,12 +225,48 @@ public class StationDirection extends MapNamedElement {
this.restoreStatus = pressDown; this.restoreStatus = pressDown;
break; break;
// 闭塞 // 闭塞
case BLOCK: case OCCLUSION:
this.blockStatus = pressDown; this.blockStatus = pressDown;
break; break;
// 事故
case ACCIDENT:
this.accidentStatus = pressDown;
} }
} }
/**
* 获取对应的方向
*
* @return 对应方向
*/
public DirectionLabelEnum getRelativeDirectionLabelEnum() {
DirectionLabelEnum nextLabelEnum;
switch (labelEnum) {
case X:
nextLabelEnum = DirectionLabelEnum.XF;
break;
case XF:
nextLabelEnum = DirectionLabelEnum.X;
break;
case XD:
nextLabelEnum = DirectionLabelEnum.SD;
break;
case S:
nextLabelEnum = DirectionLabelEnum.SF;
break;
case SF:
nextLabelEnum = DirectionLabelEnum.S;
break;
case SD:
nextLabelEnum = DirectionLabelEnum.XD;
break;
default:
nextLabelEnum = DirectionLabelEnum.NO;
break;
}
return nextLabelEnum;
}
/** /**
* 设置默认属性 * 设置默认属性
*/ */
@ -231,6 +276,7 @@ public class StationDirection extends MapNamedElement {
this.receiveAssistStatus = false; this.receiveAssistStatus = false;
this.deliverAssistStatus = false; this.deliverAssistStatus = false;
this.blockStatus = false; this.blockStatus = false;
this.readyStatus = false;
this.receiveAspect = IndicatorStatusEnum.F; this.receiveAspect = IndicatorStatusEnum.F;
this.deliverAspect = IndicatorStatusEnum.F; this.deliverAspect = IndicatorStatusEnum.F;
this.sectionAspect = IndicatorStatusEnum.F; this.sectionAspect = IndicatorStatusEnum.F;
@ -247,7 +293,7 @@ public class StationDirection extends MapNamedElement {
} else if (DirectionLabelEnum.XF.equals(labelEnum) || DirectionLabelEnum.SF.equals(labelEnum)) { // SFXF方向默认发车灯亮起 } else if (DirectionLabelEnum.XF.equals(labelEnum) || DirectionLabelEnum.SF.equals(labelEnum)) { // SFXF方向默认发车灯亮起
return ReceiveAndDeliverModel.D; return ReceiveAndDeliverModel.D;
} else { // SDXD方向默认发车灯亮起 } else { // SDXD方向默认发车灯亮起
return ReceiveAndDeliverModel.N; return ReceiveAndDeliverModel.NO;
} }
} }
@ -270,11 +316,10 @@ public class StationDirection extends MapNamedElement {
private boolean judgeSignalLock() { private boolean judgeSignalLock() {
Section section = this.getSignal().getSection(); Section section = this.getSignal().getSection();
boolean isLock = section.isRouteLock(); boolean isLock = section.isRouteLock();
if (!isLock && section.getLeftSection() != null) { // 判断信号机所在下一个区段是否锁闭
isLock = section.getLeftSection().isRouteLock(); if (!isLock) {
} section = section.getNextSection(getSignal().isRight());
if (!isLock && section.getRightSection() != null) { isLock = section.isRouteLock();
isLock = section.getRightSection().isRouteLock();
} }
return isLock; return isLock;
} }
@ -336,20 +381,6 @@ public class StationDirection extends MapNamedElement {
* 半自动闭塞,不会自动恢复 * 半自动闭塞,不会自动恢复
*/ */
private void semiAutomaticModelAspectStatus() { private void semiAutomaticModelAspectStatus() {
// 只有当状态为空时才做判断
if (ReceiveAndDeliverModel.N.equals(this.runStatus)) {
// 进路锁闭判断接发状态
// 接车进路锁闭
boolean receiveRouteBlock = this.receiveRouteList.stream().anyMatch(Route::isLock);
if (receiveRouteBlock) {
// 接发状态
this.runStatus = ReceiveAndDeliverModel.R;
} else {
// 发车进路锁闭
boolean deliverRouteBlock = this.deliverRouteList.stream().anyMatch(Route::isLock);
this.runStatus = deliverRouteBlock ? ReceiveAndDeliverModel.D : this.runStatus;
}
}
// 点灯 // 点灯
if (ReceiveAndDeliverModel.R.equals(this.runStatus)) { // 接车方向 if (ReceiveAndDeliverModel.R.equals(this.runStatus)) { // 接车方向
if (IndicatorStatusEnum.F.equals(this.receiveAspect) && IndicatorStatusEnum.O.equals(this.sectionAspect)) { if (IndicatorStatusEnum.F.equals(this.receiveAspect) && IndicatorStatusEnum.O.equals(this.sectionAspect)) {
@ -360,7 +391,7 @@ public class StationDirection extends MapNamedElement {
if (IndicatorStatusEnum.F.equals(this.deliverAspect) && IndicatorStatusEnum.O.equals(this.sectionAspect)) { if (IndicatorStatusEnum.F.equals(this.deliverAspect) && IndicatorStatusEnum.O.equals(this.sectionAspect)) {
this.deliverAspect = IndicatorStatusEnum.O; this.deliverAspect = IndicatorStatusEnum.O;
} }
} else if (ReceiveAndDeliverModel.N.equals(this.runStatus)) { } else if (ReceiveAndDeliverModel.NO.equals(this.runStatus)) {
this.deliverAspect = IndicatorStatusEnum.F; this.deliverAspect = IndicatorStatusEnum.F;
this.receiveAspect = IndicatorStatusEnum.F; this.receiveAspect = IndicatorStatusEnum.F;
} }
@ -374,14 +405,16 @@ public class StationDirection extends MapNamedElement {
// //
A, A,
// //
N NO
} }
public enum IndicatorStatusEnum { public enum IndicatorStatusEnum {
// 占用 // 占用
O, O,
// 空闲 // 空闲
F F,
// 预备
R
} }
public enum ButtonTypeEnum { public enum ButtonTypeEnum {
@ -396,7 +429,9 @@ public class StationDirection extends MapNamedElement {
// 复原 // 复原
RESTORE, RESTORE,
// 闭塞 // 闭塞
BLOCK, OCCLUSION,
// 事故
ACCIDENT,
NO; NO;
} }

View File

@ -69,6 +69,26 @@ public class StationDirectionStatus extends DeviceStatus {
*/ */
private AtomicInteger remain; private AtomicInteger remain;
/**
* 闭塞按钮
*/
private boolean blockStatus;
/**
* 复原按钮
*/
private boolean restoreStatus;
/**
* 预备状态
*/
private boolean readyStatus;
/**
* 事故
*/
private boolean accidentStatus;
public StationDirectionStatus(StationDirection stationDirection) { public StationDirectionStatus(StationDirection stationDirection) {
super(stationDirection.getCode(), stationDirection.getDeviceType()); super(stationDirection.getCode(), stationDirection.getDeviceType());
this.stationCode = stationDirection.getStation().getCode(); this.stationCode = stationDirection.getStation().getCode();
@ -83,73 +103,101 @@ public class StationDirectionStatus extends DeviceStatus {
this.receiveAssistStatus = stationDirection.isReceiveAssistStatus(); this.receiveAssistStatus = stationDirection.isReceiveAssistStatus();
this.deliverAssistStatus = stationDirection.isDeliverAssistStatus(); this.deliverAssistStatus = stationDirection.isDeliverAssistStatus();
this.remain = new AtomicInteger(stationDirection.getRemain().intValue()); this.remain = new AtomicInteger(stationDirection.getRemain().intValue());
this.blockStatus = stationDirection.isBlockStatus();
this.restoreStatus = stationDirection.isRestoreStatus();
this.readyStatus = stationDirection.isReadyStatus();
this.accidentStatus = stationDirection.isAccidentStatus();
} }
@Override @Override
public boolean compareAndChange(MapElement device, DeviceStatusVO statusVO) { public boolean compareAndChange(MapElement device, DeviceStatusVO statusVO) {
StationDirection labelEnum = (StationDirection) device; StationDirection stationDirection = (StationDirection) device;
StationDirectionStatusVO status = (StationDirectionStatusVO) statusVO; StationDirectionStatusVO status = (StationDirectionStatusVO) statusVO;
boolean change = false; boolean change = false;
// 接车发车口 // 接车发车口
if (!Objects.equals(labelEnum.getRunStatus(), runStatus)) { if (!Objects.equals(stationDirection.getRunStatus(), runStatus)) {
this.runStatus = labelEnum.getRunStatus(); this.runStatus = stationDirection.getRunStatus();
status.setRunStatus(labelEnum.getRunStatus()); status.setRunStatus(stationDirection.getRunStatus());
change = true; change = true;
} }
// 接车 // 接车
if (!Objects.equals(labelEnum.getReceiveAspect(), receiveAspect)) { if (!Objects.equals(stationDirection.getReceiveAspect(), receiveAspect)) {
this.receiveAspect = labelEnum.getReceiveAspect(); this.receiveAspect = stationDirection.getReceiveAspect();
status.setReceiveAspect(receiveAspect); status.setReceiveAspect(receiveAspect);
change = true; change = true;
} }
// 发车 // 发车
if (!Objects.equals(labelEnum.getDeliverAspect(), deliverAspect)) { if (!Objects.equals(stationDirection.getDeliverAspect(), deliverAspect)) {
this.deliverAspect = labelEnum.getDeliverAspect(); this.deliverAspect = stationDirection.getDeliverAspect();
status.setDeliverAspect(deliverAspect); status.setDeliverAspect(deliverAspect);
change = true; change = true;
} }
// 区间 // 区间
if (!Objects.equals(labelEnum.getSectionAspect(), sectionAspect)) { if (!Objects.equals(stationDirection.getSectionAspect(), sectionAspect)) {
this.sectionAspect = labelEnum.getSectionAspect(); this.sectionAspect = stationDirection.getSectionAspect();
status.setSectionAspect(sectionAspect); status.setSectionAspect(sectionAspect);
change = true; change = true;
} }
// 辅助灯 // 辅助灯
if (!Objects.equals(labelEnum.getAssistAspect(), assistAspect)) { if (!Objects.equals(stationDirection.getAssistAspect(), assistAspect)) {
this.assistAspect = labelEnum.getAssistAspect(); this.assistAspect = stationDirection.getAssistAspect();
status.setAssistAspect(assistAspect); status.setAssistAspect(assistAspect);
change = true; change = true;
} }
// 改方按钮 // 改方按钮
if (!Objects.equals(labelEnum.isChangeDirectionStatus(), changeDirectionStatus)) { if (!Objects.equals(stationDirection.isChangeDirectionStatus(), changeDirectionStatus)) {
this.changeDirectionStatus = labelEnum.isChangeDirectionStatus(); this.changeDirectionStatus = stationDirection.isChangeDirectionStatus();
status.setChangeDirectionStatus(changeDirectionStatus); status.setChangeDirectionStatus(changeDirectionStatus);
change = true; change = true;
} }
// 总辅助按钮 // 总辅助按钮
if (!Objects.equals(labelEnum.isMainAssistStatus(), mainAssistStatus)) { if (!Objects.equals(stationDirection.isMainAssistStatus(), mainAssistStatus)) {
this.mainAssistStatus = labelEnum.isMainAssistStatus(); this.mainAssistStatus = stationDirection.isMainAssistStatus();
status.setMainAssistStatus(mainAssistStatus); status.setMainAssistStatus(mainAssistStatus);
change = true; change = true;
} }
// 接辅助按钮 // 接辅助按钮
if (!Objects.equals(labelEnum.isReceiveAssistStatus(), receiveAssistStatus)) { if (!Objects.equals(stationDirection.isReceiveAssistStatus(), receiveAssistStatus)) {
this.receiveAssistStatus = labelEnum.isReceiveAssistStatus(); this.receiveAssistStatus = stationDirection.isReceiveAssistStatus();
status.setReceiveAssistStatus(receiveAssistStatus); status.setReceiveAssistStatus(receiveAssistStatus);
change = true; change = true;
} }
// 发辅助按钮 // 发辅助按钮
if (!Objects.equals(labelEnum.isDeliverAssistStatus(), deliverAssistStatus)) { if (!Objects.equals(stationDirection.isDeliverAssistStatus(), deliverAssistStatus)) {
this.deliverAssistStatus = labelEnum.isDeliverAssistStatus(); this.deliverAssistStatus = stationDirection.isDeliverAssistStatus();
status.setDeliverAssistStatus(deliverAssistStatus); status.setDeliverAssistStatus(deliverAssistStatus);
change = true; change = true;
} }
// 倒计时判断 // 倒计时判断
if (!Objects.equals(labelEnum.getRemain().intValue(), remain.intValue())) { if (!Objects.equals(stationDirection.getRemain().intValue(), remain.intValue())) {
this.remain.set(labelEnum.getRemain().intValue()); this.remain.set(stationDirection.getRemain().intValue());
status.setRemain(remain.intValue()); status.setRemain(remain.intValue());
change = true; change = true;
} }
// 闭塞状态
if (!Objects.equals(stationDirection.isBlockStatus(), blockStatus)) {
this.blockStatus = stationDirection.isBlockStatus();
status.setBlockStatus(stationDirection.isBlockStatus());
change = true;
}
// 复原状态
if (!Objects.equals(stationDirection.isRestoreStatus(), restoreStatus)) {
this.restoreStatus = stationDirection.isRestoreStatus();
status.setRestoreStatus(stationDirection.isRestoreStatus());
change = true;
}
// 预备状态
if (!Objects.equals(stationDirection.isReadyStatus(), readyStatus)) {
this.readyStatus = stationDirection.isReadyStatus();
status.setReadyStatus(stationDirection.isReadyStatus());
change = true;
}
// 预备状态
if (!Objects.equals(stationDirection.isAccidentStatus(), accidentStatus)) {
this.accidentStatus = stationDirection.isAccidentStatus();
status.setAccidentStatus(stationDirection.isAccidentStatus());
change = true;
}
return change; return change;
} }
@ -167,6 +215,11 @@ public class StationDirectionStatus extends DeviceStatus {
statusVO.setMainAssistStatus(mainAssistStatus); statusVO.setMainAssistStatus(mainAssistStatus);
statusVO.setReceiveAssistStatus(receiveAssistStatus); statusVO.setReceiveAssistStatus(receiveAssistStatus);
statusVO.setDeliverAssistStatus(deliverAssistStatus); statusVO.setDeliverAssistStatus(deliverAssistStatus);
statusVO.setRemain(remain.intValue());
statusVO.setBlockStatus(blockStatus);
statusVO.setRestoreStatus(restoreStatus);
statusVO.setReadyStatus(readyStatus);
statusVO.setAccidentStatus(accidentStatus);
return statusVO; return statusVO;
} }
} }

View File

@ -63,6 +63,26 @@ public class StationDirectionStatusVO extends DeviceStatusVO {
*/ */
private Integer remain; private Integer remain;
/**
* 闭塞按钮
*/
private Boolean blockStatus;
/**
* 复原按钮
*/
private Boolean restoreStatus;
/**
* 预备状态
*/
private Boolean readyStatus;
/**
* 事故
*/
private Boolean accidentStatus;
public StationDirectionStatusVO(StationDirection stationDirection) { public StationDirectionStatusVO(StationDirection stationDirection) {
super(stationDirection.getCode(), stationDirection.getDeviceType()); super(stationDirection.getCode(), stationDirection.getDeviceType());
} }

View File

@ -38,19 +38,33 @@ public class MapSignalButtonVO {
private DirectionLabelEnum labelEnum; private DirectionLabelEnum labelEnum;
public enum Type { public enum Type {
/** 接车按钮 */ /**
* 接车按钮
*/
PICK, PICK,
/** 通过按钮 */ /**
* 通过按钮
*/
PASS, PASS,
/** 引导按钮 */ /**
* 引导按钮
*/
GUIDE, GUIDE,
/** 变通按钮 */ /**
* 变通按钮
*/
FLEXIBLE, FLEXIBLE,
/** 坡道终端按钮 */ /**
* 坡道终端按钮
*/
RAMP_TERMINAL, RAMP_TERMINAL,
/** 列车终端按钮 */ /**
* 列车终端按钮
*/
TRAIN_TERMINAL, TRAIN_TERMINAL,
/** 调车终端按钮 */ /**
* 调车终端按钮
*/
SHUNT_TERMINAL, SHUNT_TERMINAL,
/** /**
@ -72,6 +86,14 @@ public class MapSignalButtonVO {
/** /**
* 改方按钮 * 改方按钮
*/ */
CHANGE_DIRECTION CHANGE_DIRECTION,
/**
* 复原
*/
RECOVERY,
/**
* 闭塞
*/
OCCLUSION
} }
} }