2023-09-15 10:13:25 +08:00
|
|
|
package system
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"joylink.club/ecs"
|
|
|
|
"log"
|
|
|
|
)
|
|
|
|
|
|
|
|
type DebugSystem struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewDebugSystem() *DebugSystem {
|
|
|
|
return &DebugSystem{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update world 执行
|
|
|
|
func (debug *DebugSystem) Update(w ecs.World) {
|
|
|
|
zdj9Query.Each(w, func(entry *ecs.Entry) {
|
2023-09-21 15:34:02 +08:00
|
|
|
swId := EntityIdentityComponent.Get(entry).Id
|
|
|
|
swState := Switch2jZdj9StateComponent.Get(entry)
|
2023-09-26 15:36:09 +08:00
|
|
|
j1 := PercentageDeviceState1Component.Get(entry)
|
|
|
|
j2 := PercentageDeviceState2Component.Get(entry)
|
2023-09-15 13:07:31 +08:00
|
|
|
//log.Println(fmt.Sprintf("==>>2JZDJ9=%s QDJ=%t j1-2DQJ=%t j2-2DQJ=%t", swId, swState.J1_QDJ, swState.J1_2DQJ, swState.J2_2DQJ))
|
|
|
|
//log.Println(fmt.Sprintf("==>>2JZDJ9=%s j1-1DQJ=%t j2-1DQJ=%t", swId, swState.J1_1DQJ, swState.J2_1DQJ))
|
2023-09-26 15:36:09 +08:00
|
|
|
log.Println(fmt.Sprintf("==>>2JZDJ9=%s YCJ=%t DCJ=%t FCJ=%t j1-2DQJ=%t j2-2DQJ=%t ZDBJ=%t ZFBJ=%t j1=%d j2=%d",
|
|
|
|
swId, swState.YCJ, swState.DCJ, swState.FCJ, swState.J1_2DQJ, swState.J2_2DQJ, swState.ZDBJ, swState.ZFBJ, j1.P, j2.P))
|
2023-09-21 15:34:02 +08:00
|
|
|
|
2023-09-15 10:13:25 +08:00
|
|
|
})
|
|
|
|
}
|