rts-sim-module/component/iscs_tfds.go

49 lines
1.4 KiB
Go
Raw Normal View History

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