Explorar el Código

Show TDD in pop up

Format TDD in pop up

Format TDD

Lessen the rounding to get same TDD with backwards TDD calc

Format boxes
Jon B.M hace 4 años
padre
commit
af860c03f3

+ 19 - 6
FreeAPS.xcodeproj/xcshareddata/xcschemes/FreeAPSWatch.xcscheme

@@ -55,8 +55,10 @@
       debugServiceExtension = "internal"
       debugServiceExtension = "internal"
       allowLocationSimulation = "YES"
       allowLocationSimulation = "YES"
       notificationPayloadFile = "FreeAPSWatch WatchKit Extension/PushNotificationPayload.apns">
       notificationPayloadFile = "FreeAPSWatch WatchKit Extension/PushNotificationPayload.apns">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
+      <RemoteRunnable
+         runnableDebuggingMode = "2"
+         BundleIdentifier = "com.apple.Carousel"
+         RemotePath = "/iAPS">
          <BuildableReference
          <BuildableReference
             BuildableIdentifier = "primary"
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "38E8751B27554D5500975559"
             BlueprintIdentifier = "38E8751B27554D5500975559"
@@ -64,7 +66,7 @@
             BlueprintName = "FreeAPSWatch"
             BlueprintName = "FreeAPSWatch"
             ReferencedContainer = "container:FreeAPS.xcodeproj">
             ReferencedContainer = "container:FreeAPS.xcodeproj">
          </BuildableReference>
          </BuildableReference>
-      </BuildableProductRunnable>
+      </RemoteRunnable>
    </LaunchAction>
    </LaunchAction>
    <ProfileAction
    <ProfileAction
       buildConfiguration = "Release"
       buildConfiguration = "Release"
@@ -72,8 +74,10 @@
       savedToolIdentifier = ""
       savedToolIdentifier = ""
       useCustomWorkingDirectory = "NO"
       useCustomWorkingDirectory = "NO"
       debugDocumentVersioning = "YES">
       debugDocumentVersioning = "YES">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
+      <RemoteRunnable
+         runnableDebuggingMode = "2"
+         BundleIdentifier = "com.apple.Carousel"
+         RemotePath = "/iAPS">
          <BuildableReference
          <BuildableReference
             BuildableIdentifier = "primary"
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "38E8751B27554D5500975559"
             BlueprintIdentifier = "38E8751B27554D5500975559"
@@ -81,7 +85,16 @@
             BlueprintName = "FreeAPSWatch"
             BlueprintName = "FreeAPSWatch"
             ReferencedContainer = "container:FreeAPS.xcodeproj">
             ReferencedContainer = "container:FreeAPS.xcodeproj">
          </BuildableReference>
          </BuildableReference>
-      </BuildableProductRunnable>
+      </RemoteRunnable>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "38E8751B27554D5500975559"
+            BuildableName = "FreeAPSWatch.app"
+            BlueprintName = "FreeAPSWatch"
+            ReferencedContainer = "container:FreeAPS.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
    </ProfileAction>
    </ProfileAction>
    <AnalyzeAction
    <AnalyzeAction
       buildConfiguration = "Debug">
       buildConfiguration = "Debug">

+ 38 - 0
FreeAPS/Resources/Assets.xcassets/Colors/Lemon.colorset/Contents.json

