添加返回前端的道岔状态

This commit is contained in:
walker 2023-11-02 15:54:26 +08:00
parent 0457d58eeb
commit 3c68b9bebb
2 changed files with 20 additions and 3 deletions

View File

@ -273,6 +273,21 @@ func (ms *SfpMs) collectTurnoutStates() ([]*state.SwitchState, error) {
Dw: pos.Dw,
Fw: pos.Fw,
}
// 强制(联锁驱动无效)
s.Force = entry.HasComponent(component.TurnoutFaultCiqdType)
// 失表
s.Sb = entry.HasComponent(component.TurnoutFaultSbType)
// 定位失表
s.Dwsb = entry.HasComponent(component.TurnoutFaultDwsbType)
// 反位失表
s.Fwsb = entry.HasComponent(component.TurnoutFaultFwsbType)
// 挤岔
s.Jc = entry.HasComponent(component.TurnoutFaultJcType)
// if entry.HasComponent(component.Zdj9TwoElectronicType) {
// elec := component.Zdj9TwoElectronicType.Get(entry)
// }
switchArr = append(switchArr, s)
}
return switchArr, nil

View File

@ -451,12 +451,14 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
city := relayGi.UniqueIdPrefix.City
lineId := relayGi.UniqueIdPrefix.LineId
station := relayGi.UniqueIdPrefix.BelongsConcentrationStation
stationUid := GenerateElementUid(city, lineId, nil, station)
relayMap := make(map[string]*proto.Relay)
for _, relay := range relayGi.Relays {
repoRelay := &proto.Relay{
Id: uidsMap.RelayIds[relay.Common.Id].Uid,
Code: relay.Code,
Model: convertRelayModel(relay.NewModel),
Id: uidsMap.RelayIds[relay.Common.Id].Uid,
Code: relay.Code,
Model: convertRelayModel(relay.NewModel),
StationId: stationUid,
}
repo.Relays = append(repo.Relays, repoRelay)
relayMap[repoRelay.Id] = repoRelay