rts-sim-module/repository/sectional_curvature.go

40 lines
985 B
Go
Raw Normal View History

package repository
import "joylink.club/rtsssimulation/repository/model/proto"
type SectionalCurvature struct {
Identity
kms []*proto.Kilometer
radius int32 //半径 mm
startLinkPosition *LinkPosition
endLinkPosition *LinkPosition
}
func NewSectionalCurvature(id string, kms []*proto.Kilometer, radius int32) *SectionalCurvature {
return &SectionalCurvature{
Identity: identity{id, proto.DeviceType_DeviceType_SectionalCurvature},
kms: kms,
radius: radius,
}
}
func (s *SectionalCurvature) bindStartLinkPosition(position *LinkPosition) {
s.startLinkPosition = position
}
func (s *SectionalCurvature) bindEndLinkPosition(position *LinkPosition) {
s.endLinkPosition = position
}
func (s *SectionalCurvature) StartLinkPosition() *LinkPosition {
return s.startLinkPosition
}
func (s *SectionalCurvature) EndLinkPosition() *LinkPosition {
return s.endLinkPosition
}
func (s *SectionalCurvature) Radius() int32 {
return s.radius
}