Skip to content

Commit 4794b6f

Browse files
committed
multiple: add step month chart, temporarily remove fitness calculations, continue working on health detail input
1 parent 38464ae commit 4794b6f

29 files changed

Lines changed: 339 additions & 121 deletions

.DS_Store

-4 KB
Binary file not shown.

.github/.DS_Store

-6 KB
Binary file not shown.

InfiniLink.xcodeproj/project.pbxproj

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
E0599A0F2CB4E62800D64E0B /* SetUpDetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0599A0E2CB4E62800D64E0B /* SetUpDetailsView.swift */; };
4949
E0599A112CB5553B00D64E0B /* FSFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0599A102CB5553B00D64E0B /* FSFile.swift */; };
5050
E05DA4C12D13752C00A49203 /* DebugLogManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E05DA4C02D13752C00A49203 /* DebugLogManager.swift */; };
51+
E064D40A2D77F32F008500AE /* CalendarDay.swift in Sources */ = {isa = PBXBuildFile; fileRef = E064D4092D77F32F008500AE /* CalendarDay.swift */; };
5152
E078ECFB2D4E6D9800560364 /* Zip in Frameworks */ = {isa = PBXBuildFile; productRef = E078ECFA2D4E6D9800560364 /* Zip */; };
5253
E07D8F142CBD688A005C1325 /* CustomizationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E07D8F132CBD688A005C1325 /* CustomizationView.swift */; };
5354
E07D8F162CBE1F6F005C1325 /* RemindersManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E07D8F152CBE1F6F005C1325 /* RemindersManager.swift */; };
@@ -66,6 +67,7 @@
6667
E09696E32D2F807700CCCBF8 /* HeartChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09696E22D2F807700CCCBF8 /* HeartChartView.swift */; };
6768
E09696E52D318AFB00CCCBF8 /* Data+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09696E42D318AFB00CCCBF8 /* Data+Extension.swift */; };
6869
E09696E72D323A6D00CCCBF8 /* StepChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09696E62D323A6D00CCCBF8 /* StepChartView.swift */; };
70+
E09990982D77685A00B0FCAF /* StepMonthlyChartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E09990972D77685A00B0FCAF /* StepMonthlyChartView.swift */; };
6971
E0A7C06B2CB0DE4C0042A12D /* Weather.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0A7C06A2CB0DE4C0042A12D /* Weather.swift */; };
7072
E0A7C0732CB0ECCE0042A12D /* NotificationsSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0A7C0722CB0ECCE0042A12D /* NotificationsSettingsView.swift */; };
7173
E0A7C0762CB17E520042A12D /* MusicSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0A7C0752CB17E520042A12D /* MusicSettingsView.swift */; };
@@ -172,6 +174,7 @@
172174
E0599A0E2CB4E62800D64E0B /* SetUpDetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetUpDetailsView.swift; sourceTree = "<group>"; };
173175
E0599A102CB5553B00D64E0B /* FSFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FSFile.swift; sourceTree = "<group>"; };
174176
E05DA4C02D13752C00A49203 /* DebugLogManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugLogManager.swift; sourceTree = "<group>"; };
177+
E064D4092D77F32F008500AE /* CalendarDay.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarDay.swift; sourceTree = "<group>"; };
175178
E06973AA2B35E6F4009C2F7D /* InfiniLink.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = InfiniLink.entitlements; sourceTree = "<group>"; };
176179
E07D8F132CBD688A005C1325 /* CustomizationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomizationView.swift; sourceTree = "<group>"; };
177180
E07D8F152CBE1F6F005C1325 /* RemindersManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemindersManager.swift; sourceTree = "<group>"; };
@@ -190,6 +193,7 @@
190193
E09696E22D2F807700CCCBF8 /* HeartChartView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeartChartView.swift; sourceTree = "<group>"; };
191194
E09696E42D318AFB00CCCBF8 /* Data+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Data+Extension.swift"; sourceTree = "<group>"; };
192195
E09696E62D323A6D00CCCBF8 /* StepChartView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepChartView.swift; sourceTree = "<group>"; };
196+
E09990972D77685A00B0FCAF /* StepMonthlyChartView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepMonthlyChartView.swift; sourceTree = "<group>"; };
193197
E0A7C06A2CB0DE4C0042A12D /* Weather.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Weather.swift; sourceTree = "<group>"; };
194198
E0A7C0722CB0ECCE0042A12D /* NotificationsSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsSettingsView.swift; sourceTree = "<group>"; };
195199
E0A7C0752CB17E520042A12D /* MusicSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicSettingsView.swift; sourceTree = "<group>"; };
@@ -430,19 +434,29 @@
430434
E09696E12D2F806A00CCCBF8 /* Charts */ = {
431435
isa = PBXGroup;
432436
children = (
437+
E09990962D77684800B0FCAF /* Steps */,
433438
E09696E22D2F807700CCCBF8 /* HeartChartView.swift */,
434-
E09696E62D323A6D00CCCBF8 /* StepChartView.swift */,
435439
);
436440
path = Charts;
437441
sourceTree = "<group>";
438442
};
443+
E09990962D77684800B0FCAF /* Steps */ = {
444+
isa = PBXGroup;
445+
children = (
446+
E09696E62D323A6D00CCCBF8 /* StepChartView.swift */,
447+
E09990972D77685A00B0FCAF /* StepMonthlyChartView.swift */,
448+
);
449+
path = Steps;
450+
sourceTree = "<group>";
451+
};
439452
E0A7C0692CB0DE450042A12D /* Model */ = {
440453
isa = PBXGroup;
441454
children = (
442455
E0A7C06A2CB0DE4C0042A12D /* Weather.swift */,
443456
E0599A102CB5553B00D64E0B /* FSFile.swift */,
444457
E0B85D202CB625FE00D85122 /* Exercise.swift */,
445458
E08C4A482CC4048900013D15 /* SleepData.swift */,
459+
E064D4092D77F32F008500AE /* CalendarDay.swift */,
446460
);
447461
path = Model;
448462
sourceTree = "<group>";
@@ -773,6 +787,7 @@
773787
E09696E52D318AFB00CCCBF8 /* Data+Extension.swift in Sources */,
774788
E0A7C09A2CB2270D0042A12D /* StepsView.swift in Sources */,
775789
E0C7C8532CAF14870043DA2D /* SetTime.swift in Sources */,
790+
E064D40A2D77F32F008500AE /* CalendarDay.swift in Sources */,
776791
E0A7C0A52CB2527F0042A12D /* HeartSettingsView.swift in Sources */,
777792
E07D8F1E2CBF03E6005C1325 /* WeatherController.swift in Sources */,
778793
E05999992CB25C5600D64E0B /* SleepView.swift in Sources */,
@@ -808,6 +823,7 @@
808823
E0A7C07D2CB1AD370042A12D /* MusicController.swift in Sources */,
809824
E05046892D136F1E00FE4BCD /* DebugLogsView.swift in Sources */,
810825
E059999C2CB2E56300D64E0B /* AlarmView.swift in Sources */,
826+
E09990982D77685A00B0FCAF /* StepMonthlyChartView.swift in Sources */,
811827
E0A7C06B2CB0DE4C0042A12D /* Weather.swift in Sources */,
812828
E0B85D6F2CB8CDC700D85122 /* Date+Extension.swift in Sources */,
813829
E0C7C85C2CAF14870043DA2D /* BLEManager.swift in Sources */,

InfiniLink/.DS_Store

-14 KB
Binary file not shown.
-10 KB
Binary file not shown.

InfiniLink/BLE/.DS_Store

-6 KB
Binary file not shown.

InfiniLink/BLE/BLEFS.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ class BLEFSHandler: ObservableObject {
245245

246246
var dataQueue = data
247247
var newOffset = 0
248-
// FIXME: this line needs to be removed if we're uploading multiple files and want to show the overall progress percentage
249-
self.progress = 0
248+
self.progress = 0 // This line needs to be removed if we're uploading multiple files and want to show the overall progress percentage
250249

251250
while !writeFileFS.completed {
252251
writeFileFS.group.enter()

InfiniLink/BLE/DeviceManager.swift

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ class DeviceManager: ObservableObject {
112112
newDevice.modelNumber = ""
113113
newDevice.serial = ""
114114

115-
try context.save()
115+
Task {
116+
try await context.perform {
117+
try context.save()
118+
}
119+
}
116120

117121
return newDevice
118122
} catch {
@@ -150,9 +154,9 @@ class DeviceManager: ObservableObject {
150154

151155
Task {
152156
await persistenceController.save()
157+
158+
getSettings()
153159
}
154-
155-
getSettings()
156160
}
157161

158162
func updateName(name: String, for device: Device) {
@@ -183,13 +187,17 @@ class DeviceManager: ObservableObject {
183187
}
184188
}
185189

186-
func removeDevice(_ device: Device) async {
187-
await persistenceController.container.performBackgroundTask { context in
188-
do {
189-
context.delete(device)
190-
try context.save()
191-
} catch {
192-
log(error.localizedDescription, caller: "DeviceManager - removeDevice")
190+
func removeDevice(_ device: Device) {
191+
let context = persistenceController.container.viewContext
192+
193+
Task {
194+
await context.perform {
195+
do {
196+
context.delete(device)
197+
try context.save()
198+
} catch {
199+
log(error.localizedDescription, caller: "DeviceManager - removeDevice")
200+
}
193201
}
194202
}
195203
}

InfiniLink/Components/.DS_Store

-10 KB
Binary file not shown.

InfiniLink/Core/.DS_Store

-6 KB
Binary file not shown.

0 commit comments

Comments
 (0)