修改列车停站后无法开站台门bug

This commit is contained in:
joylink_zhangsai 2023-02-15 09:54:30 +08:00
parent 6d37169068
commit a3846f459b
4 changed files with 8 additions and 9 deletions

View File

@ -42,25 +42,25 @@ public class CiStandService {
switch (source) { switch (source) {
case SIG: { case SIG: {
VirtualRealityPsl vrPsl = stand.getVrPsl(); VirtualRealityPsl vrPsl = stand.getVrPsl();
if (vrPsl != null && vrPsl.isAllowOperation()) { if (vrPsl != null && vrPsl.isAllowOperate()) {
return false; return false;
} }
VirtualRealityIbp vrIbp = stand.getStation().getVrIbp(); VirtualRealityIbp vrIbp = stand.getStation().getVrIbp();
if (vrIbp != null && vrIbp.isAllowOperation(true, config.isUp(stand.isRight()))) { if (vrIbp != null && !vrIbp.isAllowOperate(true, config.isUp(stand.isRight()))) {
return false; return false;
} }
break; break;
} }
case PSL: { case PSL: {
VirtualRealityPsl vrPsl = stand.getVrPsl(); VirtualRealityPsl vrPsl = stand.getVrPsl();
if (vrPsl == null || !vrPsl.isAllowOperation()) { if (vrPsl == null || !vrPsl.isAllowOperate()) {
return false; return false;
} }
break; break;
} }
case IBP: { case IBP: {
VirtualRealityIbp vrIbp = stand.getStation().getVrIbp(); VirtualRealityIbp vrIbp = stand.getStation().getVrIbp();
if (vrIbp == null || !vrIbp.isAllowOperation(false, config.isUp(stand.isRight()))) { if (vrIbp == null || !vrIbp.isAllowOperate(false, config.isUp(stand.isRight()))) {
return false; return false;
} }
break; break;

View File

@ -125,7 +125,7 @@ public class VirtualRealityIbp extends VirtualRealityDevice {
* @param up 是否是上行 * @param up 是否是上行
* @return * @return
*/ */
public boolean isAllowOperation(boolean signal, boolean up) { public boolean isAllowOperate(boolean signal, boolean up) {
List<IbpElement> elements = up ? queryByMean(Mean.SXYS) : queryByMean(Mean.XXYS); List<IbpElement> elements = up ? queryByMean(Mean.SXYS) : queryByMean(Mean.XXYS);
if (CollectionUtils.isEmpty(elements)) { if (CollectionUtils.isEmpty(elements)) {
return true; return true;

View File

@ -1,6 +1,5 @@
package club.joylink.rtss.simulation.cbtc.data.vr; package club.joylink.rtss.simulation.cbtc.data.vr;
import club.joylink.rtss.simulation.cbtc.data.map.MapNamedElement;
import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.simulation.cbtc.data.map.Stand;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -52,7 +51,7 @@ public class VirtualRealityPsl extends VirtualRealityDevice {
this.sdButton = false; this.sdButton = false;
} }
public boolean isAllowOperation() { public boolean isAllowOperate() {
return this.isYxjzKey(); return this.isYxjzKey();
} }

View File

@ -130,7 +130,7 @@ public class SimulationRobotService {
} }
} }
VirtualRealityPsl vrPsl = stand.getVrPsl(); VirtualRealityPsl vrPsl = stand.getVrPsl();
if (!vrPsl.isAllowOperation()) { //确保此时允许操作 if (!vrPsl.isAllowOperate()) { //确保此时允许操作
iVirtualRealityPslService.pressTheButton(simulation, iVirtualRealityPslService.pressTheButton(simulation,
stand.getCode(), VirtualRealityPsl.Button.YXJZ); stand.getCode(), VirtualRealityPsl.Button.YXJZ);
} }
@ -141,7 +141,7 @@ public class SimulationRobotService {
iVirtualRealityPslService.pressTheButton(simulation, iVirtualRealityPslService.pressTheButton(simulation,
stand.getCode(), VirtualRealityPsl.Button.GM); stand.getCode(), VirtualRealityPsl.Button.GM);
} }
if (vrPsl.isAllowOperation()) { //将允许禁止钥匙打到禁止位 if (vrPsl.isAllowOperate()) { //将允许禁止钥匙打到禁止位
iVirtualRealityPslService.pressTheButton(simulation, iVirtualRealityPslService.pressTheButton(simulation,
stand.getCode(), VirtualRealityPsl.Button.YXJZ); stand.getCode(), VirtualRealityPsl.Button.YXJZ);
} }