rts-sim-module/component/iscs_bas_pump.go

43 lines
1.1 KiB
Go
Raw Normal View History

package component
import (
"joylink.club/ecs"
)
//水泵相关
// WaterPump 水泵
2023-12-19 11:11:27 +08:00
// 具体异常-故障、异常、通信中断
2023-12-14 13:33:18 +08:00
// 如:冷冻水泵、冷却水循环泵、超声波型水泵、浮球型水泵、火警相关水泵
type WaterPump struct {
2023-12-19 11:11:27 +08:00
Running bool //true-正常运行false-停止
}
// FloatBallSwitch 浮球控制的开关,用于浮球型水泵
// 浮球由水箱水位控制
type FloatBallSwitch struct {
On bool //true-水位超过某个限度后开关开启false-开关关闭
}
// WaterTank 水池、水箱
2023-12-19 11:11:27 +08:00
// 具体异常-通信中断
type WaterTank struct {
2023-12-19 11:11:27 +08:00
Value int32 //水位单位mm
Level WaterLevel //当前水位级别
}
// WaterLevel 水位定义
type WaterLevel = uint8
const (
WaterLevelNormal WaterLevel = iota //正常安全水位
WaterLevelHigh //水位过高
WaterLevelLow //水位过低
)
var (
WaterPumpType = ecs.NewComponentType[WaterPump]()
FloatBallSwitchType = ecs.NewComponentType[FloatBallSwitch]()
WaterTankType = ecs.NewComponentType[WaterTank]()
)