【改方按钮状态修改】

Signed-off-by: weizhihong <weizhihong@joylink.club>
This commit is contained in:
weizhihong 2022-04-22 17:49:40 +08:00
parent b5bd2b4035
commit 8abe421380

View File

@ -75,12 +75,17 @@ public class AssistService {
// 是否被占用,TRUE 未占用,FALSE 占用 // 是否被占用,TRUE 未占用,FALSE 占用
boolean isNotOccupied = indicator.getSectionList() boolean isNotOccupied = indicator.getSectionList()
.stream() .stream()
.filter(section -> section.isBlockade() .filter(section -> section.isOccupied()).findAny().isEmpty();
|| section.isRouteLock() || section.isCtOccupied()
|| section.isNctOccupied() || section.isOverlapLock()
).findAny().isEmpty();
// 占用为红色 // 占用为红色
IndicatorStatusEnum statusEnum = isNotOccupied ? IndicatorStatusEnum.No : IndicatorStatusEnum.R; IndicatorStatusEnum statusEnum = isNotOccupied ? IndicatorStatusEnum.No : IndicatorStatusEnum.R;
// 占用点亮时灭掉改方按钮
if (IndicatorStatusEnum.R.equals(statusEnum)) {
indicator.getStation().getButtonsList()
.stream()
.filter(button -> indicator.getType().equals(button.getLabel()) && ButtonTypeEnum.CHANGE_DIRECTION.equals(button.getType()))
.forEach(button -> button.setPressDown(false));
}
indicator.setAspect(statusEnum); indicator.setAspect(statusEnum);
} }
@ -118,16 +123,6 @@ public class AssistService {
receiveStatus = receiveIndicator.getDefaultStatus(); receiveStatus = receiveIndicator.getDefaultStatus();
deliverStatus = deliverIndicator.getDefaultStatus(); deliverStatus = deliverIndicator.getDefaultStatus();
} }
// 判断状态是否变化
if (deliverStatus.equals(deliverIndicator.getAspect()) || receiveStatus.equals(receiveIndicator.getAspect())) {
// 变化接车灯亮发车灯灭
if (IndicatorStatusEnum.G.equals(deliverStatus)) {
curStation.getButtonsList()
.stream()
.filter(button -> labelEnum.equals(button.getLabel()) && ButtonTypeEnum.CHANGE_DIRECTION.equals(button.getType()))
.forEach(button -> button.setPressDown(IndicatorStatusEnum.G.equals(deliverStatus)));
}
}
receiveIndicator.setAspect(receiveStatus); receiveIndicator.setAspect(receiveStatus);
deliverIndicator.setAspect(deliverStatus); deliverIndicator.setAspect(deliverStatus);
} }