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