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

iPhone model list additions (#511)

* Commit my changes to date

* Convert Double -> String so that we get just 1 decimal precision stored

* shrink footprint of json labels

* Start mapping table for iphone id -> model name

* map more iphone's, and include processor type as part of string

iPhone 14 is an A15, while the iPhone 14 Pro is an A16, so from a CPU
perspective, are totally different phones

* Major clean up of loopStats ... instead of having two records written
to loopstats.json, one for start and one for end, we now have one
record to represent the whole process.

   createdAt == Loop Start Time
   loopEnd == Loop Completed Time
   loopStatus == "Success" -or- Error

I have to figure out the dailyStats code next, namely that:

   Interval is now currentRecord.createAt - previousRecord.loopEnd
   Loop duration is now currentRecord.loopEnd - currentRecord.createdAt

* Update loopstats.json to include loop Duration

Re-write loop/interval calculations to use new data in loopstats.json

* Fix for "Average Time Between Loop Cycles" values that were coming
out greater then Max Time Between Loop Cycles ...

* Remove Loop_Cycles

* Just some additions to the iPhone models list ... no rush to get this
out, expect to have some more updates, but want to make sure that the
next version has as many as possible in place
Marc G. Fournier 3 лет назад
Родитель
Сommit
ab2b5453a3
1 измененных файлов с 19 добавлено и 11 удалено
  1. 19 11
      FreeAPS/Sources/Helpers/UIDevice+Extensions.swift

+ 19 - 11
FreeAPS/Sources/Helpers/UIDevice+Extensions.swift

@@ -12,32 +12,40 @@ extension UIDevice {
 
         func mapToDevice(identifier: String) -> String {
             switch identifier {
+
+            case "iPhone10,6":
+                return "iPhone X"
+
             case "iPhone11,8":
-                return "iPhone XR (A12)"
+                return "iPhone XR"
 
             case "iPhone12,1":
-                return "iPhone 11 (A13)"
+                return "iPhone 11"
             case "iPhone12,8":
-                return "iPhone SE (2nd Gen) (A13)"
+                return "iPhone SE (2nd Gen)"
 
+            case "iPhone13,1":
+                return "iPhone 12 mini"
             case "iPhone13,2":
-                return "iPhone 12 (A14)"
+                return "iPhone 12"
             case "iPhone13,3":
-                return "iPhone 12 Pro (A14)"
+                return "iPhone 12 Pro"
             case "iPhone13,4":
-                return "iPhone 12 Pro Max (A14)"
+                return "iPhone 12 Pro Max"
 
+            case "iPhone14,2":
+                return "iPhone 13 Pro"
             case "iPhone14,4":
-                return "iPhone 13 mini (A15)"
+                return "iPhone 13 mini"
             case "iPhone14,5":
-                return "iPhone 13 (A15)"
+                return "iPhone 13"
             case "iPhone14,6":
-                return "iPhone SE (3rd Gen) (A15)"
+                return "iPhone SE (3rd Gen)"
             case "iPhone14,7":
-                return "iPhone 14 (A15)"
+                return "iPhone 14"
 
             case "iPhone15,2":
-                return "iPhone 14 Pro (A16)"
+                return "iPhone 14 Pro"
 
             default:
                 return identifier