@@ -0,0 +1,38 @@
+{
+  "colors" : [
+    {
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "0.089",
+          "green" : "0.940",
+          "red" : "1.000"
+        }
+      },
+      "idiom" : "universal"
+    },
+    {
+      "appearances" : [
+        {
+          "appearance" : "luminosity",
+          "value" : "dark"
+        }
+      ],
+      "color" : {
+        "color-space" : "srgb",
+        "components" : {
+          "alpha" : "1.000",
+          "blue" : "0.089",
+          "green" : "0.940",
+          "red" : "1.000"
+        }
+      },
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
FreeAPS/Resources/javascript/bundle/determine-basal.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
FreeAPS/Resources/javascript/bundle/profile.js


+ 2 - 2
FreeAPS/Resources/javascript/middleware/determine_basal.js

@@ -1,6 +1,6 @@
 function middleware(iob, currenttemp, glucose, profile, autosens, meal, reservoir, clock, pumphistory, preferences, basalProfile) {
 function middleware(iob, currenttemp, glucose, profile, autosens, meal, reservoir, clock, pumphistory, preferences, basalProfile) {
      
      
-    // This middleware will work with my "dyn_ISF_and_CR branch" and my "bdb" branch.
+    // Dynamic ratios and TDD calculation
     const BG = glucose[0].glucose;
     const BG = glucose[0].glucose;
     var chrisFormula = preferences.enableChris;
     var chrisFormula = preferences.enableChris;
     var useDynamicCR = preferences.enableDynamicCR;
     var useDynamicCR = preferences.enableDynamicCR;
@@ -403,7 +403,7 @@ function middleware(iob, currenttemp, glucose, profile, autosens, meal, reservoi
         }
         }
         
         
         // Set the new ratio
         // Set the new ratio
-        autosens.ratio = round(newRatio, 2);
+        autosens.ratio = round(newRatio, 4);
         
         
         logOutPut = startLog + dataLog + bgLog + afLog + formula + log + logTDD + logBolus + logTempBasal + logBasal;
         logOutPut = startLog + dataLog + bgLog + afLog + formula + log + logTDD + logBolus + logTempBasal + logBasal;
     } else if (chrisFormula == false && useDynamicCR == true) {
     } else if (chrisFormula == false && useDynamicCR == true) {

+ 1 - 0
FreeAPS/Sources/Helpers/Color+Extensions.swift

@@ -12,4 +12,5 @@ extension Color {
     static let basal = Color("Basal")
     static let basal = Color("Basal")
     static let darkerBlue = Color("DarkerBlue")
     static let darkerBlue = Color("DarkerBlue")
     static let loopPink = Color("LoopPink")
     static let loopPink = Color("LoopPink")
+    static let lemon = Color("Lemon")
 }
 }

+ 2 - 0
FreeAPS/Sources/Models/Suggestion.swift

@@ -19,6 +19,7 @@ struct Suggestion: JSON, Equatable {
     let isf: Decimal?
     let isf: Decimal?
     var timestamp: Date?
     var timestamp: Date?
     var recieved: Bool?
     var recieved: Bool?
+    let tdd: Decimal?
 }
 }
 
 
 struct Predictions: JSON, Equatable {
 struct Predictions: JSON, Equatable {
@@ -48,6 +49,7 @@ extension Suggestion {
         case timestamp
         case timestamp
         case recieved
         case recieved
         case isf = "ISF"
         case isf = "ISF"
+        case tdd
     }
     }
 }
 }
 
 

+ 3 - 5
FreeAPS/Sources/Views/TagCloudView.swift

@@ -51,7 +51,7 @@ struct TagCloudView: View {
 
 
     private func item(for textTag: String) -> some View {
     private func item(for textTag: String) -> some View {
         var colorOfTag: Color {
         var colorOfTag: Color {
-            if textTag.contains("Not Floating") {
+            if textTag.contains("NotFloating") {
                 return .loopYellow } else {
                 return .loopYellow } else {
                 switch textTag {
                 switch textTag {
                 case "Floating Carbs:":
                 case "Floating Carbs:":
@@ -62,10 +62,8 @@ struct TagCloudView: View {
                     return .uam
                     return .uam
                 case "Parabolic Fit":
                 case "Parabolic Fit":
                     return .loopRed
                     return .loopRed
-                case "Autosense":
-                    return .loopGreen
-                case "Standard":
-                    return .darkerBlue
+                // case "Autosens":
+                //    return .loopGreen
                 default:
                 default:
                     return .insulin
                     return .insulin
                 }
                 }