diff --git a/src/main/java/club/joylink/rtss/controller/publish/MapController.java b/src/main/java/club/joylink/rtss/controller/publish/MapController.java index 6b8e85e6a..1bfab8540 100644 --- a/src/main/java/club/joylink/rtss/controller/publish/MapController.java +++ b/src/main/java/club/joylink/rtss/controller/publish/MapController.java @@ -50,10 +50,10 @@ public class MapController { return iMapService.checkNameExist(name); } - @ApiOperation(value = "根据地图id查询地图版本") + @ApiOperation(value = "根据地图id查询地图当前使用版本") @GetMapping(path = "/{id}/version") public String getMapVersionById(@PathVariable Long id) { - return this.iMapService.findMapVersion(id); + return this.iMapService.getMapDetail(id).getVersion(); } @ApiOperation(value = "根据地图id查询地图明细") diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java index 520f13e24..4709c529a 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java @@ -161,6 +161,10 @@ public class ZCLogicLoop { endList.add(unlockedOverlapEnd); } } + //非通信车占用区段 + if (section.isNonCbtcOccupy()) { + endList.add(new MovementAuthority.End(section, MovementAuthority.EndType.NCT_OCCUPIED_IN_FRONT_OF_SECTION)); + } // 轨道尽头/问题道岔 Section temp = section.getNextRunningSectionOf(right); if (Objects.isNull(temp)) { // 到尽头 @@ -174,12 +178,12 @@ public class ZCLogicLoop { break; } //非通信车占用区段 - if (temp.isNonCbtcOccupy()) { - SectionPosition headPosition1 = train.getHeadPosition(); - if (!temp.isSamePhysical(headPosition1.getSection().getCode())) { - endList.add(new MovementAuthority.End(section, MovementAuthority.EndType.NCT_OCCUPIED_IN_FRONT_OF_SECTION)); - } - } +// if (temp.isNonCbtcOccupy()) { +// SectionPosition headPosition1 = train.getHeadPosition(); +// if (!temp.isSamePhysical(headPosition1.getSection().getCode())) { +// endList.add(new MovementAuthority.End(section, MovementAuthority.EndType.NCT_OCCUPIED_IN_FRONT_OF_SECTION)); +// } +// } //检查关闭的区段 MovementAuthority.End cs = checkClosedSection(section); if (cs != null) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/command/CommandBO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/command/CommandBO.java index 6fd978782..615d72c87 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/command/CommandBO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/command/CommandBO.java @@ -421,7 +421,7 @@ public class CommandBO { /** * 设置限速 */ - Set_Speed_Limit(Arrays.asList(ParamName.speedLimit), SimulationMember.Type.DRIVER) { + Set_Speed_Limit(List.of(ParamName.speedLimit), SimulationMember.Type.DRIVER) { @Override public List buildStepList(Simulation simulation, SimulationMember targetMember, Map params) { if (!SimulationMember.Type.DRIVER.equals(targetMember.getType())) { @@ -429,7 +429,10 @@ public class CommandBO { } List stepList = new ArrayList<>(); - stepList.add(buildSetSpeedLimitStep(Float.parseFloat((String) params.get(ParamName.speedLimit.name())))); + float speedLimit = Float.parseFloat((String) params.get(ParamName.speedLimit.name())); + if (speedLimit < 0) + speedLimit = Float.MAX_VALUE; + stepList.add(buildSetSpeedLimitStep(speedLimit)); return stepList; } @@ -446,7 +449,7 @@ public class CommandBO { /** * 换端 */ - Turn_Direction(Arrays.asList(), SimulationMember.Type.DRIVER) { + Turn_Direction(List.of(), SimulationMember.Type.DRIVER) { @Override public List buildStepList(Simulation simulation, SimulationMember targetMember, Map params) { BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertEquals(SimulationMember.Type.DRIVER, targetMember.getType()); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/support/MovementAuthority.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/support/MovementAuthority.java index 8d193f479..71e3a6cbb 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/support/MovementAuthority.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/support/MovementAuthority.java @@ -143,7 +143,6 @@ public class MovementAuthority { } case FAULT_SWITCH: case UNLOCK_SECTION: - case NCT_OCCUPIED_IN_FRONT_OF_SECTION: case FAULT_SECTION: case CLOSED_SECTION: { Section section = (Section) this.device; @@ -154,6 +153,13 @@ public class MovementAuthority { // float offset = right ? 0 : baseSection.getLen(); // return new SectionPosition(baseSection, offset); // } + case NCT_OCCUPIED_IN_FRONT_OF_SECTION:{ + Section section = (Section) this.device; + Section previous = section.getNextRunningSectionOf(!right); + float offset = right ? 0 : previous.getLen(); + return new SectionPosition(previous, offset); + } + default: { throw new SimulationException(SimulationExceptionType.System_Fault, String.format("未知的移动授权终端类型:[%s]", this.type));