diff --git a/component/train.go b/component/train.go index 23660f2..71912a2 100644 --- a/component/train.go +++ b/component/train.go @@ -28,8 +28,17 @@ func (t *TrainPositionInfo) ToString() string { // TrainBtm 列车应答器传输模块 type TrainBtm struct { + //车载应答器天线功率放大器开关,true-开,false-关 + PowerAmplifierSwitch bool + //应答器计数(每过一个应答器加一,在同一个应答器内不变) + BaliseCounter int + //报文计数器(每解出一个应答器报文加一) + MessageCounter int + //BTM此时是否在应答器上方 + AboveBalise bool } var ( TrainPositionInfoType = ecs.NewComponentType[TrainPositionInfo]() + TrainBtmType = ecs.NewComponentType[TrainBtm]() ) diff --git a/sys/device_sys/balise_detection.go b/sys/device_sys/balise_detection.go index 16d19c6..c8a29fc 100644 --- a/sys/device_sys/balise_detection.go +++ b/sys/device_sys/balise_detection.go @@ -15,7 +15,7 @@ type BaliseDetectSystem struct { func NewBaliseDetectSystem() *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) {