rts-sim-module/component/signal.go

182 lines
5.1 KiB
Go
Raw Normal View History

2023-10-08 16:00:05 +08:00
package component
import "joylink.club/ecs"
2023-10-12 11:00:56 +08:00
// SignalLights 信号机灯位列表
type SignalLights struct {
Lights []*ecs.Entry
}
var SignalLightsType = ecs.NewComponentType[SignalLights]()
// GetLightByTag 根据标签获取灯位列表中的某个灯
2023-10-12 11:06:20 +08:00
func (sl *SignalLights) GetLightByTag(dTag DsTag) *ecs.Entry {
2023-10-12 11:00:56 +08:00
for _, light := range sl.Lights {
if light.HasComponent(dTag) {
return light
}
}
return nil
}
///////////////////////////////////////////////////
2023-10-11 17:11:13 +08:00
// Signal2XH1Electronic 电路状态:**信号机2XH-1(红-绿) 出段(场)信号机 或 **出站区间阻挡信号机
type Signal2XH1Electronic struct {
// 点灯继电器true-吸合,常态落下表示逻辑点灯
Z2XH1_DDJ *ecs.Entry
//灯丝继电器true-吸合
Z2XH1_DJ *ecs.Entry
//列车信号继电器true-吸合
Z2XH1_LXJ *ecs.Entry
}
2023-10-12 10:07:40 +08:00
// Signal2XH1Lsq 联锁驱
type Signal2XH1Lsq struct {
//true-联锁施加励磁电流驱动继电器DDJ
Z2XH1_DDJ_Q bool
////true-联锁施加励磁电流驱动继电器LXJ
Z2XH1_LXJ_Q bool
}
// Signal2XH1Lsc 联锁采
type Signal2XH1Lsc struct {
//true-继电器DJ吸起
Z2XH1_DJ_Xq bool
//true-继电器DDJ落下
Z2XH1_DDJ_Lx bool
//true-继电器LXJ吸起
Z2XH1_LXJ_Xq bool
}
2023-10-11 17:11:13 +08:00
var (
//Signal2XH1ElectronicType 2XH1信号机电路组件
Signal2XH1ElectronicType = ecs.NewComponentType[Signal2XH1Electronic]()
2023-10-12 10:07:40 +08:00
Signal2XH1LsqType = ecs.NewComponentType[Signal2XH1Lsq]()
Signal2XH1LscType = ecs.NewComponentType[Signal2XH1Lsc]()
2023-10-11 17:11:13 +08:00
)
/////////////////////////////////////////////////////////////////////////
2023-10-08 16:00:05 +08:00
// Signal3XH1Electronic 电路状态信号机3XH-1(红-绿-黄) 道岔防护信号机(三显示不封灯,有单黄显示、带引导)
type Signal3XH1Electronic struct {
// 点灯继电器true-吸合,常态落下表示逻辑点灯
Z3XH1_DDJ *ecs.Entry
//2DJ灯丝继电器true-吸合
Z3XH1_2DJ *ecs.Entry
//灯丝继电器true-吸合
Z3XH1_DJ *ecs.Entry
//列车信号继电器true-吸合
Z3XH1_LXJ *ecs.Entry
//引导信号继电器true-吸合
Z3XH1_YXJ *ecs.Entry
//开通正线信号继电器true-吸合
Z3XH1_ZXJ *ecs.Entry
2023-10-12 13:54:53 +08:00
}
// Signal3XH1Lsq 联锁驱
type Signal3XH1Lsq struct {
//true-联锁施加励磁电流驱动继电器DDJ
Z3XH1_DDJ_Q bool
////true-联锁施加励磁电流驱动继电器LXJ
Z3XH1_LXJ_Q bool
////true-联锁施加励磁电流驱动继电器LXJ
Z3XH1_ZXJ_Q bool
////true-联锁施加励磁电流驱动继电器LXJ
Z3XH1_YXJ_Q bool
}
// Signal3XH1Lsc 联锁采
type Signal3XH1Lsc struct {
//true-继电器DJ吸起
Z3XH1_DJ_Xq bool
//true-继电器2DJ吸起
Z3XH1_2DJ_Xq bool
//true-继电器DDJ落下
Z3XH1_DDJ_Lx bool
//true-继电器LXJ吸起
Z3XH1_LXJ_Xq bool
//true-继电器ZXJ吸起
Z3XH1_ZXJ_Xq bool
//true-继电器YXJ吸起
Z3XH1_YXJ_Xq bool
2023-10-08 16:00:05 +08:00
}
var (
Signal3XH1ElectronicType = ecs.NewComponentType[Signal3XH1Electronic]()
2023-10-12 13:54:53 +08:00
Signal3XH1LsqType = ecs.NewComponentType[Signal3XH1Lsq]()
Signal3XH1LscType = ecs.NewComponentType[Signal3XH1Lsc]()
2023-10-08 16:00:05 +08:00
)
2023-10-11 17:25:25 +08:00
/////////////////////////////////////////////////////////////////////////
// Signal3XH2Electronic 电路状态信号机3XH-2(红-绿-黄) 道岔防护信号机(三显示不封灯、无单黄显示、带引导)
// 引导信号:红黄
type Signal3XH2Electronic struct {
// 点灯继电器true-吸合,常态落下表示逻辑点灯
Z3XH2_DDJ *ecs.Entry
//2DJ灯丝继电器true-吸合
Z3XH2_2DJ *ecs.Entry
//灯丝继电器true-吸合
Z3XH2_DJ *ecs.Entry
//列车信号继电器true-吸合
Z3XH2_LXJ *ecs.Entry
//引导信号继电器true-吸合
Z3XH2_YXJ *ecs.Entry
2023-10-12 14:19:00 +08:00
}
// Signal3XH2Lsq 联锁驱
type Signal3XH2Lsq struct {
//true-联锁施加励磁电流驱动继电器DDJ
Z3XH2_DDJ_Q bool
////true-联锁施加励磁电流驱动继电器LXJ
Z3XH2_LXJ_Q bool
////true-联锁施加励磁电流驱动继电器LXJ
Z3XH2_YXJ_Q bool
}
// Signal3XH2Lsc 联锁采
type Signal3XH2Lsc struct {
//true-继电器DJ吸起
Z3XH2_DJ_Xq bool
//true-继电器2DJ吸起
Z3XH2_2DJ_Xq bool
//true-继电器DDJ落下
Z3XH2_DDJ_Lx bool
//true-继电器LXJ吸起
Z3XH2_LXJ_Xq bool
//true-继电器YXJ吸起
Z3XH2_YXJ_Xq bool
2023-10-11 17:25:25 +08:00
}
var (
Signal3XH2ElectronicType = ecs.NewComponentType[Signal3XH2Electronic]()
2023-10-12 14:19:00 +08:00
Signal3XH2LsqType = ecs.NewComponentType[Signal3XH2Lsq]()
Signal3XH2LscType = ecs.NewComponentType[Signal3XH2Lsc]()
2023-10-11 17:25:25 +08:00
)
2023-10-11 17:44:44 +08:00
//////////////////////////////////////////////////////////////////////////////
// Signal3XH3Electronic 电路状态信号机3XH-3(红-绿-黄) 道岔防护信号机(三显示封绿灯、有单黄显示、带引导)
// 引导信号:红黄
type Signal3XH3Electronic struct {
// 点灯继电器true-吸合,常态落下表示逻辑点灯
Z3XH3_DDJ *ecs.Entry
//2DJ灯丝继电器true-吸合
Z3XH3_2DJ *ecs.Entry
//灯丝继电器true-吸合
Z3XH3_DJ *ecs.Entry
//列车信号继电器true-吸合
Z3XH3_LXJ *ecs.Entry
//引导信号继电器true-吸合
Z3XH3_YXJ *ecs.Entry
// 物理黄灯true-亮
Z3XH3_U *ecs.Entry
// 物理红灯true-亮
Z3XH3_H *ecs.Entry
}
var (
Signal3XH3ElectronicType = ecs.NewComponentType[Signal3XH3Electronic]()
)