48 lines
1.3 KiB
Go
48 lines
1.3 KiB
Go
package component
|
|
|
|
import (
|
|
"joylink.club/ecs"
|
|
"joylink.club/rtsssimulation/component/component_data"
|
|
"joylink.club/rtsssimulation/component/relation"
|
|
)
|
|
|
|
var (
|
|
// 道岔标签
|
|
PointsTag = ecs.NewTag()
|
|
// 道岔模型数据引用组件类型
|
|
PointsModelRelaType = relation.PointsModelRelaType
|
|
// 道岔转辙机关系组件类型
|
|
PointsZzjRelaType = relation.PointsZzjRelaType
|
|
// 道岔ZDJ9双机电路元器件组件类型
|
|
Zdj9TwoElectronicType = relation.Zdj9TwoElectronicType
|
|
// 道岔转辙机自动开闭器状态组件类型
|
|
PointsZzjKbqStateType = ecs.NewComponentType[component_data.PointsZzjKbqState]()
|
|
// 道岔位置组件类型
|
|
PointsPositionType = ecs.NewComponentType[component_data.PointsPosition]()
|
|
)
|
|
|
|
var (
|
|
// 失表故障
|
|
PointsFaultSbType = ecs.NewComponentType[PointsFaultSb]()
|
|
// 挤岔故障
|
|
PointsFaultJcType = ecs.NewComponentType[component_data.PointsFaultJc]()
|
|
// 联锁无法驱动故障
|
|
PointsFaultCiqdType = ecs.NewComponentType[component_data.PointsFaultCiqd]()
|
|
)
|
|
|
|
type PointsFaultSb struct {
|
|
component_data.PointsFaultSb
|
|
}
|
|
|
|
func (f *PointsFaultSb) IsAllSB() bool {
|
|
return f.Type == component_data.PointsFaultSb_ALL
|
|
}
|
|
|
|
func (f *PointsFaultSb) IsDW() bool {
|
|
return f.Type == component_data.PointsFaultSb_DW
|
|
}
|
|
|
|
func (f *PointsFaultSb) IsFW() bool {
|
|
return f.Type == component_data.PointsFaultSb_FW
|
|
}
|