diff --git a/repository/repository_manager.go b/repository/repository_manager.go index 731fc68..edec024 100644 --- a/repository/repository_manager.go +++ b/repository/repository_manager.go @@ -78,7 +78,7 @@ func buildModels(source *proto.Repository, repository *Repository) error { repository.signalMap[m.Id()] = m } for _, protoData := range source.Transponders { - m := NewTransponder(protoData.Id, protoData.Km) + m := NewTransponder(protoData.Id, protoData.Km, protoData.FixedTelegram) repository.responderMap[m.Id()] = m } for _, protoData := range source.Slopes { diff --git a/repository/transponder.go b/repository/transponder.go index b292d30..ec6a3eb 100644 --- a/repository/transponder.go +++ b/repository/transponder.go @@ -8,13 +8,15 @@ type Transponder struct { km *proto.Kilometer //section *PhysicalSection //turnoutPort TurnoutPort - linkPosition *LinkPosition + linkPosition *LinkPosition + fixedTelegram string //无源应答器固定报文 } -func NewTransponder(id string, km *proto.Kilometer) *Transponder { +func NewTransponder(id string, km *proto.Kilometer, fixedTelegram string) *Transponder { return &Transponder{ - Identity: identity{id, proto.DeviceType_DeviceType_Transponder}, - km: km, + Identity: identity{id, proto.DeviceType_DeviceType_Transponder}, + km: km, + fixedTelegram: fixedTelegram, } }