Просмотр исходного кода

Add SMB flag and robot emoji for SMB boluses

dnzxy 2 лет назад
Родитель
Сommit
09e1f509f3

+ 1 - 1
FreeAPS/Sources/Modules/DataTable/DataTableDataFlow.swift

@@ -137,7 +137,7 @@ enum DataTable {
             case .bolus:
                 return numberFormatter
                     .string(from: amount as NSNumber)! + NSLocalizedString(" U", comment: "Insulin unit") +
-                    "\((isSMB ?? true)! ? " SMB" : " Manual")"
+                    "\(isSMB ?? false ? " SMB" : "")"
             case .tempBasal:
                 return numberFormatter
                     .string(from: amount as NSNumber)! + NSLocalizedString(" U/hr", comment: "Unit insulin per hour")

+ 8 - 1
FreeAPS/Sources/Modules/DataTable/DataTableStateModel.swift

@@ -66,7 +66,14 @@ extension DataTable {
                 let boluses = self.provider.pumpHistory()
                     .filter { $0.type == .bolus }
                     .map {
-                        Treatment(units: units, type: .bolus, date: $0.timestamp, amount: $0.amount, idPumpEvent: $0.id)
+                        Treatment(
+                            units: units,
+                            type: .bolus,
+                            date: $0.timestamp,
+                            amount: $0.amount,
+                            idPumpEvent: $0.id,
+                            isSMB: $0.isSMB
+                        )
                     }
 
                 let tempBasals = self.provider.pumpHistory()

+ 2 - 1
FreeAPS/Sources/Modules/DataTable/View/DataTableRootView.swift

@@ -113,8 +113,9 @@ extension DataTable {
                 Image(systemName: "circle.fill").foregroundColor(item.color)
                 Text(dateFormatter.string(from: item.date))
                     .moveDisabled(true)
-                Text(item.type.name)
+                Text((item.isSMB ?? false) ? "🤖" : item.type.name)
                 Text(item.amountText).foregroundColor(.secondary)
+
                 if let duration = item.durationText {
                     Text(duration).foregroundColor(.secondary)
                 }