Merge remote-tracking branch 'origin/test' into rt-train-drive

This commit is contained in:
walker-sheng 2021-06-04 18:07:33 +08:00
commit 6aed3492ba
4 changed files with 25 additions and 12 deletions

View File

@ -50,10 +50,10 @@ public class MapController {
return iMapService.checkNameExist(name); return iMapService.checkNameExist(name);
} }
@ApiOperation(value = "根据地图id查询地图版本") @ApiOperation(value = "根据地图id查询地图当前使用版本")
@GetMapping(path = "/{id}/version") @GetMapping(path = "/{id}/version")
public String getMapVersionById(@PathVariable Long id) { public String getMapVersionById(@PathVariable Long id) {
return this.iMapService.findMapVersion(id); return this.iMapService.getMapDetail(id).getVersion();
} }
@ApiOperation(value = "根据地图id查询地图明细") @ApiOperation(value = "根据地图id查询地图明细")

View File

@ -161,6 +161,10 @@ public class ZCLogicLoop {
endList.add(unlockedOverlapEnd); 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); Section temp = section.getNextRunningSectionOf(right);
if (Objects.isNull(temp)) { // 到尽头 if (Objects.isNull(temp)) { // 到尽头
@ -174,12 +178,12 @@ public class ZCLogicLoop {
break; break;
} }
//非通信车占用区段 //非通信车占用区段
if (temp.isNonCbtcOccupy()) { // if (temp.isNonCbtcOccupy()) {
SectionPosition headPosition1 = train.getHeadPosition(); // SectionPosition headPosition1 = train.getHeadPosition();
if (!temp.isSamePhysical(headPosition1.getSection().getCode())) { // if (!temp.isSamePhysical(headPosition1.getSection().getCode())) {
endList.add(new MovementAuthority.End(section, MovementAuthority.EndType.NCT_OCCUPIED_IN_FRONT_OF_SECTION)); // endList.add(new MovementAuthority.End(section, MovementAuthority.EndType.NCT_OCCUPIED_IN_FRONT_OF_SECTION));
} // }
} // }
//检查关闭的区段 //检查关闭的区段
MovementAuthority.End cs = checkClosedSection(section); MovementAuthority.End cs = checkClosedSection(section);
if (cs != null) if (cs != null)

View File

@ -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 @Override
public List<Step> buildStepList(Simulation simulation, SimulationMember targetMember, Map<String, Object> params) { public List<Step> buildStepList(Simulation simulation, SimulationMember targetMember, Map<String, Object> params) {
if (!SimulationMember.Type.DRIVER.equals(targetMember.getType())) { if (!SimulationMember.Type.DRIVER.equals(targetMember.getType())) {
@ -429,7 +429,10 @@ public class CommandBO {
} }
List<Step> stepList = new ArrayList<>(); List<Step> 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; return stepList;
} }
@ -446,7 +449,7 @@ public class CommandBO {
/** /**
* 换端 * 换端
*/ */
Turn_Direction(Arrays.asList(), SimulationMember.Type.DRIVER) { Turn_Direction(List.of(), SimulationMember.Type.DRIVER) {
@Override @Override
public List<Step> buildStepList(Simulation simulation, SimulationMember targetMember, Map<String, Object> params) { public List<Step> buildStepList(Simulation simulation, SimulationMember targetMember, Map<String, Object> params) {
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertEquals(SimulationMember.Type.DRIVER, targetMember.getType()); BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertEquals(SimulationMember.Type.DRIVER, targetMember.getType());

View File

@ -143,7 +143,6 @@ public class MovementAuthority {
} }
case FAULT_SWITCH: case FAULT_SWITCH:
case UNLOCK_SECTION: case UNLOCK_SECTION:
case NCT_OCCUPIED_IN_FRONT_OF_SECTION:
case FAULT_SECTION: case FAULT_SECTION:
case CLOSED_SECTION: { case CLOSED_SECTION: {
Section section = (Section) this.device; Section section = (Section) this.device;
@ -154,6 +153,13 @@ public class MovementAuthority {
// float offset = right ? 0 : baseSection.getLen(); // float offset = right ? 0 : baseSection.getLen();
// return new SectionPosition(baseSection, offset); // 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: { default: {
throw new SimulationException(SimulationExceptionType.System_Fault, throw new SimulationException(SimulationExceptionType.System_Fault,
String.format("未知的移动授权终端类型:[%s]", this.type)); String.format("未知的移动授权终端类型:[%s]", this.type));