DataSourceSelectionView.swift 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // DataSourceSelectionView.swift
  3. // MinimedKitUI
  4. //
  5. // Created by Pete Schwamb on 11/30/22.
  6. // Copyright © 2022 LoopKit Authors. All rights reserved.
  7. //
  8. import SwiftUI
  9. import MinimedKit
  10. import LoopKitUI
  11. struct DataSourceSelectionView: View {
  12. @Binding var batteryType: InsulinDataSource
  13. var body: some View {
  14. VStack {
  15. List {
  16. Picker("Preferred Data Source", selection: $batteryType) {
  17. ForEach(InsulinDataSource.allCases, id: \.self) { dataSource in
  18. Text(dataSource.description)
  19. }
  20. }
  21. .pickerStyle(.inline)
  22. Section(content: {
  23. }, footer: {
  24. Text(LocalizedString("Insulin delivery can be determined from the pump by either interpreting the event history or comparing the reservoir volume over time. Reading event history allows for a more accurate status graph and uploading up-to-date treatment data to Nightscout, at the cost of faster pump battery drain and the possibility of a higher radio error rate compared to reading only reservoir volume. If the selected source cannot be used for any reason, the system will attempt to fall back to the other option.", comment: "Instructions on selecting an insulin data source"))
  25. })
  26. }
  27. }
  28. .insetGroupedListStyle()
  29. .navigationTitle(LocalizedString("Preferred Data Source", comment: "navigation title for pump battery type selection"))
  30. }
  31. }