【修改IBP EMP继电器状态获取逻辑】

This commit is contained in:
weizhihong 2023-12-06 17:02:35 +08:00
parent ab595ab402
commit 74b86a9b12

View File

@ -336,15 +336,14 @@ func (ms *SfpMs) collectPlatformStates() ([]*state.PlatformState, error) {
} }
sta := &state.PlatformState{Id: platform.Common.Id} sta := &state.PlatformState{Id: platform.Common.Id}
isX := strings.Contains(platform.Code, "下行站台") //下行站台 isX := strings.Contains(platform.Code, "下行站台") //下行站台
if entry.HasComponent(component.SpkElectronicType) { // 紧急停车继电器 if entry.HasComponent(component.EmpElectronicType) { // 紧急停车继电器
empElectronic := component.EmpElectronicType.Get(entry) empElectronic := component.EmpElectronicType.Get(entry)
if isX { deviceElectronic := empElectronic.EMPJMap[platform.GetRefEsbRelayCode()]
sta.Empj = getRelayXqVal(empElectronic.XEMPJ) if deviceElectronic != nil {
} else { sta.Empj = getRelayXqVal(deviceElectronic.EMPJ)
sta.Empj = getRelayXqVal(empElectronic.SEMPJ)
} }
} }
if entry.HasComponent(component.EmpElectronicType) { // SPKS继电器 if entry.HasComponent(component.SpkElectronicType) { // SPKS继电器
spkElectronic := component.SpkElectronicType.Get(entry) spkElectronic := component.SpkElectronicType.Get(entry)
if isX { if isX {
sta.SpksState = append(sta.SpksState, &state.ReplyState{Code: "SPKSX旁路", Xh: getRelayXqVal(spkElectronic.SPKSXPLAJ)}) sta.SpksState = append(sta.SpksState, &state.ReplyState{Code: "SPKSX旁路", Xh: getRelayXqVal(spkElectronic.SPKSXPLAJ)})