PumpManagerUI.swift 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // PumpManagerUI.swift
  3. // Loop
  4. //
  5. // Copyright © 2018 LoopKit Authors. All rights reserved.
  6. //
  7. import UIKit
  8. import SwiftUI
  9. import LoopKit
  10. public protocol PumpManagerUI: DeviceManagerUI, PumpManager, DeliveryLimitSettingsTableViewControllerSyncSource, BasalScheduleTableViewControllerSyncSource {
  11. // View for initial setup of device.
  12. static func setupViewController(insulinTintColor: Color, guidanceColors: GuidanceColors, allowedInsulinTypes: [InsulinType]) -> (UIViewController & PumpManagerSetupViewController & CompletionNotifying)
  13. // View for managing device after initial setup
  14. func settingsViewController(insulinTintColor: Color, guidanceColors: GuidanceColors, allowedInsulinTypes: [InsulinType]) -> (UIViewController & CompletionNotifying)
  15. // View for recovering from delivery uncertainty
  16. func deliveryUncertaintyRecoveryViewController(insulinTintColor: Color, guidanceColors: GuidanceColors) -> (UIViewController & CompletionNotifying)
  17. // Returns a class that can provide HUD views
  18. func hudProvider(insulinTintColor: Color, guidanceColors: GuidanceColors, allowedInsulinTypes: [InsulinType]) -> HUDProvider?
  19. // Instantiates HUD view (typically reservoir volume) from the raw state returned by hudViewRawState
  20. static func createHUDView(rawValue: HUDProvider.HUDViewRawState) -> LevelHUDView?
  21. }
  22. public protocol PumpManagerSetupViewController {
  23. var setupDelegate: PumpManagerSetupViewControllerDelegate? { get set }
  24. var maxBasalRateUnitsPerHour: Double? { get set }
  25. var maxBolusUnits: Double? { get set }
  26. var basalSchedule: BasalRateSchedule? { get set }
  27. }
  28. public protocol PumpManagerSetupViewControllerDelegate: AnyObject {
  29. func pumpManagerSetupViewController(_ pumpManagerSetupViewController: PumpManagerSetupViewController, didSetUpPumpManager pumpManager: PumpManagerUI)
  30. }