rts-sim-module/component/iscs.go

50 lines
1.4 KiB
Go
Raw Normal View History

2023-12-18 18:04:37 +08:00
package component
2023-12-19 11:11:27 +08:00
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/consts"
)
// DeviceException 设备异常
type DeviceException struct {
Exception consts.DeviceExceptionEnum //具体异常
}
// DevicePlacing 设备置牌
type DevicePlacing struct {
Placing consts.DevicePlacingEnum
}
2023-12-22 15:00:34 +08:00
// NetworkSwitch 交换机
// 具体异常-通信中断、异常
type NetworkSwitch struct {
Normal bool //true-正常
}
var (
NetworkSwitchType = ecs.NewComponentType[NetworkSwitch]()
)
2023-12-19 11:11:27 +08:00
var (
DeviceExceptionType = ecs.NewComponentType[DeviceException]() //设备异常组件
DevicePlacingType = ecs.NewComponentType[DevicePlacing]() //设备置牌组件
)
2023-12-18 18:04:37 +08:00
// 设备例外标签定义
var (
DeviceCommunicationInterruptTag = ecs.NewTag() //通信中断
DeviceAbnormalTag = ecs.NewTag() //异常
DeviceFaultTag = ecs.NewTag() //故障 有预告信号产生
DeviceAlarmTag = ecs.NewTag() //报警 有事故信号产生
DeviceStartTimeoutTag = ecs.NewTag() //启动超时
DeviceModuleFaultTag = ecs.NewTag() //模块故障
)
// 设备置牌标签定义
var (
DevicePlacingOverhaulCardTag = ecs.NewTag() //设备置牌:检修
DevicePlacingLandingCardTag = ecs.NewTag() //设备置牌:接地
DevicePlacingHandTag = ecs.NewTag() //设备置牌:就地(手型牌)
DevicePlacingOtherCardTag = ecs.NewTag() //设备置牌:其他
)