rts-sim-module/component/axle_section.go
2023-10-23 17:39:39 +08:00

67 lines
2.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package component
import "joylink.club/ecs"
// AxleSectionState 计轴区段状态
type AxleSectionState struct {
//true-计轴占用
Occ bool
//true-计轴出清
Clr bool
}
func NewAxleSectionState() *AxleSectionState {
return &AxleSectionState{Clr: true, Occ: false}
}
//计轴直接复位:计轴的轮对计数清零,区段转换为空闲状态
//计轴预复位:将计轴的轮对计数清零,但是区段不会立即变成空闲区段,而是处于一种“占用”状态,在压道车通过之后确认区段空闲且计轴正常后,区段转换为空闲状态
//
//当CI系统给计轴设备发送计轴直接复零/预复零命令时,连续发送一定时间(具体发送时间调试后确定)的复零/预复零命令。
//当RACRJORJT任意一个不为0时终止发送复零/预复零命令。
// AxleSectionDevice 计轴区段设备(由几个计轴检测点、一个或多个轨道区段、计轴器运算电路组成)
type AxleSectionDevice struct {
//true-计轴复位反馈,表示计轴设备已收到CI系统发送的直接复零/预复零命令。
Rac bool
//true-运营原因拒绝计轴复位,如区段空闲时下发复位命令;或车轮压住传感器时收到复位命令。
Rjo bool
//true-技术原因拒绝计轴复位,主要指计轴相关设备故障时收到复位命令如车轮传感器的导线断开、AEB之间的通信故障等
Rjt bool
//true-计轴直接复位
//计轴的轮对计数清零,区段转换为空闲状态
Drst bool
//true-计轴预复位
//将计轴的轮对计数清零,但是区段不会立即变成空闲区段,而是处于一种“占用”状态,在压道车通过之后确认区段空闲且计轴正常后,区段转换为空闲状态
Pdrst bool
}
func NewAxleSectionDevice() *AxleSectionDevice {
return &AxleSectionDevice{Rac: false, Rjo: false, Rjt: false, Drst: false, Pdrst: false}
}
// AxleSectionRuntime 计轴区段相关运算中间数据
type AxleSectionRuntime struct {
//true-计轴系统正在执行直接预复位操作
DoingPdrst bool
//true-压道车离开计轴区段
CountTrainOutPulse bool
//true-压道车进入计轴区段
CountTrainInPulse bool
//计轴区段内车轴数
Count int16
//Count变化前的数据
CountLast int16
}
func NewAxleSectionRuntime() *AxleSectionRuntime {
return &AxleSectionRuntime{DoingPdrst: false, CountTrainInPulse: false, CountTrainOutPulse: false, Count: 0, CountLast: 0}
}
var (
AxleSectionStateType = ecs.NewComponentType[AxleSectionState]()
AxleSectionDeviceType = ecs.NewComponentType[AxleSectionDevice]()
AxleSectionRuntimeType = ecs.NewComponentType[AxleSectionRuntime]()
AxleSectionTag = ecs.NewTag()
)