diff --git a/ats/verify/simulation/wayside/memory/wayside_simulation.go b/ats/verify/simulation/wayside/memory/wayside_simulation.go index 8c07862..5759fc0 100644 --- a/ats/verify/simulation/wayside/memory/wayside_simulation.go +++ b/ats/verify/simulation/wayside/memory/wayside_simulation.go @@ -239,20 +239,24 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD if signal == nil { continue } - for _, group := range relationship.Combinationtypes { - var componentIds []string - for _, relayId := range group.RefRelays { - if uidsMap.RelayIds[relayId] == nil { - continue - } - componentIds = append(componentIds, uidsMap.RelayIds[relayId].Uid) - } - signal.ElectronicComponentGroups = append(signal.ElectronicComponentGroups, - &proto.ElectronicComponentGroup{ - Code: group.Code, - ComponentIds: componentIds, - }) + //信号机只有一个组合类型 + if len(relationship.Combinationtypes) != 1 { + panic(fmt.Sprintf("信号机[%s]须有一个组合类型", signal.Id)) } + group := relationship.Combinationtypes[0] + var componentIds []string + for _, relayId := range group.RefRelays { + if uidsMap.RelayIds[relayId] == nil { + continue + } + componentIds = append(componentIds, uidsMap.RelayIds[relayId].Uid) + } + signal.Code = group.Code + signal.ElectronicComponentGroups = append(signal.ElectronicComponentGroups, + &proto.ElectronicComponentGroup{ + Code: group.Code, + ComponentIds: componentIds, + }) } } } @@ -351,6 +355,7 @@ func fillProtoRepository(repo *proto.Repository, storage *graphicData.RtssGraphi Km: convertKm(data.KilometerSystem), SectionId: sectionId, TurnoutPort: turnoutPort, + //Code: data., } repo.Signals = append(repo.Signals, converSignalUid(signal, uidsMap)) }