26 lines
778 B
Go
26 lines
778 B
Go
package component
|
||
|
||
import (
|
||
"joylink.club/ecs"
|
||
)
|
||
|
||
// Valve 阀门开关(电动调节阀、电动风阀、组合式风阀、电动蝶阀)
|
||
type Valve struct {
|
||
Opened bool //true-开到位(全开)
|
||
Closed bool //true-关到位(全关)
|
||
Moving bool //true-正在动作
|
||
OpenRate uint8 //开度,0-100%
|
||
}
|
||
type ValveController struct {
|
||
TargetOpenRate uint8 //目标开度,0-100%
|
||
}
|
||
|
||
var (
|
||
ValveType = ecs.NewComponentType[Valve]() //阀门(开关)
|
||
ValveControllerType = ecs.NewComponentType[ValveController]()
|
||
ElectricControlValveTag = ecs.NewTag() //电动调节阀
|
||
ElectricAirValveTag = ecs.NewTag() //电动风阀
|
||
CombinationAirValveTag = ecs.NewTag() //组合式风阀
|
||
ElectricButterflyValveTag = ecs.NewTag() //电动蝶阀
|
||
)
|