rts-sim-module/repository/transponder.go

37 lines
899 B
Go
Raw Normal View History

package repository
import "joylink.club/rtsssimulation/repository/model/proto"
type Transponder struct {
Identity
km *proto.Kilometer
//section *PhysicalSection
//turnoutPort TurnoutPort
2023-11-22 13:52:38 +08:00
linkPosition *LinkPosition
fixedTelegram string //无源应答器固定报文
}
2023-11-22 13:52:38 +08:00
func NewTransponder(id string, km *proto.Kilometer, fixedTelegram string) *Transponder {
return &Transponder{
2023-11-22 13:52:38 +08:00
Identity: identity{id, proto.DeviceType_DeviceType_Transponder},
km: km,
fixedTelegram: fixedTelegram,
}
}
func (t *Transponder) bindLinkPosition(position *LinkPosition) {
t.linkPosition = position
}
// func (r *Transponder) bindSection(section *PhysicalSection) {
// r.section = section
// }
//
// func (r *Transponder) bindTurnoutPort(turnoutPort TurnoutPort) {
// r.turnoutPort = turnoutPort
// }
func (t *Transponder) LinkPosition() *LinkPosition {
return t.linkPosition
}