balise detect 预测实现
This commit is contained in:
parent
83a5ee52e8
commit
3218fddb7d
2
third_party/can_btm/balise_btm.go
vendored
2
third_party/can_btm/balise_btm.go
vendored
@ -81,6 +81,8 @@ func Default() BtmCanetClient {
|
|||||||
}
|
}
|
||||||
return btmClient
|
return btmClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HandleTrainHeadPositionInfo 处理来自动力学的列车位置信息
|
||||||
func (s *btmCanetClient) HandleTrainHeadPositionInfo(w ecs.World, h *TrainHeadPositionInfo) {
|
func (s *btmCanetClient) HandleTrainHeadPositionInfo(w ecs.World, h *TrainHeadPositionInfo) {
|
||||||
//slog.Debug(h.String())
|
//slog.Debug(h.String())
|
||||||
wd := entity.GetWorldData(w)
|
wd := entity.GetWorldData(w)
|
||||||
|
14
third_party/can_btm/balise_detection.go
vendored
14
third_party/can_btm/balise_detection.go
vendored
@ -57,7 +57,7 @@ type BaliseDetector struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *BaliseDetector) Detect(wd *component.WorldData, repo *repository.Repository, th *TrainHeadPositionInfo) {
|
func (t *BaliseDetector) Detect(wd *component.WorldData, repo *repository.Repository, th *TrainHeadPositionInfo) {
|
||||||
if !t.powerAmplifierSwitch { //天线功率放大器未不进行探测
|
if !t.powerAmplifierSwitch { //天线功率放大器未开启,不进行探测
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
curTime := time.Now()
|
curTime := time.Now()
|
||||||
@ -144,18 +144,6 @@ func (t *BaliseDetector) DoScan() *BtmAntennaScanningBaliseInfo {
|
|||||||
}
|
}
|
||||||
return rt
|
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 {
|
func (t *BaliseDetector) timeScanNearestBalise(curTime time.Time, wd *component.WorldData, repo *repository.Repository, ba *BtmAntennaRunningInfo) *BtmAntennaScanningBaliseInfo {
|
||||||
|
Loading…
Reference in New Issue
Block a user