From ba95c8bdefed2ba5803a222c55bdd33b40e47f12 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Thu, 18 Jan 2024 13:58:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=8F=E8=94=BD=E9=97=A8?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E9=97=A8=E8=BF=87=E7=A8=8B=E8=BF=87=E7=9F=AD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sys/circuit_sys/psd.go | 4 ++-- sys/device_sys/asd.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/circuit_sys/psd.go b/sys/circuit_sys/psd.go index c9abeae..f9fd5e0 100644 --- a/sys/circuit_sys/psd.go +++ b/sys/circuit_sys/psd.go @@ -44,7 +44,7 @@ func (p *PsdSys) Update(world ecs.World) { psdState.Close = component.BitStateType.Get(psdCircuit.MGJ).Val } 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 } //间隙探测 @@ -193,7 +193,7 @@ func (p *PsdSys) isAllAsdMotorClosed(asdList *component.AsdList) bool { 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) psd := data.Repo.FindPsd(uid.Id) platform := psd.Platform() diff --git a/sys/device_sys/asd.go b/sys/device_sys/asd.go index 191c6e9..db06a0b 100644 --- a/sys/device_sys/asd.go +++ b/sys/device_sys/asd.go @@ -18,7 +18,7 @@ func NewAsdSys() *AsdSys { } 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) { //设置两位置转换速度 psdMotorState := component.AsdMotorStateType.Get(entry)