diff --git a/sys/circuit_sys/ckm.go b/sys/circuit_sys/ckm.go index 184c56e..e277427 100644 --- a/sys/circuit_sys/ckm.go +++ b/sys/circuit_sys/ckm.go @@ -27,13 +27,12 @@ func (p *CkmSys) Update(world ecs.World) { return } posCom := component.FixedPositionTransformType.Get(entry) - local := false //是否本地模式 circuit := component.CkmCircuitType.Get(entry) //目前不考虑没有车库门电路的情况 //车库门PSL if entry.HasComponent(component.CkmPslType) { ckmPsl := component.CkmPslType.Get(entry) - component.RelayDriveType.Get(circuit.MPLJ).Td = component.BitStateType.Get(ckmPsl.MPLA).Val - local = component.BitStateType.Get(ckmPsl.MMSA).Val + component.RelayDriveType.Get(circuit.MPLJ).Td = component.BitStateType.Get(ckmPsl.MPLA).Val //门旁路 + component.RelayDriveType.Get(circuit.MMSJ).Td = component.BitStateType.Get(ckmPsl.MMSA).Val //门模式 } //门开/关继电器及状态 if posCom.Pos == consts.TwoPosMin { @@ -46,7 +45,7 @@ func (p *CkmSys) Update(world ecs.World) { //门故障继电器及状态 component.RelayDriveType.Get(circuit.MGZJ).Td = entry.HasComponent(component.CkmStateLossTag) //开/关门继电器驱动状态 - if local { + if component.BitStateType.Get(circuit.MMSJ).Val { ckmPsl := component.CkmPslType.Get(entry) component.RelayDriveType.Get(circuit.KMJ).Td = component.BitStateType.Get(ckmPsl.KMA).Val component.RelayDriveType.Get(circuit.GMJ).Td = component.BitStateType.Get(ckmPsl.GMA).Val