ForecastResults.swift 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import Foundation
  2. struct IOBForecast {
  3. let forecasts: [Decimal] // The final, trimmed array for output
  4. let minGuardGlucose: Decimal // The absolute min of the untrimmed array
  5. let minForecastGlucose: Decimal // The min after the initial 90-min peak
  6. let maxForecastGlucose: Decimal // The absolute max of the untrimmed array
  7. let lastForecastGlucose: Decimal // The last forecast (IOBPredBG in JS)
  8. }
  9. struct COBForecast {
  10. let forecasts: [Decimal] // The final, trimmed array for output
  11. let minGuardGlucose: Decimal // The absolute min of the untrimmed array
  12. let minForecastGlucose: Decimal // The min after the initial 90-min peak
  13. let maxForecastGlucose: Decimal // The absolute max of the untrimmed array
  14. let lastForecastGlucose: Decimal // The last forecast (COBPredBG in JS)
  15. }
  16. struct UAMForecast {
  17. let forecasts: [Decimal] // The final, trimmed array for output
  18. let minGuardGlucose: Decimal // The absolute min of the untrimmed array
  19. let minForecastGlucose: Decimal // The min after the initial 60-min peak
  20. let maxForecastGlucose: Decimal // The absolute max of the untrimmed array
  21. let duration: Decimal // The calculated UAM duration in hours
  22. let lastForecastGlucose: Decimal // The last forecast (UAMPredBG in JS)
  23. }
  24. struct ZTForecast {
  25. let forecasts: [Decimal] // The final, trimmed array for output
  26. let minGuardGlucose: Decimal // The absolute min of the untrimmed array
  27. }
  28. struct IndividualForecast {
  29. let forecasts: [Decimal]
  30. let minGuardGlucose: Decimal
  31. let rawForecasts: [Decimal]
  32. let duration: Decimal? // only set by UAM
  33. }
  34. struct AllForecasts {
  35. let iob: IOBForecast
  36. let zt: ZTForecast
  37. let cob: COBForecast
  38. let uam: UAMForecast
  39. }