修改零散组合构建
This commit is contained in:
parent
8198f1895d
commit
2f17438079
|
@ -648,6 +648,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
|
|||
for _, platform := range repo.Platforms {
|
||||
platformMap[platform.Id] = platform
|
||||
}
|
||||
ciecs := stationMap[stationUid] //联锁集中站
|
||||
for _, relationship := range relayGi.DeviceRelateRelayList {
|
||||
switch relationship.DeviceType {
|
||||
case graphicData.RelatedRef_Turnout:
|
||||
|
@ -729,6 +730,30 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
|
|||
ComponentIds: componentIds,
|
||||
})
|
||||
}
|
||||
case graphicData.RelatedRef_SignalFaultAlarm: // 信号机故障报警仪设备组合
|
||||
{
|
||||
egs := buildEgs(relationship.Combinationtypes, relayUidStructure)
|
||||
ciecs.Deccs = append(ciecs.Deccs, &proto.DeviceEcc{
|
||||
DeviceType: proto.DeviceType_DeviceType_SignalFaultAlarm,
|
||||
Egs: egs,
|
||||
})
|
||||
}
|
||||
case graphicData.RelatedRef_Breakers: // 断路器
|
||||
{
|
||||
egs := buildEgs(relationship.Combinationtypes, relayUidStructure)
|
||||
ciecs.Deccs = append(ciecs.Deccs, &proto.DeviceEcc{
|
||||
DeviceType: proto.DeviceType_DeviceType_Breakers,
|
||||
Egs: egs,
|
||||
})
|
||||
}
|
||||
case graphicData.RelatedRef_PowerScreen: // 电源屏
|
||||
{
|
||||
egs := buildEgs(relationship.Combinationtypes, relayUidStructure)
|
||||
ciecs.Deccs = append(ciecs.Deccs, &proto.DeviceEcc{
|
||||
DeviceType: proto.DeviceType_DeviceType_PowerScreen,
|
||||
Egs: egs,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
//门控箱
|
||||
|
@ -787,6 +812,21 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
|
|||
sortQcTable(ref.QdList)
|
||||
}
|
||||
|
||||
func buildEgs(cts []*graphicData.Combinationtype, relayUidStructure *RelayUidStructure) []*proto.ElectronicComponentGroup {
|
||||
var egs []*proto.ElectronicComponentGroup
|
||||
for _, ct := range cts {
|
||||
d := &proto.ElectronicComponentGroup{Code: ct.Code}
|
||||
for _, relayId := range ct.RefRelays {
|
||||
if relayUidStructure.RelayIds[relayId] == nil {
|
||||
continue
|
||||
}
|
||||
d.ComponentIds = append(d.ComponentIds, relayUidStructure.RelayIds[relayId].Uid)
|
||||
}
|
||||
egs = append(egs, d)
|
||||
}
|
||||
return egs
|
||||
}
|
||||
|
||||
type IQcTable interface {
|
||||
GetRow() int32
|
||||
GetCol() int32
|
||||
|
|
Loading…
Reference in New Issue