Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7009e32
IRC-discrepancy-timeline
dm61 Oct 14, 2018
4311919
IRC as separate class
dm61 Oct 21, 2018
d7a17fe
Merge pull request #8 from dm61/IRC-class
dm61 Oct 21, 2018
9eae122
IRC class in a separate file, with comments
dm61 Oct 22, 2018
b653a7c
Merge pull request #9 from dm61/IRC-class
dm61 Oct 23, 2018
d774f4c
IRC issue report
dm61 Oct 25, 2018
b2beb20
Merge pull request #10 from dm61/IRC-class
dm61 Oct 25, 2018
17468f1
refactor RC to generic protocol
dm61 Oct 27, 2018
d3a4d06
reorganize RC protocol
dm61 Oct 28, 2018
5bb4eab
settings moved to RC/IRC calcs
dm61 Nov 1, 2018
ca9bd27
IRC unit tests
dm61 Nov 3, 2018
908d755
standard retrospective correction always enabled
dm61 Nov 6, 2018
2649cee
Merge remote-tracking branch 'upstream/dev' into integral-retrospecti…
dm61 Dec 20, 2018
6ce3673
Merge branch 'IRC-backup' into integral-retrospective-correction
dm61 Jan 28, 2019
ed12f3c
Update project.pbxproj
dm61 Apr 21, 2019
aa2140b
Merge branch 'integral-retrospective-correction' into IRC-rebase-to-v…
dm61 Apr 24, 2019
1b8cecd
update IRC code to v1.10.0dev
dm61 Apr 24, 2019
d7cbd41
IRC disabled by default
dm61 Jun 11, 2019
e441d29
sign
dm61 Jul 29, 2019
5a9da10
Merge branch 'integral-retrospective-correction' into IRC-rebase-to-d…
dm61 Jul 29, 2019
f3e6ab5
refactor IRC
dm61 Jul 31, 2019
2afff92
IRC off by default
dm61 Jul 31, 2019
a8bb1c3
remove signing
dm61 Jul 31, 2019
ba6908b
sign
dm61 Aug 2, 2019
63fa125
add ParameterEstimation
dm61 Aug 2, 2019
2844cae
Update LoopDataManager.swift
dm61 Aug 2, 2019
2079a31
Update View Controllers
dm61 Aug 2, 2019
9aa5fa6
Review report intro statement
dm61 Aug 4, 2019
b30b25c
Merge branch 'integral-retrospective-correction' into irc-rebase-to-d…
dm61 Aug 17, 2019
204ce76
Update Cartfile.resolved
dm61 Aug 17, 2019
3e3abe6
Merge branch 'settings-review-wip' into settings-review-rebase-to-dev…
dm61 Aug 17, 2019
89d45c8
Update Cartfile.resolved
dm61 Aug 17, 2019
2322c30
Merge branch 'integral-retrospective-correction' into irc-rebase-to-d…
dm61 Aug 19, 2019
e3e0247
Merge branch 'settings-review-wip' into settings-review-rebase-to-dev…
dm61 Aug 20, 2019
e56587c
fix trailing-end fasting interval assembly
dm61 Sep 7, 2019
e0492e2
Merge branch 'integral-retrospective-correction' into irc-rebase-to-d…
dm61 Sep 7, 2019
6e51eb3
Merge branch 'settings-review-wip' into settings-review-wip-rebase-to…
dm61 Sep 7, 2019
e601692
Merge branch 'integral-retrospective-correction' into irc-rebase-to-d…
dm61 Sep 21, 2019
9794a98
Update project.pbxproj
dm61 Sep 21, 2019
901164b
fix irc switch
dm61 Sep 21, 2019
36bfd3d
Merge branch 'settings-review-wip' into settings-review-wip-rebase-to…
dm61 Sep 21, 2019
bb3cd3e
Merge branch 'settings-review-wip' into irc-pe-wip
dm61 Sep 21, 2019
ded37a3
sign
dm61 Sep 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Common/Extensions/GlucoseRangeSchedule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ extension GlucoseRangeSchedule {
func minQuantity(at date: Date) -> HKQuantity {
return HKQuantity(unit: unit, doubleValue: value(at: date).minValue)
}

func maxQuantity(at date: Date) -> HKQuantity {
return HKQuantity(unit: unit, doubleValue: value(at: date).maxValue)
}
}


