Skip to content

Commit b9d7f7a

Browse files
authored
dynamic carb absorption (#507)
* dynamic carb absorption * Carb chart contrast
1 parent 7aae4eb commit b9d7f7a

24 files changed

+1819
-248
lines changed

Loop Status Extension/Base.lproj/MainInterface.storyboard

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12118" systemVersion="16A323" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="64E-I5-5c4">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G24b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="64E-I5-5c4">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1010
</dependencies>
1111
<scenes>
@@ -50,7 +50,7 @@
5050
<constraint firstAttribute="trailing" secondItem="9iF-xY-Bh4" secondAttribute="trailing" constant="8" id="x9b-EB-fji"/>
5151
</constraints>
5252
</view>
53-
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GVu-hk-PBg" customClass="ChartContentView" customModule="LoopUI">
53+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GVu-hk-PBg" customClass="ChartContainerView" customModule="LoopUI">
5454
<rect key="frame" x="0.0" y="110" width="359" height="110"/>
5555
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
5656
<constraints>

Loop Status Extension/StatusViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class StatusViewController: UIViewController, NCWidgetProviding {
2626
}
2727
}
2828
@IBOutlet weak var subtitleLabel: UILabel!
29-
@IBOutlet weak var glucoseChartContentView: LoopUI.ChartContentView!
29+
@IBOutlet weak var glucoseChartContentView: LoopUI.ChartContainerView!
3030

3131
private lazy var charts: StatusChartsManager = {
3232
let charts = StatusChartsManager(

Loop.xcodeproj/project.pbxproj

Lines changed: 34 additions & 6 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "Uploading.pdf"
6+
}
7+
],
8+
"info" : {
9+
"version" : 1,
10+
"author" : "xcode"
11+
}
12+
}
6.26 KB
Binary file not shown.

Loop/Base.lproj/Main.storyboard

Lines changed: 317 additions & 15 deletions
Large diffs are not rendered by default.

Loop/Extensions/NSUserDefaults.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,20 @@ extension UserDefaults {
173173
}
174174
}
175175

176+
var insulinCounteractionEffects: [GlucoseEffectVelocity]? {
177+
get {
178+
guard let rawValue = array(forKey: Key.insulinCounteractionEffects.rawValue) as? [GlucoseEffectVelocity.RawValue] else {
179+
return nil
180+
}
181+
return rawValue.flatMap {
182+
GlucoseEffectVelocity(rawValue: $0)
183+
}
184+
}
185+
set {
186+
set(newValue?.map({ $0.rawValue }), forKey: Key.insulinCounteractionEffects.rawValue)
187+
}
188+
}
189+
176190
var insulinSensitivitySchedule: InsulinSensitivitySchedule? {
177191
get {
178192
if let rawValue = dictionary(forKey: Key.insulinSensitivitySchedule.rawValue) {

Loop/Managers/DoseMath.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
//
88

99
import Foundation
10+
import CarbKit
1011
import HealthKit
1112
import InsulinKit
1213
import LoopKit
1314

1415

15-
struct DoseMath {
16+
enum DoseMath {
1617
/// The allowed precision
1718
static let basalStrokes: Double = 40
1819

0 commit comments

Comments
 (0)