feat(SetBase): new parameter: Accumulation
This commit is contained in:
parent
3224e1ef0f
commit
af3b3b40f3
@ -6,6 +6,7 @@ type SetBaseOptions struct {
|
||||
Latitude *float64
|
||||
Longitude *float64
|
||||
Height *float64
|
||||
Accumulation *int
|
||||
}
|
||||
|
||||
type SetBaseOptionFunc func(opts *SetBaseOptions)
|
||||
@ -47,3 +48,9 @@ func WithBaseHeight(value float64) SetBaseOptionFunc {
|
||||
opts.Height = &value
|
||||
}
|
||||
}
|
||||
|
||||
func WithAccumulation(value int) SetBaseOptionFunc {
|
||||
return func(opts *SetBaseOptions) {
|
||||
opts.Accumulation = &value
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,10 @@ func (o *Operations) SetBase(ctx context.Context, funcs ...protocol.SetBaseOptio
|
||||
base.Mode = *opts.Mode
|
||||
}
|
||||
|
||||
if opts.Accumulation != nil {
|
||||
base.Accumulation = *opts.Accumulation
|
||||
}
|
||||
|
||||
if opts.Height != nil {
|
||||
base.Coordinates.Height = *opts.Height
|
||||
}
|
||||
@ -129,6 +133,7 @@ func (o *Operations) GetBaseInfo(ctx context.Context) (*protocol.BaseInfo, error
|
||||
Height: config.BaseMode.BaseCoordinates.Coordinates.Height,
|
||||
Latitude: config.BaseMode.BaseCoordinates.Coordinates.Latitude,
|
||||
Longitude: config.BaseMode.BaseCoordinates.Coordinates.Longitude,
|
||||
Accumulation: config.BaseMode.BaseCoordinates.Accumulation,
|
||||
}
|
||||
|
||||
return baseInfo, nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user