Przeglądaj źródła

remove autotune

polscm32 aka Marvout 1 rok temu
rodzic
commit
bc90acfa3d
38 zmienionych plików z 52 dodań i 725 usunięć
  1. 1 38
      FreeAPS.xcodeproj/project.pbxproj
  2. 0 2
      FreeAPS/Resources/json/defaults/freeaps/freeaps_settings.json
  3. 0 1
      FreeAPS/Resources/json/defaults/preferences.json
  4. 3 40
      FreeAPS/Sources/APS/APSManager.swift
  5. 5 126
      FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift
  6. 0 17
      FreeAPS/Sources/Models/Autotune.swift
  7. 0 7
      FreeAPS/Sources/Models/DecimalPickerSettings.swift
  8. 0 10
      FreeAPS/Sources/Models/FreeAPSSettings.swift
  9. 0 6
      FreeAPS/Sources/Models/Preferences.swift
  10. 0 3
      FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/AlgorithmAdvancedSettingsStateModel.swift
  11. 0 27
      FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/View/AlgorithmAdvancedSettingsRootView.swift
  12. 0 10
      FreeAPS/Sources/Modules/AutotuneConfig/AutotuneConfigDataFlow.swift
  13. 0 15
      FreeAPS/Sources/Modules/AutotuneConfig/AutotuneConfigProvider.swift
  14. 0 113
      FreeAPS/Sources/Modules/AutotuneConfig/AutotuneConfigStateModel.swift
  15. 0 198
      FreeAPS/Sources/Modules/AutotuneConfig/View/AutotuneConfigRootView.swift
  16. 0 1
      FreeAPS/Sources/Modules/CarbRatioEditor/CarbRatioEditorDataFlow.swift
  17. 0 4
      FreeAPS/Sources/Modules/CarbRatioEditor/CarbRatioEditorProvider.swift
  18. 0 3
      FreeAPS/Sources/Modules/CarbRatioEditor/CarbRatioEditorStateModel.swift
  19. 0 11
      FreeAPS/Sources/Modules/CarbRatioEditor/View/CarbRatioEditorRootView.swift
  20. 1 2
      FreeAPS/Sources/Modules/Home/HomeDataFlow.swift
  21. 4 9
      FreeAPS/Sources/Modules/Home/HomeProvider.swift
  22. 8 8
      FreeAPS/Sources/Modules/Home/HomeStateModel.swift
  23. 6 16
      FreeAPS/Sources/Modules/Home/View/Chart/ChartElements/BasalChart.swift
  24. 1 1
      FreeAPS/Sources/Modules/Home/View/HomeRootView.swift
  25. 0 1
      FreeAPS/Sources/Modules/ISFEditor/ISFEditorDataFlow.swift
  26. 0 4
      FreeAPS/Sources/Modules/ISFEditor/ISFEditorProvider.swift
  27. 0 3
      FreeAPS/Sources/Modules/ISFEditor/ISFEditorStateModel.swift
  28. 0 14
      FreeAPS/Sources/Modules/ISFEditor/View/ISFEditorRootView.swift
  29. 1 1
      FreeAPS/Sources/Modules/PumpConfig/PumpConfigDataFlow.swift
  30. 4 3
      FreeAPS/Sources/Modules/PumpConfig/PumpConfigProvider.swift
  31. 15 11
      FreeAPS/Sources/Modules/PumpConfig/PumpConfigStateModel.swift
  32. 0 2
      FreeAPS/Sources/Modules/Settings/SettingItems.swift
  33. 0 2
      FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift
  34. 0 8
      FreeAPS/Sources/Modules/Settings/View/Subviews/FeatureSettingsView.swift
  35. 0 3
      FreeAPS/Sources/Router/Screen.swift
  36. 2 2
      FreeAPS/Sources/Services/Network/Nightscout/NightscoutManager.swift
  37. 0 2
      FreeAPS/Sources/Views/SettingInputSection.swift
  38. 1 1
      FreeAPS/Sources/Views/TagCloudView.swift

+ 1 - 38
FreeAPS.xcodeproj/project.pbxproj

@@ -64,7 +64,6 @@
 		1BBB001DAD60F3B8CEA4B1C7 /* ISFEditorStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505E09DC17A0C3D0AF4B66FE /* ISFEditorStateModel.swift */; };
 		1D845DF2E3324130E1D95E67 /* DataTableProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60744C3E9BB3652895C908CC /* DataTableProvider.swift */; };
 		23888883D4EA091C88480FF2 /* TreatmentsProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = C19984D62EFC0035A9E9644D /* TreatmentsProvider.swift */; };
-		3083261C4B268E353F36CD0B /* AutotuneConfigDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DCCCCE633F5E98E41B0CD3C /* AutotuneConfigDataFlow.swift */; };
 		3171D2818C7C72CD1584BB5E /* GlucoseNotificationSettingsStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC2C6489D29ECCCAD78E0721 /* GlucoseNotificationSettingsStateModel.swift */; };
 		320D030F724170A637F06D50 /* (null) in Sources */ = {isa = PBXBuildFile; };
 		3811DE0B25C9D32F00A708ED /* BaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3811DE0725C9D32E00A708ED /* BaseView.swift */; };
@@ -143,7 +142,6 @@
 		389A572026079BAA00BC102F /* Interpolation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 389A571F26079BAA00BC102F /* Interpolation.swift */; };
 		389ECDFE2601061500D86C4F /* View+Snapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 389ECDFD2601061500D86C4F /* View+Snapshot.swift */; };
 		389ECE052601144100D86C4F /* ConcurrentMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 389ECE042601144100D86C4F /* ConcurrentMap.swift */; };
-		38A00B1F25FC00F7006BC0B0 /* Autotune.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38A00B1E25FC00F7006BC0B0 /* Autotune.swift */; };
 		38A00B2325FC2B55006BC0B0 /* LRUCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38A00B2225FC2B55006BC0B0 /* LRUCache.swift */; };
 		38A0363B25ECF07E00FCBB52 /* GlucoseStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38A0363A25ECF07E00FCBB52 /* GlucoseStorage.swift */; };
 		38A0364225ED069400FCBB52 /* TempBasal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38A0364125ED069400FCBB52 /* TempBasal.swift */; };
@@ -309,12 +307,10 @@
 		7F7B756BE8543965D9FDF1A2 /* DataTableDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A401509D21F7F35D4E109EDA /* DataTableDataFlow.swift */; };
 		8194B80890CDD6A3C13B0FEE /* SnoozeStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = E26904AACA8D9C15D229D675 /* SnoozeStateModel.swift */; };
 		88AB39B23C9552BD6E0C9461 /* ISFEditorRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBB3BAE7494CB771ABAC7B8B /* ISFEditorRootView.swift */; };
-		891DECF7BC20968D7F566161 /* AutotuneConfigProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5EF98E22A39CD656A230704 /* AutotuneConfigProvider.swift */; };
 		8B759CFCF47B392BB365C251 /* BasalProfileEditorDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67F94DD2853CF42BA4E30616 /* BasalProfileEditorDataFlow.swift */; };
 		9702FF92A09C53942F20D7EA /* TargetsEditorRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DD795BA46B193644D48138C /* TargetsEditorRootView.swift */; };
 		9825E5E923F0B8FA80C8C7C7 /* NightscoutConfigStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0A48AE3AC813A49A517846A /* NightscoutConfigStateModel.swift */; };
 		98641AF4F92123DA668AB931 /* CarbRatioEditorRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0BDC6993C1087310EDFC428 /* CarbRatioEditorRootView.swift */; };
-		A05235B9112E677ED03B6E8E /* AutotuneConfigRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CF5ACEE1F0859670E71B2C0 /* AutotuneConfigRootView.swift */; };
 		A33352ED40476125EBAC6EE0 /* CarbRatioEditorDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E22146D3DF4853786C78132 /* CarbRatioEditorDataFlow.swift */; };
 		AD3D2CD42CD01B9EB8F26522 /* PumpConfigDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF65DA88F972B56090AD6AC3 /* PumpConfigDataFlow.swift */; };
 		B7C465E9472624D8A2BE2A6A /* (null) in Sources */ = {isa = PBXBuildFile; };
@@ -422,7 +418,6 @@
 		CEE9A65E2BBC9F6500EB5194 /* CalibrationsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEE9A65D2BBC9F6500EB5194 /* CalibrationsTests.swift */; };
 		D6D02515BBFBE64FEBE89856 /* DataTableRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 881E04BA5E0A003DE8E0A9C6 /* DataTableRootView.swift */; };
 		D6DEC113821A7F1056C4AA1E /* NightscoutConfigDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F2A13DF0EDEEEDC4106AA2A /* NightscoutConfigDataFlow.swift */; };
