Skip to content

Commit 7e01ff2

Browse files
committed
Remove .DS_Store
1 parent 43a076f commit 7e01ff2

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

.DS_Store

-8 KB
Binary file not shown.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ xcuserdata/
2020
*.xcuserstate // <--- Here
2121
!default.xcworkspace
2222
*.swp
23+
.DS_Store

InfiniLink/BLE/BLECharacteristicHandler.swift

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,6 @@ struct BLECharacteristicHandler {
2828
@AppStorage("lastTimeCheckCompleted") var lastTimeCheckCompleted: Double = 0
2929
@AppStorage("lastTimeStepGoalNotified") var lastTimeStepGoalNotified: Double = 0
3030

31-
func fetchHeartPoints() -> [HeartDataPoint] {
32-
let fetchRequest: NSFetchRequest<HeartDataPoint> = HeartDataPoint.fetchRequest()
33-
fetchRequest.sortDescriptors = [NSSortDescriptor(key: "timestamp", ascending: true)]
34-
35-
do {
36-
return try persistenceController.container.viewContext.fetch(fetchRequest)
37-
} catch {
38-
log("Error fetching heart points: \(error)", caller: "BLECharacteristicHandler")
39-
return []
40-
}
41-
}
42-
4331
func heartRate(from characteristic: CBCharacteristic) -> Int {
4432
guard let characteristicData = characteristic.value else { return -1 }
4533
let byteArray = [UInt8](characteristicData)
@@ -130,14 +118,14 @@ struct BLECharacteristicHandler {
130118
let timeDifference = currentTime - lastHeartRateUpdateTimestamp
131119

132120
// Check if the last data point is available and if filtering is enabled
133-
if let referenceValue = fetchHeartPoints().last?.value, filterHeartRateData {
121+
if let referenceValue = chartManager.heartPoints().last?.value, filterHeartRateData {
134122
let isWithinRange = abs(referenceValue - bleManager.heartRate) <= 25
135123

136124
// Update heart rate if within the valid range or recent enough
137125
if isWithinRange || timeDifference <= 15 {
138126
updateHeartRate(bpm: bpm)
139127
} else {
140-
log("Abnormal heart rate value detected: \(bpm)", caller: "BLECharacteristicHandler")
128+
log("Abnormal heart rate value detected: \(bpm)", type: .info, caller: "BLECharacteristicHandler")
141129
}
142130
} else {
143131
// If no last data point or filtering is not applied, update heart rate

InfiniLink/Utils/FitnessCalculator.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ class FitnessCalculator {
120120
return Int(ceil(pace.metValue * calculatedWeight * durationInHours))
121121
}
122122

123+
/// - Parameter pace: the average pace the user is walking
124+
/// - Returns: the numbers the user takes per mile or kilometer
123125
func stepsPerUnit(pace: Pace = .avgWalk) -> Int {
124126
let unitInInches = personalizationController.units == .imperial ? 63360 : 39370.1
125127
return Int(ceil(unitInInches / strideLength()))

0 commit comments

Comments
 (0)