Przeglądaj źródła

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 4 lat temu
rodzic
commit
af860c03f3

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

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

Plik diff jest za duży
+ 1 - 1
FreeAPS/Resources/javascript/bundle/determine-basal.js


Plik diff jest za duży
+ 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) {
      
-    // 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;
     var chrisFormula = preferences.enableChris;
     var useDynamicCR = preferences.enableDynamicCR;
@@ -403,7 +403,7 @@ function middleware(iob, currenttemp, glucose, profile, autosens, meal, reservoi
         }
         
         // 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;
     } 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 darkerBlue = Color("DarkerBlue")
     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?
     var timestamp: Date?
     var recieved: Bool?
+    let tdd: Decimal?
 }
 
 struct Predictions: JSON, Equatable {
@@ -48,6 +49,7 @@ extension Suggestion {
         case timestamp
         case recieved
         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 {
         var colorOfTag: Color {
-            if textTag.contains("Not Floating") {
+            if textTag.contains("NotFloating") {
                 return .loopYellow } else {
                 switch textTag {
                 case "Floating Carbs:":
@@ -62,10 +62,8 @@ struct TagCloudView: View {
                     return .uam
                 case "Parabolic Fit":
                     return .loopRed
-                case "Autosense":
-                    return .loopGreen
-                case "Standard":
-                    return .darkerBlue
+                // case "Autosens":
+                //    return .loopGreen
                 default:
                     return .insulin
                 }