polscm32 1 ano atrás
pai
commit
c37bc3414c

+ 0 - 23
FreeAPS/Sources/Modules/OverrideProfilesConfig/View/OverrideProfilesRootView.swift

@@ -8,20 +8,6 @@ extension OverrideProfilesConfig {
         let resolver: Resolver
 
         @StateObject var state = StateModel()
-<<<<<<< HEAD
-=======
-        @State private var isEditing = false
-        @State private var showAlert = false
-        @State private var showingDetail = false
-        @State private var selectedPreset: OverridePresets?
-        @State private var isEditSheetPresented: Bool = false
-        @State private var alertSring = ""
-        @State var isSheetPresented: Bool = false
-        @State private var originalPreset: OverridePresets?
-        @State private var showDeleteAlert = false
-        @State private var indexToDelete: Int?
-        @State private var profileNameToDelete: String = ""
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
 
         @State private var isEditing = false
         @State private var showOverrideCreationSheet = false
@@ -55,18 +41,9 @@ extension OverrideProfilesConfig {
         }
 
         @FetchRequest(
-<<<<<<< HEAD
             entity: TempTargetsSlider.entity(),
             sortDescriptors: [NSSortDescriptor(key: "date", ascending: false)]
         ) var isEnabledArray: FetchedResults<TempTargetsSlider>
-=======
-            entity: OverridePresets.entity(),
-            sortDescriptors: [NSSortDescriptor(key: "name", ascending: true)], predicate: NSPredicate(
-                format: "name != %@", "" as String
-            )
-        ) var fetchedProfiles: FetchedResults<OverridePresets>
-        var units: GlucoseUnits = .mmolL
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
 
         private var formatter: NumberFormatter {
             let formatter = NumberFormatter()

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 95
FreeAPS/Sources/Modules/PreferencesEditor/PreferencesEditorStateModel.swift


+ 0 - 9
FreeAPS/Sources/Modules/PreferencesEditor/View/PreferencesEditorRootView.swift

@@ -45,15 +45,6 @@ extension PreferencesEditor {
                         Text("mg/dL").tag(0)
                         Text("mmol/L").tag(1)
                     }
-<<<<<<< HEAD
-=======
-                    HStack {
-                        Text("Recommended Bolus Percentage")
-                        TextFieldWithToolBar(text: $state.insulinReqPercentage, placeholder: "", numberFormatter: formatter)
-                    }
-
-                    Toggle("Skip Bolus screen after carbs", isOn: $state.skipBolusScreenAfterCarbs)
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
                 }
 
                 ForEach(state.sections.indexed(), id: \.1.id) { sectionIndex, section in

+ 5 - 7
FreeAPS/Sources/Modules/PumpSettingsEditor/View/PumpSettingsEditorRootView.swift

@@ -40,14 +40,12 @@ extension PumpSettingsEditor {
                     HStack {
                         Text("Max Bolus")
                         TextFieldWithToolBar(text: $state.maxBolus, placeholder: "U", numberFormatter: formatter)
-<<<<<<< HEAD
-                    }
-                    HStack {
-                        Text("Max Carbs")
-                        TextFieldWithToolBar(text: $state.maxCarbs, placeholder: "g", numberFormatter: formatter)
-=======
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
                     }
+                    //TODO: is max carbs now somewhere else?
+//                    HStack {
+//                        Text("Max Carbs")
+//                        TextFieldWithToolBar(text: $state.maxCarbs, placeholder: "g", numberFormatter: formatter)
+//                    }
                 }
 
                 Section(header: Text("Duration of Insulin Action")) {

+ 1 - 23
FreeAPS/Sources/Modules/Settings/SettingsStateModel.swift

@@ -31,30 +31,8 @@ extension Settings {
 
             versionNumber = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
 
-<<<<<<< HEAD
-            // Read branch information from the branch.txt instead of infoDictionary
-            if let branchFileURL = Bundle.main.url(forResource: "branch", withExtension: "txt"),
-               let branchFileContent = try? String(contentsOf: branchFileURL)
-            {
-                let lines = branchFileContent.components(separatedBy: .newlines)
-                for line in lines {
-                    let components = line.components(separatedBy: "=")
-                    if components.count == 2 {
-                        let key = components[0].trimmingCharacters(in: .whitespaces)
-                        let value = components[1].trimmingCharacters(in: .whitespaces)
-
-                        if key == "BRANCH" {
-                            branch = value
-                            break
-                        }
-                    }
-                }
-            } else {
-                branch = "Unknown"
-            }
-=======
             branch = BuildDetails.default.branchAndSha
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
+
 
             copyrightNotice = Bundle.main.infoDictionary?["NSHumanReadableCopyright"] as? String ?? ""
 

+ 10 - 93
FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -33,87 +33,22 @@ extension Settings {
         var body: some View {
             Form {
                 Section {
-<<<<<<< HEAD
-                    HStack(spacing: 15) {
-                        Image(systemName: "circle")
-                            .imageScale(.small)
-                            .font(.system(size: 32))
-                            .foregroundColor(Color.green)
-                        Toggle("Closed loop", isOn: $state.closedLoop)
-                            .font(.subheadline)
-                            .foregroundStyle(.primary)
-                    }
-                } header: {
-                    Text(
-                        "iAPS v\(state.versionNumber) (\(state.buildNumber))\nBranch: \(state.branch) \(state.copyrightNotice)\nBuild Expires: \(Bundle.main.profileExpiration)"
-                    )
-                    .textCase(nil)
+                    Toggle("Closed loop", isOn: $state.closedLoop)
+                }
+                header: {
+                    Text(viewModel.headerText).textCase(nil)
                 }.listRowBackground(Color.chart)
-
+                
                 Section {
                     SettingsRowView(imageName: "chart.xyaxis.line", title: "Statistics", tint: Color.green, spacing: 10)
                         .navigationLink(to: .statistics, from: self)
                 } header: { Text("Statistics") }.listRowBackground(Color.chart)
 
                 Section {
-                    SettingsRowViewCustomImage(imageName: "pod", title: "Pump")
-                        .navigationLink(to: .pumpConfig, from: self)
-                    SettingsRowViewCustomImage(imageName: "g6", title: "CGM")
-                        .navigationLink(to: .cgm, from: self)
-                    SettingsRowView(imageName: "applewatch.watchface", title: "Watch", tint: Color.primary, spacing: 18)
-                        .navigationLink(to: .watch, from: self)
-                } header: { Text("Select Devices") }.listRowBackground(Color.chart)
-
-                Section {
-                    SettingsRowViewCustomImage(imageName: "owl", title: "Nightscout", frame: 32)
-                        .navigationLink(to: .nighscoutConfig, from: self)
-                    if HKHealthStore.isHealthDataAvailable() {
-                        SettingsRowView(imageName: "heart.circle.fill", title: "Apple Health", tint: Color.red)
-                            .navigationLink(to: .healthkit, from: self)
-                    }
-                    SettingsRowView(imageName: "message.circle.fill", title: "Notifications", tint: Color.blue)
-                        .navigationLink(to: .notificationsConfig, from: self)
-                } header: { Text("Services") }.listRowBackground(Color.chart)
-
-                Section {
-                    SettingsRowViewCustomImage(imageName: "pod", title: "Pump Settings")
-                        .navigationLink(to: .pumpSettingsEditor, from: self)
-                    SettingsRowView(imageName: "chart.bar.xaxis", title: "Basal Profile", tint: Color.insulin, spacing: 10)
-                        .navigationLink(to: .basalProfileEditor, from: self)
-                    SettingsRowView(imageName: "drop.fill", title: "Insulin Sensitivities", tint: Color.insulin, spacing: 22)
-                        .navigationLink(to: .isfEditor, from: self)
-                    SettingsRowView(imageName: "fork.knife.circle", title: "Carb Ratios", tint: Color.orange, spacing: 14)
-                        .navigationLink(to: .crEditor, from: self)
-                    SettingsRowView(imageName: "target", title: "Target Glucose", tint: Color.green, spacing: 14)
-                        .navigationLink(to: .targetsEditor, from: self)
-                } header: { Text("Configuration") }.listRowBackground(Color.chart)
-
-                Section {
-                    Text("OpenAPS").navigationLink(to: .preferencesEditor, from: self)
-                    Text("Autotune").navigationLink(to: .autotuneConfig, from: self)
-                } header: { Text("OpenAPS") }.listRowBackground(Color.chart)
-
-                Section {
-                    Text("UI/UX").navigationLink(to: .statisticsConfig, from: self)
-                    Text("App Icons").navigationLink(to: .iconConfig, from: self)
-                    Text("Bolus Calculator").navigationLink(to: .bolusCalculatorConfig, from: self)
-                    Text("Fat And Protein Conversion").navigationLink(to: .fpuConfig, from: self)
-                    Text("Dynamic ISF").navigationLink(to: .dynamicISF, from: self)
-                } header: { Text("Extra Features") }.listRowBackground(Color.chart)
-
-                Section {
-=======
-                    Toggle("Closed loop", isOn: $state.closedLoop)
-                }
-                header: {
-                    Text(viewModel.headerText).textCase(nil)
-                }
-
-                Section {
                     Text("Pump").navigationLink(to: .pumpConfig, from: self)
                     Text("CGM").navigationLink(to: .cgm, from: self)
                     Text("Watch").navigationLink(to: .watch, from: self)
-                } header: { Text("Devices") }
+                } header: { Text("Devices") }.listRowBackground(Color.chart)
 
                 Section {
                     Text("Nightscout").navigationLink(to: .nighscoutConfig, from: self)
@@ -125,12 +60,14 @@ extension Settings {
                         Text("Apple Health").navigationLink(to: .healthkit, from: self)
                     }
                     Text("Notifications").navigationLink(to: .notificationsConfig, from: self)
+                    Text("Bolus Calculator").navigationLink(to: .bolusCalculatorConfig, from: self)
                     Text("App Icons").navigationLink(to: .iconConfig, from: self)
                     Text("Statistics and Home View").navigationLink(to: .statisticsConfig, from: self)
-                } header: { Text("Services") }
+                } header: { Text("Services") }.listRowBackground(Color.chart)
 
                 Section {
                     Text("Preferences").navigationLink(to: .preferencesEditor, from: self)
+                    Text("Dynamic ISF").navigationLink(to: .dynamicISF, from: self)
                     Text("Pump Settings").navigationLink(to: .pumpSettingsEditor, from: self)
                     Text("Meal Settings").navigationLink(to: .fpuConfig, from: self)
                     Text("Basal Profile").navigationLink(to: .basalProfileEditor, from: self)
@@ -138,10 +75,9 @@ extension Settings {
                     Text("Carb Ratios").navigationLink(to: .crEditor, from: self)
                     Text("Target Glucose").navigationLink(to: .targetsEditor, from: self)
                     Text("Autotune").navigationLink(to: .autotuneConfig, from: self)
-                } header: { Text("Configuration") }
+                } header: { Text("Configuration") }.listRowBackground(Color.chart)
 
                 Section {
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
                     Toggle("Debug options", isOn: $state.debugOptions)
                     if state.debugOptions {
                         Group {
@@ -151,8 +87,6 @@ extension Settings {
                                     .frame(maxWidth: .infinity, alignment: .trailing)
                                     .buttonStyle(.borderedProminent)
                             }
-<<<<<<< HEAD
-=======
                             // Commenting this out for now, as not needed and possibly dangerous for users to be able to nuke their pump pairing informations via the debug menu
                             // Leaving it in here, as it may be a handy functionality for further testing or developers.
                             // See https://github.com/nightscout/Trio/pull/277 for more information
@@ -163,7 +97,6 @@ extension Settings {
 //                                    .frame(maxWidth: .infinity, alignment: .trailing)
 //                                    .buttonStyle(.borderedProminent)
 //                            }
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
                         }
                         Group {
                             Text("Preferences")
@@ -210,11 +143,7 @@ extension Settings {
                                 .navigationLink(to: .configEditor(file: OpenAPS.FreeAPS.settings), from: self)
                         }
                     }
-<<<<<<< HEAD
                 } header: { Text("Developer") }.listRowBackground(Color.chart)
-=======
-                } header: { Text("Developer") }
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
 
                 Section {
                     Toggle("Animated Background", isOn: $state.animatedBackground)
@@ -230,23 +159,11 @@ extension Settings {
                 .sheet(isPresented: $showShareSheet) {
                     ShareSheet(activityItems: state.logItems())
                 }
-<<<<<<< HEAD
                 .onAppear(perform: configureView)
                 .navigationTitle("Settings")
                 .navigationBarTitleDisplayMode(.large)
                 .onDisappear(perform: { state.uploadProfileAndSettings(false) })
                 .screenNavigation(self)
-=======
-            }
-            .sheet(isPresented: $showShareSheet) {
-                ShareSheet(activityItems: state.logItems())
-            }
-            .onAppear(perform: configureView)
-            .navigationTitle("Settings")
-            .navigationBarItems(leading: Button("Close", action: state.hideSettingsModal))
-            .navigationBarTitleDisplayMode(.automatic)
-            .onDisappear(perform: { state.uploadProfileAndSettings(false) })
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
         }
     }
 }

+ 0 - 6
FreeAPS/Sources/Router/Screen.swift

@@ -32,12 +32,9 @@ enum Screen: Identifiable, Hashable {
     case statistics
     case watch
     case statisticsConfig
-<<<<<<< HEAD
     case bolusCalculatorConfig
     case dynamicISF
-=======
     case calibrations
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
 
     var id: Int { String(reflecting: self).hashValue }
 }
@@ -105,15 +102,12 @@ extension Screen {
             Stat.RootView(resolver: resolver)
         case .statisticsConfig:
             StatConfig.RootView(resolver: resolver)
-<<<<<<< HEAD
         case .bolusCalculatorConfig:
             BolusCalculatorConfig.RootView(resolver: resolver)
         case .dynamicISF:
             Dynamic.RootView(resolver: resolver)
-=======
         case .calibrations:
             Calibrations.RootView(resolver: resolver)
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
         }
     }
 

+ 0 - 5
FreeAPS/Sources/Services/Calendar/CalendarManager.swift

@@ -139,7 +139,6 @@ final class BaseCalendarManager: CalendarManager, Injectable {
 
         let directionText = glucose.direction ?? "↔︎"
 
-<<<<<<< HEAD
         let deltaValue = settingsManager.settings.units == .mmolL ? Int(delta.asMmolL) : delta
         let deltaText = deltaFormatter.string(from: NSNumber(value: deltaValue)) ?? "--"
 
@@ -166,11 +165,7 @@ final class BaseCalendarManager: CalendarManager, Injectable {
         }
 
         event.title = glucoseDisplayText
-        event.notes = "iAPS"
-=======
-        event.title = title
         event.notes = "Trio"
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
         event.startDate = Date()
         event.endDate = Date(timeIntervalSinceNow: 60 * 10)
         event.calendar = calendar

+ 2 - 17
FreeAPS/Sources/Services/HealthKit/HealthKitManager.swift

@@ -19,15 +19,9 @@ protocol HealthKitManager: GlucoseSource {
     func saveIfNeeded(carbs: [CarbsEntry])
     /// Save Insulin to Health store
     func saveIfNeeded(pumpEvents events: [PumpHistoryEvent])
-<<<<<<< HEAD
-    /// Create observer for data passing beetwen Health Store and iAPS
-    func createBGObserver()
-    /// Enable background delivering objects from Apple Health to iAPS
-=======
     /// Create observer for data passing beetwen Health Store and Trio
     func createBGObserver()
     /// Enable background delivering objects from Apple Health to Trio
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
     func enableBackgroundDelivery()
     /// Delete glucose with syncID
     func deleteGlucose(syncID: String)
@@ -52,11 +46,7 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
         static let healthInsulinObject = HKObjectType.quantityType(forIdentifier: .insulinDelivery)
 
         // Meta-data key of FreeASPX data in HealthStore
-<<<<<<< HEAD
-        static let freeAPSMetaKey = "From iAPS"
-=======
         static let freeAPSMetaKey = "From Trio"
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
     }
 
     @Injected() private var glucoseStorage: GlucoseStorage!
@@ -214,11 +204,9 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
             let sampleDates = samples.map(\.startDate)
             let samplesToSave = carbsWithId
                 .filter { !sampleIDs.contains($0.id ?? "") } // id existing in AH
-<<<<<<< HEAD
-                .filter { !sampleDates.contains($0.actualDate ?? $0.createdAt) } // not id but exactly the same datetime
-=======
+//                .filter { !sampleDates.contains($0.actualDate ?? $0.createdAt) } // not id but exactly the same datetime
                 .filter { !sampleDates.contains($0.createdAt) } // not id but exactly the same datetime
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
+
                 .map {
                     HKQuantitySample(
                         type: sampleType,
@@ -636,10 +624,7 @@ final class BaseHealthKitManager: HealthKitManager, Injectable, CarbsObserver, P
                 withMetadataKey: HKMetadataKeySyncIdentifier,
                 allowedValues: ids
             )
-<<<<<<< HEAD
             print("found IDs: " + ids.description)
-=======
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
             healthKitStore.deleteObjects(of: sampleType, predicate: predicate) { _, _, error in
                 guard let error = error else { return }
                 warning(.service, "Cannot delete sample with fpuID: \(fpuID)", error: error)

+ 0 - 17
FreeAPS/Sources/Services/WatchManager/WatchManager.swift

@@ -173,13 +173,10 @@ final class BaseWatchManager: NSObject, WatchManager, Injectable {
                     self.state.bolusRecommended = self.apsManager
                         .roundBolus(amount: max(recommended, 0))
                 }
-<<<<<<< HEAD
-=======
             self.state.bolusAfterCarbs = !self.settingsManager.settings.skipBolusScreenAfterCarbs
             self.state.displayOnWatch = self.settingsManager.settings.displayOnWatch
             self.state.displayFatAndProteinOnWatch = self.settingsManager.settings.displayFatAndProteinOnWatch
             self.state.confirmBolusFaster = self.settingsManager.settings.confirmBolusFaster
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
 
                 self.state.iob = lastDetermination?.iob as? Decimal
                 self.state.cob = lastDetermination?.cob as? Decimal
@@ -374,7 +371,6 @@ extension BaseWatchManager: WCSessionDelegate {
            let protein = message["protein"] as? Double,
            carbs > 0 || fat > 0 || protein > 0
         {
-<<<<<<< HEAD
             Task {
                 await carbsStorage.storeCarbs(
                     [CarbsEntry(
@@ -390,19 +386,6 @@ extension BaseWatchManager: WCSessionDelegate {
                         fpuID: nil
                     )]
                 )
-=======
-            carbsStorage.storeCarbs(
-                [CarbsEntry(
-                    id: UUID().uuidString,
-                    createdAt: Date.now,
-                    carbs: Decimal(carbs),
-                    fat: Decimal(fat),
-                    protein: Decimal(protein), note: nil,
-                    enteredBy: CarbsEntry.manual,
-                    isFPU: false, fpuID: nil
-                )]
-            )
->>>>>>> 9672da256c317a314acc76d6e4f6e82cc174d133
 
                 if settingsManager.settings.skipBolusScreenAfterCarbs {
                     let success = await apsManager.determineBasal()