【CTC 岔前、定位、反位区段不良操作】
This commit is contained in:
parent
1b3fee07af
commit
2ffedfc0a5
@ -233,6 +233,27 @@ public class Operation {
|
||||
* 区段分路不良设置
|
||||
*/
|
||||
Section_Defective_Shunting(new Label[]{Label.CLIENT},true),
|
||||
|
||||
/**
|
||||
* 岔前分路不良
|
||||
*/
|
||||
Section_Defective_Shunting_Front(new Label[]{Label.CLIENT},true),
|
||||
|
||||
/**
|
||||
* 定位分路不良
|
||||
*/
|
||||
Section_Defective_Shunting_Fixed(new Label[]{Label.CLIENT},true),
|
||||
|
||||
/**
|
||||
* 反位分路不良
|
||||
*/
|
||||
Section_Defective_Shunting_Reverse(new Label[]{Label.CLIENT},true),
|
||||
|
||||
/**
|
||||
* 区段确认空闲,取消分路不良
|
||||
*/
|
||||
Section_Cancel_Defective_Shunting(new Label[]{Label.CLIENT},true),
|
||||
|
||||
//--------------------------- 信号机 ---------------------------
|
||||
/**
|
||||
* 封锁
|
||||
|
@ -13,6 +13,8 @@ import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@OperateHandler
|
||||
@ -177,4 +179,40 @@ public class SectionOperateHandler {
|
||||
public void defectiveShunting(Simulation simulation, String sectionCode, List<Section.ShuntingType> shuntingTypeList) {
|
||||
atsSectionService.defectiveShunting(simulation, sectionCode, shuntingTypeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置岔前分路不良
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Section_Defective_Shunting_Front)
|
||||
public void defectiveShuntingFront(Simulation simulation, String sectionCode) {
|
||||
atsSectionService.defectiveShuntingAxleCounter(simulation, sectionCode, Arrays.asList(Section.ShuntingType.SWITCH_FRONT_SHUNTING));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置定位分路不良
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Section_Defective_Shunting_Fixed)
|
||||
public void defectiveShuntingFixed(Simulation simulation, String sectionCode) {
|
||||
atsSectionService.defectiveShuntingAxleCounter(simulation, sectionCode, Arrays.asList(Section.ShuntingType.FIXED_POSITION_SHUNTING));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置反位分路不良
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Section_Defective_Shunting_Reverse)
|
||||
public void defectiveShuntingReverse(Simulation simulation, String sectionCode) {
|
||||
atsSectionService.defectiveShuntingAxleCounter(simulation, sectionCode, Arrays.asList(Section.ShuntingType.REVERSE_POSITION_SHUNTING));
|
||||
}
|
||||
|
||||
/**
|
||||
* 区段确认空闲,取消分路不良
|
||||
*
|
||||
* @param simulation 仿真实体
|
||||
* @param sectionCode 区段编码
|
||||
*/
|
||||
@OperateHandlerMapping(type = Operation.Type.Section_Cancel_Defective_Shunting)
|
||||
public void cancelDefectiveShunting(Simulation simulation, String sectionCode) {
|
||||
atsSectionService.defectiveShunting(simulation, sectionCode, new ArrayList<>());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -128,6 +128,26 @@ public class AtsSectionService {
|
||||
}
|
||||
}
|
||||
|
||||
public void defectiveShuntingAxleCounter(Simulation simulation, String sectionCode, List<Section.ShuntingType> shuntingTypeList) {
|
||||
// 设置区段的不良类型
|
||||
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
||||
// 是否是计轴区段、道岔区段
|
||||
boolean isSwitchSection = section.isAxleCounter() || section.getParent() != null;
|
||||
if (isSwitchSection) {
|
||||
Section targetSection = section.isAxleCounter() ? section : section.getParent();
|
||||
targetSection.getLogicList().forEach(logicSection -> {
|
||||
// 岔前分路不良、定位分路不良、反位分路不良
|
||||
Section.ShuntingType shuntingType = getShuntingType(logicSection);
|
||||
logicSection.setShuntingTypeList(shuntingTypeList);
|
||||
logicSection.setBadShunt(shuntingTypeList.contains(shuntingType));
|
||||
});
|
||||
targetSection.setBadShunt(!CollectionUtils.isEmpty(shuntingTypeList));
|
||||
targetSection.setShuntingTypeList(shuntingTypeList);
|
||||
} else {
|
||||
throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, "非道岔区段");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 区段分路不良类型
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user