ISFEditorDataFlow.swift 784 B

1234567891011121314151617181920212223242526272829303132
  1. import Foundation
  2. enum ISFEditor {
  3. enum Config {}
  4. class Item: Identifiable, Hashable, Equatable {
  5. let id = UUID()
  6. var rateIndex = 0
  7. var timeIndex = 0
  8. init(rateIndex: Int, timeIndex: Int) {
  9. self.rateIndex = rateIndex
  10. self.timeIndex = timeIndex
  11. }
  12. static func == (lhs: Item, rhs: Item) -> Bool {
  13. lhs.timeIndex == rhs.timeIndex && lhs.rateIndex == rhs.rateIndex
  14. }
  15. func hash(into hasher: inout Hasher) {
  16. hasher.combine(timeIndex)
  17. hasher.combine(rateIndex)
  18. }
  19. }
  20. }
  21. protocol ISFEditorProvider: Provider {
  22. var profile: InsulinSensitivities { get }
  23. func saveProfile(_ profile: InsulinSensitivities)
  24. var autotune: Autotune? { get }
  25. }