-		D76333C9256787610B3B4875 /* AutotuneConfigStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D295A3F870E826BE371C0BB5 /* AutotuneConfigStateModel.swift */; };
 		DBA5254DBB2586C98F61220C /* ISFEditorProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9F137F126D9F8DEB799F26 /* ISFEditorProvider.swift */; };
 		DD07CA142CE80B73002D45A9 /* TimeInRangeChartStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD07CA132CE80B73002D45A9 /* TimeInRangeChartStyle.swift */; };
 		DD09D47B2C5986D1003FEA5D /* CalendarEventSettingsDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD09D47A2C5986D1003FEA5D /* CalendarEventSettingsDataFlow.swift */; };
@@ -841,7 +836,6 @@
 		389A571F26079BAA00BC102F /* Interpolation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Interpolation.swift; sourceTree = "<group>"; };
 		389ECDFD2601061500D86C4F /* View+Snapshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Snapshot.swift"; sourceTree = "<group>"; };
 		389ECE042601144100D86C4F /* ConcurrentMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConcurrentMap.swift; sourceTree = "<group>"; };
-		38A00B1E25FC00F7006BC0B0 /* Autotune.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Autotune.swift; sourceTree = "<group>"; };
 		38A00B2225FC2B55006BC0B0 /* LRUCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LRUCache.swift; sourceTree = "<group>"; };
 		38A0363A25ECF07E00FCBB52 /* GlucoseStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlucoseStorage.swift; sourceTree = "<group>"; };
 		38A0364125ED069400FCBB52 /* TempBasal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TempBasal.swift; sourceTree = "<group>"; };
@@ -1007,8 +1001,6 @@
 		7E22146D3DF4853786C78132 /* CarbRatioEditorDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CarbRatioEditorDataFlow.swift; sourceTree = "<group>"; };
 		8782B44544F38F2B2D82C38E /* NightscoutConfigRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NightscoutConfigRootView.swift; sourceTree = "<group>"; };
 		881E04BA5E0A003DE8E0A9C6 /* DataTableRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DataTableRootView.swift; sourceTree = "<group>"; };
-		8CF5ACEE1F0859670E71B2C0 /* AutotuneConfigRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AutotuneConfigRootView.swift; sourceTree = "<group>"; };
-		8DCCCCE633F5E98E41B0CD3C /* AutotuneConfigDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AutotuneConfigDataFlow.swift; sourceTree = "<group>"; };
 		920DDB21E5D0EB813197500D /* ConfigEditorRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ConfigEditorRootView.swift; sourceTree = "<group>"; };
 		9455FA2D92E77A6C4AFED8A3 /* DataTableStateModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DataTableStateModel.swift; sourceTree = "<group>"; };
 		96653287EDB276A111288305 /* ManualTempBasalDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ManualTempBasalDataFlow.swift; sourceTree = "<group>"; };
@@ -1020,7 +1012,6 @@
 		AAFF91130F2FCCC7EBBA11AD /* BasalProfileEditorStateModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BasalProfileEditorStateModel.swift; sourceTree = "<group>"; };
 		AF65DA88F972B56090AD6AC3 /* PumpConfigDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PumpConfigDataFlow.swift; sourceTree = "<group>"; };
 		B5822B15939E719628E9FF7C /* SnoozeRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SnoozeRootView.swift; sourceTree = "<group>"; };
-		B5EF98E22A39CD656A230704 /* AutotuneConfigProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AutotuneConfigProvider.swift; sourceTree = "<group>"; };
 		B9B5C0607505A38F256BF99A /* CGMDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CGMDataFlow.swift; sourceTree = "<group>"; };
 		B9CAAEFB2AE70836000F68BC /* branch.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = branch.txt; sourceTree = SOURCE_ROOT; };
 		BA49538D56989D8DA6FCF538 /* TargetsEditorDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TargetsEditorDataFlow.swift; sourceTree = "<group>"; };
@@ -1062,9 +1053,8 @@
 		BDF530D72B40F8AC002CAF43 /* LockScreenView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LockScreenView.swift; sourceTree = "<group>"; };
 		BDFD16592AE40438007F0DDA /* TreatmentsRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreatmentsRootView.swift; sourceTree = "<group>"; };
 		BF8BCB0C37DEB5EC377B9612 /* BasalProfileEditorRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BasalProfileEditorRootView.swift; sourceTree = "<group>"; };
-		C19984D62EFC0035A9E9644D /* BolusProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BolusProvider.swift; sourceTree = "<group>"; };
-		C2A0A42E2CE0312C003B98E8 /* ConstantValues.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstantValues.swift; sourceTree = "<group>"; };
 		C19984D62EFC0035A9E9644D /* TreatmentsProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TreatmentsProvider.swift; sourceTree = "<group>"; };
+		C2A0A42E2CE0312C003B98E8 /* ConstantValues.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstantValues.swift; sourceTree = "<group>"; };
 		C377490C77661D75E8C50649 /* ManualTempBasalRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ManualTempBasalRootView.swift; sourceTree = "<group>"; };
 		C8D1A7CA8C10C4403D4BBFA7 /* TreatmentsDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TreatmentsDataFlow.swift; sourceTree = "<group>"; };
 		CC6C406D2ACDD69E009B8058 /* RawFetchedProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RawFetchedProfile.swift; sourceTree = "<group>"; };
@@ -1128,7 +1118,6 @@
 		CEE9A65D2BBC9F6500EB5194 /* CalibrationsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalibrationsTests.swift; sourceTree = "<group>"; };
 		CFCFE0781F9074C2917890E8 /* ManualTempBasalStateModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ManualTempBasalStateModel.swift; sourceTree = "<group>"; };
 		D0BDC6993C1087310EDFC428 /* CarbRatioEditorRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CarbRatioEditorRootView.swift; sourceTree = "<group>"; };
-		D295A3F870E826BE371C0BB5 /* AutotuneConfigStateModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AutotuneConfigStateModel.swift; sourceTree = "<group>"; };
 		DC2C6489D29ECCCAD78E0721 /* GlucoseNotificationSettingsStateModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GlucoseNotificationSettingsStateModel.swift; sourceTree = "<group>"; };
 		DD07CA132CE80B73002D45A9 /* TimeInRangeChartStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeInRangeChartStyle.swift; sourceTree = "<group>"; };
 		DD09D47A2C5986D1003FEA5D /* CalendarEventSettingsDataFlow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarEventSettingsDataFlow.swift; sourceTree = "<group>"; };
@@ -1558,7 +1547,6 @@
 				DDD163032C4C67B400CD525A /* Adjustments */,
 				DD1745382C55BF8B00211FAC /* AlgorithmAdvancedSettings */,
 				DD1745422C55C5C400211FAC /* AutosensSettings */,
-				672F63EEAE27400625E14BAD /* AutotuneConfig */,
 				A42F1FEDFFD0DDE00AAD54D3 /* BasalProfileEditor */,
 				3811DE0425C9D32E00A708ED /* Base */,
 				BD7DA9A32AE06DBA00601B20 /* BolusCalculatorConfig */,
@@ -2002,7 +1990,6 @@
 				DD6D67E32C9C253500660C9B /* ColorSchemeOption.swift */,
 				385CEAC025F2EA52002D6D5B /* Announcement.swift */,
 				388E5A5F25B6F2310019842D /* Autosens.swift */,
-				38A00B1E25FC00F7006BC0B0 /* Autotune.swift */,
 				388358C725EEF6D200E024B2 /* BasalProfileEntry.swift */,
 				38D0B3B525EBE24900CB6E88 /* Battery.swift */,
 				382C134A25F14E3700715CE1 /* BGTargets.swift */,
@@ -2331,14 +2318,6 @@
 			path = View;
 			sourceTree = "<group>";
 		};
