diff --git a/sys/circuit_sys/ibp.go b/sys/circuit_sys/ibp.go index f7e318f..caaab97 100644 --- a/sys/circuit_sys/ibp.go +++ b/sys/circuit_sys/ibp.go @@ -8,26 +8,30 @@ import ( // ibp 系统 type IBPSys struct { - query *ecs.Query + empQuery *ecs.Query + spksQuery *ecs.Query } // ibp盘系统 func NewIBPSys() *IBPSys { return &IBPSys{ - query: ecs.NewQuery(filter.Contains(component.SpkElectronicType, component.EmpElectronicType)), + empQuery: ecs.NewQuery(filter.Contains(component.EmpElectronicType)), + spksQuery: ecs.NewQuery(filter.Contains(component.SpkElectronicType)), } } // 控制电路更新 func (ibp *IBPSys) Update(w ecs.World) { - ibp.query.Each(w, func(entry *ecs.Entry) { - spkState := component.SpkElectronicType.Get(entry) - ibp.spkControl(entry, spkState) - ibp.spksState(entry, spkState) + ibp.empQuery.Each(w, func(entry *ecs.Entry) { empState := component.EmpElectronicType.Get(entry) ibp.empControl(entry, empState) ibp.empState(entry, empState) }) + ibp.spksQuery.Each(w, func(entry *ecs.Entry) { + spkState := component.SpkElectronicType.Get(entry) + ibp.spkControl(entry, spkState) + ibp.spksState(entry, spkState) + }) } // 人员防护继电器控制电路逻辑