[补充]12号线联锁通信应答器数据解析;

[修改]联锁配置中的车站编号不再改为车站uid
This commit is contained in:
thesai 2024-08-08 13:23:24 +08:00
parent efa7d1655e
commit ae5ee2729e

View File

@ -25,7 +25,7 @@ func BaliseUpdateFixedTelegram(w ecs.World, id string, telegram []byte, userTele
} }
// BaliseUpdateVariableTelegram 更新可变报文 // BaliseUpdateVariableTelegram 更新可变报文
func BaliseUpdateVariableTelegram(w ecs.World, id string, telegram []byte, force bool) error { func BaliseUpdateVariableTelegram(w ecs.World, id string, telegram []byte, userTelegram []byte, force bool) error {
result := <-ecs.Request[ecs.EmptyType](w, func() ecs.Result[ecs.EmptyType] { result := <-ecs.Request[ecs.EmptyType](w, func() ecs.Result[ecs.EmptyType] {
wd := entity.GetWorldData(w) wd := entity.GetWorldData(w)
entry, ok := wd.EntityMap[id] entry, ok := wd.EntityMap[id]
@ -38,6 +38,7 @@ func BaliseUpdateVariableTelegram(w ecs.World, id string, telegram []byte, force
} }
baliseVariableTelegram := component.BaliseVariableTelegramType.Get(entry) baliseVariableTelegram := component.BaliseVariableTelegramType.Get(entry)
baliseVariableTelegram.Telegram = telegram baliseVariableTelegram.Telegram = telegram
baliseVariableTelegram.UserTelegram = userTelegram
} else { } else {
ecs.NewErrResult(fmt.Errorf("应答器[%s]无可变报文组件", id)) ecs.NewErrResult(fmt.Errorf("应答器[%s]无可变报文组件", id))
} }