2023-12-12 13:08:37 +08:00
|
|
|
|
package component
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"joylink.club/ecs"
|
|
|
|
|
"joylink.club/rtsssimulation/consts"
|
|
|
|
|
)
|
|
|
|
|
|
2023-12-13 14:54:23 +08:00
|
|
|
|
// 阀门开关
|
|
|
|
|
|
2023-12-12 13:08:37 +08:00
|
|
|
|
// ElectricControlValve 电动调节阀
|
|
|
|
|
//
|
2023-12-13 14:54:23 +08:00
|
|
|
|
// 电动风阀、电动调节阀、组合式风阀、电动两通调节阀、电动蝶阀
|
2023-12-12 13:08:37 +08:00
|
|
|
|
type ElectricControlValve struct {
|
|
|
|
|
Opened bool //true-开到位
|
|
|
|
|
Closed bool //true-关到位
|
|
|
|
|
Moving bool //true-正在动作
|
|
|
|
|
OpenRate uint8 //开度
|
|
|
|
|
Exception consts.DeviceExceptionEnum //具体异常
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ElectricControlValveOperationTime 电动调节阀动作耗时,ms
|
|
|
|
|
const ElectricControlValveOperationTime int = 4000
|
|
|
|
|
|
2023-12-13 14:54:23 +08:00
|
|
|
|
// ControlValve 调节阀
|
|
|
|
|
type ControlValve struct {
|
|
|
|
|
OpenRate uint8 //开度,0-100%
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-12 13:08:37 +08:00
|
|
|
|
var (
|
|
|
|
|
ElectricControlValveType = ecs.NewComponentType[ElectricControlValve]()
|
|
|
|
|
|
2023-12-13 14:54:23 +08:00
|
|
|
|
ElectricAirValveTag = ecs.NewTag() //电动风阀标签
|
|
|
|
|
CombinationAirValveTag = ecs.NewTag() //组合式风阀
|
|
|
|
|
ElectricTwoWayValveTag = ecs.NewTag() //电动两通调节阀
|
|
|
|
|
ElectricButterflyValveTag = ecs.NewTag() //电动蝶阀
|
|
|
|
|
|
|
|
|
|
ControlValveType = ecs.NewComponentType[ControlValve]()
|
|
|
|
|
BypassValveSwitchTag = ecs.NewTag() //旁通阀开关(ControlValve)
|
2023-12-12 13:08:37 +08:00
|
|
|
|
)
|