rts-sim-module/component/iscs_tfds.go

48 lines
1.2 KiB
Go
Raw Normal View History

2023-12-15 15:43:54 +08:00
package component
import (
"joylink.club/ecs"
)
// TFDSHost TFDS主机-与感温光纤有关状态
2023-12-19 11:11:27 +08:00
// 具体异常-异常、通信中断
2023-12-15 15:43:54 +08:00
type TFDSHost struct {
2023-12-19 11:11:27 +08:00
State TofState //一整条感温光纤状态
2023-12-15 15:43:54 +08:00
}
// TofState 一整条感温光纤状态定义
type TofState = uint8
const (
TofNormal TofState = iota //正常
TofBroken //断纤
TofFireAlarm //火警
)
/////////////////////////////////////////////////////////////////
// TofCheckPoint 分布式感温光纤上的温度检测点
2023-12-19 11:11:27 +08:00
// 具体异常-通信中断
2023-12-15 15:43:54 +08:00
// 实际上感温光纤上的每个点都可以传回温度,工程上选取每隔一段距离的来检测温度
type TofCheckPoint struct {
2023-12-19 11:11:27 +08:00
T int16 //检测点温度
State TofcpState //状态,通过检测点温度计算得到
2023-12-15 15:43:54 +08:00
}
// TofcpState 感温关系检测点状态定义
type TofcpState = uint8
const (
TofcpNormal TofcpState = iota //正常
TofcpNon //未知,当通信中断时
TofcpEarlyWarn //预警
TofcpFireAlarm //火警
)
////////////////////////////////////////////////////////////
var (
TFDSHostType = ecs.NewComponentType[TFDSHost]()
TofCheckPointType = ecs.NewComponentType[TofCheckPoint]()
)