diff --git a/ts/simulation/wayside/memory/wayside_simulation.go b/ts/simulation/wayside/memory/wayside_simulation.go index 4effb58..2e30990 100644 --- a/ts/simulation/wayside/memory/wayside_simulation.go +++ b/ts/simulation/wayside/memory/wayside_simulation.go @@ -524,9 +524,37 @@ func buildProtoRepository(mapIds []int32) (*proto.Repository, error) { buildAndRelateElectronicComponent(repo, relayGi, mapId) } } + //构建信号平面图中物理区段码表与集中站的关系 + for _, mapId := range mapIds { + giType := QueryGiType(mapId) + if giType == graphicData.PictureType_StationLayout { + stationGi := QueryGiData[*graphicData.RtssGraphicStorage](mapId) + buildSectionCodePoint(repo, stationGi, mapId) + } + } + // return repo, nil } +func buildSectionCodePoint(repo *proto.Repository, storage *graphicData.RtssGraphicStorage, mapId int32) { + city := storage.UniqueIdPrefix.City + lineId := storage.UniqueIdPrefix.LineId + + for _, sscp := range storage.SectionCodePointList { + centralizedStation := sscp.CentralizedStation + sectionGIds := sscp.SectionIds + centralizedStationId := GenerateElementUid(city, lineId, nil, centralizedStation) + ref := queryCentralizedStationRef(centralizedStationId, repo) + var ccs []*proto.CiSectionCodePoint + for sectionPoint, sectionGId := range sectionGIds { + cc := &proto.CiSectionCodePoint{} + cc.Row = int32(sectionPoint) + cc.SectionId = QueryUidByMidAndComId(mapId, sectionGId, &graphicData.Section{}) + ccs = append(ccs, cc) + } + ref.SectionCodePoints = ccs + } +} func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicData.RelayCabinetGraphicStorage, mapId int32) { uidsMap := QueryUidStructure[*RelayUidStructure](mapId) city := relayGi.UniqueIdPrefix.City