Browse Source

Changed commenting style

Jonas Björkert 2 years ago
parent
commit
7c7116c944

+ 3 - 3
LoopFollow/Controllers/Nightscout/DeviceStatus.swift

@@ -134,18 +134,18 @@ extension MainViewController {
             if let lastCorrection = lastOverride["currentCorrectionRange"] as? [String: AnyObject],
                let minValue = lastCorrection["minValue"] as? Double,
                let maxValue = lastCorrection["maxValue"] as? Double {
-
+                
                 if let multiplier = lastOverride["multiplier"] as? Double {
                     currentOverride = multiplier
                     oText += String(format: "%.0f%%", (multiplier * 100))
                 } else {
                     oText += "100%"
                 }
-
+                
                 oText += " ("
                 oText += Localizer.toDisplayUnits(String(minValue)) + "-" + Localizer.toDisplayUnits(String(maxValue)) + ")"
             }
-
+            
             infoManager.updateInfoData(type: .override, value: oText)
         } else {
             infoManager.clearInfoData(type: .override)

+ 5 - 15
LoopFollow/Controllers/Nightscout/DeviceStatusLoop.swift

@@ -31,25 +31,19 @@ extension MainViewController {
                     }
                 }
 
-                /*
-                 ISF
-                 */
+                // ISF
                 let profileISF = profileManager.currentISF()
                 if let profileISF = profileISF {
                     infoManager.updateInfoData(type: .isf, value: profileISF)
                 }
 
-                /*
-                 Carb Ratio (CR)
-                 */
+                // Carb Ratio (CR)
                 let profileCR = profileManager.currentCarbRatio()
                 if let profileCR = profileCR {
                     infoManager.updateInfoData(type: .carbRatio, value: profileCR)
                 }
 
-                /*
-                 Target
-                 */
+                // Target
                 let profileTargetLow = profileManager.currentTargetLow()
                 let profileTargetHigh = profileManager.currentTargetHigh()
 
@@ -59,17 +53,13 @@ extension MainViewController {
                     infoManager.updateInfoData(type: .target, value: profileTargetLow)
                 }
 
-                /*
-                 IOB
-                 */
+                // IOB
                 if let insulinMetric = InsulinMetric(from: lastLoopRecord["iob"], key: "iob") {
                     infoManager.updateInfoData(type: .iob, value: insulinMetric)
                     latestIOB = insulinMetric
                 }
 
-                /*
-                 COB
-                 */
+                // COB
                 if let cobMetric = CarbMetric(from: lastLoopRecord["cob"], key: "cob") {
                     infoManager.updateInfoData(type: .cob, value: cobMetric)
                     latestCOB = cobMetric

+ 10 - 30
LoopFollow/Controllers/Nightscout/DeviceStatusOpenAPS.swift

@@ -32,18 +32,14 @@ extension MainViewController {
                     }
                 }
 
-                /*
-                 Updated
-                 */
+                // Updated
                 if let enactedTimestamp = enacted["timestamp"] as? String,
                    let enactedTime = formatter.date(from: enactedTimestamp)?.timeIntervalSince1970 {
                     let formattedTime = Localizer.formatTimestampToLocalString(enactedTime)
                     infoManager.updateInfoData(type: .updated, value: formattedTime)
                 }
 
-                /*
-                 ISF
-                 */
+                // ISF
                 let profileISF = profileManager.currentISF()
                 var enactedISF: HKQuantity?
                 if let enactedISFValue = enacted["ISF"] as? Double {
@@ -55,9 +51,7 @@ extension MainViewController {
                     infoManager.updateInfoData(type: .isf, value: profileISF)
                 }
 
-                /*
-                 Carb Ratio (CR)
-                 */
+                // Carb Ratio (CR)
                 let profileCR = profileManager.currentCarbRatio()
                 var enactedCR: Double?
                 if let reasonString = enacted["reason"] as? String {
@@ -77,25 +71,19 @@ extension MainViewController {
                     infoManager.updateInfoData(type: .carbRatio, value: profileCR)
                 }
 
-                /*
-                 IOB
-                 */
+                // IOB
                 if let iobMetric = InsulinMetric(from: lastLoopRecord["iob"], key: "iob") {
                     infoManager.updateInfoData(type: .iob, value: iobMetric)
                     latestIOB = iobMetric
                 }
 
-                /*
-                 COB
-                 */
+                // COB
                 if let cobMetric = CarbMetric(from: enacted, key: "COB") {
                     infoManager.updateInfoData(type: .cob, value: cobMetric)
                     latestCOB = cobMetric
                 }
 
-                /*
-                 Insulin Required
-                 */
+                // Insulin Required
                 if let insulinReqMetric = InsulinMetric(from: enacted, key: "insulinReq") {
                     infoManager.updateInfoData(type: .recBolus, value: insulinReqMetric)
                     UserDefaultsRepository.deviceRecBolus.value = insulinReqMetric.value
@@ -103,25 +91,19 @@ extension MainViewController {
                     UserDefaultsRepository.deviceRecBolus.value = 0
                 }
 
-                /*
-                 Autosens
-                 */
+                // Autosens
                 if let sens = enacted["sensitivityRatio"] as? Double {
                     let formattedSens = String(format: "%.0f", sens * 100.0) + "%"
                     infoManager.updateInfoData(type: .autosens, value: formattedSens)
                 }
 
-                /*
-                 Eventual BG
-                 */
+                // Eventual BG
                 if let eventualBGValue = enacted["eventualBG"] as? Double {
                     let eventualBGQuantity = HKQuantity(unit: .milligramsPerDeciliter, doubleValue: eventualBGValue)
                     PredictionLabel.text = Localizer.formatQuantity(eventualBGQuantity)
                 }
 
-                /*
-                 Target
-                 */
+                // Target
                 let profileTargetHigh = profileManager.currentTargetHigh()
                 var enactedTarget: HKQuantity?
                 if let enactedTargetValue = enacted["current_target"] as? Double {
@@ -141,9 +123,7 @@ extension MainViewController {
                     }
                 }
 
-                /*
-                 TDD
-                 */
+                // TDD
                 if let tddMetric = InsulinMetric(from: enacted, key: "TDD") {
                     infoManager.updateInfoData(type: .tdd, value: tddMetric)
                 }