rts-sim-module/component/points.go
walker 9401b15142 组件调整
实体加载调整
继电器、断相保护器、道岔转辙机、道岔、道岔电路等系统调整
继电器、道岔对外接口调整
2024-01-12 18:20:21 +08:00

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
}