From eae1b8d6df53fc84125688f26d965a2012bc3692 Mon Sep 17 00:00:00 2001 From: thesai <1021828630@qq.com> Date: Thu, 15 Aug 2024 14:43:20 +0800 Subject: [PATCH] =?UTF-8?q?[bug]=E4=B9=8B=E5=89=8D=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E4=BB=BF=E7=9C=9F=E8=BF=90=E8=A1=8C=E6=97=B6=E8=81=94=E9=94=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=AD=E7=9A=84code=E8=A2=AB=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E4=BA=86=E8=BD=A6=E7=AB=99uid=EF=BC=8C?= =?UTF-8?q?=E5=90=8E=E6=9D=A5=E6=88=91=E5=8F=AA=E6=98=AF=E7=AE=80=E5=8D=95?= =?UTF-8?q?=E5=B0=86=E6=AD=A4=E8=BD=AC=E6=8D=A2=E5=8E=BB=E6=8E=89=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=9C=89=E4=BA=9B=E5=B0=86=E6=AD=A4?= =?UTF-8?q?code=E5=BD=93uid=E4=BD=BF=E7=94=A8=E7=9A=84=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- third_party/interlock/beijing12/interlock.go | 7 ++++++- ts/simulation/wayside/memory/wayside_simulation.go | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/third_party/interlock/beijing12/interlock.go b/third_party/interlock/beijing12/interlock.go index eceb13a..1f81f3c 100644 --- a/third_party/interlock/beijing12/interlock.go +++ b/third_party/interlock/beijing12/interlock.go @@ -207,7 +207,12 @@ func (i *interlockProxy) handleFromCiData(n int, data []byte) { //处理驱动数据 if i.simulation != nil { logger().Info(fmt.Sprintf("解析出的驱动数据:%x", msg.driveData)) - i.simulation.HandleInterlockDriverInfo(i.runConfig.Code, msg.driveData) + station := i.simulation.Repo.FindStationByStationName(i.runConfig.Code) + if station != nil { + i.simulation.HandleInterlockDriverInfo(station.Id(), msg.driveData) + } else { + logger().Error(fmt.Sprintf("没有找到名为%s的车站", i.runConfig.Code)) + } } //处理应答器数据 for _, datum := range msg.baliseTelegramData { diff --git a/ts/simulation/wayside/memory/wayside_simulation.go b/ts/simulation/wayside/memory/wayside_simulation.go index 7b9519a..81eb062 100644 --- a/ts/simulation/wayside/memory/wayside_simulation.go +++ b/ts/simulation/wayside/memory/wayside_simulation.go @@ -430,8 +430,12 @@ func (s *VerifySimulation) HandleInterlockDriverInfo(code string, driveBytes []b // 采集联锁中的继电器消息 func (s *VerifySimulation) CollectInterlockRelayInfo(code string) *message.InterlockSendMsgPkg { + station := s.Repo.FindStationByStationName(code) + if station == nil { + return nil + } for _, m := range s.Repo.CiQcList() { // 获取继电器地图信息 - if m.StationId != code { + if m.StationId != station.Id() { continue } if len(m.CjList) == 0 {