From 74b86a9b12605dd530c1b1125f9bcaa2a0beea66 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Wed, 6 Dec 2023 17:02:35 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9IBP=20EMP=E7=BB=A7?= =?UTF-8?q?=E7=94=B5=E5=99=A8=E7=8A=B6=E6=80=81=E8=8E=B7=E5=8F=96=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- message_server/sfp_ms.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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)})