From 28997a2b527196c8997c37f7f66b767fe63d379d Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Mon, 27 Sep 2021 10:41:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BF=E7=9C=9F=E6=95=B0=E6=8D=AE=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E6=B7=BB=E5=8A=A0=E4=BF=A1=E5=8F=B7=E6=9C=BA=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=92=8C=E5=9E=8B=E5=8F=B7=E6=A0=A1=E9=AA=8C=20?= =?UTF-8?q?=E8=81=94=E9=94=81=E7=94=9F=E6=88=90=E4=BF=A1=E5=8F=B7=E6=9C=BA?= =?UTF-8?q?=E5=9E=8B=E5=8F=B7=E4=B8=8D=E6=AD=A3=E7=A1=AE=E6=97=B6=E6=8A=9B?= =?UTF-8?q?=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../draftData/DraftMapCiDataGeneratorImpl.java | 3 +++ .../simulation/cbtc/build/MapDeviceBuilder.java | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java index 547732421..362a5fc5b 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java @@ -1442,6 +1442,9 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { case BW: route.setAspect(SignalAspect.W); break; + default: + throw BusinessExceptionAssertEnum.DATA_ERROR.exception(String.format("信号机[%s]型号[%s]不正确", + start.debugStr(), start.getSignalModel())); } route.setTurnBack(false); // 根据信号机和区段是否同向,设置进路联锁自排和是否车队模式 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java index 6b60bc0e4..4d3cdc710 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/MapDeviceBuilder.java @@ -1121,13 +1121,24 @@ public class MapDeviceBuilder { case PASSING: case ARRIVAL: case EXIT: - signal.setSignalModel(SignalModel.RGY); + if (signal.getSignalModel() == null || + SignalModel.R.equals(signal.getSignalModel()) || + SignalModel.BW.equals(signal.getSignalModel())) { + errMsgList.add(String.format("信号机[%s]类型[%s]和型号[%s]不匹配", signal.debugStr(), + signal.getType(), signal.getSignalModel())); + } break; case BLOCKING: - signal.setSignalModel(SignalModel.R); + if (signal.getSignalModel() == null || !SignalModel.R.equals(signal.getSignalModel())) { + errMsgList.add(String.format("信号机[%s]类型[%s]和型号[%s]不匹配", signal.debugStr(), + signal.getType(), signal.getSignalModel())); + } break; case SHUNTING: - signal.setSignalModel(SignalModel.BW); + if (signal.getSignalModel() == null || !SignalModel.BW.equals(signal.getSignalModel())) { + errMsgList.add(String.format("信号机[%s]类型[%s]和型号[%s]不匹配", signal.debugStr(), + signal.getType(), signal.getSignalModel())); + } break; } }