From 5e70ad158eff0389df44ccd2ca506ebc187a39e0 Mon Sep 17 00:00:00 2001 From: thesai <1021828630@qq.com> Date: Tue, 13 Aug 2024 11:00:27 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]11=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=E8=81=94=E9=94=81=E9=80=9A=E4=BF=A1=EF=BC=8C=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BB=8E=E7=89=A9=E7=90=86=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E8=AE=A1=E8=BD=B4=E5=8C=BA=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- third_party/interlock/beijing11/service.go | 40 +++++++++---------- .../wayside/memory/wayside_simulation.go | 18 +++++---- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/third_party/interlock/beijing11/service.go b/third_party/interlock/beijing11/service.go index f7bd2ae..daa7c74 100644 --- a/third_party/interlock/beijing11/service.go +++ b/third_party/interlock/beijing11/service.go @@ -205,25 +205,23 @@ func makeTable(sim *memory.VerifySimulation, stationCode string) *StationDeviceI } } } - ////计轴区段 - //for _, data := range stationGi.LianSuoData.AcSections { - // if data.Index <= 0 { - // continue - // } - // if data.Index == 0 { //这是其它线的区段 - // continue - // } - // for _, station := range uids.AxleCountingSectionIds[data.Id].CentralizedStations { - // if station.StationName == stationCode { - // table.AxleSectionMap[uint16(data.Id)] = &Row{ - // commonId: data.Id, - // uid: uids.PhysicalSectionIds[data.Id].Uid, - // index: uint16(data.Index), - // relateDeviceMap: nil, - // } - // } - // } - //} + //计轴区段 + for _, data := range stationGi.LianSuoData.AcSections { + if data.Index <= 0 { + continue + } + sectionModule := sim.Repo.FindAxleCountingSection(uids.AxleCountingSectionIds[data.Id].Uid) + for _, station := range sectionModule.PhysicalSection().CentralizedStation() { + if station.GetCode() == stationCode { + table.AxleSectionMap[uint16(data.Id)] = &Row{ + commonId: data.Id, + uid: uids.AxleCountingSectionIds[data.Id].Uid, + index: uint16(data.Index), + relateDeviceMap: nil, + } + } + } + } //无人折返,实际数据中数量为0 //防淹门,实际数据中数量为0 //人员防护 @@ -360,10 +358,10 @@ func (s *serviceContext) collectDeviceState() *ToInterlockFrame { //计轴区段 for _, row := range s.deviceTable.AxleSectionMap { entry := wd.EntityMap[row.uid] - axleManager := component.PhysicalSectionManagerType.Get(entry) + sectionState := component.AxleCountingSectionStateType.Get(entry) frame.AxleSectionStates = append(frame.AxleSectionStates, &AxleSectionState{ Id: row.index, - State: GetStateByte(axleManager.Occupied), + State: GetStateByte(sectionState.Occupied), }) } //SPKS diff --git a/ts/simulation/wayside/memory/wayside_simulation.go b/ts/simulation/wayside/memory/wayside_simulation.go index b46f9a8..7b9519a 100644 --- a/ts/simulation/wayside/memory/wayside_simulation.go +++ b/ts/simulation/wayside/memory/wayside_simulation.go @@ -1125,19 +1125,23 @@ func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphic turnoutUids = append(turnoutUids, uidsMap.TurnoutIds[tid].Uid) } } - var centralizedStation string - if len(data.CentralizedStations) > 0 { - s := uidsMap.StationIds[data.CentralizedStations[0]] - if s != nil { - centralizedStation = s.Code - } + var centralizedStationIds []string + for _, station := range uidsMap.PhysicalSectionIds[data.Common.Id].CentralizedStations { + centralizedStationIds = append(centralizedStationIds, uidsMap.StationIds[station.Common.Id].Uid) } + //var centralizedStation string + //if len(data.CentralizedStations) > 0 { + // s := uidsMap.StationIds[data.CentralizedStations[0]] + // if s != nil { + // centralizedStation = s.Code + // } + //} physicalSection := &proto.PhysicalSection{ Id: uidsMap.PhysicalSectionIds[GetMapElementId(data.Common)].Uid, ADevicePort: convertDevicePort(data.PaRef, uidsMap), BDevicePort: convertDevicePort(data.PbRef, uidsMap), TurnoutIds: turnoutUids, - CentralizedStation: centralizedStation, + CentralizedStation: centralizedStationIds, } repo.PhysicalSections = append(repo.PhysicalSections, physicalSection) }