diff --git a/component/psd.go b/component/psd.go index ac7705c..74f765d 100644 --- a/component/psd.go +++ b/component/psd.go @@ -65,6 +65,12 @@ type AsdMotorState struct { var AsdStateType = ecs.NewComponentType[component_proto.AsdState]() +// AsdForceType ture强制开门 false强制关门 +var AsdForceType = ecs.NewComponentType[BitState]() + +// AsdHasObstacleTag 滑动门有障碍物 +var AsdHasObstacleTag = ecs.NewTag() + var PlatformMkxCircuitType = ecs.NewComponentType[PlatformMkxCircuit]() // PlatformMkxCircuit 站台门控箱电路 diff --git a/jl-ecs-go b/jl-ecs-go index 8a028e6..9c5dde7 160000 --- a/jl-ecs-go +++ b/jl-ecs-go @@ -1 +1 @@ -Subproject commit 8a028e6405150dada3caa4c90f34ebf93aef6163 +Subproject commit 9c5dde7b2ec28c555488eee7dec81bb1f612c443 diff --git a/sys/device_sys/asd.go b/sys/device_sys/asd.go index db06a0b..f0ec2a4 100644 --- a/sys/device_sys/asd.go +++ b/sys/device_sys/asd.go @@ -51,7 +51,12 @@ func (s *AsdSys) Update(world ecs.World) { } } //门关继电器状态 - psdMotorState.MG = pos == consts.TwoPosMin + if entry.HasComponent(component.AsdForceType) { + force := component.AsdForceType.Get(entry) + psdMotorState.MG = !force.Val + } else { + psdMotorState.MG = pos == consts.TwoPosMin + } asdState.Mgj = psdMotorState.MG //滑动门状态 if pos == consts.TwoPosMax {