From a7053e02b6f1fcdc9d3737bdf33bf88e4ae9ed50 Mon Sep 17 00:00:00 2001 From: Nathan Racklyeft Date: Mon, 23 May 2016 22:12:55 -0700 Subject: [PATCH 1/5] Have travis build the app --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 143470a730..4d3b0a6ac5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,4 +6,5 @@ xcode_scheme: Loop before_script: - carthage bootstrap script: + - xctool -project Loop.xcodeproj -scheme Loop -sdk iphonesimulator9.3 build - xctool -project Loop.xcodeproj -scheme LoopTests -sdk iphonesimulator9.3 test From 64a8f97089be66cbb488e7302130c0a4b8a7f7e3 Mon Sep 17 00:00:00 2001 From: Nathan Racklyeft Date: Mon, 23 May 2016 22:18:59 -0700 Subject: [PATCH 2/5] mvers 0.1.0 --- Loop/Info.plist | 2 +- LoopTests/Info.plist | 2 +- WatchApp Extension/Info.plist | 2 +- WatchApp/Info.plist | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Loop/Info.plist b/Loop/Info.plist index 75aa0229cb..e3107628a2 100644 --- a/Loop/Info.plist +++ b/Loop/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + 0.1.0 CFBundleSignature ???? CFBundleVersion diff --git a/LoopTests/Info.plist b/LoopTests/Info.plist index ba72822e87..484c716a41 100644 --- a/LoopTests/Info.plist +++ b/LoopTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.0 + 0.1.0 CFBundleSignature ???? CFBundleVersion diff --git a/WatchApp Extension/Info.plist b/WatchApp Extension/Info.plist index e54fcdc103..f6594eeb99 100644 --- a/WatchApp Extension/Info.plist +++ b/WatchApp Extension/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.0 + 0.1.0 CFBundleSignature ???? CFBundleVersion diff --git a/WatchApp/Info.plist b/WatchApp/Info.plist index e57efd4a29..b6940e29d1 100644 --- a/WatchApp/Info.plist +++ b/WatchApp/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + 0.1.0 CFBundleSignature ???? CFBundleVersion From f95e33ec38eddf6f1e1313cb56a0128e41ede38e Mon Sep 17 00:00:00 2001 From: Nathan Racklyeft Date: Thu, 26 May 2016 17:54:54 -0700 Subject: [PATCH 3/5] Read reservoir volume before bolusing --- Cartfile | 2 +- Cartfile.resolved | 2 +- Loop/Managers/LoopDataManager.swift | 29 ++++++++++++++++++++++------- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Cartfile b/Cartfile index e745f5a87b..06d6632441 100644 --- a/Cartfile +++ b/Cartfile @@ -2,5 +2,5 @@ github "loudnate/LoopKit" ~> 0.3 github "loudnate/xDripG5" ~> 0.4 github "loudnate/SwiftCharts" "loudnate/naterade" github "mddub/dexcom-share-client-swift" ~> 0.1 -github "ps2/rileylink_ios" ~> 0.3 +github "ps2/rileylink_ios" "read-reservoir" github "mpurland/Amplitude-iOS" "framework" diff --git a/Cartfile.resolved b/Cartfile.resolved index 1e54dde2da..47812d55c0 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -3,5 +3,5 @@ github "loudnate/Crypto" "e0ef5b498f2c373d676135dabf5d1803b8558509" github "loudnate/LoopKit" "v0.3.2" github "loudnate/SwiftCharts" "448b80f4025bbf592a4d8ca9d079e9684bc0b64b" github "mddub/dexcom-share-client-swift" "v0.1.0" -github "ps2/rileylink_ios" "v0.3.0" +github "ps2/rileylink_ios" "dd340d04b65199fdd1519018b42a954ac24a870d" github "loudnate/xDripG5" "0.4.1" diff --git a/Loop/Managers/LoopDataManager.swift b/Loop/Managers/LoopDataManager.swift index f4ab29ed84..f234d7baa2 100644 --- a/Loop/Managers/LoopDataManager.swift +++ b/Loop/Managers/LoopDataManager.swift @@ -516,15 +516,30 @@ class LoopDataManager { return } - ops.setNormalBolus(units) { (error) in - if let error = error { - self.deviceDataManager.logger?.addError(error, fromSource: "Bolus") + ops.readRemainingInsulin { (result) in + switch result { + case .Success(let unitVolume): + self.deviceDataManager.doseStore.addReservoirValue(unitVolume, atDate: NSDate()) { (_, _, error) in + if let error = error { + self.deviceDataManager.logger?.addError(error, fromSource: "Bolus") + resultsHandler(success: false, error: .CommunicationError) + } else { + ops.setNormalBolus(units) { (error) in + if let error = error { + self.deviceDataManager.logger?.addError(error, fromSource: "Bolus") + resultsHandler(success: false, error: .CommunicationError) + } else { + self.lastBolus = (units: units, date: NSDate()) + resultsHandler(success: true, error: nil) + } + self.notify() + } + } + } + case .Failure(let error): + self.deviceDataManager.logger?.addError(error, fromSource: "Bolus") resultsHandler(success: false, error: .CommunicationError) - } else { - self.lastBolus = (units: units, date: NSDate()) - - resultsHandler(success: true, error: nil) } } } From 8bbef17edd51c13702d3f0a7dbdd9dcfc002dbf3 Mon Sep 17 00:00:00 2001 From: Nathan Racklyeft Date: Thu, 26 May 2016 17:57:10 -0700 Subject: [PATCH 4/5] Fixing travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4d3b0a6ac5..143470a730 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,4 @@ xcode_scheme: Loop before_script: - carthage bootstrap script: - - xctool -project Loop.xcodeproj -scheme Loop -sdk iphonesimulator9.3 build - xctool -project Loop.xcodeproj -scheme LoopTests -sdk iphonesimulator9.3 test From 40bff056b82ceefa2523e9b3480522e71c3eddfc Mon Sep 17 00:00:00 2001 From: Nathan Racklyeft Date: Thu, 26 May 2016 19:59:23 -0700 Subject: [PATCH 5/5] Updating RL branch --- Cartfile | 2 +- Cartfile.resolved | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cartfile b/Cartfile index 06d6632441..e2582e51dd 100644 --- a/Cartfile +++ b/Cartfile @@ -2,5 +2,5 @@ github "loudnate/LoopKit" ~> 0.3 github "loudnate/xDripG5" ~> 0.4 github "loudnate/SwiftCharts" "loudnate/naterade" github "mddub/dexcom-share-client-swift" ~> 0.1 -github "ps2/rileylink_ios" "read-reservoir" +github "ps2/rileylink_ios" "dev" github "mpurland/Amplitude-iOS" "framework" diff --git a/Cartfile.resolved b/Cartfile.resolved index 47812d55c0..a112654877 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -3,5 +3,5 @@ github "loudnate/Crypto" "e0ef5b498f2c373d676135dabf5d1803b8558509" github "loudnate/LoopKit" "v0.3.2" github "loudnate/SwiftCharts" "448b80f4025bbf592a4d8ca9d079e9684bc0b64b" github "mddub/dexcom-share-client-swift" "v0.1.0" -github "ps2/rileylink_ios" "dd340d04b65199fdd1519018b42a954ac24a870d" +github "ps2/rileylink_ios" "4305a83f897c19bd343c6b4f6fcdaaba0985ea64" github "loudnate/xDripG5" "0.4.1"