From 7694e092231530cbfa1d838902d802ca8c1de336 Mon Sep 17 00:00:00 2001 From: thesai <1021828630@qq.com> Date: Mon, 19 Feb 2024 14:01:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=8F=E8=94=BD=E9=97=A8?= =?UTF-8?q?=E9=97=A8=E6=8E=A7=E7=AE=B1ecs=E9=80=BB=E8=BE=91=E5=BC=95?= =?UTF-8?q?=E8=B5=B7=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sys/circuit_sys/psd.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/circuit_sys/psd.go b/sys/circuit_sys/psd.go index 4236d8f..41ae04c 100644 --- a/sys/circuit_sys/psd.go +++ b/sys/circuit_sys/psd.go @@ -94,7 +94,7 @@ func (p *PsdSys) Update(world ecs.World) { // 门控箱按钮驱动继电器 func mkxBtnDriveRelay(mkx *component.Mkx, pmc *component.PlatformMkxCircuit, psdCircuit *component.PsdCircuit) { //PCB - if mkx.PCB != nil { + if pmc.PCBJ != nil && mkx.PCB != nil { pcb := component.BitStateType.Get(mkx.PCB).Val pcbpl := false if mkx.PCBPL != nil { @@ -103,7 +103,7 @@ func mkxBtnDriveRelay(mkx *component.Mkx, pmc *component.PlatformMkxCircuit, psd component.RelayDriveType.Get(pmc.PCBJ).Td = !pcbpl && pcb } //POB - if mkx.POB != nil { + if pmc.POBJ != nil && mkx.POB != nil { pob := component.BitStateType.Get(mkx.POB).Val pobpl := false if mkx.POBPL != nil { @@ -112,7 +112,7 @@ func mkxBtnDriveRelay(mkx *component.Mkx, pmc *component.PlatformMkxCircuit, psd component.RelayDriveType.Get(pmc.POBJ).Td = !pobpl && pob } //PAB - if mkx.PAB != nil { + if pmc.PABJ != nil && mkx.PAB != nil { pab := component.BitStateType.Get(mkx.PAB).Val pabpl := false if mkx.PABPL != nil { @@ -121,7 +121,7 @@ func mkxBtnDriveRelay(mkx *component.Mkx, pmc *component.PlatformMkxCircuit, psd component.RelayDriveType.Get(pmc.PABJ).Td = !pabpl && pab } //WRZF - if mkx.WRZF != nil { + if pmc.WRZFJ != nil && mkx.WRZF != nil { wrzf := component.BitStateType.Get(mkx.WRZF).Val wrzfpl := false if mkx.WRZFPL != nil { @@ -130,7 +130,7 @@ func mkxBtnDriveRelay(mkx *component.Mkx, pmc *component.PlatformMkxCircuit, psd component.RelayDriveType.Get(pmc.WRZFJ).Td = !wrzfpl && wrzf } //QKQR - if mkx.QKQR != nil { + if pmc.QKQRJ != nil && mkx.QKQR != nil { qkqr := component.BitStateType.Get(mkx.QKQR).Val qkqrpl := false if mkx.QKQRPL != nil { @@ -139,11 +139,11 @@ func mkxBtnDriveRelay(mkx *component.Mkx, pmc *component.PlatformMkxCircuit, psd component.RelayDriveType.Get(pmc.QKQRJ).Td = !qkqrpl && qkqr } //MPL - if psdCircuit != nil && mkx.MPL != nil { + if psdCircuit != nil && psdCircuit.MPLJ != nil && mkx.MPL != nil { component.RelayDriveType.Get(psdCircuit.MPLJ).Td = component.BitStateType.Get(mkx.MPL).Val } //JXTCPL - if psdCircuit != nil && mkx.JXTCPL != nil { + if psdCircuit != nil && psdCircuit.JXTCPLJ != nil && mkx.JXTCPL != nil { component.RelayDriveType.Get(psdCircuit.JXTCPLJ).Td = component.BitStateType.Get(mkx.JXTCPL).Val } }