-		55DE731ACE8289FAF3819077 /* View */ = {
-			isa = PBXGroup;
-			children = (
-				8CF5ACEE1F0859670E71B2C0 /* AutotuneConfigRootView.swift */,
-			);
-			path = View;
-			sourceTree = "<group>";
-		};
 		5825D1622BD405AE00F36E9B /* Helper */ = {
 			isa = PBXGroup;
 			children = (
@@ -2401,17 +2380,6 @@
 			path = TargetsEditor;
 			sourceTree = "<group>";
 		};
-		672F63EEAE27400625E14BAD /* AutotuneConfig */ = {
-			isa = PBXGroup;
-			children = (
-				8DCCCCE633F5E98E41B0CD3C /* AutotuneConfigDataFlow.swift */,
-				B5EF98E22A39CD656A230704 /* AutotuneConfigProvider.swift */,
-				D295A3F870E826BE371C0BB5 /* AutotuneConfigStateModel.swift */,
-				55DE731ACE8289FAF3819077 /* View */,
-			);
-			path = AutotuneConfig;
-			sourceTree = "<group>";
-		};
 		6B1A8D1C2B14D91600E76752 /* LiveActivity */ = {
 			isa = PBXGroup;
 			children = (
@@ -3802,7 +3770,6 @@
 				DDD163162C4C690300CD525A /* AdjustmentsDataFlow.swift in Sources */,
 				BDF34F932C10D0E100D51995 /* LiveActivityAttributes+Helper.swift in Sources */,
 				E0D4F80527513ECF00BDF1FE /* HealthKitSample.swift in Sources */,
-				38A00B1F25FC00F7006BC0B0 /* Autotune.swift in Sources */,
 				38AAF85525FFF846004AF583 /* CurrentGlucoseView.swift in Sources */,
 				041D1E995A6AE92E9289DC49 /* TreatmentsDataFlow.swift in Sources */,
 				DD32CF9E2CC824C5003686D6 /* TrioRemoteControl+Override.swift in Sources */,
@@ -3833,11 +3800,7 @@
 				38E44534274E411700EC9A94 /* Disk+InternalHelpers.swift in Sources */,
 				38A00B2325FC2B55006BC0B0 /* LRUCache.swift in Sources */,
 				DDD163122C4C689900CD525A /* AdjustmentsStateModel.swift in Sources */,
-				3083261C4B268E353F36CD0B /* AutotuneConfigDataFlow.swift in Sources */,
 				DD1745132C54169400211FAC /* DevicesView.swift in Sources */,
-				891DECF7BC20968D7F566161 /* AutotuneConfigProvider.swift in Sources */,
-				D76333C9256787610B3B4875 /* AutotuneConfigStateModel.swift in Sources */,
-				A05235B9112E677ED03B6E8E /* AutotuneConfigRootView.swift in Sources */,
 				7F7B756BE8543965D9FDF1A2 /* DataTableDataFlow.swift in Sources */,
 				1D845DF2E3324130E1D95E67 /* DataTableProvider.swift in Sources */,
 				19F95FFA29F1102A00314DDC /* StatRootView.swift in Sources */,

+ 0 - 2
FreeAPS/Resources/json/defaults/freeaps/freeaps_settings.json

@@ -2,8 +2,6 @@
   "units" : "mg/dL",
   "closedLoop" : false,
   "allowAnnouncements" : false,
-  "useAutotune" : false,
-  "onlyAutotuneBasals" : false,
   "isUploadEnabled" : false,
   "isDownloadEnabled" : false,
   "useLocalGlucoseSource" : false,

+ 0 - 1
FreeAPS/Resources/json/defaults/preferences.json

@@ -18,7 +18,6 @@
   "skip_neutral_temps" : false,
   "unsuspend_if_no_temp" : false,
   "min_5m_carbimpact" : 8,
-  "autotune_isf_adjustmentFraction" : 1,
   "remainingCarbsFraction" : 1,
   "remainingCarbsCap" : 90,
   "enableUAM" : false,

+ 3 - 40
FreeAPS/Sources/APS/APSManager.swift

@@ -8,7 +8,6 @@ import Swinject
 
 protocol APSManager {
     func heartbeat(date: Date)
-    func autotune() async -> Autotune?
     func enactBolus(amount: Double, isSMB: Bool) async
     var pumpManager: PumpManagerUI? { get set }
     var bluetoothManager: BluetoothStateManager? { get }
@@ -21,7 +20,6 @@ protocol APSManager {
     var pumpExpiresAtDate: CurrentValueSubject<Date?, Never> { get }
     var isManualTempBasal: Bool { get }
     func enactTempBasal(rate: Double, duration: TimeInterval) async
-    func makeProfiles() async throws -> Bool
     func determineBasal() async -> Bool
     func determineBasalSync() async
     func simulateDetermineBasal(carbs: Decimal, iob: Decimal) async -> Determination?
@@ -70,7 +68,6 @@ final class BaseAPSManager: APSManager, Injectable {
     @Injected() private var nightscout: NightscoutManager!
     @Injected() private var settingsManager: SettingsManager!
     @Injected() private var broadcaster: Broadcaster!
-    @Persisted(key: "lastAutotuneDate") private var lastAutotuneDate = Date()
     @Persisted(key: "lastLoopStartDate") private var lastLoopStartDate: Date = .distantPast
     @Persisted(key: "lastLoopDate") var lastLoopDate: Date = .distantPast {
         didSet {
@@ -135,7 +132,7 @@ final class BaseAPSManager: APSManager, Injectable {
             let wasParsed = storage.parseOnFileSettingsToMgdL()
             if wasParsed {
                 Task {
-                    try await makeProfiles()
+                    await openAPS.createInitialProfiles()
                 }
             }
         }
@@ -391,11 +388,9 @@ final class BaseAPSManager: APSManager, Injectable {
             let now = Date()
 
             // Start fetching asynchronously
-            let (currentTemp, _, _, _) = try await (
+            let (currentTemp, _) = try await (
                 fetchCurrentTempBasal(date: now),
-                makeProfiles(),
-                autosense(),
-                dailyAutotune()
+                autosense()
             )
 
             // Determine basal using the fetched temp and current time
@@ -433,18 +428,6 @@ final class BaseAPSManager: APSManager, Injectable {
         }
     }
 
-    func makeProfiles() async throws -> Bool {
-        let tunedProfile = await openAPS.makeProfiles(useAutotune: settings.useAutotune)
-        if let basalProfile = tunedProfile?.basalProfile {
-            processQueue.async {
-                self.broadcaster.notify(BasalProfileObserver.self, on: self.processQueue) {
-                    $0.basalProfileDidChange(basalProfile)
-                }
-            }
-        }
-        return tunedProfile != nil
-    }
-
     func roundBolus(amount: Decimal) -> Decimal {
         guard let pump = pumpManager else { return amount }
         let rounded = Decimal(pump.roundToSupportedBolusVolume(units: Double(amount)))
@@ -537,26 +520,6 @@ final class BaseAPSManager: APSManager, Injectable {
         }
     }
 
-    func dailyAutotune() async throws -> Bool {
-        guard settings.useAutotune else {
-            return false
-        }
-
-        let now = Date()
-
-        guard lastAutotuneDate.isBeforeDate(now, granularity: .day) else {
-            return false
-        }
-        lastAutotuneDate = now
-
-        let result = await autotune()
-        return result != nil
-    }
-
-    func autotune() async -> Autotune? {
-        await openAPS.autotune()
-    }
-
     func enactAnnouncement(_ announcement: Announcement) {
         guard let action = announcement.action else {
             warning(.apsManager, "Invalid Announcement action")

+ 5 - 126
FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift

@@ -462,66 +462,8 @@ final class OpenAPS {
         }
     }
 
-    func autotune(categorizeUamAsBasal: Bool = false, tuneInsulinCurve: Bool = false) async -> Autotune? {
-        debug(.openAPS, "Start autotune")
-
-        // Perform asynchronous calls in parallel
-        async let pumpHistoryObjectIDs = fetchPumpHistoryObjectIDs() ?? []
-        async let carbs = fetchAndProcessCarbs()
-        async let glucose = fetchAndProcessGlucose()
-        async let getProfile = loadFileFromStorageAsync(name: Settings.profile)
-        async let getPumpProfile = loadFileFromStorageAsync(name: Settings.pumpProfile)
-        async let getPreviousAutotune = storage.retrieveAsync(Settings.autotune, as: RawJSON.self)
-
-        // Await the results of asynchronous tasks
-        let (pumpHistoryJSON, carbsAsJSON, glucoseAsJSON, profile, pumpProfile, previousAutotune) = await (
-            parsePumpHistory(await pumpHistoryObjectIDs),
-            carbs,
-            glucose,
-            getProfile,
-            getPumpProfile,
-            getPreviousAutotune
-        )
-
-        // Error need to be handled here because the function is not declared as throws
-        do {
-            // Autotune Prepare
-            let autotunePreppedGlucose = try await autotunePrepare(
-                pumphistory: pumpHistoryJSON,
-                profile: profile,
-                glucose: glucoseAsJSON,
-                pumpprofile: pumpProfile,
-                carbs: carbsAsJSON,
-                categorizeUamAsBasal: categorizeUamAsBasal,
-                tuneInsulinCurve: tuneInsulinCurve
-            )
-
-            debug(.openAPS, "AUTOTUNE PREP: \(autotunePreppedGlucose)")
-
-            // Autotune Run
-            let autotuneResult = try await autotuneRun(
-                autotunePreparedData: autotunePreppedGlucose,
-                previousAutotuneResult: previousAutotune ?? profile,
-                pumpProfile: pumpProfile
-            )
-
-            debug(.openAPS, "AUTOTUNE RESULT: \(autotuneResult)")
-
-            if let autotune = Autotune(from: autotuneResult) {
-                storage.save(autotuneResult, as: Settings.autotune)
-
-                return autotune
-            } else {
-                return nil
-            }
-        } catch {
-            debug(.openAPS, "\(DebuggingIdentifiers.failed) \(#file) \(#function) Failed to prepare/run Autotune")
-            return nil
-        }
-    }
-
-    func makeProfiles(useAutotune _: Bool) async -> Autotune? {
-        debug(.openAPS, "Start makeProfiles")
+    func createInitialProfiles() async {
+        debug(.openAPS, "Start creating pump profile and user profile")
 
         // Load required settings and profiles asynchronously
         async let getPumpSettings = loadFileFromStorageAsync(name: Settings.settings)
@@ -531,10 +473,9 @@ final class OpenAPS {
         async let getCR = loadFileFromStorageAsync(name: Settings.carbRatios)
         async let getTempTargets = loadFileFromStorageAsync(name: Settings.tempTargets)
         async let getModel = loadFileFromStorageAsync(name: Settings.model)
-        async let getAutotune = loadFileFromStorageAsync(name: Settings.autotune)
         async let getFreeAPS = loadFileFromStorageAsync(name: FreeAPS.settings)
 
-        let (pumpSettings, bgTargets, basalProfile, isf, cr, tempTargets, model, autotune, freeaps) = await (
+        let (pumpSettings, bgTargets, basalProfile, isf, cr, tempTargets, model, freeaps) = await (
             getPumpSettings,
             getBGTargets,
             getBasalProfile,
@@ -542,7 +483,6 @@ final class OpenAPS {
             getCR,
             getTempTargets,
             getModel,
-            getAutotune,
             getFreeAPS
         )
 
@@ -588,27 +528,18 @@ final class OpenAPS {
                 carbRatio: cr,
                 tempTargets: tempTargets,
                 model: model,
-                autotune: autotune.isEmpty ? .null : autotune,
+                autotune: RawJSON.null,
                 freeaps: freeaps
             )
 
             // Save the profiles
             await storage.saveAsync(pumpProfile, as: Settings.pumpProfile)
             await storage.saveAsync(profile, as: Settings.profile)
-
-            // Return the Autotune object, if available
-            if let tunedProfile = Autotune(from: profile) {
-                return tunedProfile
-            } else {
-                return nil
-            }
         } catch {
-            // Handle errors and log failure
             debug(
                 .apsManager,
-                "\(DebuggingIdentifiers.failed) \(#file) \(#function) Failed to execute makeProfiles()"
+                "\(DebuggingIdentifiers.failed) \(#file) \(#function) Failed to create pump profile and normal profile: \(error)"
             )
-            return nil
         }
     }
 
@@ -687,58 +618,6 @@ final class OpenAPS {
         }
     }
 
-    private func autotunePrepare(
-        pumphistory: JSON,
-        profile: JSON,
-        glucose: JSON,
-        pumpprofile: JSON,
-        carbs: JSON,
-        categorizeUamAsBasal: Bool,
-        tuneInsulinCurve: Bool
-    ) async throws -> RawJSON {
-        try await withCheckedThrowingContinuation { continuation in
-            jsWorker.inCommonContext { worker in
-                worker.evaluateBatch(scripts: [
-                    Script(name: Prepare.log),
-                    Script(name: Bundle.autotunePrep),
-                    Script(name: Prepare.autotunePrep)
-                ])
-                let result = worker.call(function: Function.generate, with: [
-                    pumphistory,
-                    profile,
-                    glucose,
-                    pumpprofile,
-                    carbs,
-                    categorizeUamAsBasal,
-                    tuneInsulinCurve
-                ])
-                continuation.resume(returning: result)
-            }
-        }
-    }
-
-    private func autotuneRun(
-        autotunePreparedData: JSON,
-        previousAutotuneResult: JSON,
-        pumpProfile: JSON
-    ) async throws -> RawJSON {
-        try await withCheckedThrowingContinuation { continuation in
-            jsWorker.inCommonContext { worker in
-                worker.evaluateBatch(scripts: [
-                    Script(name: Prepare.log),
-                    Script(name: Bundle.autotuneCore),
-                    Script(name: Prepare.autotuneCore)
-                ])
-                let result = worker.call(function: Function.generate, with: [
-                    autotunePreparedData,
-                    previousAutotuneResult,
-                    pumpProfile
-                ])
-                continuation.resume(returning: result)
-            }
-        }
-    }
-
     private func determineBasal(
         glucose: JSON,
         currentTemp: JSON,

+ 0 - 17
FreeAPS/Sources/Models/Autotune.swift

@@ -1,17 +0,0 @@
-import Foundation
-
-struct Autotune: JSON, Equatable {
-    var createdAt: Date?
-    let basalProfile: [BasalProfileEntry]
-    let sensitivity: Decimal
-    let carbRatio: Decimal
-}
-
-extension Autotune {
-    private enum CodingKeys: String, CodingKey {
-        case createdAt = "created_at"
-        case basalProfile = "basalprofile"
-        case sensitivity = "sens"
-        case carbRatio = "carb_ratio"
-    }
-}

+ 0 - 7
FreeAPS/Sources/Models/DecimalPickerSettings.swift

@@ -78,13 +78,6 @@ struct DecimalPickerSettings {
     )
     var maxCOB = PickerSetting(value: 120, step: 5, min: 0, max: 300, type: PickerSetting.PickerSettingType.gram)
     var min5mCarbimpact = PickerSetting(value: 8, step: 1, min: 1, max: 20, type: PickerSetting.PickerSettingType.glucose)
-    var autotuneISFAdjustmentFraction = PickerSetting(
-        value: 1.0,
-        step: 0.05,
-        min: 0,
-        max: 1,
-        type: PickerSetting.PickerSettingType.factor
-    )
     var remainingCarbsFraction = PickerSetting(
         value: 1.0,
         step: 0.05,

+ 0 - 10
FreeAPS/Sources/Models/FreeAPSSettings.swift

@@ -19,7 +19,6 @@ struct FreeAPSSettings: JSON, Equatable {
     var units: GlucoseUnits = .mgdL
     var closedLoop: Bool = false
     var allowAnnouncements: Bool = false
-    var useAutotune: Bool = false
     var isUploadEnabled: Bool = false
     var isDownloadEnabled: Bool = false
     var useLocalGlucoseSource: Bool = false
@@ -68,7 +67,6 @@ struct FreeAPSSettings: JSON, Equatable {
     var maxProtein: Decimal = 250
     var displayFatAndProteinOnWatch: Bool = false
     var confirmBolusFaster: Bool = false
-    var onlyAutotuneBasals: Bool = false
     var overrideFactor: Decimal = 0.8
     var fattyMeals: Bool = false
     var fattyMealFactor: Decimal = 0.7
@@ -98,10 +96,6 @@ extension FreeAPSSettings: Decodable {
             settings.allowAnnouncements = allowAnnouncements
         }
 
-        if let useAutotune = try? container.decode(Bool.self, forKey: .useAutotune) {
-            settings.useAutotune = useAutotune
-        }
-
         if let isUploadEnabled = try? container.decode(Bool.self, forKey: .isUploadEnabled) {
             settings.isUploadEnabled = isUploadEnabled
         }
@@ -319,10 +313,6 @@ extension FreeAPSSettings: Decodable {
             settings.confirmBolusFaster = confirmBolusFaster
         }
 
-        if let onlyAutotuneBasals = try? container.decode(Bool.self, forKey: .onlyAutotuneBasals) {
-            settings.onlyAutotuneBasals = onlyAutotuneBasals
-        }
-
         if let displayPresets = try? container.decode(Bool.self, forKey: .displayPresets) {
             settings.displayPresets = displayPresets
         }

+ 0 - 6
FreeAPS/Sources/Models/Preferences.swift

@@ -20,7 +20,6 @@ struct Preferences: JSON, Equatable {
     var skipNeutralTemps: Bool = false
     var unsuspendIfNoTemp: Bool = false
     var min5mCarbimpact: Decimal = 8
-    var autotuneISFAdjustmentFraction: Decimal = 1.0
     var remainingCarbsFraction: Decimal = 1.0
     var remainingCarbsCap: Decimal = 90
     var enableUAM: Bool = false
@@ -77,7 +76,6 @@ extension Preferences {
         case skipNeutralTemps = "skip_neutral_temps"
         case unsuspendIfNoTemp = "unsuspend_if_no_temp"
         case min5mCarbimpact = "min_5m_carbimpact"
-        case autotuneISFAdjustmentFraction = "autotune_isf_adjustmentFraction"
         case remainingCarbsFraction
         case remainingCarbsCap
         case enableUAM
@@ -202,10 +200,6 @@ extension Preferences: Decodable {
             preferences.min5mCarbimpact = min5mCarbimpact
         }
 
-        if let autotuneISFAdjustmentFraction = try? container.decode(Decimal.self, forKey: .autotuneISFAdjustmentFraction) {
-            preferences.autotuneISFAdjustmentFraction = autotuneISFAdjustmentFraction
-        }
-
         if let remainingCarbsFraction = try? container.decode(Decimal.self, forKey: .remainingCarbsFraction) {
             preferences.remainingCarbsFraction = remainingCarbsFraction
         }

+ 0 - 3
FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/AlgorithmAdvancedSettingsStateModel.swift

@@ -18,7 +18,6 @@ extension AlgorithmAdvancedSettings {
         @Published var unsuspendIfNoTemp: Bool = false
         @Published var suspendZerosIOB: Bool = false
         @Published var min5mCarbimpact: Decimal = 8
-        @Published var autotuneISFAdjustmentFraction: Decimal = 1.0
         @Published var remainingCarbsFraction: Decimal = 1.0
         @Published var remainingCarbsCap: Decimal = 90
         @Published var noisyCGMTargetMultiplier: Decimal = 1.3
@@ -42,8 +41,6 @@ extension AlgorithmAdvancedSettings {
             subscribePreferencesSetting(\.suspendZerosIOB, on: $suspendZerosIOB) { suspendZerosIOB = $0 }
             subscribePreferencesSetting(\.suspendZerosIOB, on: $suspendZerosIOB) { suspendZerosIOB = $0 }
             subscribePreferencesSetting(\.min5mCarbimpact, on: $min5mCarbimpact) { min5mCarbimpact = $0 }
-            subscribePreferencesSetting(\.autotuneISFAdjustmentFraction, on: $autotuneISFAdjustmentFraction) {
-                autotuneISFAdjustmentFraction = $0 }
             subscribePreferencesSetting(\.remainingCarbsFraction, on: $remainingCarbsFraction) { remainingCarbsFraction = $0 }
             subscribePreferencesSetting(\.remainingCarbsCap, on: $remainingCarbsCap) { remainingCarbsCap = $0 }
             subscribePreferencesSetting(\.noisyCGMTargetMultiplier, on: $noisyCGMTargetMultiplier) {

+ 0 - 27
FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/View/AlgorithmAdvancedSettingsRootView.swift

@@ -228,33 +228,6 @@ extension AlgorithmAdvancedSettings {
                     }
                 )
 
-                // Commenting out Autotune from Settings Menu until full removal is complete
-                // SettingInputSection(
-                // decimalValue: $state.autotuneISFAdjustmentFraction,
-                // booleanValue: $booleanPlaceholder,
-                // shouldDisplayHint: $shouldDisplayHint,
-                // selectedVerboseHint: Binding(
-                // get: { selectedVerboseHint },
-                // set: {
-                // selectedVerboseHint = $0.map { AnyView($0) }
-                // hintLabel = NSLocalizedString(
-                // "Autotune ISF Adjustment Percent",
-                // comment: "Autotune ISF Adjustment Percent"
-                // )
-                // }
-                // ),
-                // units: state.units,
-                // type: .decimal("autotuneISFAdjustmentFraction"),
-                // label: NSLocalizedString("Autotune ISF Adjustment Percent", comment: "Autotune ISF Adjustment Percent"),
-                // miniHint: "Using Autotune is not advised",
-                // verboseHint: Text(
-                // NSLocalizedString(
-                // "The default of 50% for this value keeps autotune ISF closer to pump ISF via a weighted average of fullNewISF and pumpISF. 100% allows full adjustment, 0% is no adjustment from pump ISF.",
-                // comment: "Autotune ISF Adjustment Percent"
-                // )
-                // )
-                // )
-
                 SettingInputSection(
                     decimalValue: $state.min5mCarbimpact,
                     booleanValue: $booleanPlaceholder,

+ 0 - 10
FreeAPS/Sources/Modules/AutotuneConfig/AutotuneConfigDataFlow.swift

@@ -1,10 +0,0 @@
-import Combine
-
-enum AutotuneConfig {
-    enum Config {}
-}
-
-protocol AutotuneConfigProvider: Provider {
-    var autotune: Autotune? { get }
-    func deleteAutotune()
-}

+ 0 - 15
FreeAPS/Sources/Modules/AutotuneConfig/AutotuneConfigProvider.swift

@@ -1,15 +0,0 @@
-import Combine
-
-extension AutotuneConfig {
-    final class Provider: BaseProvider, AutotuneConfigProvider {
-        @Injected() private var apsManager: APSManager!
-
-        var autotune: Autotune? {
-            storage.retrieve(OpenAPS.Settings.autotune, as: Autotune.self)
-        }
-
-        func deleteAutotune() {
-            storage.remove(OpenAPS.Settings.autotune)
-        }
-    }
-}

+ 0 - 113
FreeAPS/Sources/Modules/AutotuneConfig/AutotuneConfigStateModel.swift

@@ -1,113 +0,0 @@
-import Combine
-import LoopKit
-import SwiftUI
-
-extension AutotuneConfig {
-    final class StateModel: BaseStateModel<Provider> {
-        @Injected() var apsManager: APSManager!
-        @Injected() private var storage: FileStorage!
-        @Published var useAutotune = false
-        @Published var onlyAutotuneBasals = false
-        @Published var autotune: Autotune?
-        private(set) var units: GlucoseUnits = .mgdL
-        @Published var publishedDate = Date()
-        @Persisted(key: "lastAutotuneDate") private var lastAutotuneDate = Date() {
-            didSet {
-                DispatchQueue.main.async {
-                    self.publishedDate = self.lastAutotuneDate
-                }
-            }
-        }
-
-        override func subscribe() {
-            autotune = provider.autotune
-            units = settingsManager.settings.units
-            useAutotune = settingsManager.settings.useAutotune
-            publishedDate = lastAutotuneDate
-            subscribeSetting(\.onlyAutotuneBasals, on: $onlyAutotuneBasals) { onlyAutotuneBasals = $0 }
-
-            $useAutotune
-                .removeDuplicates()
-                .flatMap { [weak self] use -> AnyPublisher<Bool, Never> in
-                    guard let self = self else {
-                        return Just(false).eraseToAnyPublisher()
-                    }
-                    self.settingsManager.settings.useAutotune = use
-                    return Future { promise in
-                        Task.init(priority: .background) {
-                            do {
-                                _ = try await self.apsManager.makeProfiles()
-                                promise(.success(true))
-
-                            } catch {
-                                promise(.success(false))
-                            }
-                        }
-                    }
-                    .eraseToAnyPublisher()
-                }
-                .cancellable()
-                .store(in: &lifetime)
-        }
-
-        func run() {
-            Task {
-                do {
-                    if let result = await self.apsManager.autotune() {
-                        autotune = result
-                        _ = try await self.apsManager.makeProfiles()
-                        lastAutotuneDate = Date()
-                    }
-                } catch {
-                    debugPrint("\(DebuggingIdentifiers.failed) \(#file) \(#function) Failed to run Autotune")
-                }
-            }
-        }
-
-        func delete() async {
-            provider.deleteAutotune()
-            autotune = nil
-            do {
-                _ = try await apsManager.makeProfiles()
-            } catch {
-                return
-            }
-        }
-
-        func replace() {
-            if let autotunedBasals = autotune {
-                let basals = autotunedBasals.basalProfile
-                    .map { basal -> BasalProfileEntry in
-                        BasalProfileEntry(
-                            start: String(basal.start.prefix(5)),
-                            minutes: basal.minutes,
-                            rate: basal.rate
-                        )
-                    }
-                guard let pump = apsManager.pumpManager else {
-                    storage.save(basals, as: OpenAPS.Settings.basalProfile)
-                    debug(.service, "Basals have been replaced with Autotuned Basals by user.")
-                    return
-                }
-                let syncValues = basals.map {
-                    RepeatingScheduleValue(startTime: TimeInterval($0.minutes * 60), value: Double($0.rate))
-                }
-                pump.syncBasalRateSchedule(items: syncValues) { result in
-                    switch result {
-                    case .success:
-                        self.storage.save(basals, as: OpenAPS.Settings.basalProfile)
-                        debug(.service, "Basals saved to pump!")
-                    case .failure:
-                        debug(.service, "Basals couldn't be save to pump")
-                    }
-                }
-            }
-        }
-    }
-}
-
-extension AutotuneConfig.StateModel: SettingsObserver {
-    func settingsDidChange(_: FreeAPSSettings) {
-        units = settingsManager.settings.units
-    }
-}

+ 0 - 198
FreeAPS/Sources/Modules/AutotuneConfig/View/AutotuneConfigRootView.swift

@@ -1,198 +0,0 @@
-import SwiftUI
-import Swinject
-
-extension AutotuneConfig {
-    struct RootView: BaseView {
-        let resolver: Resolver
-        @StateObject var state = StateModel()
-
-        @State private var shouldDisplayHint: Bool = false
-        @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: AnyView?
-        @State var hintLabel: String?
-        @State private var decimalPlaceholder: Decimal = 0.0
-        @State private var booleanPlaceholder: Bool = false
-
-        @State var replaceAlert = false
-
-        @Environment(\.colorScheme) var colorScheme
-        @Environment(AppState.self) var appState
-
-        private var isfFormatter: NumberFormatter {
-            let formatter = NumberFormatter()
-            formatter.numberStyle = .decimal
-            formatter.maximumFractionDigits = 2
-            return formatter
-        }
-
-        private var rateFormatter: NumberFormatter {
-            let formatter = NumberFormatter()
-            formatter.numberStyle = .decimal
-            formatter.maximumFractionDigits = 2
-            return formatter
-        }
-
-        private var dateFormatter: DateFormatter {
-            let formatter = DateFormatter()
-            formatter.dateStyle = .medium
-            formatter.timeStyle = .short
-            return formatter
-        }
-
-        var body: some View {
-            Form {
-                SettingInputSection(
-                    decimalValue: $decimalPlaceholder,
-                    booleanValue: $state.useAutotune,
-                    shouldDisplayHint: $shouldDisplayHint,
-                    selectedVerboseHint: Binding(
-                        get: { selectedVerboseHint },
-                        set: {
-                            selectedVerboseHint = $0.map { AnyView($0) }
-                            hintLabel = "Use Autotune"
-                        }
-                    ),
-                    units: state.units,
-                    type: .boolean,
-                    label: "Use Autotune",
-                    miniHint: "It is not advised to use Autotune with Trio.",
-                    verboseHint:
-                    VStack(alignment: .leading, spacing: 10) {
-                        Text("It is not advised to use Autotune with Trio").bold()
-                        Text("Autotune is not designed to work with Trio. It is best to keep Autotune off and do not use it.")
-
-                    },
-                    headerText: "Data-driven Adjustments"
-                )
-
-                if state.useAutotune {
-                    SettingInputSection(
-                        decimalValue: $decimalPlaceholder,
-                        booleanValue: $state.onlyAutotuneBasals,
-                        shouldDisplayHint: $shouldDisplayHint,
-                        selectedVerboseHint: Binding(
-                            get: { selectedVerboseHint },
-                            set: {
-                                selectedVerboseHint = $0.map { AnyView($0) }
-                                hintLabel = "Only Autotune Basal Insulin"
-                            }
-                        ),
-                        units: state.units,
-                        type: .boolean,
-                        label: "Only Autotune Basal Insulin",
-                        miniHint: "Restricts Autotune adjustments to only basal settings.",
-                        verboseHint: Text("Restricts Autotune adjustments to only basal settings.")
-                    )
-                }
-
-                Section(
-                    header: HStack {
-                        Text("Last run")
-                        Spacer()
-                        Text(dateFormatter.string(from: state.publishedDate))
-                    },
-                    content: {
-                        Button {
-                            state.run()
-                        } label: {
-                            Text("Run now")
-                        }
-                        .frame(maxWidth: .infinity, alignment: .center)
-                        .listRowBackground(Color(.systemBlue))
-                        .tint(.white)
-                    }
-                )
-
-                if let autotune = state.autotune {
-                    if !state.onlyAutotuneBasals {
-                        Section {
-                            HStack {
-                                Text("Carb ratio")
-                                Spacer()
-                                Text(isfFormatter.string(from: autotune.carbRatio as NSNumber) ?? "0")
-                                Text("g/U").foregroundColor(.secondary)
-                            }
-                            HStack {
-                                Text("Sensitivity")
-                                Spacer()
-                                if state.units == .mmolL {
-                                    Text(isfFormatter.string(from: autotune.sensitivity.asMmolL as NSNumber) ?? "0")
-                                } else {
-                                    Text(isfFormatter.string(from: autotune.sensitivity as NSNumber) ?? "0")
-                                }
-                                Text(state.units.rawValue + "/U").foregroundColor(.secondary)
-                            }
-                        }
-                        .listRowBackground(Color.chart)
-                    }
-
-                    Section(header: Text("Basal profile")) {
-                        ForEach(0 ..< autotune.basalProfile.count, id: \.self) { index in
-                            HStack {
-                                Text(autotune.basalProfile[index].start).foregroundColor(.secondary)
-                                Spacer()
-                                Text(rateFormatter.string(from: autotune.basalProfile[index].rate as NSNumber) ?? "0")
-                                Text("U/hr").foregroundColor(.secondary)
-                            }
-                        }
-                        HStack {
-                            Text("Total")
-                                .bold()
-                                .foregroundColor(.primary)
-                            Spacer()
-                            Text(rateFormatter.string(from: autotune.basalProfile.reduce(0) { $0 + $1.rate } as NSNumber) ?? "0")
-                                .foregroundColor(.primary) +
-                                Text(" U/day")
-                                .foregroundColor(.secondary)
-                        }
-                    }
-                    .listRowBackground(Color.chart)
-
-                    Section {
-                        Button {
-                            Task {
-                                await state.delete()
-                            }
-                        } label: {
-                            Text("Delete Autotune Data")
-                        }
-                        .frame(maxWidth: .infinity, alignment: .center)
-                        .listRowBackground(Color(.loopRed))
-                        .tint(.white)
-                    }
-
-                    Section {
-                        Button {
-                            replaceAlert = true
-                        } label: {
-                            Text("Save as Normal Basal Rates")
-                        }
-                        .frame(maxWidth: .infinity, alignment: .center)
-                        .listRowBackground(Color(.systemGray4))
-                        .tint(.white)
-                    }
-                }
-            }
-            .sheet(isPresented: $shouldDisplayHint) {
-                SettingInputHintView(
-                    hintDetent: $hintDetent,
-                    shouldDisplayHint: $shouldDisplayHint,
-                    hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
-                    sheetTitle: "Help"
-                )
-            }
-            .scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))
-            .onAppear(perform: configureView)
-            .navigationTitle("Autotune")
-            .navigationBarTitleDisplayMode(.automatic)
-            .alert(Text("Are you sure?"), isPresented: $replaceAlert) {
-                Button("Yes", action: {
-                    state.replace()
-                    replaceAlert.toggle()
-                })
-                Button("No", action: { replaceAlert.toggle() })
-            }
-        }
-    }
-}

+ 0 - 1
FreeAPS/Sources/Modules/CarbRatioEditor/CarbRatioEditorDataFlow.swift

@@ -27,5 +27,4 @@ enum CarbRatioEditor {
 protocol CarbRatioEditorProvider: Provider {
     var profile: CarbRatios { get }
     func saveProfile(_ profile: CarbRatios)
-    var autotune: Autotune? { get }
 }

+ 0 - 4
FreeAPS/Sources/Modules/CarbRatioEditor/CarbRatioEditorProvider.swift

@@ -11,9 +11,5 @@ extension CarbRatioEditor {
         func saveProfile(_ profile: CarbRatios) {
             storage.save(profile, as: OpenAPS.Settings.carbRatios)
         }
-
-        var autotune: Autotune? {
-            storage.retrieve(OpenAPS.Settings.autotune, as: Autotune.self)
-        }
     }
 }

+ 0 - 3
FreeAPS/Sources/Modules/CarbRatioEditor/CarbRatioEditorStateModel.swift

@@ -5,7 +5,6 @@ extension CarbRatioEditor {
         @Injected() private var nightscout: NightscoutManager!
         @Published var items: [Item] = []
         @Published var initialItems: [Item] = []
-        @Published var autotune: Autotune?
         @Published var shouldDisplaySaving: Bool = false
 
         let timeValues = stride(from: 0.0, to: 1.days.timeInterval, by: 30.minutes.timeInterval).map { $0 }
@@ -39,8 +38,6 @@ extension CarbRatioEditor {
             }
 
             initialItems = items.map { Item(rateIndex: $0.rateIndex, timeIndex: $0.timeIndex) }
-
-            autotune = provider.autotune
         }
 
         func add() {

+ 0 - 11
FreeAPS/Sources/Modules/CarbRatioEditor/View/CarbRatioEditorRootView.swift

@@ -68,17 +68,6 @@ extension CarbRatioEditor {
 
         var body: some View {
             Form {
-                if let autotune = state.autotune, !state.settingsManager.settings.onlyAutotuneBasals {
-                    Section(header: Text("Autotune")) {
-                        HStack {
-                            Text("Calculated Ratio")
-                            Spacer()
-                            Text(rateFormatter.string(from: autotune.carbRatio as NSNumber) ?? "0")
-                            Text("g/U").foregroundColor(.secondary)
-                        }
-                    }.listRowBackground(Color.chart)
-                }
-
                 if !state.canAdd {
                     Section {
                         VStack(alignment: .leading) {

+ 1 - 2
FreeAPS/Sources/Modules/Home/HomeDataFlow.swift

@@ -8,8 +8,7 @@ enum Home {
 protocol HomeProvider: Provider {
     func heartbeatNow()
     func pumpSettings() -> PumpSettings
-    func autotunedBasalProfile() -> [BasalProfileEntry]
-    func basalProfile() -> [BasalProfileEntry]
+    func getBasalProfile() async -> [BasalProfileEntry]
     func tempTargets(hours: Int) -> [TempTarget]
     func pumpReservoir() -> Decimal?
     func tempTarget() -> TempTarget?

+ 4 - 9
FreeAPS/Sources/Modules/Home/HomeProvider.swift

@@ -43,15 +43,10 @@ extension Home {
             storage.retrieve(OpenAPS.Monitor.reservoir, as: Decimal.self)
         }
 
-        func autotunedBasalProfile() -> [BasalProfileEntry] {
-            storage.retrieve(OpenAPS.Settings.profile, as: Autotune.self)?.basalProfile
-                ?? storage.retrieve(OpenAPS.Settings.pumpProfile, as: Autotune.self)?.basalProfile
-                ?? [BasalProfileEntry(start: "00:00", minutes: 0, rate: 1)]
-        }
-
-        func basalProfile() -> [BasalProfileEntry] {
-            storage.retrieve(OpenAPS.Settings.pumpProfile, as: Autotune.self)?.basalProfile
-                ?? [BasalProfileEntry(start: "00:00", minutes: 0, rate: 1)]
+        func getBasalProfile() async -> [BasalProfileEntry] {
+            await storage.retrieveAsync(OpenAPS.Settings.basalProfile, as: [BasalProfileEntry].self)
+                ?? [BasalProfileEntry](from: OpenAPS.defaults(for: OpenAPS.Settings.basalProfile))
+                ?? []
         }
 
         func getBGTarget() async -> BGTargets {

+ 8 - 8
FreeAPS/Sources/Modules/Home/HomeStateModel.swift

@@ -24,7 +24,6 @@ extension Home {
         var uploadStats = false
         var recentGlucose: BloodGlucose?
         var maxBasal: Decimal = 2
-        var autotunedBasalProfile: [BasalProfileEntry] = []
         var basalProfile: [BasalProfileEntry] = []
         var tempTargets: [TempTarget] = []
         var timerDate = Date()
@@ -166,7 +165,7 @@ extension Home {
                         self.setupPumpSettings()
                     }
                     group.addTask {
-                        self.setupBasalProfile()
+                        await self.setupBasalProfile()
                     }
                     group.addTask {
                         self.setupReservoir()
@@ -467,11 +466,10 @@ extension Home {
             }
         }
 
-        private func setupBasalProfile() {
-            DispatchQueue.main.async { [weak self] in
-                guard let self = self else { return }
-                self.autotunedBasalProfile = self.provider.autotunedBasalProfile()
-                self.basalProfile = self.provider.basalProfile()
+        private func setupBasalProfile() async {
+            let basalProfile = await provider.getBasalProfile()
+            await MainActor.run {
+                self.basalProfile = basalProfile
             }
         }
 
@@ -606,7 +604,9 @@ extension Home.StateModel:
     }
 
     func basalProfileDidChange(_: [BasalProfileEntry]) {
-        setupBasalProfile()
+        Task {
+            await setupBasalProfile()
+        }
     }
 
     func pumpReservoirDidChange(_: Decimal) {

+ 6 - 16
FreeAPS/Sources/Modules/Home/View/Chart/ChartElements/BasalChart.swift

@@ -168,14 +168,13 @@ extension MainChartView {
 
     func findRegularBasalPoints(
         timeBegin: TimeInterval,
-        timeEnd: TimeInterval,
-        autotuned: Bool
+        timeEnd: TimeInterval
     ) async -> [BasalProfile] {
         guard timeBegin < timeEnd else { return [] }
 
         let beginDate = Date(timeIntervalSince1970: timeBegin)
         let startOfDay = Calendar.current.startOfDay(for: beginDate)
-        let profile = autotuned ? state.autotunedBasalProfile : state.basalProfile
+        let profile = state.basalProfile
         var basalPoints: [BasalProfile] = []
 
         // Iterate over the next three days, multiplying the time intervals
@@ -203,22 +202,13 @@ extension MainChartView {
         Task {
             let dayAgoTime = Date().addingTimeInterval(-1.days.timeInterval).timeIntervalSince1970
 
-            // Get Regular and Autotuned Basal parallel
-            async let getRegularBasalPoints = findRegularBasalPoints(
+            // Get Regular Basal
+            let basalPoints = await findRegularBasalPoints(
                 timeBegin: dayAgoTime,
-                timeEnd: endMarker.timeIntervalSince1970,
-                autotuned: false
+                timeEnd: endMarker.timeIntervalSince1970
             )
 
-            async let getAutotunedBasalPoints = findRegularBasalPoints(
-                timeBegin: dayAgoTime,
-                timeEnd: endMarker.timeIntervalSince1970,
-                autotuned: true
-            )
-
-            let (regularPoints, autotunedBasalPoints) = await (getRegularBasalPoints, getAutotunedBasalPoints)
-
-            var totalBasal = regularPoints + autotunedBasalPoints
+            var totalBasal = basalPoints
             totalBasal.sort {
                 $0.startDate.timeIntervalSince1970 < $1.startDate.timeIntervalSince1970
             }

+ 1 - 1
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -1058,7 +1058,7 @@ extension Home {
             }
         }
 
-        //TODO: Consolidate all mmol parsing methods (in TagCloudView, NightscoutManager and HomeRootView) to one central func
+        // TODO: Consolidate all mmol parsing methods (in TagCloudView, NightscoutManager and HomeRootView) to one central func
         private func parseReasonConclusion(_ reasonConclusion: String, isMmolL _: Bool) -> String {
             let patterns = [
                 "minGuardBG\\s*-?\\d+\\.?\\d*<-?\\d+\\.?\\d*",

+ 0 - 1
FreeAPS/Sources/Modules/ISFEditor/ISFEditorDataFlow.swift

@@ -28,5 +28,4 @@ protocol ISFEditorProvider: Provider {
     var profile: InsulinSensitivities { get }
     func saveProfile(_ profile: InsulinSensitivities)
     var autosense: Autosens { get }
-    var autotune: Autotune? { get }
 }

+ 0 - 4
FreeAPS/Sources/Modules/ISFEditor/ISFEditorProvider.swift

@@ -40,9 +40,5 @@ extension ISFEditor {
                 ?? Autosens(from: OpenAPS.defaults(for: OpenAPS.Settings.autosense))
                 ?? Autosens(ratio: 1, newisf: nil, timestamp: nil)
         }
-
-        var autotune: Autotune? {
-            storage.retrieve(OpenAPS.Settings.autotune, as: Autotune.self)
-        }
     }
 }

+ 0 - 3
FreeAPS/Sources/Modules/ISFEditor/ISFEditorStateModel.swift

@@ -12,7 +12,6 @@ extension ISFEditor {
         var shouldDisplaySaving: Bool = false
         private(set) var autosensISF: Decimal?
         private(set) var autosensRatio: Decimal = 0
-        var autotune: Autotune?
         var determinationsFromPersistence: [OrefDetermination] = []
 
         let context = CoreDataStack.shared.newTaskContext()
@@ -54,8 +53,6 @@ extension ISFEditor {
 
             initialItems = items.map { Item(rateIndex: $0.rateIndex, timeIndex: $0.timeIndex) }
 
-            autotune = provider.autotune
-
             if let newISF = provider.autosense.newisf {
                 autosensISF = newISF
             }

+ 0 - 14
FreeAPS/Sources/Modules/ISFEditor/View/ISFEditorRootView.swift

@@ -68,20 +68,6 @@ extension ISFEditor {
 
         var body: some View {
             Form {
-                if let autotune = state.autotune, !state.settingsManager.settings.onlyAutotuneBasals {
-                    Section(header: Text("Autotune")) {
-                        HStack {
-                            Text("Calculated Sensitivity")
-                            Spacer()
-                            if state.units == .mgdL {
-                                Text(autotune.sensitivity.description)
-                            } else {
-                                Text(autotune.sensitivity.formattedAsMmolL)
-                            }
-                            Text(state.units.rawValue + "/U").foregroundColor(.secondary)
-                        }
-                    }.listRowBackground(Color.chart)
-                }
                 if let newISF = state.autosensISF {
                     Section(
                         header: !state.settingsManager.preferences

+ 1 - 1
FreeAPS/Sources/Modules/PumpConfig/PumpConfigDataFlow.swift

@@ -35,5 +35,5 @@ protocol PumpConfigProvider: Provider {
     func setPumpManager(_: PumpManagerUI)
     var pumpDisplayState: AnyPublisher<PumpDisplayState?, Never> { get }
     func pumpSettings() -> PumpSettings
-    func basalProfile() -> [BasalProfileEntry]
+    func getBasalProfile() async -> [BasalProfileEntry]
 }

+ 4 - 3
FreeAPS/Sources/Modules/PumpConfig/PumpConfigProvider.swift

@@ -14,9 +14,10 @@ extension PumpConfig {
             apsManager.pumpDisplayState.eraseToAnyPublisher()
         }
 
-        func basalProfile() -> [BasalProfileEntry] {
-            storage.retrieve(OpenAPS.Settings.pumpProfile, as: Autotune.self)?.basalProfile
-                ?? [BasalProfileEntry(start: "00:00", minutes: 0, rate: 1)]
+        func getBasalProfile() async -> [BasalProfileEntry] {
+            await storage.retrieveAsync(OpenAPS.Settings.basalProfile, as: [BasalProfileEntry].self)
+                ?? [BasalProfileEntry](from: OpenAPS.defaults(for: OpenAPS.Settings.basalProfile))
+                ?? []
         }
 
         func pumpSettings() -> PumpSettings {

+ 15 - 11
FreeAPS/Sources/Modules/PumpConfig/PumpConfigStateModel.swift

@@ -23,19 +23,23 @@ extension PumpConfig {
                 .assign(to: \.alertNotAck, on: self)
                 .store(in: &lifetime)
 
-            let basalSchedule = BasalRateSchedule(
-                dailyItems: provider.basalProfile().map {
-                    RepeatingScheduleValue(startTime: $0.minutes.minutes.timeInterval, value: Double($0.rate))
-                }
-            )
+            Task {
+                let basalSchedule = BasalRateSchedule(
+                    dailyItems: await provider.getBasalProfile().map {
+                        RepeatingScheduleValue(startTime: $0.minutes.minutes.timeInterval, value: Double($0.rate))
+                    }
+                )
 
-            let pumpSettings = provider.pumpSettings()
+                let pumpSettings = provider.pumpSettings()
 
-            initialSettings = PumpInitialSettings(
-                maxBolusUnits: Double(pumpSettings.maxBolus),
-                maxBasalRateUnitsPerHour: Double(pumpSettings.maxBasal),
-                basalSchedule: basalSchedule!
-            )
+                await MainActor.run {
+                    initialSettings = PumpInitialSettings(
+                        maxBolusUnits: Double(pumpSettings.maxBolus),
+                        maxBasalRateUnitsPerHour: Double(pumpSettings.maxBasal),
+                        basalSchedule: basalSchedule!
+                    )
+                }
+            }
         }
 
         func addPump(_ type: PumpType) {

+ 0 - 2
FreeAPS/Sources/Modules/Settings/SettingItems.swift

@@ -136,7 +136,6 @@ enum SettingItems {
                 "Unsuspend If No Temp",
                 "Suspend Zeros IOB",
                 "Min 5m Carbimpact",
-                // "Autotune ISF Adjustment Fraction",
                 "Remaining Carbs Fraction",
                 "Remaining Carbs Cap",
                 "Noisy CGM Target Multiplier"
@@ -212,7 +211,6 @@ enum SettingItems {
             path: ["Features", "User Interface"]
         ),
         SettingItem(title: "App Icons", view: .iconConfig)
-        // SettingItem(title: "Autotune", view: .autotuneConfig)
     ]
 
     static let notificationItems = [

+ 0 - 2
FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -270,8 +270,6 @@ extension Settings {
 //                            //                                .navigationLink(to: .configEditor(file: OpenAPS.FreeAPS.announcements), from: self)
 //                            //                            Text("Enacted announcements")
 //                            //                                .navigationLink(to: .configEditor(file: OpenAPS.FreeAPS.announcementsEnacted), from: self)
-//                            Text("Autotune")
-//                                .navigationLink(to: .configEditor(file: OpenAPS.Settings.autotune), from: self)
 //                        }
 //
 //                        Group {

+ 0 - 8
FreeAPS/Sources/Modules/Settings/View/Subviews/FeatureSettingsView.swift

@@ -37,14 +37,6 @@ struct FeatureSettingsView: BaseView {
                 }
             )
             .listRowBackground(Color.chart)
-
-            // Section(
-            // header: Text("Data-Driven Settings Tuning"),
-            // content: {
-            // Text("Autotune").navigationLink(to: .autotuneConfig, from: self)
-            // }
-            // )
-            .listRowBackground(Color.chart)
         }
         .scrollContentBackground(.hidden)
         .background(appState.trioBackgroundColor(for: colorScheme))

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

@@ -17,7 +17,6 @@ enum Screen: Identifiable, Hashable {
     case targetsEditor
     case bolus
     case manualTempBasal
-    case autotuneConfig
     case dataTable
     case cgm
     case cgmDirect
@@ -87,8 +86,6 @@ extension Screen {
             Treatments.RootView(resolver: resolver)
         case .manualTempBasal:
             ManualTempBasal.RootView(resolver: resolver)
-        case .autotuneConfig:
-            AutotuneConfig.RootView(resolver: resolver)
         case .dataTable:
             DataTable.RootView(resolver: resolver)
         case .cgm:

+ 2 - 2
FreeAPS/Sources/Services/Network/Nightscout/NightscoutManager.swift

@@ -445,7 +445,7 @@ final class BaseNightscoutManager: NightscoutManager, Injectable {
         var modifiedSuggestedDetermination = fetchedSuggestedDetermination
         if var suggestion = fetchedSuggestedDetermination {
             suggestion.timestamp = suggestion.deliverAt
-            
+
             if settingsManager.settings.units == .mmolL {
                 suggestion.reason = parseReasonGlucoseValuesToMmolL(suggestion.reason)
                 // TODO: verify that these parsings are needed for 3rd party apps, e.g., LoopFollow
@@ -1152,7 +1152,7 @@ extension BaseNightscoutManager {
      - Glucose tags handled: `ISF:`, `Target:`, `minPredBG`, `minGuardBG`, `IOBpredBG`, `COBpredBG`, `UAMpredBG`, `Dev:`, `maxDelta`, `BGI`.
      */
 
-     //TODO: Consolidate all mmol parsing methods (in TagCloudView, NightscoutManager and HomeRootView) to one central func
+    // TODO: Consolidate all mmol parsing methods (in TagCloudView, NightscoutManager and HomeRootView) to one central func
     func parseReasonGlucoseValuesToMmolL(_ reason: String) -> String {
         let patterns = [
             "ISF:\\s*-?\\d+\\.?\\d*→-?\\d+\\.?\\d*",

+ 0 - 2
FreeAPS/Sources/Views/SettingInputSection.swift

@@ -135,8 +135,6 @@ struct SettingInputSection<VerboseHint: View>: View {
             return pickerSettingsProvider.settings.maxCOB
         case "min5mCarbimpact":
             return pickerSettingsProvider.settings.min5mCarbimpact
-        case "autotuneISFAdjustmentFraction":
-            return pickerSettingsProvider.settings.autotuneISFAdjustmentFraction
         case "remainingCarbsFraction":
             return pickerSettingsProvider.settings.remainingCarbsFraction
         case "remainingCarbsCap":

+ 1 - 1
FreeAPS/Sources/Views/TagCloudView.swift

@@ -104,7 +104,7 @@ struct TagCloudView: View {
      - Glucose tags handled: `ISF:`, `Target:`, `minPredBG`, `minGuardBG`, `IOBpredBG`, `COBpredBG`, `UAMpredBG`, `Dev:`, `maxDelta`, `BGI`.
      */
 
-     //TODO: Consolidate all mmol parsing methods (in TagCloudView, NightscoutManager and HomeRootView) to one central func
+    // TODO: Consolidate all mmol parsing methods (in TagCloudView, NightscoutManager and HomeRootView) to one central func
     private func formatGlucoseTags(_ tag: String, isMmolL: Bool) -> String {
         let patterns = [
             "ISF:\\s*-?\\d+\\.?\\d*→-?\\d+\\.?\\d*",