Expand Down
56 changes: 46 additions & 10 deletions Loop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,12 @@
89E267FD2292456700A3F2AF /* FeatureFlags.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89E267FB2292456700A3F2AF /* FeatureFlags.swift */; };
89E267FF229267DF00A3F2AF /* Optional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89E267FE229267DF00A3F2AF /* Optional.swift */; };
89E26800229267DF00A3F2AF /* Optional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89E267FE229267DF00A3F2AF /* Optional.swift */; };
9E0F6349218D4AC1006E5D21 /* IntegralRetrospectiveCorrectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E0F6348218D4AC1006E5D21 /* IntegralRetrospectiveCorrectionTests.swift */; };
9E38926722F4C97900AC2801 /* ParameterEstimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E38926622F4C97900AC2801 /* ParameterEstimation.swift */; };
9E575201217D87E7002D167B /* IntegralRetrospectiveCorrection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E575200217D87E7002D167B /* IntegralRetrospectiveCorrection.swift */; };
9E604099218F8850003D93A9 /* glucose_discrepancies_constant_positive.json in Resources */ = {isa = PBXBuildFile; fileRef = 9E604098218F8850003D93A9 /* glucose_discrepancies_constant_positive.json */; };
9E60409B218FFF75003D93A9 /* glucose_discrepancies_single_same_sign.json in Resources */ = {isa = PBXBuildFile; fileRef = 9E60409A218FFF75003D93A9 /* glucose_discrepancies_single_same_sign.json */; };
9EAFDFEE218E6CBC0016F9ED /* glucose_discrepancies_sampled.json in Resources */ = {isa = PBXBuildFile; fileRef = 9EAFDFED218E6CBB0016F9ED /* glucose_discrepancies_sampled.json */; };
C10428971D17BAD400DD539A /* NightscoutUploadKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C10428961D17BAD400DD539A /* NightscoutUploadKit.framework */; };
C10B28461EA9BA5E006EA1FC /* far_future_high_bg_forecast.json in Resources */ = {isa = PBXBuildFile; fileRef = C10B28451EA9BA5E006EA1FC /* far_future_high_bg_forecast.json */; };
C11C87DE1E21EAAD00BB71D3 /* HKUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F526D5E1DF2459000A04910 /* HKUnit.swift */; };
Expand Down Expand Up @@ -1004,6 +1010,12 @@
89CA2B3C226E6B13004D9350 /* LocalTestingScenariosManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalTestingScenariosManager.swift; sourceTree = "<group>"; };
89E267FB2292456700A3F2AF /* FeatureFlags.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureFlags.swift; sourceTree = "<group>"; };
89E267FE229267DF00A3F2AF /* Optional.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Optional.swift; sourceTree = "<group>"; };
9E0F6348218D4AC1006E5D21 /* IntegralRetrospectiveCorrectionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntegralRetrospectiveCorrectionTests.swift; sourceTree = "<group>"; };
9E38926622F4C97900AC2801 /* ParameterEstimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParameterEstimation.swift; sourceTree = "<group>"; };
9E575200217D87E7002D167B /* IntegralRetrospectiveCorrection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntegralRetrospectiveCorrection.swift; sourceTree = "<group>"; };
9E604098218F8850003D93A9 /* glucose_discrepancies_constant_positive.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = glucose_discrepancies_constant_positive.json; sourceTree = "<group>"; };
9E60409A218FFF75003D93A9 /* glucose_discrepancies_single_same_sign.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = glucose_discrepancies_single_same_sign.json; sourceTree = "<group>"; };
9EAFDFED218E6CBB0016F9ED /* glucose_discrepancies_sampled.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = glucose_discrepancies_sampled.json; sourceTree = "<group>"; };
C10428961D17BAD400DD539A /* NightscoutUploadKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = NightscoutUploadKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C10B28451EA9BA5E006EA1FC /* far_future_high_bg_forecast.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = far_future_high_bg_forecast.json; sourceTree = "<group>"; };
C125F31A22FE7CE200FD0545 /* copy-frameworks.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "copy-frameworks.sh"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1212,6 +1224,7 @@
children = (
43511CDF21FD80E400566C63 /* RetrospectiveCorrection.swift */,
43511CE021FD80E400566C63 /* StandardRetrospectiveCorrection.swift */,
9E575200217D87E7002D167B /* IntegralRetrospectiveCorrection.swift */,
);
path = RetrospectiveCorrection;
sourceTree = "<group>";
Expand All @@ -1229,6 +1242,7 @@
438D42F81D7C88BC003244B0 /* PredictionInputEffect.swift */,
43441A9B1EDB34810087958C /* StatusExtensionContext+LoopKit.swift */,
4328E0311CFC068900E199AA /* WatchContext+LoopKit.swift */,
9E38926622F4C97900AC2801 /* ParameterEstimation.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -1596,9 +1610,11 @@
43F78D2C1C8FC58F002152D1 /* LoopTests */ = {
isa = PBXGroup;
children = (
9E0F634A218D4DC8006E5D21 /* Fixtures */,
43E2D90F1D20C581004DA55F /* Info.plist */,
7D2366E421250E0A0028B67D /* InfoPlist.strings */,
43E2D8C91D20B9E7004DA55F /* KeychainManagerTests.swift */,
9E0F6348218D4AC1006E5D21 /* IntegralRetrospectiveCorrectionTests.swift */,
);
path = LoopTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -1807,6 +1823,16 @@
name = Frameworks;
sourceTree = "<group>";
};
9E0F634A218D4DC8006E5D21 /* Fixtures */ = {
isa = PBXGroup;
children = (
9EAFDFED218E6CBB0016F9ED /* glucose_discrepancies_sampled.json */,
9E604098218F8850003D93A9 /* glucose_discrepancies_constant_positive.json */,
9E60409A218FFF75003D93A9 /* glucose_discrepancies_single_same_sign.json */,
);
path = Fixtures;
sourceTree = "<group>";
};
C16DA84022E8E104008624C2 /* Plugins */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2301,7 +2327,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9E60409B218FFF75003D93A9 /* glucose_discrepancies_single_same_sign.json in Resources */,
7D2366E621250E0A0028B67D /* InfoPlist.strings in Resources */,
9E604099218F8850003D93A9 /* glucose_discrepancies_constant_positive.json in Resources */,
9EAFDFEE218E6CBC0016F9ED /* glucose_discrepancies_sampled.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -2558,6 +2587,7 @@
43A51E1F1EB6D62A000736CC /* CarbAbsorptionViewController.swift in Sources */,
43776F901B8022E90074EA36 /* AppDelegate.swift in Sources */,
4372E48B213CB5F00068E043 /* Double.swift in Sources */,
9E575201217D87E7002D167B /* IntegralRetrospectiveCorrection.swift in Sources */,
430B29932041F5B300BA9F93 /* UserDefaults+Loop.swift in Sources */,
4341F4EB1EDB92AC001C936B /* LogglyService.swift in Sources */,
43CE7CDE1CA8B63E003CC1B0 /* Data.swift in Sources */,
Expand Down Expand Up @@ -2620,6 +2650,7 @@
433EA4C41D9F71C800CD78FB /* CommandResponseViewController.swift in Sources */,
C16DA84222E8E112008624C2 /* LoopPlugins.swift in Sources */,
43D2E8231F00425400AE5CBF /* BolusViewController+LoopDataManager.swift in Sources */,
9E38926722F4C97900AC2801 /* ParameterEstimation.swift in Sources */,
430B29952041F5CB00BA9F93 /* LoopSettings+Loop.swift in Sources */,
43785E932120A01B0057DED1 /* NewCarbEntryIntent+Loop.swift in Sources */,
43CEE6E61E56AFD400CB9116 /* NightscoutUploader.swift in Sources */,
Expand Down Expand Up @@ -2802,6 +2833,7 @@
buildActionMask = 2147483647;
files = (
43E2D9151D20C5A2004DA55F /* KeychainManagerTests.swift in Sources */,
9E0F6349218D4AC1006E5D21 /* IntegralRetrospectiveCorrectionTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -3335,7 +3367,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LOCALIZED_STRING_MACRO_NAMES = (
NSLocalizedString,
CFLocalizedString,
Expand Down Expand Up @@ -3401,7 +3433,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LOCALIZED_STRING_MACRO_NAMES = (
NSLocalizedString,
CFLocalizedString,
Expand All @@ -3426,7 +3458,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "$(APPICON_NAME)";
CODE_SIGN_ENTITLEMENTS = Loop/Loop.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = L6S34EF9DC;
ENABLE_BITCODE = YES;
INFOPLIST_FILE = Loop/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -3445,7 +3477,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "$(APPICON_NAME)";
CODE_SIGN_ENTITLEMENTS = Loop/Loop.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = L6S34EF9DC;
ENABLE_BITCODE = YES;
INFOPLIST_FILE = Loop/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -3463,7 +3495,7 @@
CODE_SIGN_ENTITLEMENTS = "WatchApp Extension/WatchApp Extension.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = L6S34EF9DC;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/watchOS";
INFOPLIST_FILE = "WatchApp Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
Expand All @@ -3475,6 +3507,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "WatchApp Extension/Extensions/WatchApp Extension-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 5.3;
};
name = Debug;
};
Expand All @@ -3486,7 +3519,7 @@
CODE_SIGN_ENTITLEMENTS = "WatchApp Extension/WatchApp Extension.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = L6S34EF9DC;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/watchOS";
INFOPLIST_FILE = "WatchApp Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
Expand All @@ -3497,6 +3530,7 @@
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "WatchApp Extension/Extensions/WatchApp Extension-Bridging-Header.h";
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 5.3;
};
name = Release;
};
Expand All @@ -3507,7 +3541,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "$(APPICON_NAME)";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = L6S34EF9DC;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/watchOS";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
Expand All @@ -3518,6 +3552,7 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 5.3;
};
name = Debug;
};
Expand All @@ -3528,7 +3563,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "$(APPICON_NAME)";
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = L6S34EF9DC;
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/watchOS";
IBSC_MODULE = WatchApp_Extension;
INFOPLIST_FILE = WatchApp/Info.plist;
Expand All @@ -3539,6 +3574,7 @@
SDKROOT = watchos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 5.3;
};
name = Release;
};
Expand Down Expand Up @@ -3808,7 +3844,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = L6S34EF9DC;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Loop Status Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
Expand All @@ -3830,7 +3866,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = L6S34EF9DC;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Loop Status Extension/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
Expand Down
3 changes: 3 additions & 0 deletions Loop/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@
/* Format string describing retrospective glucose prediction comparison. (1: Predicted glucose)(2: Actual glucose)(3: difference) */
"prediction-description-retrospective-correction" = "Predicted: %1$@\nActual: %2$@ (%3$@)";

/* Format string describing integral retrospective correction. (1: Integral glucose effect)(2: Total glucose effect) */
"prediction-description-integral-retrospective-correction" = "Integral effect: %1$@\nTotal glucose effect: %2$@";

/* Glucose HUD accessibility hint */
"Launches CGM app" = "Launches CGM app";

Expand Down
6 changes: 3 additions & 3 deletions Loop/Managers/AnalyticsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ final class AnalyticsManager: IdentifiableClass {
if newValue.dosingEnabled != oldValue.dosingEnabled {
logEvent("Closed loop enabled change")
}

if newValue.retrospectiveCorrectionEnabled != oldValue.retrospectiveCorrectionEnabled {
logEvent("Retrospective correction enabled change")
if newValue.integralRetrospectiveCorrectionEnabled != oldValue.integralRetrospectiveCorrectionEnabled {
logEvent("Integral retrospective correction enabled change")
}

if newValue.glucoseTargetRangeSchedule != oldValue.glucoseTargetRangeSchedule {
Expand Down
Loading