【地面设备状态组件】
This commit is contained in:
parent
c4bc8c640f
commit
5d66ac7bb5
124
component/cbtc_atp_ground.go
Normal file
124
component/cbtc_atp_ground.go
Normal file
@ -0,0 +1,124 @@
|
||||
package component
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"joylink.club/ecs"
|
||||
"joylink.club/rtsssimulation/repository/model/proto"
|
||||
)
|
||||
|
||||
// 控制模式
|
||||
type ControlMode uint8
|
||||
|
||||
const (
|
||||
ControlMode_None ControlMode = iota // 交出未被接收
|
||||
ControlMode_Center // 中控
|
||||
ControlMode_Local // 站控/自律站控
|
||||
ControlMode_Emergency // 紧急站控
|
||||
ControlMode_Interlock // 联锁控/非常站控
|
||||
)
|
||||
|
||||
// 控制模式
|
||||
type ControlState struct {
|
||||
Model ControlMode // 当前控制模式
|
||||
}
|
||||
|
||||
var ControlStateType = ecs.NewComponentType[ControlState]() // 控制模式
|
||||
|
||||
// 限速组件
|
||||
type SpeedLimit struct {
|
||||
Val float32 // 限速值
|
||||
}
|
||||
|
||||
var SpeedLimitType = ecs.NewComponentType[SpeedLimit]() // 限速组件
|
||||
|
||||
// 门状态
|
||||
type DoorStatus struct {
|
||||
Open bool // 站台门开信息
|
||||
Close bool // 站台门关信息
|
||||
Locked bool // 锁闭状态
|
||||
}
|
||||
|
||||
var DoorStatusType = ecs.NewComponentType[DoorStatus]() // 门开关闭状态组件
|
||||
|
||||
// 占用类型
|
||||
type OccupiedType uint8
|
||||
|
||||
const (
|
||||
Occupied_Ct OccupiedType = iota // 通信车占用
|
||||
Occupied_Nct // 非通信车占用
|
||||
Occupied_Fault // 故障占用
|
||||
)
|
||||
|
||||
// 占用状态
|
||||
type OccupiedStatus struct {
|
||||
Type OccupiedType
|
||||
}
|
||||
|
||||
var OccupiedStatusType = ecs.NewComponentType[OccupiedStatus]() // 占用状态组件
|
||||
|
||||
// 位置:目标位置、占用位置
|
||||
type DevicePosition struct {
|
||||
Device *ecs.Entry // 设备
|
||||
Len int64 // 占用长度
|
||||
Port proto.Port // 占用起始端口
|
||||
}
|
||||
|
||||
var DevicePositionType = ecs.NewComponentType[DevicePosition]()
|
||||
|
||||
// 进路锁闭状态
|
||||
type RouteLock struct {
|
||||
Route *ecs.Entry
|
||||
}
|
||||
|
||||
var RouteLockType = ecs.NewComponentType[RouteLock]()
|
||||
|
||||
// 故障锁闭状态
|
||||
type FaultLock struct {
|
||||
Fault any // 故障信息
|
||||
}
|
||||
|
||||
var FaultLockType = ecs.NewComponentType[FaultLock]()
|
||||
|
||||
// 封锁状态
|
||||
type BlockadeStatus struct {
|
||||
}
|
||||
|
||||
var BlockadeStatusType = ecs.NewComponentType[BlockadeStatus]() // 区段状态
|
||||
|
||||
// 站台跳停状态
|
||||
type StandSkipStatus struct {
|
||||
AllSkip bool // 全部跳停
|
||||
Trains []*ecs.Entry // 跳停列车
|
||||
}
|
||||
|
||||
var StandSkipStatusType = ecs.NewComponentType[StandSkipStatus]() // 站台跳停状态
|
||||
|
||||
// 站台停靠发车状态
|
||||
type StandParkStatus struct {
|
||||
Park bool // 列车停靠状态
|
||||
ParkTime time.Duration // 停靠时间
|
||||
Depart bool // 列车发车状态
|
||||
}
|
||||
|
||||
var StandParkStatusType = ecs.NewComponentType[StandParkStatus]() // 站台停靠发车状态
|
||||
|
||||
// 扣车状态
|
||||
type StandHoldStatus struct {
|
||||
}
|
||||
|
||||
var StandHoldStatusType = ecs.NewComponentType[StandHoldStatus]() // 站台扣车状态
|
||||
|
||||
// 站台紧急关闭状态
|
||||
type StandEmpStatus struct {
|
||||
EMPJ *ecs.Entry // 紧急关闭状态
|
||||
}
|
||||
|
||||
var StandEmpStatusType = ecs.NewComponentType[StandEmpStatus]() // 站台状态
|
||||
|
||||
// 进路状态
|
||||
type RouteStatus struct {
|
||||
StartSignal *ecs.Entry // 起始信号机
|
||||
EndSignal *ecs.Entry // 终止信号机
|
||||
Sections []*ecs.Entry // 区段列表
|
||||
}
|
Loading…
Reference in New Issue
Block a user