feat: predictor works
This commit is contained in:
parent
11be8f351f
commit
7a9f81e527
20 changed files with 1357 additions and 1794 deletions
|
|
@ -35,60 +35,54 @@ type PredicitonResult struct {
|
|||
// Add other result fields as needed
|
||||
}
|
||||
|
||||
// ConvertOptPredictionParameters converts ogen's OptPredictionParameters to the internal pointer-based model.
|
||||
// Returns nil if the input is not set.
|
||||
func ConvertOptPredictionParameters(opt api.OptPredictionParameters) *PredictionParameters {
|
||||
if !opt.Set {
|
||||
return nil
|
||||
}
|
||||
in := opt.Value
|
||||
// Converts flat ogen params to internal pointer-based model
|
||||
func ConvertFlatPredictionParams(params api.PerformPredictionParams) *PredictionParameters {
|
||||
out := &PredictionParameters{}
|
||||
|
||||
if v, ok := in.LaunchLatitude.Get(); ok {
|
||||
if v, ok := params.LaunchLatitude.Get(); ok {
|
||||
out.LaunchLatitude = &v
|
||||
}
|
||||
if v, ok := in.LaunchLongitude.Get(); ok {
|
||||
if v, ok := params.LaunchLongitude.Get(); ok {
|
||||
out.LaunchLongitude = &v
|
||||
}
|
||||
if v, ok := in.LaunchDatetime.Get(); ok {
|
||||
if v, ok := params.LaunchDatetime.Get(); ok {
|
||||
out.LaunchDatetime = &v
|
||||
}
|
||||
if v, ok := in.LaunchAltitude.Get(); ok {
|
||||
if v, ok := params.LaunchAltitude.Get(); ok {
|
||||
out.LaunchAltitude = &v
|
||||
}
|
||||
if v, ok := in.Profile.Get(); ok {
|
||||
if v, ok := params.Profile.Get(); ok {
|
||||
s := string(v)
|
||||
out.Profile = &s
|
||||
}
|
||||
if v, ok := in.AscentRate.Get(); ok {
|
||||
if v, ok := params.AscentRate.Get(); ok {
|
||||
out.AscentRate = &v
|
||||
}
|
||||
if v, ok := in.BurstAltitude.Get(); ok {
|
||||
if v, ok := params.BurstAltitude.Get(); ok {
|
||||
out.BurstAltitude = &v
|
||||
}
|
||||
if v, ok := in.DescentRate.Get(); ok {
|
||||
if v, ok := params.DescentRate.Get(); ok {
|
||||
out.DescentRate = &v
|
||||
}
|
||||
if v, ok := in.FloatAltitude.Get(); ok {
|
||||
if v, ok := params.FloatAltitude.Get(); ok {
|
||||
out.FloatAltitude = &v
|
||||
}
|
||||
if v, ok := in.StopDatetime.Get(); ok {
|
||||
if v, ok := params.StopDatetime.Get(); ok {
|
||||
out.StopDatetime = &v
|
||||
}
|
||||
if v, ok := in.AscentCurve.Get(); ok {
|
||||
if v, ok := params.AscentCurve.Get(); ok {
|
||||
out.AscentCurve = &v
|
||||
}
|
||||
if v, ok := in.DescentCurve.Get(); ok {
|
||||
if v, ok := params.DescentCurve.Get(); ok {
|
||||
out.DescentCurve = &v
|
||||
}
|
||||
if v, ok := in.Interpolate.Get(); ok {
|
||||
if v, ok := params.Interpolate.Get(); ok {
|
||||
out.Interpolate = &v
|
||||
}
|
||||
if v, ok := in.Format.Get(); ok {
|
||||
if v, ok := params.Format.Get(); ok {
|
||||
s := string(v)
|
||||
out.Format = &s
|
||||
}
|
||||
if v, ok := in.Dataset.Get(); ok {
|
||||
if v, ok := params.Dataset.Get(); ok {
|
||||
out.Dataset = &v
|
||||
}
|
||||
return out
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue