balise detect 预测实现

This commit is contained in:
xzb 2023-12-05 11:24:43 +08:00
parent 83a5ee52e8
commit 3218fddb7d
2 changed files with 3 additions and 13 deletions

View File

@ -81,6 +81,8 @@ func Default() BtmCanetClient {
}
return btmClient
}
// HandleTrainHeadPositionInfo 处理来自动力学的列车位置信息
func (s *btmCanetClient) HandleTrainHeadPositionInfo(w ecs.World, h *TrainHeadPositionInfo) {
//slog.Debug(h.String())
wd := entity.GetWorldData(w)

View File

@ -57,7 +57,7 @@ type BaliseDetector struct {
}
func (t *BaliseDetector) Detect(wd *component.WorldData, repo *repository.Repository, th *TrainHeadPositionInfo) {
if !t.powerAmplifierSwitch { //天线功率放大器未不进行探测
if !t.powerAmplifierSwitch { //天线功率放大器未开启,不进行探测
return
}
curTime := time.Now()
@ -144,18 +144,6 @@ func (t *BaliseDetector) DoScan() *BtmAntennaScanningBaliseInfo {
}
return rt
}
func (t *BaliseDetector) HasBaliseBeingScan() bool {
//
t.eqLock.Lock()
defer t.eqLock.Unlock()
//
for i := 0; i < len(t.eq); i++ {
if t.eq[i] != nil && !t.eq[i].active {
return true
}
}
return false
}
// 计算列车在当前运行状态下,预测到最近一个应答器的时刻
func (t *BaliseDetector) timeScanNearestBalise(curTime time.Time, wd *component.WorldData, repo *repository.Repository, ba *BtmAntennaRunningInfo) *BtmAntennaScanningBaliseInfo {