diff --git a/sys/iscs_sys/iscs_bas_electric_control_valve.go b/sys/iscs_sys/iscs_bas_electric_control_valve.go deleted file mode 100644 index c927c16..0000000 --- a/sys/iscs_sys/iscs_bas_electric_control_valve.go +++ /dev/null @@ -1,30 +0,0 @@ -package iscs_sys - -import ( - "joylink.club/ecs" - "joylink.club/ecs/filter" - "joylink.club/rtsssimulation/component" - "joylink.club/rtsssimulation/consts" -) - -// ElectricControlValveSystem 电动调节阀、电动风阀、组合式风阀、电动两通调节阀 -type ElectricControlValveSystem struct { - query *ecs.Query -} - -func NewElectricControlValveSystem() *ElectricControlValveSystem { - return &ElectricControlValveSystem{ - query: ecs.NewQuery(filter.Contains(component.ElectricControlValveType, component.TwoPositionTransformType)), - } -} -func (s *ElectricControlValveSystem) Update(w ecs.World) { - s.query.Each(w, func(entry *ecs.Entry) { - valve := component.ElectricControlValveType.Get(entry) - tps := component.TwoPositionTransformType.Get(entry) //最小表示全关,最大表示全开 - // - valve.Moving = tps.Pos > consts.TwoPosMin && tps.Pos < consts.TwoPosMax - valve.Opened = tps.Pos >= consts.TwoPosMax - valve.Closed = tps.Pos <= consts.TwoPosMin - valve.OpenRate = uint8(tps.Percentage() * 100) //xxx% - }) -} diff --git a/sys/iscs_sys/iscs_bas_fan.go b/sys/iscs_sys/iscs_bas_fan.go index 62b4d31..2c15227 100644 --- a/sys/iscs_sys/iscs_bas_fan.go +++ b/sys/iscs_sys/iscs_bas_fan.go @@ -1,32 +1 @@ package iscs_sys - -import ( - "joylink.club/ecs" - "joylink.club/ecs/filter" - "joylink.club/rtsssimulation/component" -) - -// BasFanSystem ISCS BAS 风机 -type BasFanSystem struct { - query *ecs.Query -} - -func NewBasFanSystem() *BasFanSystem { - return &BasFanSystem{ - query: ecs.NewQuery(filter.Contains(component.FanType)), - } -} -func (s *BasFanSystem) Update(w ecs.World) { - s.query.Each(w, func(entry *ecs.Entry) { - fan := component.FanType.Get(entry) - // - fanState := component.FanStateType.Get(entry) - fanState.Fc = fan.Fc - fanState.Bypass = fan.Bypass - fanState.Running = fan.Power != 0 - fanState.Forward = fan.Power > 0 - fanState.SoftStart = fan.SoftStart - fanState.HighSpeed = fanState.Running && entry.HasComponent(component.HighSpeedModeFanTag) - fanState.SlowSpeed = fanState.Running && entry.HasComponent(component.LowSpeedModeFanTag) - }) -} diff --git a/sys/iscs_sys/iscs_bas_valve.go b/sys/iscs_sys/iscs_bas_valve.go new file mode 100644 index 0000000..2c15227 --- /dev/null +++ b/sys/iscs_sys/iscs_bas_valve.go @@ -0,0 +1 @@ +package iscs_sys