修改屏蔽门开关门过程过短的问题

This commit is contained in:
joylink_zhangsai 2024-01-18 13:58:43 +08:00
parent 896db9e6e9
commit ba95c8bdef
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ func (p *PsdSys) Update(world ecs.World) {
psdState.Close = component.BitStateType.Get(psdCircuit.MGJ).Val psdState.Close = component.BitStateType.Get(psdCircuit.MGJ).Val
} }
if psdCircuit.MPLJ != nil { if psdCircuit.MPLJ != nil {
p.exciteMPLJ(world, psdCircuit, component.UidType.Get(entry)) p.driveMPLJ(world, psdCircuit, component.UidType.Get(entry))
psc.InterlockMPL = component.BitStateType.Get(psdCircuit.MPLJ).Val psc.InterlockMPL = component.BitStateType.Get(psdCircuit.MPLJ).Val
} }
//间隙探测 //间隙探测
@ -193,7 +193,7 @@ func (p *PsdSys) isAllAsdMotorClosed(asdList *component.AsdList) bool {
return true return true
} }
func (p *PsdSys) exciteMPLJ(world ecs.World, circuit *component.PsdCircuit, uid *component.Uid) { func (p *PsdSys) driveMPLJ(world ecs.World, circuit *component.PsdCircuit, uid *component.Uid) {
data := entity.GetWorldData(world) data := entity.GetWorldData(world)
psd := data.Repo.FindPsd(uid.Id) psd := data.Repo.FindPsd(uid.Id)
platform := psd.Platform() platform := psd.Platform()

View File

@ -18,7 +18,7 @@ func NewAsdSys() *AsdSys {
} }
func (s *AsdSys) Update(world ecs.World) { func (s *AsdSys) Update(world ecs.World) {
var speed int32 = consts.TwoPosMax / 4 var speed int32 = int32(consts.TwoPosMax / (4 * 1000 / world.Tick()))
s.query.Each(world, func(entry *ecs.Entry) { s.query.Each(world, func(entry *ecs.Entry) {
//设置两位置转换速度 //设置两位置转换速度
psdMotorState := component.AsdMotorStateType.Get(entry) psdMotorState := component.AsdMotorStateType.Get(entry)