95 lines
2.1 KiB
Go
95 lines
2.1 KiB
Go
package ds
|
|
|
|
import (
|
|
"time"
|
|
|
|
api "git.intra.yksa.space/gsn/predictor/pkg/rest"
|
|
)
|
|
|
|
type PredictionParameters struct {
|
|
LaunchLatitude *float64
|
|
LaunchLongitude *float64
|
|
LaunchDatetime *time.Time
|
|
LaunchAltitude *float64
|
|
Profile *string
|
|
AscentRate *float64
|
|
BurstAltitude *float64
|
|
DescentRate *float64
|
|
FloatAltitude *float64
|
|
StopDatetime *time.Time
|
|
AscentCurve *string // base64
|
|
DescentCurve *string // base64
|
|
Interpolate *bool
|
|
Format *string
|
|
Dataset *time.Time
|
|
// Add other parameters as needed
|
|
}
|
|
|
|
type PredicitonResult struct {
|
|
Latitude *float64
|
|
Longitude *float64
|
|
Altitude *float64
|
|
Timestamp *time.Time
|
|
WindU *float64
|
|
WindV *float64
|
|
// 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
|
|
out := &PredictionParameters{}
|
|
|
|
if v, ok := in.LaunchLatitude.Get(); ok {
|
|
out.LaunchLatitude = &v
|
|
}
|
|
if v, ok := in.LaunchLongitude.Get(); ok {
|
|
out.LaunchLongitude = &v
|
|
}
|
|
if v, ok := in.LaunchDatetime.Get(); ok {
|
|
out.LaunchDatetime = &v
|
|
}
|
|
if v, ok := in.LaunchAltitude.Get(); ok {
|
|
out.LaunchAltitude = &v
|
|
}
|
|
if v, ok := in.Profile.Get(); ok {
|
|
s := string(v)
|
|
out.Profile = &s
|
|
}
|
|
if v, ok := in.AscentRate.Get(); ok {
|
|
out.AscentRate = &v
|
|
}
|
|
if v, ok := in.BurstAltitude.Get(); ok {
|
|
out.BurstAltitude = &v
|
|
}
|
|
if v, ok := in.DescentRate.Get(); ok {
|
|
out.DescentRate = &v
|
|
}
|
|
if v, ok := in.FloatAltitude.Get(); ok {
|
|
out.FloatAltitude = &v
|
|
}
|
|
if v, ok := in.StopDatetime.Get(); ok {
|
|
out.StopDatetime = &v
|
|
}
|
|
if v, ok := in.AscentCurve.Get(); ok {
|
|
out.AscentCurve = &v
|
|
}
|
|
if v, ok := in.DescentCurve.Get(); ok {
|
|
out.DescentCurve = &v
|
|
}
|
|
if v, ok := in.Interpolate.Get(); ok {
|
|
out.Interpolate = &v
|
|
}
|
|
if v, ok := in.Format.Get(); ok {
|
|
s := string(v)
|
|
out.Format = &s
|
|
}
|
|
if v, ok := in.Dataset.Get(); ok {
|
|
out.Dataset = &v
|
|
}
|
|
return out
|
|
}
|