StoredInsulinModel.swift 742 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // StoredInsulinModel.swift
  3. // LoopKit
  4. //
  5. // Created by Darin Krauss on 7/23/20.
  6. // Copyright © 2020 LoopKit Authors. All rights reserved.
  7. //
  8. import Foundation
  9. public struct StoredInsulinModel: Codable, Equatable {
  10. public enum ModelType: String, Codable {
  11. case fiasp
  12. case lyumjev
  13. case rapidAdult
  14. case rapidChild
  15. case walsh
  16. }
  17. public let modelType: ModelType
  18. public let actionDuration: TimeInterval
  19. public let peakActivity: TimeInterval?
  20. public init(modelType: ModelType, actionDuration: TimeInterval, peakActivity: TimeInterval? = nil) {
  21. self.modelType = modelType
  22. self.actionDuration = actionDuration
  23. self.peakActivity = peakActivity
  24. }
  25. }