From 162eedbcfd33901cf452297efc720ea434f0b627 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 5 Aug 2022 16:56:13 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=90=E6=8C=87=E4=BB=A4=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=93=8D=E4=BD=9C=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/operation/Operation.java | 59 +++ .../handler/DriverOperateHandler.java | 163 ++++++-- .../cbtc/onboard/ATP/ATPService.java | 361 +++++++++++++++++- 3 files changed, 550 insertions(+), 33 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index 4c7e12375..56331dcd3 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -838,6 +838,65 @@ public class Operation { */ Driver_Stop, + /** + * 确认运行至前方站 + */ + Drive_Ahead, + + /** + * 进路闭塞法行车 + */ + Route_Block_Drive, + + /** + * 越红灯行驶 + */ + Drive_Through_The_Red_Light, + + /** + * 越引导信号行驶 + */ + Drive_Through_The_Guide_Signal, + + /** + * 开关门 + */ + Open_Or_Close_Door, + + /** + * 设置限速 + */ + Set_Speed_Limit, + + /** + * 驾驶至 + */ + Drive_To, + + /** + * 回库 + */ + Inbound, + + /** + * 修改预选模式 + */ + Change_Preselection_Mode, + + /** + * 转NRM模式 + */ + Apply_NRM, + + /** + * 大铁、发车 + **/ + Depart_Train, + + /** + * 大铁、停车 + */ + Parking_Train, //--------------------------- 方向杆 --------------------------- /** * 方向转换 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/DriverOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/DriverOperateHandler.java index 90f996079..7f3171eb7 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/DriverOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/DriverOperateHandler.java @@ -37,34 +37,7 @@ public class DriverOperateHandler { public void changeTrainForce(Simulation simulation, String groupNumber, Float percent) { Objects.requireNonNull(percent); VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); -// if (train.isSignalEB() && percent == -2) -// ATPService.cancelSignalEB(train); - // 门选不是零位,不给牵引力 - if (!train.getDoorSelection().equals(VirtualRealityTrain.DoorSelection.Z)) { - return; - } - if ((percent <= 1 && percent >= -1) || percent == -2) { - train.setLeverPosition(percent); - } - if (train.isEB()) { - return; - } - if (percent <= 1 && percent >= -1) { - if (percent > 0) { - float fk = train.getCurrentFkMax() * percent; - train.leaverUpdateTBForce(fk, 0); - } else if (percent < 0) { - float fb = train.getCurrentFbMax() * Math.abs(percent); - train.leaverUpdateTBForce(0, fb); - } else { - train.leaverUpdateTBForce(0, 0); - } - } else if (percent == -2) { - train.leaverUpdateTBForce(0, 350); - } else { - throw new SimulationException(SimulationExceptionType.Illegal_Argument, - String.format("数值[%s]超限,列车牵引/制动力可调整比例范围应该在[-1, 1]之间,或为快速制动-2", percent)); - } + ATPService.changeTrainForce(train, percent); } /** @@ -82,6 +55,7 @@ public class DriverOperateHandler { /** * 修改工况手轮档位 + * * @param simulation * @param groupNumber * @param gear @@ -210,4 +184,137 @@ public class DriverOperateHandler { public void stopTrain(Simulation simulation, SimulationMember simulationMember, String groupNumber, Boolean eb) { simulationRobotService.stopTrain(simulation, simulationMember, groupNumber, eb); } + + /** + * 确认运行至前方站 + */ + @OperateHandlerMapping(type = Operation.Type.Drive_Ahead) + public void driveAhead(Simulation simulation, SimulationMember simulationMember, String groupNumber) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.driveAhead(simulation, groupNumber); + } + + /** + * 进路闭塞法行车 + */ + @OperateHandlerMapping(type = Operation.Type.Route_Block_Drive) + public void routeBlockDrive(Simulation simulation, SimulationMember simulationMember, String groupNumber) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.routeBlockDrive(simulation, groupNumber); + } + + /** + * 越红灯行驶 + */ + @OperateHandlerMapping(type = Operation.Type.Drive_Through_The_Red_Light) + public void driveThroughTheRedLight(Simulation simulation, SimulationMember simulationMember, String groupNumber) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.driveThroughTheRedLight(simulation, groupNumber); + } + + /** + * 越引导信号行驶 + */ + @OperateHandlerMapping(type = Operation.Type.Drive_Through_The_Guide_Signal) + public void driveThroughTheGuideSignal(Simulation simulation, SimulationMember simulationMember, String groupNumber) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.driveThroughTheGuideSignal(simulation, groupNumber); + } + + /** + * 开关门 + */ + @OperateHandlerMapping(type = Operation.Type.Open_Or_Close_Door) + public void openOrCloseDoor(Simulation simulation, SimulationMember simulationMember, String groupNumber) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.openOrCloseDoor(simulation, groupNumber); + } + + /** + * 设置限速 + */ + @OperateHandlerMapping(type = Operation.Type.Set_Speed_Limit) + public void setSpeedLimit(Simulation simulation, SimulationMember simulationMember, String groupNumber, Float speedLimit) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.setSpeedLimit(simulation, groupNumber, speedLimit); + } + + /** + * 驾驶至 + */ + @OperateHandlerMapping(type = Operation.Type.Drive_To) + public void driveTo(Simulation simulation, SimulationMember simulationMember, String groupNumber, String sectionCode) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.driveTo(simulation, groupNumber, sectionCode); + } + + /** + * 回库 + */ + @OperateHandlerMapping(type = Operation.Type.Inbound) + public void inbound(Simulation simulation, SimulationMember simulationMember, String groupNumber) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.inbound(simulation, groupNumber); + } + + /** + * 修改预选模式 + */ + @OperateHandlerMapping(type = Operation.Type.Change_Preselection_Mode) + public void changePreselectionMode(Simulation simulation, SimulationMember simulationMember, String groupNumber + , VirtualRealityTrain.PreselectionMode preselectionMode) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.changePreselectionMode(simulation, groupNumber, preselectionMode); + } + + /** + * 转NRM模式 + */ + @OperateHandlerMapping(type = Operation.Type.Apply_NRM) + public void applyNRM(Simulation simulation, SimulationMember simulationMember, String groupNumber) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.applyNRM(simulation, groupNumber); + } + + /** + * 大铁、发车 + **/ + @OperateHandlerMapping(type = Operation.Type.Depart_Train) + public void departTrain(Simulation simulation, SimulationMember simulationMember, String groupNumber) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.departTrain(simulation, groupNumber); + } + + /** + * 大铁、停车 + */ + @OperateHandlerMapping(type = Operation.Type.Parking_Train) + public void parkingTrain(Simulation simulation, SimulationMember simulationMember, String groupNumber) { + if (!SimulationMember.Type.DRIVER.equals(simulationMember.getType())) { + throw new SimulationException(SimulationExceptionType.Member_Is_Not_Driver); + } + ATPService.parkingTrain(simulation, groupNumber); + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java index ea4da8269..e6788bbbf 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java @@ -5,23 +5,27 @@ import club.joylink.rtss.simulation.cbtc.ATP.ground.MaService; import club.joylink.rtss.simulation.cbtc.CI.CiApiService; import club.joylink.rtss.simulation.cbtc.CI.device.CiStandService; import club.joylink.rtss.simulation.cbtc.Simulation; -import club.joylink.rtss.simulation.cbtc.constant.DriveMode; -import club.joylink.rtss.simulation.cbtc.constant.RunLevel; -import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; -import club.joylink.rtss.simulation.cbtc.constant.SimulationModule; +import club.joylink.rtss.simulation.cbtc.constant.*; import club.joylink.rtss.simulation.cbtc.data.CalculateService; +import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.map.Section; +import club.joylink.rtss.simulation.cbtc.data.map.Signal; import club.joylink.rtss.simulation.cbtc.data.map.Stand; import club.joylink.rtss.simulation.cbtc.data.support.MovementAuthority; +import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; +import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain.PreselectionMode; +import club.joylink.rtss.simulation.cbtc.exception.SimulationException; +import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import club.joylink.rtss.simulation.cbtc.onboard.ATO.SpeedCurve; import club.joylink.rtss.simulation.cbtc.onboard.ATO.service.ATOService; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; import java.util.List; import java.util.Objects; @@ -153,7 +157,7 @@ public class ATPService { train.setCircuitEB(true); train.emergencyBreak(); } - + /** * 取消信号EB */ @@ -491,4 +495,351 @@ public class ATPService { closeATO(train); } } + + /** + * 确认运行至前方站 + */ + public void driveAhead(Simulation simulation, String groupNumber) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + // 列车车头所在区段 + Section section = train.getHeadPosition().getSection(); + // 停车目的区段 + SectionPosition standStopPosition; + if (section.isStandTrack()) { + standStopPosition = new SectionPosition(section, section.getStopPointByDirection(train.isRight())); + } else { + standStopPosition = train.calculateNextStandStopPosition(); + if (standStopPosition == null && train.getTarget() != null) { + standStopPosition = new SectionPosition(train.getTarget(), train.getTarget().getStopPointByDirection(train.isRight())); + } + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotNull(standStopPosition, train.debugStr() + "找不到下一个停车点"); + } + if (!train.isStopAtThePosition(standStopPosition)) { //如果列车没停到目标位置 + if (!train.isInTheGear(VirtualRealityTrain.Handwheel.MANUAL)) { // 改变工况手轮档位 + changeGear(train, VirtualRealityTrain.Handwheel.MANUAL); + } + float percent = train.isEB() && (!train.isStop() || !train.isLeverNotInTractionGear()) + ? -2F : (!train.isStop() ? -1F : 0); + if (percent != 0) { + changeTrainForce(train, percent); // 改变列车的牵引/ + } + if ((!DriveMode.RM.equals(train.getDriveMode()) || train.isEB()) && !train.isNRMMode()) { + changePreselectionMode(train, PreselectionMode.RM); // 修改预选模式 + } + train.setRobotTargetPosition(standStopPosition); + train.getRobotDriveParam().setRun(true); + train.getRobotDriveParam().setStop(false); + } + } + + /** + * 进路闭塞法行车 + */ + public void routeBlockDrive(Simulation simulation, String groupNumber) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + if (!train.isAMMode()) { + changePreselectionMode(train, PreselectionMode.AM_C); + } + } + + /** + * 越红灯行驶 + */ + public void driveThroughTheRedLight(Simulation simulation, String groupNumber) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + if (!DriveMode.RM.equals(train.getDriveMode()) && !train.isNRMMode()) { + changePreselectionMode(train, PreselectionMode.RM); + } + if (train.isSignalEB()) { + releaseEB(train); + } + train.setRobotTargetPosition(train.calculateStopPosition4CrossTheRedLight()); //如果列车没停到目标位置 + train.getRobotDriveParam().setThroughSignal(train.getHeadPosition().getSection().getSignalOf(train.isRight())); + } + + /** + * 越引导信号行驶 + */ + public void driveThroughTheGuideSignal(Simulation simulation, String groupNumber) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + if (!train.isRMMode() && !train.isNRMMode()) { //既不是RM也不是NRM,切换预选模式 + changePreselectionMode(train, PreselectionMode.RM); + } + if (!train.isInTheGear(VirtualRealityTrain.Handwheel.MANUAL)) { //转手轮 + changeGear(train, VirtualRealityTrain.Handwheel.MANUAL); + } + train.setRobotTargetPosition(calculateStepPosition4CrossTheGuideSignal(train)); //如果列车没停到目标位置 + train.getRobotDriveParam().setThroughSignal(train.getHeadPosition().getSection().getSignalOf(train.isRight())); + } + + /** + * 开关门 + */ + public void openOrCloseDoor(Simulation simulation, String groupNumber) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + List standList = train.getHeadPosition().getSection().getStandList(); + if (!CollectionUtils.isEmpty(standList) && standList.size() == 1 && standList.get(0).isSmall()) { + // 小站台停车,无需开关门 + return; + } + boolean doorIsRight = false, open = false; + if (!train.getDoorByDirection(false).isCloseAndLock()) { //列车左门没关 + doorIsRight = false; + open = false; + } else if (!train.getDoorByDirection(true).isCloseAndLock()) { //列车右门没关 + doorIsRight = true; + open = false; + } else { + Stand stand = standList.get(0); + if (stand.isInside() && stand.isRight()) { // 内测 + if (stand.isRight()) { // 右站台,开1门 + doorIsRight = train.judgeDirection4DoorIsRight(train.getDoor1()); + } else { // 左站台,开2门 + doorIsRight = train.judgeDirection4DoorIsRight(train.getDoor2()); + } + } else { //外侧 + if (stand.isRight()) { // 右站台,开2门 + doorIsRight = train.judgeDirection4DoorIsRight(train.getDoor2()); + } else { // 左站台,开1门 + doorIsRight = train.judgeDirection4DoorIsRight(train.getDoor1()); + } + } + open = true; + } + VirtualRealityTrain.Door door = train.getDoorByDirection(doorIsRight); + if (!Objects.equals(door.isOpen(), open)) { + openOrCloseDoor(simulation, train, doorIsRight, open); + } + } + + /** + * 设置限速 + */ + public void setSpeedLimit(Simulation simulation, String groupNumber, Float speedLimit) { + if (speedLimit != null) { + return; + } + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + if (speedLimit < 0) { + train.setSpeedLimit(Float.MAX_VALUE); + } else { + train.setSpeedLimit(speedLimit / 3.6f); + } + } + + /** + * 驾驶至 + */ + public void driveTo(Simulation simulation, String groupNumber, String sectionCode) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + Section section = simulation.getRepository().getByCode(sectionCode, Section.class); + SectionPosition targetPosition = new SectionPosition(section, section.getStopPointByDirection(train.isRight())); + train.setRobotTargetPosition(targetPosition); + train.getRobotDriveParam().setRun(true); + } + + /** + * 回库 + */ + public void inbound(Simulation simulation, String groupNumber) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + Section headSection = train.getHeadPosition().getSection(); + if (headSection.isTransferTrack() && train.isStop()) { //列车停在折返轨 + SimulationDataRepository repository = simulation.getRepository(); + TrainInfo trainInfo = repository.getSupervisedTrainByGroup(train.getGroupNumber()); + List routePathList = repository.queryRoutePathsByEnd(headSection); + if (routePathList.get(0).isRight() == trainInfo.getRight()) { //准备回库 + trainInfo.finishPlanPrepareInbound(); + } + } + } + + /** + * 修改预选模式 + */ + public void changePreselectionMode(Simulation simulation, String groupNumber, VirtualRealityTrain.PreselectionMode preselectionMode) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + if (!train.isAtpOn()) { + this.openAtp(train); + } + if (train.isSignalEB()) { + this.releaseEB(train); + } + PreselectionMode trainMode = train.getPreselectionMode(); + if (trainMode != preselectionMode) { //预选级别不对 + changePreselectionMode(train, preselectionMode); + } else if (trainMode.isMatchTheDriveMode(DriveMode.AM) && !train.isAMMode()) { + if (!train.isInTheGear(VirtualRealityTrain.Handwheel.ATO)) { + this.changeGear(train, VirtualRealityTrain.Handwheel.ATO); + } + if (!train.isLeverInCoastingGear()) { + this.changeTrainForce(train, 0F); // 改变列车的牵引 + } + if (!train.isAtoOn()) { + this.openATO(train); + } + } + } + + /** + * 转NRM模式 + */ + public void applyNRM(Simulation simulation, String groupNumber) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + if (!train.isNRMMode()) { + this.cutOffAtp(train); + } + } + + /** + * 大铁、发车 + **/ + public void departTrain(Simulation simulation, String groupNumber) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + Section targetSection = getTargetSection(train.isRight(), train.getHeadPosition().getSection()); + SectionPosition targetPosition = new SectionPosition(targetSection, targetSection.getStopPointByDirection(train.isRight())); + train.setRobotTargetPosition(targetPosition); + train.getRobotDriveParam().setStop(false); + train.getRobotDriveParam().setRun(true); + } + + /** + * 大铁、停车 + */ + public void parkingTrain(Simulation simulation, String groupNumber) { + VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); + train.setRobotTargetPosition(train.getHeadPosition()); + train.getRobotDriveParam().setStop(true); + train.getRobotDriveParam().setRun(false); + } + + /** + * 改变列车的牵引 + */ + public void changeTrainForce(VirtualRealityTrain train, Float percent) { + // 门选不是零位,不给牵引力 + if (!train.getDoorSelection().equals(VirtualRealityTrain.DoorSelection.Z)) { + return; + } + if ((percent <= 1 && percent >= -1) || percent == -2) { + train.setLeverPosition(percent); + } + if (train.isEB()) { + return; + } + if (percent <= 1 && percent >= -1) { + if (percent > 0) { + float fk = train.getCurrentFkMax() * percent; + train.leaverUpdateTBForce(fk, 0); + } else if (percent < 0) { + float fb = train.getCurrentFbMax() * Math.abs(percent); + train.leaverUpdateTBForce(0, fb); + } else { + train.leaverUpdateTBForce(0, 0); + } + } else if (percent == -2) { + train.leaverUpdateTBForce(0, 350); + } else { + throw new SimulationException(SimulationExceptionType.Illegal_Argument, + String.format("数值[%s]超限,列车牵引/制动力可调整比例范围应该在[-1, 1]之间,或为快速制动-2", percent)); + } + } + + /** + * 修改预选模式 + * + * @param train 列车 + * @param preselectionMode 预选模式 + */ + private void changePreselectionMode(VirtualRealityTrain train, PreselectionMode preselectionMode) { + if (train.getPreselectionMode() != preselectionMode) { + if (train.getTempPreselectionMode() != preselectionMode) { + if (preselectionMode.isHigherThan(train.getTempPreselectionMode())) { + this.preselectionModeUp(train); + } else { + this.preselectionModeDown(train); + } + } else { + this.confirmMessage(train); + } + } + } + + private SectionPosition calculateStepPosition4CrossTheGuideSignal(VirtualRealityTrain train) { + boolean right = train.isRight(); + SectionPosition headPosition = train.getHeadPosition(); + Section section = headPosition.getSection(); + Signal trainHeadSignal = section.getSignalOf(right); + if (trainHeadSignal == null || !trainHeadSignal.isGuideAspect()) { + throw new SimulationException(SimulationExceptionType.Invalid_Operation, "指令要求:列车车头所在区段有同向信号机并且开放引导信号"); + } + + SectionPosition sectionPosition = null; + for (int i = 0; i < 30; i++) { + section = section.findNextRunningSectionBaseRealSwitch(right); + BusinessExceptionAssertEnum.OPERATION_FAIL.assertNotNull(section, "引导信号前方未找到停车位置"); + Signal signal = section.getSignalOf(right); + if (section.isStandTrack() || section.isTurnBackTrack()) { + sectionPosition = new SectionPosition(section, section.getStopPointByDirection(right)); + break; + } else if (signal != null && !signal.isShunting() && !signal.isMainAspect()) { //同向信号机未正常开放 + sectionPosition = new SectionPosition(section, signal.getOffset()); + break; + } + } + if (sectionPosition == null) { + throw new SimulationException(SimulationExceptionType.Invalid_Operation, "引导信号前方未找到停车位置"); + } + return sectionPosition; + } + + private void releaseEB(VirtualRealityTrain train) { + if (!train.isInTheGear(VirtualRealityTrain.Handwheel.MANUAL)) { + changeGear(train, VirtualRealityTrain.Handwheel.MANUAL); + } + if (!train.isStop() || !train.isLeverNotInTractionGear()) { + changeTrainForce(train, -2F); // 改变列车的牵引/ + } + if (!train.isRMMode()) { + changePreselectionMode(train, PreselectionMode.RM); + } + } + + /** + * 从此区段向right方向获取未被占用的目标区段 + * + * @param isRight 方向 + * @param section 起始区段 + * @return 目标区段 + */ + private Section getTargetSection(boolean isRight, Section section) { + boolean loop = true; + Signal signal; + Section nextSection = section, targetSection = null; + while (loop) { + signal = isRight ? nextSection.getSignalToRight() : nextSection.getSignalToLeft(); // 方向信号机 + // 信号机未开放,直接中断 + if (signal != null && SignalAspect.R.equals(signal.getAspect())) { + targetSection = nextSection; + break; + } + // 存在锁闭进路,获取进路末端 + if (signal != null && signal.getLockedRoute() != null) { + nextSection = signal.getLockedRoute().getDestination().getSection(); + } else if (nextSection.isRouteLock()) { // 如果当前区段进路锁闭 + nextSection = nextSection.getRoute().getDestination().getSection(); + } else if (nextSection.isSwitchTrack()) { // 是邻近岔道 + nextSection = nextSection.getNextRunningSectionOf(isRight); + } else { + nextSection = nextSection.getNextSection(isRight); + } + // 存在邻近区段,赋值 + if (nextSection != null) { + targetSection = nextSection; + } + // 进路存在且不占用不出故障 + loop = nextSection != null && !nextSection.isOccupied() && !nextSection.isFaultLock(); + } + return targetSection; + } } From b2d7404f96426e0d2a12560de204cf13fe31e905 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 5 Aug 2022 17:21:17 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E3=80=90=E8=A1=8C=E9=A9=B6=E8=87=B3?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java index e6788bbbf..f2455dfd5 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java @@ -636,6 +636,7 @@ public class ATPService { SectionPosition targetPosition = new SectionPosition(section, section.getStopPointByDirection(train.isRight())); train.setRobotTargetPosition(targetPosition); train.getRobotDriveParam().setRun(true); + train.getRobotDriveParam().setStop(false); } /** From c89a2ba5e49d3e5b65d5ae54ab5ab964052c568c Mon Sep 17 00:00:00 2001 From: tiger_zhou <123456> Date: Tue, 9 Aug 2022 09:46:20 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/operation/Operation.java | 638 ++++++++++-------- 1 file changed, 342 insertions(+), 296 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index 56331dcd3..ba896672b 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -1,10 +1,14 @@ package club.joylink.rtss.simulation.cbtc.ATS.operation; import club.joylink.rtss.simulation.cbtc.member.SimulationMember; +import com.github.pagehelper.util.StringUtil; import lombok.Builder; import lombok.Getter; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; import java.util.Map; +import java.util.Objects; /** * 操作 @@ -27,6 +31,10 @@ public class Operation { * 参数 */ private Map param; + public final static String CLIENT = "CLIENT"; + public final static String FAULT = "fault"; + public final static String OTHER = "other"; + /** * 操作类型 @@ -35,1255 +43,1293 @@ public class Operation { /** * 设置故障 */ - Set_Fault(), + Set_Fault(Operation.FAULT), /** * 取消故障 */ - Cancel_Fault(), + Cancel_Fault(Operation.FAULT), //--------------------------- 道岔 --------------------------- /** * 单锁 */ - Switch_Single_Lock(), + Switch_Single_Lock(Operation.CLIENT), /** * 单解 */ - Switch_Single_Unlock(), + Switch_Single_Unlock(Operation.CLIENT), // /** 单锁(联动) */ -// Switch_Single_Lock_Chain(), +// Switch_Single_Lock_Chain(Operation.CLIENT +// ), // /** 单解(联动) */ -// Switch_Single_Unlock_Chain(), +// Switch_Single_Unlock_Chain(Operation.CLIENT +// ), /** * 初始化封锁 */ - Switch_Initialize_Block, + Switch_Initialize_Block(Operation.CLIENT), /** * 封锁 */ - Switch_Block(), + Switch_Block(Operation.CLIENT), /** * 解封 */ - Switch_Unblock(), + Switch_Unblock(Operation.CLIENT), /** * 道岔区段封锁 */ - Switch_Section_Block(), + Switch_Section_Block(Operation.CLIENT), /** * 道岔区段解封 */ - Switch_Section_Unblock(), + Switch_Section_Unblock(Operation.CLIENT), /** * 道岔区段切除 */ - Switch_Cut_Off(), + Switch_Cut_Off(Operation.CLIENT), /** * 道岔区段激活 */ - Switch_Active(), + Switch_Active(Operation.CLIENT), /** * 设置临时限速 */ - Switch_Set_Limit_Speed(), + Switch_Set_Limit_Speed(Operation.CLIENT), /** * 取消临时限速 */ - Switch_Cancel_Limit_Speed(), + Switch_Cancel_Limit_Speed(Operation.CLIENT), /** * 计轴预复位 */ - Switch_Axle_Pre_Reset(), + Switch_Axle_Pre_Reset(Operation.CLIENT), /** * 故障解锁 */ - Switch_Fault_Unlock(), + Switch_Fault_Unlock(Operation.CLIENT), /** * 转动 */ - Switch_Turn(), + Switch_Turn(Operation.CLIENT), /** * 单操到定位 */ - Switch_Normal_Position(), + Switch_Normal_Position(Operation.CLIENT), /** * 单操到反位 */ - Switch_Reverse_Position(), + Switch_Reverse_Position(Operation.CLIENT), // /** 道岔定操(联动) */ -// Switch_Turn_NP_Chain(), +// Switch_Turn_NP_Chain(Operation.CLIENT +// ), // /** 道岔反操(联动) */ -// Switch_Turn_RP_Chain(), +// Switch_Turn_RP_Chain(Operation.CLIENT +// ), /** * 确认计轴有效 */ - Switch_Confirm_Axis_Valid(), + Switch_Confirm_Axis_Valid(Operation.OTHER), /** * 道岔强扳 */ - Switch_Force_Turn, + Switch_Force_Turn(Operation.CLIENT), /** * 道岔钩锁 */ - Switch_Hook_Lock, + Switch_Hook_Lock(Operation.CLIENT), /** * 道岔强解 */ - Switch_Force_Unlock, + Switch_Force_Unlock(Operation.CLIENT), /** * 挤岔恢复 */ - Switch_Squeeze_Recovery, + Switch_Squeeze_Recovery(Operation.CLIENT), /** * 命令 */ - Switch_Command, + Switch_Command(Operation.OTHER), /** * 道岔设置分路不良 */ - Switch_Defective_Shunting, + Switch_Defective_Shunting(Operation.CLIENT), /** * 道岔取消分路不良 */ - Switch_Cancel_Defective_Shunting, + Switch_Cancel_Defective_Shunting(Operation.CLIENT), //--------------------------- 区段 --------------------------- /** * 封锁 */ - Section_Block(), + Section_Block(Operation.CLIENT), /** * 解封 */ - Section_Unblock(), + Section_Unblock(Operation.CLIENT), /** * 切除 */ - Section_Cut_Off(), + Section_Cut_Off(Operation.CLIENT), /** * 激活 */ - Section_Active(), + Section_Active(Operation.CLIENT), /** * 设置临时限速 */ - Section_Set_Limit_Speed(), + Section_Set_Limit_Speed(Operation.CLIENT), /** * 取消临时限速 */ - Section_Cancel_Limit_Speed(), + Section_Cancel_Limit_Speed(Operation.CLIENT), /** * 屏蔽一次临时限速 */ - Section_Shield_Limit_Speed, + Section_Shield_Limit_Speed(Operation.CLIENT), /** * 取消全线临时限速 */ - Cancel_All_Limit_Speed(), + Cancel_All_Limit_Speed(Operation.CLIENT), /** * 计轴预复位 */ - Section_Axis_Pre_Reset(), + Section_Axis_Pre_Reset(Operation.CLIENT), /** * 计轴复位 */ - Section_Reset, + Section_Reset(Operation.CLIENT), /** * 故障解锁 */ - Section_Fault_Unlock(), + Section_Fault_Unlock(Operation.CLIENT), /** * 确认计轴有效 */ - Section_Confirm_Axis_Valid(), + Section_Confirm_Axis_Valid(Operation.CLIENT), /** * 区段详情 */ - Section_Details(), + Section_Details(Operation.CLIENT), /** * 强解 */ - Section_Force_Unlock(), + Section_Force_Unlock(Operation.CLIENT), /** * 初始化开放 */ - Section_Initialize_Open, + Section_Initialize_Open(Operation.CLIENT), /** * 开放 */ - Section_Open, + Section_Open(Operation.CLIENT), /** * 初始化关闭 */ - Section_Initialize_Close, + Section_Initialize_Close(Operation.CLIENT), /** * 关闭 */ - Section_Close, + Section_Close(Operation.CLIENT), /** * 区段分路不良设置 */ - Section_Defective_Shunting, + Section_Defective_Shunting(Operation.CLIENT), //--------------------------- 信号机 --------------------------- /** * 封锁 */ - Signal_Block(), + Signal_Block(Operation.CLIENT), /** * 解封 */ - Signal_Unblock(), + Signal_Unblock(Operation.CLIENT), /** * 排列进路 */ - Signal_Set_Route(), + Signal_Set_Route(Operation.CLIENT), /** * 取消进路 */ - Signal_Cancel_Route(), + Signal_Cancel_Route(Operation.CLIENT), /** * 设置保护 */ - Signal_Set_Overlap(), + Signal_Set_Overlap(Operation.CLIENT), // /** 取消进路(强制取消进路,无论接近区段是否占用,如果占用延时取消) */ -// Signal_Force_Cancel_Route(), +// Signal_Force_Cancel_Route(Operation.CLIENT +// ), /** * 人解进路 */ - Signal_Human_Release_Route(), + Signal_Human_Release_Route(Operation.CLIENT), /** * 信号关灯 */ - Signal_Close_Signal(), + Signal_Close_Signal(Operation.CLIENT), /** * 信号重开 */ - Signal_Reopen_Signal(), + Signal_Reopen_Signal(Operation.CLIENT), /** * 查找进路控制模式/状态 */ - Signal_Find_Routes_Status(), + Signal_Find_Routes_Status(Operation.OTHER), /** * 进路自排开|进路交自动控 */ - Signal_Open_Auto_Setting(), + Signal_Open_Auto_Setting(Operation.CLIENT), /** * 冲突进路办理确认 */ - Signal_Conflict_Route_Set_Confirm(), + Signal_Conflict_Route_Set_Confirm(Operation.CLIENT), /** * 进路自排关|进路交人工控 */ - Signal_Close_Auto_Setting(), + Signal_Close_Auto_Setting(Operation.CLIENT), /** * 设置联锁自动进路 */ - Signal_Set_CI_Auto(), + Signal_Set_CI_Auto(Operation.CLIENT), /** * 取消联锁自动进路 */ - Signal_Cancel_CI_Auto(), + Signal_Cancel_CI_Auto(Operation.CLIENT), /** * 设置联锁自动触发 */ - Signal_Set_CI_Auto_Trigger(), + Signal_Set_CI_Auto_Trigger(Operation.CLIENT), /** * 取消联锁自动触发 */ - Signal_Cancel_CI_Auto_Trigger(), + Signal_Cancel_CI_Auto_Trigger(Operation.CLIENT), /** * 设置自动折返进路 */ - Signal_Set_Auto_Turn_Back, + Signal_Set_Auto_Turn_Back(Operation.CLIENT), /** * 取消自动折返进路 */ - Signal_Cancel_Auto_Turn_Back, + Signal_Cancel_Auto_Turn_Back(Operation.CLIENT), /** * 信号机总取消 */ - Signal_Total_Cancel, + Signal_Total_Cancel(Operation.CLIENT), /** * 初始化引导 */ - Signal_Initialize_Guide, + Signal_Initialize_Guide(Operation.CLIENT), /** * 取消引导的初始化 */ - Signal_Cancel_Guide_Initialization, + Signal_Cancel_Guide_Initialization(Operation.CLIENT), /** * 办理引导 */ - Signal_Set_Guide, + Signal_Set_Guide(Operation.CLIENT), /** * 点灯 */ - Signal_Turn_On, + Signal_Turn_On(Operation.CLIENT), /** * 灭灯 */ - Signal_Turn_Off, + Signal_Turn_Off(Operation.CLIENT), //--------------------------- 站台操作 --------------------------- /** * 设置跳停 */ - Stand_Set_Jump_Stop(), + Stand_Set_Jump_Stop(Operation.CLIENT), /** * 取消跳停 */ - Stand_Cancel_Jump_Stop(), + Stand_Cancel_Jump_Stop(Operation.CLIENT), /** * 全站台设置跳停 */ - Stand_All_Set_Jump_Stop(), + Stand_All_Set_Jump_Stop(Operation.CLIENT), /** * 全站台取消跳停 */ - Stand_All_Cancel_Jump_Stop(), + Stand_All_Cancel_Jump_Stop(Operation.CLIENT), /** * 设置扣车 */ - Stand_Set_Hold_Train(), + Stand_Set_Hold_Train(Operation.CLIENT), /** * 取消扣车 */ - Stand_Cancel_Hold_Train(), + Stand_Cancel_Hold_Train(Operation.CLIENT), /** * 强制取消扣车 */ - Stand_Force_Cancel_Hold_Train(), + Stand_Force_Cancel_Hold_Train(Operation.CLIENT), /** * 全线取消扣车 */ - Stand_Whole_Line_Cancel_Hold_Train(), + Stand_Whole_Line_Cancel_Hold_Train(Operation.CLIENT), /** * 提前发车 */ - Stand_Early_Depart(), + Stand_Early_Depart(Operation.CLIENT), /** * 设置停站时间 */ - Stand_Set_Park_Time(), + Stand_Set_Park_Time(Operation.CLIENT), /** * 设置站间运行时间(设置运行等级) */ - Stand_Set_Run_Time(), + Stand_Set_Run_Time(Operation.CLIENT), /** * 设置折返策略 */ - Stand_Set_Reentry_Strategy(), + Stand_Set_Reentry_Strategy(Operation.CLIENT), /** * 查看站台状态 */ - Stand_View_Status(), + Stand_View_Status(Operation.OTHER), /** * 批量扣车 */ - Stand_Set_Hold_Train_Batch(), + Stand_Set_Hold_Train_Batch(Operation.CLIENT), /** * 批量取消扣车 */ - Stand_Cancel_Hold_Train_Batch(), + Stand_Cancel_Hold_Train_Batch(Operation.CLIENT), /** * 区间列车数量限制(自动扣车) */ - Stand_Set_Hold_Train_Auto(), + Stand_Set_Hold_Train_Auto(Operation.CLIENT), /** * 取消区间列车数量限制(取消自动扣车) */ - Stand_Cancel_Hold_Train_Auto(), + Stand_Cancel_Hold_Train_Auto(Operation.CLIENT), /** * 站台总取消 */ - Stand_Total_Cancel, + Stand_Total_Cancel(Operation.CLIENT), /** * 手动开启屏蔽门 */ - Stand_Open_Psd, + Stand_Open_Psd(Operation.CLIENT), /** * 取消设置(扣车或跳停) */ - Stand_Cancel_Setting, + Stand_Cancel_Setting(Operation.CLIENT), /** * 系统扣车 */ - Stand_Sys_Hold_Train(), + Stand_Sys_Hold_Train(Operation.CLIENT), /** * 取消系统扣车 */ - Stand_Cancel_Sys_Hold_Train(), + Stand_Cancel_Sys_Hold_Train(Operation.CLIENT), /** * 站台开放 */ - Stand_Open, + Stand_Open(Operation.CLIENT), /** * 站台关闭 */ - Stand_Close, + Stand_Close(Operation.CLIENT), /** * 站台紧急关闭 */ - Stand_Emergency_Close, + Stand_Emergency_Close(Operation.CLIENT), /** * 取消站台紧急关闭 */ - Stand_Cancel_Emergency_Close, + Stand_Cancel_Emergency_Close(Operation.CLIENT), //--------------------------- 控制模式 --------------------------- /** * 请求站控 */ - CM_Apply_For_Station_Control(), + CM_Apply_For_Station_Control(Operation.CLIENT), /** * 请求中控 */ - CM_Apply_For_Center_Control(), + CM_Apply_For_Center_Control(Operation.CLIENT), /** * 强制站控 */ - CM_Force_Station_Control(), + CM_Force_Station_Control(Operation.CLIENT), /** * 紧急站控 */ - CM_Emergency_Station_Control(), + CM_Emergency_Station_Control(Operation.CLIENT), /** * 回复站控请求(同意/拒绝) */ - CM_Reply_Station_Control(), + CM_Reply_Station_Control(Operation.CLIENT), /** * 回复中控请求(同意/拒绝) */ - CM_Reply_Center_Control(), + CM_Reply_Center_Control(Operation.CLIENT), /** * 接收控制权 */ - CM_Receive_Control(), + CM_Receive_Control(Operation.CLIENT), /** * 交出控制权 */ - CM_Surrender_Control(), + CM_Surrender_Control(Operation.CLIENT), /** * 连锁控 */ - CM_Interlock_Control(), + CM_Interlock_Control(Operation.CLIENT), /** * 回复连锁控请求(同意/拒绝) */ - CM_Reply_Interlock_Control(), + CM_Reply_Interlock_Control(Operation.CLIENT), /** * 大铁非常站控 */ - CM_Special_Station_Control(), + CM_Special_Station_Control(Operation.CLIENT), //--------------------------- 集中车站 --------------------------- /** * 设置折返策略 */ - Station_Set_Turn_Back_Strategy(), + Station_Set_Turn_Back_Strategy(Operation.CLIENT), /** * 全站设置联锁自动触发 */ - Station_Set_CI_Auto_Trigger(), + Station_Set_CI_Auto_Trigger(Operation.CLIENT), /** * 全站取消联锁自动触发 */ - Station_Cancel_CI_Auto_Trigger(), + Station_Cancel_CI_Auto_Trigger(Operation.CLIENT), /** * 所有进路自排开 */ - Station_Open_Auto_Setting(), + Station_Open_Auto_Setting(Operation.CLIENT), /** * 所有进路自排关 */ - Station_Close_Auto_Setting(), + Station_Close_Auto_Setting(Operation.CLIENT), /** * 执行关键操作测试 */ - Station_Key_Operation_Test(), + Station_Key_Operation_Test(Operation.CLIENT), /** * 上电解锁 */ - Station_Power_On_Unlock(), + Station_Power_On_Unlock(Operation.CLIENT), /** * 车站信息 */ - Station_Info, + Station_Info(Operation.CLIENT), /** * 设置引导总锁 */ - Station_Set_Master_Guide_Lock, + Station_Set_Master_Guide_Lock(Operation.CLIENT), /** * 取消引导总锁 */ - Station_Cancel_Master_Guide_Lock, + Station_Cancel_Master_Guide_Lock(Operation.CLIENT), /** * 关站信号 */ - Station_Close_AllSignal, + Station_Close_AllSignal(Operation.CLIENT), /** * 关区信号 */ - Station_CIArea_Close_AllSignal, + Station_CIArea_Close_AllSignal(Operation.CLIENT), /** * 释放指令 */ - Station_Release, + Station_Release(Operation.CLIENT), /** * 重启令解 */ - Station_Restart, + Station_Restart(Operation.CLIENT), /** * 全站设置自动通过 */ - Station_Set_CI_Auto, + Station_Set_CI_Auto(Operation.CLIENT), /** * 全站取消自动通过 */ - Station_Cancel_CI_Auto, + Station_Cancel_CI_Auto(Operation.CLIENT), /** * 设置/取消强制点灯 */ - Station_Set_Or_Cancel_Force_Physical_Signal, + Station_Set_Or_Cancel_Force_Physical_Signal(Operation.CLIENT), /** * 预复位(宁波一) */ - Station_Pre_Reset, + Station_Pre_Reset(Operation.CLIENT), /** * 取消预复位 */ - Station_Cancel_Pre_Reset, + Station_Cancel_Pre_Reset(Operation.CLIENT), //车站控制授权 /** * 区域选择(请求区域控制权【泰雷兹】) */ - Station_Control_Apply, + Station_Control_Apply(Operation.CLIENT), /** * 授权转移 */ - Station_Control_Transfer, + Station_Control_Transfer(Operation.CLIENT), /** * 下放站控 */ - Station_Control_Devolve, + Station_Control_Devolve(Operation.CLIENT), /** * 收回站控 */ - Station_Control_Revoke, + Station_Control_Revoke(Operation.CLIENT), /** * 重启联锁机 */ - Station_Restart_Interlock_Machine, + Station_Restart_Interlock_Machine(Operation.CLIENT), /** * 引导总锁(大铁) */ - Station_Master_Lock, + Station_Master_Lock(Operation.CLIENT), /** * 解除引导总锁(大铁) */ - Station_Master_Unlock, + Station_Master_Unlock(Operation.CLIENT), /** * 分路不良(大铁) */ - Station_Set_Defective_Shunting, + Station_Set_Defective_Shunting(Operation.CLIENT), //--------------------------- 列车 --------------------------- /** * 在指定区段加载一辆计划列车(本地开发使用) */ - Train_Init_Plan(), + Train_Init_Plan(Operation.CLIENT), /** * 设置车组号 */ - Train_Add_Train_Trace(), + Train_Add_Train_Trace(Operation.CLIENT), /** * 删除车组号 */ - Train_Remove_Train_Trace(), + Train_Remove_Train_Trace(Operation.CLIENT), /** * 移动车组号 */ - Train_Move_Train_Trace(), + Train_Move_Train_Trace(Operation.CLIENT), /** * 修改列车识别号 */ - Train_Update_Type(), + Train_Update_Type(Operation.CLIENT), /** * 设计划车 */ - Train_Set_Plan(), + Train_Set_Plan(Operation.CLIENT), /** * 设头码车 */ - Train_Set_Head(), + Train_Set_Head(Operation.CLIENT), /** * 设人工车 */ - Train_Set_Manual(), + Train_Set_Manual(Operation.CLIENT), /** * 设乘务组号 */ - Train_Set_Crew_Number(), + Train_Set_Crew_Number(Operation.CLIENT), // /** // * 标记ATP切除 // */ -// Train_Tag_Atp_Cut(), +// Train_Tag_Atp_Cut(Operation.CLIENT +// ), // /** // * 标记ATP恢复 // */ -// Train_Tag_Atp_Recover(), +// Train_Tag_Atp_Recover(Operation.CLIENT +// ), // /** // * 放行冲突列车 // */ -// Train_Allow_Pass(), +// Train_Allow_Pass(Operation.CLIENT +// ), // /** // * 列车信息 // */ -// Train_Info(), +// Train_Info(Operation.CLIENT +// ), // /** // * 人工限速行驶 // */ -// Train_Manual_Limit_Drive(), +// Train_Manual_Limit_Drive(Operation.CLIENT +// ), // /** // * 按进路闭塞法行车 // */ -// Train_Manual_Route_Blocking_Drive(), +// Train_Manual_Route_Blocking_Drive(Operation.CLIENT +// ), // /** // * 越信号机红灯 // */ -// Train_Pass_Red_Signal(), +// Train_Pass_Red_Signal(Operation.CLIENT +// ), // /** // * 引导信号行车 // */ -// Train_Drive_By_Guide_Signal(), +// Train_Drive_By_Guide_Signal(Operation.CLIENT +// ), // /** 添加列车识别号 */ -// Train_Identify_Add(), +// Train_Identify_Add(Operation.CLIENT +// ), // /** 删除列车识别号 */ -// Train_Identify_Del(), +// Train_Identify_Del(Operation.CLIENT +// ), // /** 修改列车识别号 */ -// Train_Identify_Modify(), +// Train_Identify_Modify(Operation.CLIENT +// ), // /** 修改车组号 */ -// Train_GroupNo_Modify(), +// Train_GroupNo_Modify(Operation.CLIENT +// ), // /** 移动列车识别号 */ -// Train_Identify_Move(), +// Train_Identify_Move(Operation.CLIENT +// ), // /** 交换列车识别号 */ -// Train_Identify_Exchange(), +// Train_Identify_Exchange(Operation.CLIENT +// ), // /** // * 列车惰行 // */ -// Train_Idle, +// Train_Idle(Operation.CLIENT +// ), /** * 扣车 */ - Train_Hold, + Train_Hold(Operation.CLIENT), /** * 取消扣车 */ - Train_Cancel_Hold, + Train_Cancel_Hold(Operation.CLIENT), // /** // * 删除车次号 // */ -// Train_Delete_Service_Number, +// Train_Delete_Service_Number(Operation.CLIENT +// ), // /** // * 更改目的地码 // */ -// Train_Change_Destination_Code, +// Train_Change_Destination_Code(Operation.CLIENT +// ), /** * 更改车次号 */ - Train_Change_Trip_Number, + Train_Change_Trip_Number(Operation.CLIENT), /** * 加载备用车 */ - Train_Load_Spare_Train, + Train_Load_Spare_Train(Operation.CLIENT), /** * 派接 */ - Train_Dispatch, + Train_Dispatch(Operation.CLIENT), /** * 托管 */ - Train_Trust, + Train_Trust(Operation.CLIENT), /** * 连挂 */ - Train_Link, + Train_Link(Operation.CLIENT), /** * 排列进路到【泰雷兹】 */ - Train_Set_Route, + Train_Set_Route(Operation.CLIENT), /** * 设置运行类型【泰雷兹】 */ - Train_Set_Run_Type, + Train_Set_Run_Type(Operation.CLIENT), /** * 下令停车 */ - Train_Order_Stop, + Train_Order_Stop(Operation.CLIENT), /** * 取消停车命令 */ - Train_Cancel_Order_Stop, + Train_Cancel_Order_Stop(Operation.CLIENT), /** * 跳停【泰雷兹】 */ - Train_Skip_Stop, + Train_Skip_Stop(Operation.CLIENT), /** * 取消跳停【泰雷兹】 */ - Train_Cancel_Skip_Stop, + Train_Cancel_Skip_Stop(Operation.CLIENT), /** * 列车发车【泰雷兹】 */ - Train_Departure, + Train_Departure(Operation.CLIENT), /** * 分配【泰雷兹】 */ - Train_Distribute, + Train_Distribute(Operation.CLIENT), /** * 更新偏差【泰雷兹】 */ - Train_Update_Plan_Time, + Train_Update_Plan_Time(Operation.CLIENT), /** * 取消CBTC进路【泰雷兹】 */ - Train_Cancel_CBTC_Route, + Train_Cancel_CBTC_Route(Operation.CLIENT), /** * 设置偏离【泰雷兹】 */ - Train_Set_Deviation, + Train_Set_Deviation(Operation.CLIENT), /** * 取消偏离【泰雷兹】 */ - Train_Cancel_Deviation, + Train_Cancel_Deviation(Operation.CLIENT), /** * 列车调度 */ - Train_Regulation, + Train_Regulation(Operation.CLIENT), /** * 计算行车间隔 */ - Train_Calculate_Interval, + Train_Calculate_Interval(Operation.CLIENT), /** * 大铁加载指定车次列车 */ - Train_Load_Trip_Number_Train, + Train_Load_Trip_Number_Train(Operation.CLIENT), /** * 大铁修改车次号 */ - Train_Update_Trip_Number_Train, + Train_Update_Trip_Number_Train(Operation.CLIENT), //--------------------------- 司机 --------------------------- /** * 改变列车的牵引/制动力 */ - Driver_Force_Change, + Driver_Force_Change(Operation.CLIENT), /** * 按EB按钮 */ - Driver_EB, + Driver_EB(Operation.OTHER), /** * 改变列车档位 */ - Driver_Gear_Change, + Driver_Gear_Change(Operation.OTHER), /** * ATO启动 */ - Driver_ATO_Open, + Driver_ATO_Open(Operation.OTHER), /** * 改变ATP状态 */ - Driver_ATP_Change, + Driver_ATP_Change(Operation.OTHER), /** * 改变列车运行模式 */ @Deprecated // 场景旧数据反序列化需要 - Driver_Drive_Mode_Change, + Driver_Drive_Mode_Change(Operation.CLIENT), /** * 换端 */ - Driver_Change_Head, + Driver_Change_Head(Operation.CLIENT), /** * 列车车门开关 */ - Driver_Door_On_Off, + Driver_Door_On_Off(Operation.CLIENT), /** * 列车门模式 */ - Driver_Door_Mode, + Driver_Door_Mode(Operation.OTHER), /** * 列车门选择 */ - Driver_Door_Selection, + Driver_Door_Selection(Operation.OTHER), /** * 列车预选模式升 */ - Driver_Preselection_Mode_Up, + Driver_Preselection_Mode_Up(Operation.OTHER), /** * 列车预选模式降 */ - Driver_Preselection_Mode_Down, + Driver_Preselection_Mode_Down(Operation.OTHER), /** * 确认 */ - Driver_Confirm, + Driver_Confirm(Operation.OTHER), /** * 停车 */ - Driver_Stop, + Driver_Stop(Operation.OTHER), /** * 确认运行至前方站 */ - Drive_Ahead, + Drive_Ahead(Operation.OTHER), /** * 进路闭塞法行车 */ - Route_Block_Drive, + Route_Block_Drive(Operation.OTHER), /** * 越红灯行驶 */ - Drive_Through_The_Red_Light, + Drive_Through_The_Red_Light(Operation.OTHER), /** * 越引导信号行驶 */ - Drive_Through_The_Guide_Signal, + Drive_Through_The_Guide_Signal(Operation.OTHER), /** * 开关门 */ - Open_Or_Close_Door, + Open_Or_Close_Door(Operation.OTHER), /** * 设置限速 */ - Set_Speed_Limit, + Set_Speed_Limit(Operation.OTHER), /** * 驾驶至 */ - Drive_To, + Drive_To(Operation.OTHER), /** * 回库 */ - Inbound, + Inbound(Operation.OTHER), /** * 修改预选模式 */ - Change_Preselection_Mode, + Change_Preselection_Mode(Operation.OTHER), /** * 转NRM模式 */ - Apply_NRM, + Apply_NRM(Operation.OTHER), /** * 大铁、发车 **/ - Depart_Train, + Depart_Train(Operation.OTHER), /** * 大铁、停车 */ - Parking_Train, + Parking_Train(Operation.OTHER), //--------------------------- 方向杆 --------------------------- /** * 方向转换 */ - Direction_Change, + Direction_Change(Operation.OTHER), //--------------------------- 运行计划 --------------------------- /** * 添加计划 */ - RunPlan_Add_Trip, + RunPlan_Add_Trip(Operation.CLIENT), /** * 删除计划 */ - RunPlan_Delete_Trip, + RunPlan_Delete_Trip(Operation.CLIENT), //--------------------------- 服务器 --------------------------- /** * ATP系统重启 */ - Server_ATP_Restart, + Server_ATP_Restart(Operation.CLIENT), //--------------------------- iscs操作 --------------------------- /** * ISCS的PA系统播放(发布)消息 */ - ISCS_PA_Play, - ISCS_PA_Stop_Playing, + ISCS_PA_Play(Operation.CLIENT), + ISCS_PA_Stop_Playing(Operation.CLIENT), /** * ISCS的PIS系统播放(发布)消息 */ - ISCS_PIS_Play, - ISCS_PIS_Stop_Playing, + ISCS_PIS_Play(Operation.CLIENT), + ISCS_PIS_Stop_Playing(Operation.CLIENT), //--------------------------- 大铁CTC操作 --------------------------- //------ 占线板操作 ------ /** * CTC完成接预 */ - CTC_FINISH_RECEIVING_NOTICE, + CTC_FINISH_RECEIVING_NOTICE(Operation.CLIENT), /** * CTC取消接预 */ - CTC_CANCEL_RECEIVING_NOTICE, + CTC_CANCEL_RECEIVING_NOTICE(Operation.CLIENT), /** * CTC完成到点 */ - CTC_FINISH_ARRIVE, + CTC_FINISH_ARRIVE(Operation.CLIENT), /** * CTC取消到点 */ - CTC_CANCEL_ARRIVE, + CTC_CANCEL_ARRIVE(Operation.CLIENT), /** * CTC完成发预 */ - CTC_FINISH_DEPARTURE_NOTICE, + CTC_FINISH_DEPARTURE_NOTICE(Operation.CLIENT), /** * CTC取消发预 */ - CTC_CANCEL_DEPARTURE_NOTICE, + CTC_CANCEL_DEPARTURE_NOTICE(Operation.CLIENT), /** * CTC完成发点 */ - CTC_FINISH_DEPARTURE, + CTC_FINISH_DEPARTURE(Operation.CLIENT), /** * CTC取消发点 */ - CTC_CANCEL_DEPARTURE, + CTC_CANCEL_DEPARTURE(Operation.CLIENT), /** * CTC进路自触 */ - CTC_AUTO_TRIGGER, + CTC_AUTO_TRIGGER(Operation.CLIENT), //------ 站场图操作 ------ - CTC_SET_ROUTE, + CTC_SET_ROUTE(Operation.CLIENT), //------ 行车日志操作 ------ /** * 发送预告(发车预告) */ - CTC_SEND_NOTICE, + CTC_SEND_NOTICE(Operation.CLIENT), /** * 同意预告 */ - CTC_AGREE_NOTICE, + CTC_AGREE_NOTICE(Operation.CLIENT), // /** // * 到达 // */ -// CTC_ARRIVE, +// CTC_ARRIVE(Operation.CLIENT +// ), // /** // * 出发 // */ -// CTC_DEPARTURE, +// CTC_DEPARTURE(Operation.CLIENT +// ), // /** // * 通过 // */ -// CTC_PASS, +// CTC_PASS(Operation.CLIENT +// ), /** * 取消红闪 */ - CTC_CANCEL_TWINKLE, + CTC_CANCEL_TWINKLE(Operation.CLIENT), /** * 行车日志取消到达 */ - CTC_LOG_CANCEL_ARRIVE, + CTC_LOG_CANCEL_ARRIVE(Operation.CLIENT), /** * 行车日志取消出发 */ - CTC_LOG_CANCEL_DEPARTURE, + CTC_LOG_CANCEL_DEPARTURE(Operation.CLIENT), /** * 行车日志取消闭塞 */ - CTC_LOG_CANCEL_BLOCK, + CTC_LOG_CANCEL_BLOCK(Operation.CLIENT), /** * 行车日志保存运行信息 */ - CTC_LOG_SAVE_RUN_PLAN, + CTC_LOG_SAVE_RUN_PLAN(Operation.CLIENT), /** * 行车日志设置运行任务 */ - CTC_LOG_SET_TASK, + CTC_LOG_SET_TASK(Operation.CLIENT), /** * 行车日志设置军用属性 */ - CTC_LOG_SET_MILITARY, + CTC_LOG_SET_MILITARY(Operation.CLIENT), /** * 行车日志设置超限 */ - CTC_LOG_SET_TRANSFINITE, + CTC_LOG_SET_TRANSFINITE(Operation.CLIENT), /** * 行车日志设置重点列车 */ - CTC_LOG_SET_KEY_TRAINS, + CTC_LOG_SET_KEY_TRAINS(Operation.CLIENT), /** * 行车日志设置删除标识 */ - CTC_LOG_SET_DELETE_LABEL, + CTC_LOG_SET_DELETE_LABEL(Operation.CLIENT), /** * 行车日志设置进出入口不一致 */ - CTC_LOG_SET_ENTRY_OUT_DISCORDANT, + CTC_LOG_SET_ENTRY_OUT_DISCORDANT(Operation.CLIENT), /** * 设置股道不一致 */ - CTC_LOG_SET_TRACK_DISCORDANT, + CTC_LOG_SET_TRACK_DISCORDANT(Operation.CLIENT), /** * 设置始发车 */ - CTC_LOG_SET_START_RUN_PLAN, + CTC_LOG_SET_START_RUN_PLAN(Operation.CLIENT), /** * 设置终到车 */ - CTC_LOG_SET_END_RUN_PLAN, + CTC_LOG_SET_END_RUN_PLAN(Operation.CLIENT), /** * 实际时间平移多少分钟 */ - CTC_LOG_ACTUAL_TIME_ADD_MINUTE, + CTC_LOG_ACTUAL_TIME_ADD_MINUTE(Operation.CLIENT), /**************调度台******************/ /** * 调度台保存运行计划 */ - CTC_ZONE_SAVE_RUN_PLAN, + CTC_ZONE_SAVE_RUN_PLAN(Operation.CLIENT), /** * 保存股道 */ - CTC_ZONE_SAVE_TRACK_SECTION, + CTC_ZONE_SAVE_TRACK_SECTION(Operation.CLIENT), /** * 修改车次 */ - CTC_ZONE_SAVE_TRIP_NUMBER, + CTC_ZONE_SAVE_TRIP_NUMBER(Operation.CLIENT), /** * 保存运行计划计划时间 */ - CTC_ZONE_SAVE_PLAN_TIME, + CTC_ZONE_SAVE_PLAN_TIME(Operation.CLIENT), /** * 分钟数 */ - CTC_ZONE_SAVE_PLAN_TIME_MINUTE, + CTC_ZONE_SAVE_PLAN_TIME_MINUTE(Operation.OTHER), /** * 保存方向 */ - CTC_ZONE_SAVE_DIRECTION, + CTC_ZONE_SAVE_DIRECTION(Operation.OTHER), /** * 保存车站 */ - CTC_ZONE_SAVE_STATION, + CTC_ZONE_SAVE_STATION(Operation.OTHER), /** * 删除运行计划 */ - CTC_ZONE_DELETE_RUN_PLAN, + CTC_ZONE_DELETE_RUN_PLAN(Operation.CLIENT), /** * 发布运行区段运行计划 */ - CTC_ZONE_RELEASE_ZONE_RUN_PLAN, + CTC_ZONE_RELEASE_ZONE_RUN_PLAN(Operation.CLIENT), /** * 发布单车站的运行计划 */ - CTC_ZONE_RELEASE_STATION_RUN_PLAN, + CTC_ZONE_RELEASE_STATION_RUN_PLAN(Operation.CLIENT), /** * 调度中心确认申请 */ - CTC_ZONE_CONFIRM_APPLY_RUN_PLAY, + CTC_ZONE_CONFIRM_APPLY_RUN_PLAY(Operation.CLIENT), /** * 全量发布计划 */ - CTC_ZONE_RELEASE_ALL_RUN_PLAN, + CTC_ZONE_RELEASE_ALL_RUN_PLAN(Operation.CLIENT), /**************调度台******************/ /** * 签收计划 */ - CTC_STATION_SIGN_RUN_PLAN, + CTC_STATION_SIGN_RUN_PLAN(Operation.CLIENT), /** * 车站发送计划 */ - CTC_STATION_SEND_OUT_RUN_PLAN, + CTC_STATION_SEND_OUT_RUN_PLAN(Operation.CLIENT), /** * 车站向中心发送申请 */ - CTC_STATION_APPLY_RUN_PLAN, + CTC_STATION_APPLY_RUN_PLAN(Operation.CLIENT), /** * 批量修改运行计划 */ - CTC_BATCH_MODIFY_RUN_PLAN, + CTC_BATCH_MODIFY_RUN_PLAN(Operation.CLIENT), /** * 修改股道 */ - CTC_MODIFY_SECTION, + CTC_MODIFY_SECTION(Operation.CLIENT), /** * 修改方向 */ - CTC_MODIFY_DIRECTION, + CTC_MODIFY_DIRECTION(Operation.CLIENT), /** * 修改实际到达时间 */ - CTC_MODIFY_ACTUAL_TIME, + CTC_MODIFY_ACTUAL_TIME(Operation.OTHER), /** * 修改车次 */ - CTC_MODIFY_TRIP_NUMBER, + CTC_MODIFY_TRIP_NUMBER(Operation.CLIENT), /** * 修改邻站 */ - CTC_MODIFY_ADJACENT_STATION, + CTC_MODIFY_ADJACENT_STATION(Operation.OTHER), /** * 移除运行计划 */ - CTC_REMOVE_RUN_PLAN, + CTC_REMOVE_RUN_PLAN(Operation.CLIENT), /** * 添加运行计划到编辑区 */ - CTC_ADD_RUN_PLAN_LIST_TO_EDIT_AREA, + CTC_ADD_RUN_PLAN_LIST_TO_EDIT_AREA(Operation.CLIENT), /** * 删除编辑区中的运行计划 */ - CTC_REMOVE_RUN_PLAN_FROM_EDIT_AREA, + CTC_REMOVE_RUN_PLAN_FROM_EDIT_AREA(Operation.CLIENT), /** * 清空编辑区中的运行计划 */ - CTC_CLEAR_RUN_PLAN_FROM_EDIT_AREA, + CTC_CLEAR_RUN_PLAN_FROM_EDIT_AREA(Operation.CLIENT), /** * 导入覆盖运行计划到编辑区 */ - CTC_COVER_RUN_PLAN_LIST_TO_EDIT_AREA, + CTC_COVER_RUN_PLAN_LIST_TO_EDIT_AREA(Operation.CLIENT), /** * 将编辑区行车日志发布至仿真计划中 */ - CTC_RELEASE_RUN_PLAN_TO_SIMULATION, + CTC_RELEASE_RUN_PLAN_TO_SIMULATION(Operation.OTHER), /** * 将CTC生效区发布至车站 */ - CTC_RELEASE_EFFECT_AREA_TO_STATION, + CTC_RELEASE_EFFECT_AREA_TO_STATION(Operation.CLIENT), //---------------------------- 改方、辅助操作 ------------------------- /** * 改方按钮操作 */ - ASSIST_PRESS_DOWN_TURN_DIRECTION, + ASSIST_PRESS_DOWN_TURN_DIRECTION(Operation.CLIENT), /** * 改方抬起操作 */ - ASSIST_PRESS_UP_TURN_DIRECTION, + ASSIST_PRESS_UP_TURN_DIRECTION(Operation.CLIENT), /** * 总辅助按钮操作 */ - ASSIST_PRESS_MAIN_ASSIST, + ASSIST_PRESS_MAIN_ASSIST(Operation.CLIENT), /** * 接辅助按钮操作 */ - ASSIST_PRESS_RECEIVE_ASSIST, + ASSIST_PRESS_RECEIVE_ASSIST(Operation.CLIENT), /** * 发辅助按钮操作 */ - ASSIST_PRESS_DELIVER_ASSIST, + ASSIST_PRESS_DELIVER_ASSIST(Operation.CLIENT), /** * 按下闭塞按钮 */ - ASSIST_PRESS_BLOCK, + ASSIST_PRESS_BLOCK(Operation.CLIENT), /** * 按下复原按钮 */ - ASSIST_PRESS_RESTORE, + ASSIST_PRESS_RESTORE(Operation.CLIENT), /** * 事故按钮 */ - ASSIST_PRESS_ACCIDENT, + ASSIST_PRESS_ACCIDENT(Operation.CLIENT), //---------------------------- 调度命令 ------------------------- /** * 发送调度命令 */ - CTC_SEND_DISPATCH_COMMAND, + CTC_SEND_DISPATCH_COMMAND(Operation.OTHER), /** * 阅读调度命令 */ - CTC_READ_DISPATCH_COMMAND, + CTC_READ_DISPATCH_COMMAND(Operation.OTHER), /** * 签收调度命令 */ - CTC_SIGN_DISPATCH_COMMAND, + CTC_SIGN_DISPATCH_COMMAND(Operation.OTHER), /** * 查询调度命令 */ - CTC_QUERY_DISPATCH_COMMAND, + CTC_QUERY_DISPATCH_COMMAND(Operation.OTHER), //---------------------------- 行车簿册 ------------------------- /** * 填写行车簿册 */ - RAIL_FILL_IN_REGISTER, + RAIL_FILL_IN_REGISTER(Operation.OTHER), /** * 查询行车簿册 */ - RAIL_QUERY_REGISTER, + RAIL_QUERY_REGISTER(Operation.OTHER), /** * 填写票据 */ - RAIL_FILL_IN_TICKET, + RAIL_FILL_IN_TICKET(Operation.OTHER), /** * 查询票据 */ - RAIL_QUERY_TICKET, + RAIL_QUERY_TICKET(Operation.OTHER), /** * 给出票据 */ - RAIL_GIVE_TICKET_TO, + RAIL_GIVE_TICKET_TO(Operation.OTHER); + + String name; + + Type(String name) { + this.name = name; + } + + public String getName() { + return name; + } + public boolean eq(String type){ + return Objects.equals(this.name,type); + } } /** From 71dadb546865fe3750aceb58d7440d413e41b91f Mon Sep 17 00:00:00 2001 From: tiger_zhou <123456> Date: Tue, 9 Aug 2022 10:00:36 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=B1=9E=E6=80=A7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/simulation/cbtc/ATS/operation/Operation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index ba896672b..ab91795fa 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -32,8 +32,8 @@ public class Operation { */ private Map param; public final static String CLIENT = "CLIENT"; - public final static String FAULT = "fault"; - public final static String OTHER = "other"; + public final static String FAULT = "FAULT"; + public final static String OTHER = "OTHER"; /** From 8131728783f05c61a46dda02105fbab925b82084 Mon Sep 17 00:00:00 2001 From: tiger_zhou <123456> Date: Tue, 9 Aug 2022 17:20:00 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=B1=9E=E6=80=A7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/operation/Operation.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index ab91795fa..da31f768b 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -31,9 +31,9 @@ public class Operation { * 参数 */ private Map param; - public final static String CLIENT = "CLIENT"; - public final static String FAULT = "FAULT"; - public final static String OTHER = "OTHER"; + public final static int CLIENT = 0; + public final static int FAULT = 1; + public final static int OTHER = 2; /** @@ -47,7 +47,7 @@ public class Operation { /** * 取消故障 */ - Cancel_Fault(Operation.FAULT), + Cancel_Fault(Operation.OTHER), //--------------------------- 道岔 --------------------------- /** * 单锁 @@ -1318,17 +1318,17 @@ public class Operation { */ RAIL_GIVE_TICKET_TO(Operation.OTHER); - String name; + int index; - Type(String name) { - this.name = name; + Type(int index) { + this.index = index; } - public String getName() { - return name; + public int getName() { + return index; } - public boolean eq(String type){ - return Objects.equals(this.name,type); + public boolean eq(int indexType){ + return this.index == indexType; } }