Skip to content

Commit

Permalink
Prepare for profile switcher coming in version 4.9
Browse files Browse the repository at this point in the history
Resolves several old issues with import/upload to Nightscout and to statistics database.
Prepares for configuration profiles and the onboarding Views coming in v4.9, for instance backup of CoreData.
  • Loading branch information
Jon-b-m authored Jul 31, 2024
1 parent 2a8eeb6 commit f0d1d52
Show file tree
Hide file tree
Showing 12 changed files with 1,006 additions and 157 deletions.
16 changes: 15 additions & 1 deletion Core_Data.xcdatamodeld/Core_Data.xcdatamodel/contents
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22758" systemVersion="23E224" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22758" systemVersion="23F79" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
<entity name="ActiveProfile" representedClassName="ActiveProfile" syncable="YES" codeGenerationType="class">
<attribute name="active" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
<attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="name" optional="YES" attributeType="String"/>
</entity>
<entity name="BGaverages" representedClassName="BGaverages" syncable="YES" codeGenerationType="class">
<attribute name="average" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
<attribute name="average_1" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
Expand Down Expand Up @@ -71,6 +76,10 @@
<attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="number" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="YES"/>
</entity>
<entity name="Onboarding" representedClassName="Onboarding" syncable="YES" codeGenerationType="class">
<attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="firstRun" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
</entity>
<entity name="Override" representedClassName="Override" syncable="YES" codeGenerationType="class">
<attribute name="advancedSettings" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
<attribute name="cr" optional="YES" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
Expand Down Expand Up @@ -126,6 +135,11 @@
<attribute name="fat" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
<attribute name="protein" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
</entity>
<entity name="Profiles" representedClassName="Profiles" syncable="YES" codeGenerationType="class">
<attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="name" optional="YES" attributeType="String"/>
<attribute name="uploaded" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
</entity>
<entity name="Protein" representedClassName="Protein" syncable="YES" codeGenerationType="class">
<attribute name="date" optional="YES" attributeType="Date" usesScalarValueType="NO"/>
<attribute name="enteredBy" optional="YES" attributeType="String"/>
Expand Down
50 changes: 23 additions & 27 deletions FreeAPS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
190F8CF72BC6F70800EDB473 /* IllustrationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 190F8CF62BC6F70800EDB473 /* IllustrationView.swift */; };
191A9D162BED00A500028D48 /* Version.swift in Sources */ = {isa = PBXBuildFile; fileRef = 191A9D152BED00A500028D48 /* Version.swift */; };
191A9D182BED24B000028D48 /* ActiveIOBView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 191A9D172BED24B000028D48 /* ActiveIOBView.swift */; };
191F62682AD6B05A004D7911 /* NightscoutSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 191F62672AD6B05A004D7911 /* NightscoutSettings.swift */; };
1920BF5D2B9DF53200E861FE /* BolusShortcut.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1920BF5C2B9DF53200E861FE /* BolusShortcut.swift */; };
19229B962AFBB84800CD91CA /* Predictions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19229B952AFBB84800CD91CA /* Predictions.swift */; };
192424CB2B7A64E70063CBF0 /* NIghtscoutExercise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192424CA2B7A64E70063CBF0 /* NIghtscoutExercise.swift */; };
Expand All @@ -31,6 +30,8 @@
1935364028496F7D001E0B16 /* Dynamic structs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1935363F28496F7D001E0B16 /* Dynamic structs.swift */; };
193F6CDD2A512C8F001240FD /* Loops.swift in Sources */ = {isa = PBXBuildFile; fileRef = 193F6CDC2A512C8F001240FD /* Loops.swift */; };
194297512B815938006B8A0B /* OverridesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 194297502B815938006B8A0B /* OverridesView.swift */; };
19493A3B2C5997AD00EC83A7 /* Database.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19493A3A2C5997AD00EC83A7 /* Database.swift */; };
19493A3D2C59987700EC83A7 /* DatabaseModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19493A3C2C59987700EC83A7 /* DatabaseModels.swift */; };
194C32772B93A9BF0016FB2A /* OverrideShortcuts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 194C32762B93A9BF0016FB2A /* OverrideShortcuts.swift */; };
194D7E6E2B974F9F007A38C1 /* LoopsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 194D7E6D2B974F9F007A38C1 /* LoopsView.swift */; };
1956FB212AFF79E200C7B4FF /* CoreDataStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1956FB202AFF79E200C7B4FF /* CoreDataStorage.swift */; };
Expand Down Expand Up @@ -450,8 +451,6 @@
F90692D3274B9A130037068D /* AppleHealthKitRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F90692D2274B9A130037068D /* AppleHealthKitRootView.swift */; };
F90692D6274B9A450037068D /* HealthKitStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F90692D5274B9A450037068D /* HealthKitStateModel.swift */; };
FA630397F76B582C8D8681A7 /* BasalProfileEditorProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42369F66CF91F30624C0B3A6 /* BasalProfileEditorProvider.swift */; };
FE41E4D429463C660047FD55 /* NightscoutStatistics.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE41E4D329463C660047FD55 /* NightscoutStatistics.swift */; };
FE41E4D629463EE20047FD55 /* NightscoutPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE41E4D529463EE20047FD55 /* NightscoutPreferences.swift */; };
FE66D16B291F74F8005D6F77 /* Bundle+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE66D16A291F74F8005D6F77 /* Bundle+Extensions.swift */; };
FEFA5C0F299F810B00765C17 /* Core_Data.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = FEFA5C0D299F810B00765C17 /* Core_Data.xcdatamodeld */; };
FEFA5C11299F814A00765C17 /* CoreDataStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEFA5C10299F814A00765C17 /* CoreDataStack.swift */; };
Expand Down Expand Up @@ -571,7 +570,6 @@
1918333A26ADA46800F45722 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = "<group>"; };
191A9D152BED00A500028D48 /* Version.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Version.swift; sourceTree = "<group>"; };
191A9D172BED24B000028D48 /* ActiveIOBView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActiveIOBView.swift; sourceTree = "<group>"; };
191F62672AD6B05A004D7911 /* NightscoutSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NightscoutSettings.swift; sourceTree = "<group>"; };
1920BF5C2B9DF53200E861FE /* BolusShortcut.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BolusShortcut.swift; sourceTree = "<group>"; };
192202902BAB567800B95BE8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
19229B952AFBB84800CD91CA /* Predictions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Predictions.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -628,6 +626,8 @@
193F1E3C2B44C14800525770 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = "<group>"; };
193F6CDC2A512C8F001240FD /* Loops.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Loops.swift; sourceTree = "<group>"; };
194297502B815938006B8A0B /* OverridesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverridesView.swift; sourceTree = "<group>"; };
19493A3A2C5997AD00EC83A7 /* Database.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Database.swift; sourceTree = "<group>"; };
19493A3C2C59987700EC83A7 /* DatabaseModels.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseModels.swift; sourceTree = "<group>"; };
194C32762B93A9BF0016FB2A /* OverrideShortcuts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverrideShortcuts.swift; sourceTree = "<group>"; };
194D7E6D2B974F9F007A38C1 /* LoopsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoopsView.swift; sourceTree = "<group>"; };
1956FB202AFF79E200C7B4FF /* CoreDataStorage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataStorage.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1052,8 +1052,6 @@
F90692D2274B9A130037068D /* AppleHealthKitRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleHealthKitRootView.swift; sourceTree = "<group>"; };
F90692D5274B9A450037068D /* HealthKitStateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HealthKitStateModel.swift; sourceTree = "<group>"; };
FBB3BAE7494CB771ABAC7B8B /* ISFEditorRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ISFEditorRootView.swift; sourceTree = "<group>"; };
FE41E4D329463C660047FD55 /* NightscoutStatistics.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NightscoutStatistics.swift; sourceTree = "<group>"; };
FE41E4D529463EE20047FD55 /* NightscoutPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NightscoutPreferences.swift; sourceTree = "<group>"; };
FE66D16A291F74F8005D6F77 /* Bundle+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+Extensions.swift"; sourceTree = "<group>"; };
FEFA5C0E299F810B00765C17 /* Core_Data.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Core_Data.xcdatamodel; sourceTree = "<group>"; };
FEFA5C10299F814A00765C17 /* CoreDataStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataStack.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1585,6 +1583,7 @@
3811DE9725C9D88300A708ED /* NightscoutManager.swift */,
38FE826925CC82DB001FF17A /* NetworkService.swift */,
38FE826C25CC8461001FF17A /* NightscoutAPI.swift */,
19493A3A2C5997AD00EC83A7 /* Database.swift */,
);
path = Network;
sourceTree = "<group>";
Expand Down Expand Up @@ -1846,49 +1845,47 @@
388E5A5925B6F0250019842D /* Models */ = {
isa = PBXGroup;
children = (
CE82E02628E869DF00473A9C /* AlertEntry.swift */,
385CEAC025F2EA52002D6D5B /* Announcement.swift */,
388E5A5F25B6F2310019842D /* Autosens.swift */,
38A00B1E25FC00F7006BC0B0 /* Autotune.swift */,
19F191E32BE686AE00F6297E /* BareMinimum.swift */,
388358C725EEF6D200E024B2 /* BasalProfileEntry.swift */,
38D0B3B525EBE24900CB6E88 /* Battery.swift */,
382C134A25F14E3700715CE1 /* BGTargets.swift */,
3870FF4225EC13F40088248F /* BloodGlucose.swift */,
38A9260425F012D8009E3739 /* CarbRatios.swift */,
38D0B3D825EC07C400CB6E88 /* CarbsEntry.swift */,
19D4E4EA29FC6A9F00351451 /* Charts.swift */,
19A910352A24D6D700C8951B /* Configs.swift */,
F2159A532BA6207F00A0B716 /* ContactTrickEntry.swift */,
3811DF0125CA9FEA00A708ED /* Credentials.swift */,
19493A3C2C59987700EC83A7 /* DatabaseModels.swift */,
1935363F28496F7D001E0B16 /* Dynamic structs.swift */,
F270F68C2BAE374C00F6D8DD /* FontTracking.swift */,
F2159A512BA60F7A00A0B716 /* FontWeight.swift */,
38AEE73C25F0200C0013F05B /* FreeAPSSettings.swift */,
383948D925CD64D500E91849 /* Glucose.swift */,
E0D4F80427513ECF00BDF1FE /* HealthKitSample.swift */,
1967DFBD29D052C200759F30 /* Icons.swift */,
382C133625F13A1E00715CE1 /* InsulinSensitivities.swift */,
38887CCD25F5725200944304 /* IOBEntry.swift */,
193F6CDC2A512C8F001240FD /* Loops.swift */,
19012CDB291D2CB900FB8210 /* LoopStats.swift */,
192424CA2B7A64E70063CBF0 /* NIghtscoutExercise.swift */,
385CEA8125F23DFD002D6D5B /* NightscoutStatus.swift */,
389442CA25F65F7100FA1F27 /* NightscoutTreatment.swift */,
3895E4C525B9E00D00214B37 /* Preferences.swift */,
38A13D3125E28B4B00EAA382 /* PumpHistoryEvent.swift */,
3883583325EEB38000E024B2 /* PumpSettings.swift */,
38E989DC25F5021400C0CED0 /* PumpStatus.swift */,
CC6C406D2ACDD69E009B8058 /* RawFetchedProfile.swift */,
38BF021C25E7E3AF00579895 /* Reservoir.swift */,
19B0EF2028F6D66200069496 /* Statistics.swift */,
3871F38625ED661C0013ECB5 /* Suggestion.swift */,
38A0364125ED069400FCBB52 /* TempBasal.swift */,
3871F39B25ED892B0013ECB5 /* TempTarget.swift */,
3811DE8E25C9D80400A708ED /* User.swift */,
E0D4F80427513ECF00BDF1FE /* HealthKitSample.swift */,
1935363F28496F7D001E0B16 /* Dynamic structs.swift */,
CE82E02628E869DF00473A9C /* AlertEntry.swift */,
19B0EF2028F6D66200069496 /* Statistics.swift */,
19F191E32BE686AE00F6297E /* BareMinimum.swift */,
19012CDB291D2CB900FB8210 /* LoopStats.swift */,
FE41E4D329463C660047FD55 /* NightscoutStatistics.swift */,
FE41E4D529463EE20047FD55 /* NightscoutPreferences.swift */,
191F62672AD6B05A004D7911 /* NightscoutSettings.swift */,
1967DFBD29D052C200759F30 /* Icons.swift */,
19D4E4EA29FC6A9F00351451 /* Charts.swift */,
19A910352A24D6D700C8951B /* Configs.swift */,
193F6CDC2A512C8F001240FD /* Loops.swift */,
CC6C406D2ACDD69E009B8058 /* RawFetchedProfile.swift */,
192424CA2B7A64E70063CBF0 /* NIghtscoutExercise.swift */,
F2159A512BA60F7A00A0B716 /* FontWeight.swift */,
F2159A532BA6207F00A0B716 /* ContactTrickEntry.swift */,
F270F68C2BAE374C00F6D8DD /* FontTracking.swift */,
191A9D152BED00A500028D48 /* Version.swift */,
);
path = Models;
Expand Down Expand Up @@ -2935,6 +2932,7 @@
19E1F7EF29D08EBA005C8D20 /* IconConfigRootWiew.swift in Sources */,
1967DFC229D053D300759F30 /* IconImage.swift in Sources */,
382C134B25F14E3700715CE1 /* BGTargets.swift in Sources */,
19493A3B2C5997AD00EC83A7 /* Database.swift in Sources */,
38AEE75725F0F18E0013F05B /* CarbsStorage.swift in Sources */,
38B4F3CA25E502E200E76A18 /* SwiftNotificationCenter.swift in Sources */,
38AEE75225F022080013F05B /* SettingsManager.swift in Sources */,
Expand Down Expand Up @@ -2985,7 +2983,6 @@
191A9D162BED00A500028D48 /* Version.swift in Sources */,
38E44535274E411700EC9A94 /* Disk+Data.swift in Sources */,
3811DE3125C9D49500A708ED /* HomeProvider.swift in Sources */,
FE41E4D629463EE20047FD55 /* NightscoutPreferences.swift in Sources */,
E013D872273AC6FE0014109C /* GlucoseSimulatorSource.swift in Sources */,
388E5A5C25B6F0770019842D /* JSON.swift in Sources */,
3811DF0225CA9FEA00A708ED /* Credentials.swift in Sources */,
Expand Down Expand Up @@ -3047,7 +3044,6 @@
38A9260525F012D8009E3739 /* CarbRatios.swift in Sources */,
38FCF3D625E8FDF40078B0D1 /* MD5.swift in Sources */,
3871F39C25ED892B0013ECB5 /* TempTarget.swift in Sources */,
191F62682AD6B05A004D7911 /* NightscoutSettings.swift in Sources */,
FEFA5C11299F814A00765C17 /* CoreDataStack.swift in Sources */,
3811DEAB25C9D88300A708ED /* HTTPResponseStatus.swift in Sources */,
3811DE5F25C9D4D500A708ED /* ProgressBar.swift in Sources */,
Expand Down Expand Up @@ -3183,6 +3179,7 @@
19E1F7EA29D082ED005C8D20 /* IconConfigProvider.swift in Sources */,
44190F0BBA464D74B857D1FB /* PreferencesEditorRootView.swift in Sources */,
E97285ED9B814CD5253C6658 /* AddCarbsDataFlow.swift in Sources */,
19493A3D2C59987700EC83A7 /* DatabaseModels.swift in Sources */,
CE48C86428CA69D5007C0598 /* OmniBLEPumpManagerExtensions.swift in Sources */,
38E8755427561E9800975559 /* DataFlow.swift in Sources */,
38E44522274E3DDC00EC9A94 /* NetworkReachabilityManager.swift in Sources */,
Expand Down Expand Up @@ -3220,7 +3217,6 @@
BF1667ADE69E4B5B111CECAE /* ManualTempBasalProvider.swift in Sources */,
F90692D6274B9A450037068D /* HealthKitStateModel.swift in Sources */,
C967DACD3B1E638F8B43BE06 /* ManualTempBasalStateModel.swift in Sources */,
FE41E4D429463C660047FD55 /* NightscoutStatistics.swift in Sources */,
38E4453B274E411700EC9A94 /* Disk+VolumeInformation.swift in Sources */,
7BCFACB97C821041BA43A114 /* ManualTempBasalRootView.swift in Sources */,
38E44534274E411700EC9A94 /* Disk+InternalHelpers.swift in Sources */,
Expand Down
5 changes: 5 additions & 0 deletions FreeAPS/Sources/APS/OpenAPS/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ extension OpenAPS {
static let uploadedCGMState = "upload/uploaded-cgm-state.json"
static let uploadedPodAge = "upload/uploaded-pod-age.json"
static let uploadedProfile = "upload/uploaded-profile.json"
static let uploadedProfileToDatabase = "upload/uploaded-profile_database.json"
static let uploadedPreferences = "upload/uploaded-preferences.json"
static let uploadedSettings = "upload/uploaded-settings.json"
static let uploadedManualGlucose = "upload/uploaded-manual-readings.json"
static let notUploadedOverrides = "upload/not-uploaded-overrides.json"
static let uploadedPumpSettings = "upload/uploaded-pump_settings.json"
static let uploadedTempTargetsDatabase = "upload/uploaded-temptargets_database.json"
static let uploadedMealPresets = "upload/uploaded-meal-presets.json"
static let uploadedOverridePresets = "upload/uploaded-override-presets.json"
}

enum FreeAPS {
Expand Down
Loading

0 comments on commit f0d1d52

Please sign in to comment.