Bläddra i källkod

remove LoopKit test

Ivan Valkou 5 år sedan
förälder
incheckning
f39b68f685

+ 0 - 4
FreeAPS.xcodeproj/project.pbxproj

@@ -77,7 +77,6 @@
 		3811DF0825CAAA4700A708ED /* ServiceContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3811DF0725CAAA4700A708ED /* ServiceContainer.swift */; };
 		3811DF0C25CAAABD00A708ED /* APSManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3811DF0B25CAAABD00A708ED /* APSManager.swift */; };
 		3811DF1025CAAAE200A708ED /* BaseAPSManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3811DF0F25CAAAE200A708ED /* BaseAPSManager.swift */; };
-		3821ED3925DC762D00BC42AD /* GlucoseRangeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3821ED3825DC762D00BC42AD /* GlucoseRangeView.swift */; };
 		3821ED4525DC785200BC42AD /* LoopKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3821ECEC25DC723100BC42AD /* LoopKit.framework */; };
 		3821ED4625DC785200BC42AD /* LoopKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3821ECEC25DC723100BC42AD /* LoopKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		3821ED4725DC785700BC42AD /* LoopKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3821ECF225DC723100BC42AD /* LoopKitUI.framework */; };
@@ -258,7 +257,6 @@
 		3811DF0B25CAAABD00A708ED /* APSManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APSManager.swift; sourceTree = "<group>"; };
 		3811DF0F25CAAAE200A708ED /* BaseAPSManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseAPSManager.swift; sourceTree = "<group>"; };
 		3821ECDE25DC723100BC42AD /* LoopKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = LoopKit.xcodeproj; path = LoopKit/LoopKit.xcodeproj; sourceTree = "<group>"; };
-		3821ED3825DC762D00BC42AD /* GlucoseRangeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlucoseRangeView.swift; sourceTree = "<group>"; };
 		383948D525CD4D8900E91849 /* FileStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileStorage.swift; sourceTree = "<group>"; };
 		383948D925CD64D500E91849 /* Glucose.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Glucose.swift; sourceTree = "<group>"; };
 		384E803325C385E60086DB71 /* JavaScriptWorker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JavaScriptWorker.swift; sourceTree = "<group>"; };
@@ -421,7 +419,6 @@
 			isa = PBXGroup;
 			children = (
 				3811DE3C25C9D4A100A708ED /* SettingsRootView.swift */,
-				3821ED3825DC762D00BC42AD /* GlucoseRangeView.swift */,
 			);
 			path = View;
 			sourceTree = "<group>";
@@ -964,7 +961,6 @@
 				3811DE1825C9D40400A708ED /* Router.swift in Sources */,
 				3811DEE825CA063400A708ED /* Injected.swift in Sources */,
 				3811DEAF25C9D88300A708ED /* KeyValueStorage.swift in Sources */,
-				3821ED3925DC762D00BC42AD /* GlucoseRangeView.swift in Sources */,
 				38FE826D25CC8461001FF17A /* NightscoutAPI.swift in Sources */,
 				3811DE4E25C9D4B800A708ED /* AuthotizedRootRootView.swift in Sources */,
 				3811DE7D25C9D6D300A708ED /* LoginRootView.swift in Sources */,

+ 0 - 36
FreeAPS/Sources/Modules/Settings/View/GlucoseRangeView.swift

@@ -1,36 +0,0 @@
-import HealthKit
-import LoopKitUI
-import SwiftUI
-
-struct GlucoseRangeView: UIViewControllerRepresentable {
-    func makeUIViewController(context _: UIViewControllerRepresentableContext<GlucoseRangeView>) -> UIViewController {
-        let unit = HKUnit.millimolesPerLiter
-        return GlucoseRangeScheduleTableViewController(allowedValues: unit.allowedCorrectionRangeValues(), unit: unit)
-    }
-
-    func updateUIViewController(
-        _: UIViewController,
-        context _: UIViewControllerRepresentableContext<GlucoseRangeView>
-    ) {}
-}
-
-extension HKUnit {
-    static let milligramsPerDeciliter: HKUnit = {
-        HKUnit.gramUnit(with: .milli).unitDivided(by: .literUnit(with: .deci))
-    }()
-
-    static let millimolesPerLiter: HKUnit = {
-        HKUnit.moleUnit(with: .milli, molarMass: HKUnitMolarMassBloodGlucose).unitDivided(by: .liter())
-    }()
-
-    func allowedCorrectionRangeValues() -> [Double] {
-        switch self {
-        case HKUnit.milligramsPerDeciliter:
-            return (60 ... 180).map { Double($0) }
-        case HKUnit.millimolesPerLiter:
-            return (33 ... 100).map { Double($0) / 10.0 }
-        default:
-            return []
-        }
-    }
-}

+ 5 - 6
FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -5,12 +5,11 @@ extension Settings {
         @EnvironmentObject var viewModel: ViewModel<Provider>
 
         var body: some View {
-//            Form {
-//                Text("Open Editor").modal(for: .configEditor, from: self)
-//                Text("Nightscout").modal(for: .nighscoutConfig, from: self)
-//            }
-            GlucoseRangeView()
-                .toolbar { ToolbarItem(placement: .principal) { Text("Settings") } }
+            Form {
+                Text("Open Editor").modal(for: .configEditor, from: self)
+                Text("Nightscout").modal(for: .nighscoutConfig, from: self)
+            }
+            .toolbar { ToolbarItem(placement: .principal) { Text("Settings") } }
         }
     }
 }