From 91e23f39fcf0668da48ba287f877df74b0cfad06 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Fri, 27 Nov 2020 15:06:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA=E8=87=AA=E6=8E=92?= =?UTF-8?q?=E5=85=B3=E5=92=8C=E8=BF=9B=E8=B7=AF=E8=87=AA=E5=8A=A8=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E5=AE=9E=E8=AE=AD=E7=94=9F=E6=88=90=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=88=86=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generatornew/base/SignalGeneratorNew.java | 63 +++++++++++++------ 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SignalGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SignalGeneratorNew.java index b8e902f6c..42873b668 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SignalGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SignalGeneratorNew.java @@ -30,7 +30,7 @@ public class SignalGeneratorNew implements GeneratorNew { OperateDefinitionVO operateDefinitionVO) { List trainingVOList = new ArrayList<>(); switch (Operation.Type.valueOf(operateDefinitionVO.getOperateType())) { - case Signal_Set_Auto_Turn_Back:{ + case Signal_Set_Auto_Turn_Back: { List cycleList = simulation.getRepository().getCycleList(); for (Cycle cycle : cycleList) { trainingVOList.add(this.build(config, simulation, cycle, operateDefinitionVO)); @@ -39,7 +39,7 @@ public class SignalGeneratorNew implements GeneratorNew { } return trainingVOList; } - case Signal_Cancel_Auto_Turn_Back:{ + case Signal_Cancel_Auto_Turn_Back: { // 设置背景:自动折返为已设置 List cycleList = simulation.getRepository().getCycleList(); for (Cycle cycle : cycleList) { @@ -55,14 +55,14 @@ public class SignalGeneratorNew implements GeneratorNew { List signalList = simulation.getRepository().getSignalList(); for (Signal signal : signalList) { - if(signal.isVirtual()) continue; + if (signal.isVirtual()) continue; List routeList = signal.getRouteList(); boolean routeLikeHa1 = simulation.getRepository().getConfig().isRouteLikeHa1(); - switch (Operation.Type.valueOf (operateDefinitionVO.getOperateType())) { + switch (Operation.Type.valueOf(operateDefinitionVO.getOperateType())) { case Signal_Block: case Signal_Find_Routes_Status: break; - case Signal_Set_Route:{ + case Signal_Set_Route: { if (!CollectionUtils.isEmpty(routeList)) { for (Route route : routeList) { // 类似哈尔滨一号线,根据配置各类进路分别生成 @@ -80,8 +80,7 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } - case Signal_Set_CI_Auto_Trigger: - case Signal_Close_Auto_Setting:{ + case Signal_Set_CI_Auto_Trigger: { if (!CollectionUtils.isEmpty(routeList)) { if (routeLikeHa1) { trainingVOList.add(this.build(config, simulation, signal, operateDefinitionVO)); @@ -105,8 +104,32 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } + case Signal_Close_Auto_Setting: { + if (!CollectionUtils.isEmpty(routeList)) { + if (routeLikeHa1) { + trainingVOList.add(this.build(config, simulation, signal, operateDefinitionVO)); + simulation.reset(); + continue; + } else { + for (Route route : routeList) { + // 类似哈尔滨一号线,根据配置各类进路分别生成 + if ((operateDefinitionVO.isAtp() && !route.isAtp()) + || (operateDefinitionVO.isGround() && !route.isGround())) { + continue; + } + if (route.isGuide()) { // 引导进路跳过 + continue; + } + trainingVOList.add(this.build(config, simulation, route, operateDefinitionVO)); + // 仿真重置 + simulation.reset(); + } + } + } + continue; + } case Signal_Total_Cancel: // 总取消暂时只生成取消未接近锁闭的进路这一种场景的实训 - case Signal_Cancel_Route:{ + case Signal_Cancel_Route: { // 查询以信号机为始端的进路列表,设置背景为进路已排列 if (!CollectionUtils.isEmpty(routeList)) { for (Route route : routeList) { @@ -126,7 +149,7 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } - case Signal_Human_Release_Route:{ + case Signal_Human_Release_Route: { // 查询信号机为始端的进路列表,设置背景为进路排列,且进路接近区段占用 // todo 接近区段设置列车逻辑较复杂,推迟实现 continue; @@ -141,7 +164,7 @@ public class SignalGeneratorNew implements GeneratorNew { // } // continue; } - case Signal_Close_Signal:{ + case Signal_Close_Signal: { // 查询进路,设置背景为进路已排列 if (!CollectionUtils.isEmpty(routeList)) { for (Route route : routeList) { @@ -156,7 +179,7 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } - case Signal_Reopen_Signal:{ + case Signal_Reopen_Signal: { // 查询进路列表,设置背景为进路已排列且信号机关闭 if (!CollectionUtils.isEmpty(routeList)) { for (Route route : routeList) { @@ -172,12 +195,12 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } - case Signal_Unblock:{ + case Signal_Unblock: { // 背景为信号机封锁 signal.setBlockade(true); break; } - case Signal_Open_Auto_Setting:{ + case Signal_Open_Auto_Setting: { // 查询进路列表,背景为进路人工控 if (!CollectionUtils.isEmpty(routeList)) { if (routeLikeHa1) { @@ -201,7 +224,7 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } - case Signal_Set_CI_Auto:{ + case Signal_Set_CI_Auto: { // 查询自动进路列表,背景为进路已排列 if (!CollectionUtils.isEmpty(routeList)) { List fltRouteList = routeList.stream() @@ -216,7 +239,7 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } - case Signal_Cancel_CI_Auto:{ + case Signal_Cancel_CI_Auto: { // 查询自动进路列表,背景为进路已排列且已设置为自动进路模式 if (!CollectionUtils.isEmpty(routeList)) { List fltRouteList = routeList.stream() @@ -232,7 +255,7 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } - case Signal_Cancel_CI_Auto_Trigger:{ + case Signal_Cancel_CI_Auto_Trigger: { if (!CollectionUtils.isEmpty(routeList)) { // 查询自动触发进路列表,背景为自动触发进路的联锁自动触发模式已设置 List arcRouteList = routeList.stream() @@ -256,7 +279,7 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } - case Signal_Set_Guide:{ + case Signal_Set_Guide: { // 若信号机可开引导信号,则生成实训,暂不设置背景(暂时先简单处理,此处业务比较复杂,需明确后再生成各种情况的实训) if (!signal.isCallOn()) { // 不是引导信号机,不生成 continue; @@ -279,7 +302,7 @@ public class SignalGeneratorNew implements GeneratorNew { continue; } } - case Signal_Close_Guide:{ + case Signal_Close_Guide: { // 若信号可开放引导信号,生成实训,背景设置为开放引导进路/开放引导信号 if (signal.isCallOn()) { if (!CollectionUtils.isEmpty(routeList)) { @@ -291,7 +314,7 @@ public class SignalGeneratorNew implements GeneratorNew { simulation.reset(); } } - } else if(Objects.nonNull(signal.getAutoSignal())) { // 信号机是自动信号 + } else if (Objects.nonNull(signal.getAutoSignal())) { // 信号机是自动信号 this.deviceStatusModifyTool.openGuideSignalDirectly(signal); trainingVOList.add(this.build(config, simulation, signal, operateDefinitionVO)); // 仿真重置 @@ -300,7 +323,7 @@ public class SignalGeneratorNew implements GeneratorNew { } continue; } - case Signal_Cancel_Guide:{ + case Signal_Cancel_Guide: { // 若信号可开放引导信号,生成实训,背景设置为开放引导进路/开放引导信号 if (signal.isCallOn()) { if (!CollectionUtils.isEmpty(routeList)) {