From 82367536daa5eac111a82498baa969eaec581239 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 5 Dec 2023 10:57:29 +0800 Subject: [PATCH] =?UTF-8?q?balise=20detect=20=E9=A2=84=E6=B5=8B=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sys/device_sys/balise.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/device_sys/balise.go b/sys/device_sys/balise.go index eee787d..b5d389b 100644 --- a/sys/device_sys/balise.go +++ b/sys/device_sys/balise.go @@ -25,16 +25,21 @@ func (s *BaliseSystem) Update(w ecs.World) { func (s *BaliseSystem) findValidTelegram(w ecs.World, entry *ecs.Entry) []byte { wd := entity.GetWorldData(w) id := component.UidType.Get(entry).Id - if entry.HasComponent(component.BaliseFB) { + if entry.HasComponent(component.BaliseFB) { //固定应答器 baliseModel := wd.Repo.FindTransponder(id) - return baliseModel.FixedTelegram() - } else if entry.HasComponent(component.BaliseDB) { + telegram := baliseModel.FixedTelegram() + if telegram != nil { + return telegram + } else { //测试用 + return []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} + } + } else if entry.HasComponent(component.BaliseDB) { //休眠唤醒应答器 - } else if entry.HasComponent(component.BaliseIB) { + } else if entry.HasComponent(component.BaliseIB) { //预告应答器 - } else if entry.HasComponent(component.BaliseVB) { + } else if entry.HasComponent(component.BaliseVB) { //主信号应答器 - } else if entry.HasComponent(component.BaliseWB) { + } else if entry.HasComponent(component.BaliseWB) { //轮径校正应答器 } return nil