【bug】车库门强制开关门无效;洗车机取消故障后依然有紧急停车
This commit is contained in:
parent
4371dad391
commit
8ccd46aa6c
@ -8,6 +8,8 @@ var (
|
|||||||
CkmTag = ecs.NewTag()
|
CkmTag = ecs.NewTag()
|
||||||
CkmCircuitType = ecs.NewComponentType[CkmCircuit]()
|
CkmCircuitType = ecs.NewComponentType[CkmCircuit]()
|
||||||
CkmPslType = ecs.NewComponentType[CkmPsl]()
|
CkmPslType = ecs.NewComponentType[CkmPsl]()
|
||||||
|
CkmForceOpenTag = ecs.NewTag()
|
||||||
|
CkmForceCloseTag = ecs.NewTag()
|
||||||
)
|
)
|
||||||
|
|
||||||
type CkmCircuit struct {
|
type CkmCircuit struct {
|
||||||
|
@ -62,6 +62,16 @@ func (p *CkmSys) Update(world ecs.World) {
|
|||||||
slog.Error(err.Error())
|
slog.Error(err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//强制开门
|
||||||
|
if entry.HasComponent(component.CkmForceOpenTag) {
|
||||||
|
posCom.Pos = consts.TwoPosMax
|
||||||
|
posCom.Speed = 0
|
||||||
|
return
|
||||||
|
} else if entry.HasComponent(component.CkmForceCloseTag) {
|
||||||
|
posCom.Pos = consts.TwoPosMin
|
||||||
|
posCom.Speed = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
//驱动
|
//驱动
|
||||||
if component.BitStateType.Get(circuit.GMJ).Val {
|
if component.BitStateType.Get(circuit.GMJ).Val {
|
||||||
posCom.Speed = -component.CalculateTwoPositionAvgSpeed(3*1000, world.Tick())
|
posCom.Speed = -component.CalculateTwoPositionAvgSpeed(3*1000, world.Tick())
|
||||||
|
@ -28,6 +28,8 @@ func (x *XcjSys) Update(w ecs.World) {
|
|||||||
//紧急停车
|
//紧急停车
|
||||||
if entry.HasComponent(component.XcjFaultTag) {
|
if entry.HasComponent(component.XcjFaultTag) {
|
||||||
component.RelayDriveType.Get(circuit.JTJ).Td = true
|
component.RelayDriveType.Get(circuit.JTJ).Td = true
|
||||||
|
} else {
|
||||||
|
component.RelayDriveType.Get(circuit.JTJ).Td = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user