计轴rssp 集成

This commit is contained in:
xzb 2023-11-07 15:10:19 +08:00
parent 26db808d23
commit d15ad494e0
1 changed files with 28 additions and 0 deletions

View File

@ -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