rts-sim-module/component/iscs_bas_valve.go

40 lines
1.2 KiB
Go
Raw Normal View History

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