diff --git a/rtss_simulation b/rtss_simulation index 3c08644..2f5b628 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit 3c08644dde7d13da7de400afa68a9fd4f1712a1e +Subproject commit 2f5b6287247d67ad12950fa6fed256925969ca65 diff --git a/ts/simulation/wayside/memory/wayside_simulation.go b/ts/simulation/wayside/memory/wayside_simulation.go index 1685421..9d738e0 100644 --- a/ts/simulation/wayside/memory/wayside_simulation.go +++ b/ts/simulation/wayside/memory/wayside_simulation.go @@ -604,6 +604,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: @@ -685,6 +686,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, + }) + } } } //门控箱 @@ -743,6 +768,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