列车应答器天线探测轨旁应答器

This commit is contained in:
xzb 2023-11-22 18:11:03 +08:00
parent ee7492c580
commit 00fb360d81
2 changed files with 10 additions and 1 deletions

View File

@ -28,8 +28,17 @@ func (t *TrainPositionInfo) ToString() string {
// TrainBtm 列车应答器传输模块 // TrainBtm 列车应答器传输模块
type TrainBtm struct { type TrainBtm struct {
//车载应答器天线功率放大器开关true-开false-关
PowerAmplifierSwitch bool
//应答器计数(每过一个应答器加一,在同一个应答器内不变)
BaliseCounter int
//报文计数器(每解出一个应答器报文加一)
MessageCounter int
//BTM此时是否在应答器上方
AboveBalise bool
} }
var ( var (
TrainPositionInfoType = ecs.NewComponentType[TrainPositionInfo]() TrainPositionInfoType = ecs.NewComponentType[TrainPositionInfo]()
TrainBtmType = ecs.NewComponentType[TrainBtm]()
) )

View File

@ -15,7 +15,7 @@ type BaliseDetectSystem struct {
func NewBaliseDetectSystem() *BaliseDetectSystem { func NewBaliseDetectSystem() *BaliseDetectSystem {
return &BaliseDetectSystem{ return &BaliseDetectSystem{
trainQuery: ecs.NewQuery(filter.Contains(component.UidType, component.TrainPositionInfoType)), trainQuery: ecs.NewQuery(filter.Contains(component.UidType, component.TrainPositionInfoType, component.TrainBtmType)),
} }
} }
func (s *BaliseDetectSystem) Update(w ecs.World) { func (s *BaliseDetectSystem) Update(w ecs.World) {