添加<区段开放/关闭>操作
This commit is contained in:
parent
aa7e69f7dd
commit
f289618709
@ -110,6 +110,9 @@ public class ZCLogicLoop {
|
|||||||
MovementAuthority.End ecStandEnd = checkEC(tailSection);
|
MovementAuthority.End ecStandEnd = checkEC(tailSection);
|
||||||
if (ecStandEnd != null)
|
if (ecStandEnd != null)
|
||||||
return List.of(ecStandEnd);
|
return List.of(ecStandEnd);
|
||||||
|
MovementAuthority.End closedSection = checkClosedSection(tailSection);
|
||||||
|
if (closedSection != null)
|
||||||
|
return List.of(closedSection);
|
||||||
// 如果车尾正常,从车头开始往前查找
|
// 如果车尾正常,从车头开始往前查找
|
||||||
Section section = headPosition.getSection();
|
Section section = headPosition.getSection();
|
||||||
List<MovementAuthority.End> endList = new ArrayList<>();
|
List<MovementAuthority.End> endList = new ArrayList<>();
|
||||||
@ -191,6 +194,13 @@ public class ZCLogicLoop {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
//检查关闭的区段
|
||||||
|
MovementAuthority.End cs = checkClosedSection(section);
|
||||||
|
if (cs != null) {
|
||||||
|
deviceEnd = cs;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
section = temp;
|
section = temp;
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(deviceEnd)) { // 找到移动授权终端,结束
|
if (Objects.nonNull(deviceEnd)) { // 找到移动授权终端,结束
|
||||||
@ -199,6 +209,13 @@ public class ZCLogicLoop {
|
|||||||
return endList;
|
return endList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private MovementAuthority.End checkClosedSection(Section section) {
|
||||||
|
if (section.isClosed()) {
|
||||||
|
return new MovementAuthority.End(section, MovementAuthority.EndType.CLOSED_SECTION);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private MovementAuthority.End checkEC(Section tailSection) {
|
private MovementAuthority.End checkEC(Section tailSection) {
|
||||||
if (tailSection.isNormalStandTrack()) {
|
if (tailSection.isNormalStandTrack()) {
|
||||||
List<Stand> standList = tailSection.getStandList();
|
List<Stand> standList = tailSection.getStandList();
|
||||||
|
@ -113,6 +113,14 @@ public class Operation {
|
|||||||
Section_Details(),
|
Section_Details(),
|
||||||
/**强解*/
|
/**强解*/
|
||||||
Section_Force_Unlock(),
|
Section_Force_Unlock(),
|
||||||
|
/** 初始化开放 */
|
||||||
|
Section_Initialize_Open,
|
||||||
|
/** 开放 */
|
||||||
|
Section_Open,
|
||||||
|
/** 初始化关闭 */
|
||||||
|
Section_Initialize_Close,
|
||||||
|
/** 关闭 */
|
||||||
|
Section_Close,
|
||||||
|
|
||||||
//--------------------------- 信号机 ---------------------------
|
//--------------------------- 信号机 ---------------------------
|
||||||
/** 封锁 */
|
/** 封锁 */
|
||||||
|
@ -117,4 +117,28 @@ public class SectionOperateHandler {
|
|||||||
this.atsSectionService.confirmAxleValid(simulation, section);
|
this.atsSectionService.confirmAxleValid(simulation, section);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateHandlerMapping(type = Operation.Type.Section_Initialize_Open)
|
||||||
|
public void initializeOpen(Simulation simulation, String sectionCode) {
|
||||||
|
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
||||||
|
atsSectionService.initializeOpen(simulation, section);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateHandlerMapping(type = Operation.Type.Section_Open)
|
||||||
|
public void open(Simulation simulation, String sectionCode) {
|
||||||
|
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
||||||
|
atsSectionService.open(simulation, section);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateHandlerMapping(type = Operation.Type.Section_Initialize_Close)
|
||||||
|
public void initializeClose(Simulation simulation, String sectionCode) {
|
||||||
|
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
||||||
|
atsSectionService.initializeClose(simulation, section);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateHandlerMapping(type = Operation.Type.Section_Close)
|
||||||
|
public void close(Simulation simulation, String sectionCode) {
|
||||||
|
Section section = simulation.getRepository().getByCode(sectionCode, Section.class);
|
||||||
|
atsSectionService.close(simulation, section);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package club.joylink.rtss.simulation.cbtc.ATS.service;
|
package club.joylink.rtss.simulation.cbtc.ATS.service;
|
||||||
|
|
||||||
|
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -51,4 +52,39 @@ public class AtsSectionService {
|
|||||||
section.confirmValid();
|
section.confirmValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化开放操作
|
||||||
|
*/
|
||||||
|
public void initializeOpen(Simulation simulation, Section section) {
|
||||||
|
section.setOpenInit(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开放区段
|
||||||
|
*/
|
||||||
|
public void open(Simulation simulation, Section section) {
|
||||||
|
if (simulation.getRepository().getConfig().isSomeCommandNeedInit()) {
|
||||||
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(section.isOpenInit(), section.debugStr() + "没有初始化开放操作");
|
||||||
|
}
|
||||||
|
section.setOpenInit(false);
|
||||||
|
section.setClosed(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化关闭操作
|
||||||
|
*/
|
||||||
|
public void initializeClose(Simulation simulation, Section section) {
|
||||||
|
section.setCloseInit(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭区段
|
||||||
|
*/
|
||||||
|
public void close(Simulation simulation, Section section) {
|
||||||
|
if (simulation.getRepository().getConfig().isSomeCommandNeedInit()) {
|
||||||
|
BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(section.isCloseInit(), section.debugStr() + "没有初始化开放操作");
|
||||||
|
}
|
||||||
|
section.setCloseInit(false);
|
||||||
|
section.setClosed(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
// ------------------状态属性---------------------
|
// ------------------状态属性---------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否封锁
|
* 是否封锁(封锁后,包含区段的进路不能排列)
|
||||||
*/
|
*/
|
||||||
private boolean blockade;
|
private boolean blockade;
|
||||||
|
|
||||||
@ -224,6 +224,21 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
*/
|
*/
|
||||||
private boolean delayUnlock;
|
private boolean delayUnlock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭操作初始化(初始化后才能使用关闭操作)
|
||||||
|
*/
|
||||||
|
private boolean closeInit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开放操作初始化(初始化后才能使用开放操作)
|
||||||
|
*/
|
||||||
|
private boolean openInit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭(关闭后列车不能进入该区段,已在该区段的紧急制动)
|
||||||
|
*/
|
||||||
|
private boolean closed;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
super.reset();
|
super.reset();
|
||||||
@ -240,6 +255,9 @@ public class Section extends MayOutOfOrderDevice {
|
|||||||
this.delayTime = 0;
|
this.delayTime = 0;
|
||||||
this.noStatus = false;
|
this.noStatus = false;
|
||||||
this.delayUnlock = false;
|
this.delayUnlock = false;
|
||||||
|
this.closeInit = false;
|
||||||
|
this.openInit = false;
|
||||||
|
this.closed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,7 +132,8 @@ public class MovementAuthority {
|
|||||||
case FAULT_SWITCH:
|
case FAULT_SWITCH:
|
||||||
case UNLOCK_SECTION:
|
case UNLOCK_SECTION:
|
||||||
case NCT_OCCUPIED_IN_FRONT_OF_SECTION:
|
case NCT_OCCUPIED_IN_FRONT_OF_SECTION:
|
||||||
case FAULT_SECTION: {
|
case FAULT_SECTION:
|
||||||
|
case CLOSED_SECTION: {
|
||||||
Section section = (Section) this.device;
|
Section section = (Section) this.device;
|
||||||
float offset = right ? 0 : section.getLen();
|
float offset = right ? 0 : section.getLen();
|
||||||
return new SectionPosition(section, offset);
|
return new SectionPosition(section, offset);
|
||||||
@ -205,6 +206,10 @@ public class MovementAuthority {
|
|||||||
* 紧急关闭的站台
|
* 紧急关闭的站台
|
||||||
*/
|
*/
|
||||||
EC_STAND,
|
EC_STAND,
|
||||||
|
/**
|
||||||
|
* 关闭的区段
|
||||||
|
*/
|
||||||
|
CLOSED_SECTION,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user