Wideband autonomous SDR analysis engine forked from sdr-visual-suite
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

37 рядки
842B

  1. package pipeline
  2. import "sdr-wideband-suite/internal/config"
  3. func ResolveProfile(cfg config.Config, name string) (config.ProfileConfig, bool) {
  4. for _, p := range cfg.Profiles {
  5. if p.Name == name {
  6. return p, true
  7. }
  8. }
  9. return config.ProfileConfig{}, false
  10. }
  11. func MergeProfile(cfg *config.Config, profile config.ProfileConfig) {
  12. if cfg == nil {
  13. return
  14. }
  15. if profile.Pipeline != nil {
  16. cfg.Pipeline = *profile.Pipeline
  17. }
  18. if profile.Surveillance != nil {
  19. cfg.Surveillance = *profile.Surveillance
  20. }
  21. if profile.Refinement != nil {
  22. cfg.Refinement = *profile.Refinement
  23. }
  24. if profile.Resources != nil {
  25. cfg.Resources = *profile.Resources
  26. }
  27. if cfg.Surveillance.AnalysisFFTSize > 0 {
  28. cfg.FFTSize = cfg.Surveillance.AnalysisFFTSize
  29. }
  30. if cfg.Surveillance.FrameRate > 0 {
  31. cfg.FrameRate = cfg.Surveillance.FrameRate
  32. }
  33. }