Skip to content

Commit 2dff1f6

Browse files
authored
Merge pull request #254 from loopandlearn/profiles
Display profile in infotables
2 parents 4af380d + 6eef9e8 commit 2dff1f6

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

LoopFollow/Controllers/NightScout.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ extension MainViewController {
3939
}
4040

4141
let store: [String: Store]
42+
let defaultProfile: String
4243
}
4344

4445
//NS Basal Data Struct
@@ -130,4 +131,4 @@ extension MainViewController {
130131
noteGraphData.removeAll()
131132
updateNotes()
132133
}
133-
}
134+
}

LoopFollow/Controllers/Nightscout/Profile.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ extension MainViewController {
2727
guard let store = profileData.store["default"] ?? profileData.store["Default"] else {
2828
return
2929
}
30-
30+
31+
tableData[12].value = profileData.defaultProfile
32+
infoTable.reloadData()
33+
3134
basalProfile.removeAll()
3235
for basalEntry in store.basal {
3336
let entry = basalProfileStruct(value: basalEntry.value, time: basalEntry.time, timeAsSeconds: basalEntry.timeAsSeconds)

LoopFollow/ViewControllers/MainViewController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ class MainViewController: UIViewController, UITableViewDataSource, ChartViewDele
165165
UserDefaultsRepository.infoNames.value.append("Pred.")
166166
UserDefaultsRepository.infoNames.value.append("Carbs today")
167167
UserDefaultsRepository.infoNames.value.append("Autosens")
168-
168+
UserDefaultsRepository.infoNames.value.append("Profile")
169+
169170
// Reset deprecated settings
170171
UserDefaultsRepository.debugLog.value = false;
171172
UserDefaultsRepository.alwaysDownloadAllBG.value = true;

LoopFollow/repository/UserDefaults.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ class UserDefaultsRepository {
3131
"Rec. Bolus",
3232
"Pred.",
3333
"Carbs today",
34-
"Autosens"])
35-
static let infoSort = UserDefaultsValue<[Int]>(key: "infoSort", default: [0,1,2,3,4,5,6,7,8,9,10,11])
36-
static let infoVisible = UserDefaultsValue<[Bool]>(key: "infoVisible", default: [true,true,true,true,true,true,true,true,true,true,true,false])
34+
"Autosens",
35+
"Profile"])
36+
static let infoSort = UserDefaultsValue<[Int]>(key: "infoSort", default: [0,1,2,3,4,5,6,7,8,9,10,11,12])
37+
static let infoVisible = UserDefaultsValue<[Bool]>(key: "infoVisible", default: [true,true,true,true,true,true,true,true,true,true,true,false,false])
3738
static let hideInfoTable = UserDefaultsValue<Bool>(key: "hideInfoTable", default: false)
3839

3940
// Nightscout Settings

0 commit comments

Comments
 (0)