signal
This commit is contained in:
parent
b698316777
commit
2dc698ccfc
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user