【bug】车库门ecs系统逻辑没有对MMSJ做处理

This commit is contained in:
thesai 2024-03-27 17:11:04 +08:00
parent e1913b8f43
commit 6d5457f706

View File

@ -27,13 +27,12 @@ func (p *CkmSys) Update(world ecs.World) {
return return
} }
posCom := component.FixedPositionTransformType.Get(entry) posCom := component.FixedPositionTransformType.Get(entry)
local := false //是否本地模式
circuit := component.CkmCircuitType.Get(entry) //目前不考虑没有车库门电路的情况 circuit := component.CkmCircuitType.Get(entry) //目前不考虑没有车库门电路的情况
//车库门PSL //车库门PSL
if entry.HasComponent(component.CkmPslType) { if entry.HasComponent(component.CkmPslType) {
ckmPsl := component.CkmPslType.Get(entry) ckmPsl := component.CkmPslType.Get(entry)
component.RelayDriveType.Get(circuit.MPLJ).Td = component.BitStateType.Get(ckmPsl.MPLA).Val component.RelayDriveType.Get(circuit.MPLJ).Td = component.BitStateType.Get(ckmPsl.MPLA).Val //门旁路
local = component.BitStateType.Get(ckmPsl.MMSA).Val component.RelayDriveType.Get(circuit.MMSJ).Td = component.BitStateType.Get(ckmPsl.MMSA).Val //门模式
} }
//门开/关继电器及状态 //门开/关继电器及状态
if posCom.Pos == consts.TwoPosMin { 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) component.RelayDriveType.Get(circuit.MGZJ).Td = entry.HasComponent(component.CkmStateLossTag)
//开/关门继电器驱动状态 //开/关门继电器驱动状态
if local { if component.BitStateType.Get(circuit.MMSJ).Val {
ckmPsl := component.CkmPslType.Get(entry) ckmPsl := component.CkmPslType.Get(entry)
component.RelayDriveType.Get(circuit.KMJ).Td = component.BitStateType.Get(ckmPsl.KMA).Val component.RelayDriveType.Get(circuit.KMJ).Td = component.BitStateType.Get(ckmPsl.KMA).Val
component.RelayDriveType.Get(circuit.GMJ).Td = component.BitStateType.Get(ckmPsl.GMA).Val component.RelayDriveType.Get(circuit.GMJ).Td = component.BitStateType.Get(ckmPsl.GMA).Val