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

This commit is contained in:
weizhihong 2023-12-06 17:02:35 +08:00
parent ab595ab402
commit 74b86a9b12
1 changed files with 5 additions and 6 deletions

View File

@ -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)})