瀏覽代碼

Release/0.1.23 (#53)

* Correctly show future temp target

* Bolus UI updated

* Fix basal rounding if pump not set

* README and FAQ updated
Ivan 5 年之前
父節點
當前提交
647f99fd19

+ 3 - 6
FAQ.md

@@ -3,7 +3,7 @@
 ## How to get the Medtronic pump ready?
 
 - Set your temporary basal to units (not percents!).
-- Turn on the remote control with any ID (for example 000000).
+- Turn on the remote control with any ID (for example 00000).
 
 ## Can I use Bolus assistant on a Medtronic pump?
 
@@ -20,14 +20,10 @@
 
 - Yes. For that you need to open the loop in settings and the button will appear on the main screen.
 
-## how to run the loop on demand manually?
+## How to run the loop on demand manually?
 
 - There is no way of doing that. You can force the data update by long-tapping the loop icon. If this actions gets any new data, loop will be recalculated.
 
-## How to change BG units?
-
-- Preferences -> Glucose units. You will then have to set targets and insulin sensitivity and restart the application.
-
 ## How to get BG values from Spike/Diabox?
 
 - Settings -> Nightscout -> Use Local Glucose Server, and set the port of a local server. Spike - 1979, Diabox - 17580
@@ -35,5 +31,6 @@
 ## How to see raw data that is used inside the app?
 
 - Preferences -> Edit settings json. Set "debugOptions": true, and restart the app.
+- In Files application on iPhone.
 - You can also download all the data to your computer through iTunes or Finder.
 

+ 2 - 5
FAQ_RU.md

@@ -3,7 +3,7 @@
 ## Как подготовить помпу Medtronic?
 
 - Установить временный базал в единицах (не в процентах!).
-- Включить удаленный контроль с любым ID (например 000000).
+- Включить удаленный контроль с любым ID (например 00000).
 
 ## Можно ли использовать Помощник болюса на помпе Medtronic?
 
@@ -24,10 +24,6 @@
 
 - Такой возможности нет. Можно принудительно обновить данные помпы долгим нажатием на круг. Если новые данные доступны, петля выполнится.
 
-## Как изменить единицы измерения глюкозы?
-
-- Preferences -> Glucose units. Вам потребуется заново настроить цели и чувствительность к инсулину, затем перезапустить приложение.
-
 ## Как получать глюкозу из Spike/Diabox?
 
 - Settings -> Nightscout -> Use Local Glucose Server, затем укажите порт внутреннего сервера. Spike - 1979, Diabox - 17580
@@ -35,5 +31,6 @@
 ## Как посмотреть сырые данные, с которыми работает приложение?
 
 - Preferences -> Edit settings json. Установите параметр "debugOprions": true, затем перезапустите приложение.
+- В приложении Файлы на iPhone.
 - Также возможно скачать все данные на компьютер через iTunes или Finder.
 

+ 2 - 2
FreeAPS.xcodeproj/project.pbxproj

@@ -2005,7 +2005,7 @@
 					"@executable_path/Frameworks",
 				);
 				MARKETING_VERSION = "$(CURRENT_PROJECT_VERSION)";
-				PRODUCT_BUNDLE_IDENTIFIER = "---CHANE-IT-TO-YOUR-OWN---";
+				PRODUCT_BUNDLE_IDENTIFIER = "---CHANGE-IT-TO-YOUR-OWN---";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
@@ -2031,7 +2031,7 @@
 					"@executable_path/Frameworks",
 				);
 				MARKETING_VERSION = "$(CURRENT_PROJECT_VERSION)";
-				PRODUCT_BUNDLE_IDENTIFIER = "---CHANE-IT-TO-YOUR-OWN---";
+				PRODUCT_BUNDLE_IDENTIFIER = "---CHANGE-IT-TO-YOUR-OWN---";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SWIFT_VERSION = 5.0;
 				TARGETED_DEVICE_FAMILY = "1,2";

+ 1 - 1
FreeAPS/Resources/Config.xcconfig

@@ -1 +1 @@
-BUILD_VERSION = 0.1.22
+BUILD_VERSION = 0.1.23

+ 2 - 0
FreeAPS/Resources/Info.plist

@@ -2,6 +2,8 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>LSSupportsOpeningDocumentsInPlace</key>
+	<true/>
 	<key>AppGroupID</key>
 	<string>$(APP_GROUP_ID)</string>
 	<key>CFBundleDevelopmentRegion</key>

+ 10 - 3
FreeAPS/Sources/APS/Storage/TempTargetsStorage.swift

@@ -58,13 +58,20 @@ final class BaseTempTargetsStorage: TempTargetsStorage, Injectable {
     }
 
     func current() -> TempTarget? {
-        guard let last = recent().last else {
+        guard let currentTarget = recent()
+            .last(where: {
+                $0.createdAt.addingTimeInterval(Int($0.duration).minutes.timeInterval) > Date()
+                    && $0.createdAt <= Date()
+            })
+        else {
             return nil
         }
-        guard last.createdAt.addingTimeInterval(Int(last.duration).minutes.timeInterval) > Date() else {
+
+        if let cancel = recent().last(where: { $0.createdAt <= Date() }), cancel.duration == 0 {
             return nil
         }
-        return last
+
+        return currentTarget
     }
 
     func nightscoutTretmentsNotUploaded() -> [NigtscoutTreatment] {

+ 1 - 1
FreeAPS/Sources/Models/BloodGlucose.swift

@@ -33,7 +33,7 @@ struct BloodGlucose: JSON, Identifiable, Hashable {
     var isStateValid: Bool { sgv ?? 0 >= 39 && noise ?? 1 != 4 }
 }
 
-enum GlucoseUnits: String, JSON {
+enum GlucoseUnits: String, JSON, Equatable {
     case mgdL = "mg/dL"
     case mmolL = "mmol/L"
 

+ 1 - 1
FreeAPS/Sources/Models/FreeAPSSettings.swift

@@ -1,6 +1,6 @@
 import Foundation
 
-struct FreeAPSSettings: JSON {
+struct FreeAPSSettings: JSON, Equatable {
     var units: GlucoseUnits
     var closedLoop: Bool
     var allowAnnouncements: Bool

+ 1 - 1
FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorViewModel.swift

@@ -15,7 +15,7 @@ extension BasalProfileEditor {
         }
 
         override func subscribe() {
-            rateValues = provider.supportedBasalRates ?? stride(from: 0.05, to: 10.01, by: 0.05).map { Decimal($0) }
+            rateValues = provider.supportedBasalRates ?? stride(from: Decimal(0.05), to: 10.01, by: 0.05).map { $0 }
             items = provider.profile.map { value in
                 let timeIndex = timeValues.firstIndex(of: Double(value.minutes * 60)) ?? 0
                 let rateIndex = rateValues.firstIndex(of: value.rate) ?? 0

+ 3 - 5
FreeAPS/Sources/Modules/Bolus/View/BolusRootView.swift

@@ -61,15 +61,13 @@ extension Bolus {
                         Button { viewModel.add() }
                         label: { Text("Enact bolus") }
                             .disabled(viewModel.amount <= 0)
+                    }
 
+                    Section {
                         if viewModel.waitForSuggestionInitial {
                             Button { viewModel.showModal(for: nil) }
                             label: { Text("Continue without bolus") }
-                        }
-                    }
-
-                    Section {
-                        if !viewModel.waitForSuggestionInitial {
+                        } else {
                             Button { isAddInsulinAlertPresented = true }
                             label: { Text("Add insulin without actually bolusing") }
                                 .disabled(viewModel.amount <= 0)

+ 6 - 4
FreeAPS/Sources/Services/SettingsManager/SettingsManager.swift

@@ -16,10 +16,12 @@ final class BaseSettingsManager: SettingsManager, Injectable {
 
     var settings: FreeAPSSettings {
         didSet {
-            save()
-            DispatchQueue.main.async {
-                self.broadcaster.notify(SettingsObserver.self, on: .main) {
-                    $0.settingsDidChange(self.settings)
+            if oldValue != settings {
+                save()
+                DispatchQueue.main.async {
+                    self.broadcaster.notify(SettingsObserver.self, on: .main) {
+                        $0.settingsDidChange(self.settings)
+                    }
                 }
             }
         }

+ 4 - 3
README.md

@@ -39,20 +39,21 @@ If you want to test it, there is a beta-version available
 - Autosens
 - Nightscout BG data source as a CGM (Online)
 - Applications that mimic Nightscout as a CGM (apps like Spike and Diabox) (Offline)
+- xDrip4iOS data source as a CGM via shared app gpoup (Offline)
 - System state upload to Nightscout
 - Remote carbs enter and temporary targets through Nightscout
+- Remote bolusing and insulin pump control
 
 ## Not implemented (plans for future)
 
 - Open loop mode
-- Phone notifications of the system state
-- Bolus cancelation possibility
+- Phone notifications of the system and connected devices state
 - Profile upload to Nightscout
 - Desktop widget
 - Apple Watch app
-- Remote bolusing and insulin pump control
 - Plugins
 - Dexcom support
+- Enlite support
 - Apple Health support
 - Detailed functions description inside the app
 

+ 5 - 4
README_RU.md

@@ -38,21 +38,22 @@ FreeAPS X находится в состоянии активной разраб
 - Autotune
 - Autosens
 - Использование Nightscout в качестве CGM
-- Использование локального сервера в качестве CGM (программы Spike, Diabox)
+- Использование оффлайн локального сервера в качестве CGM (программы Spike, Diabox)
+- Использование xDrip4iOS оффлан в качестве CGM через shared app gpoup
 - Загрузка состояния системы в Nightscout
 - Удаленный ввод углеводов и временных целей через Nightscout
+- Удаленный ввод болюса и управление помпой
 
 ## Не реализовано (планируется в будущих версиях)
 
 - Режим открытой петли
-- Уведомления на смартфоне о состоянии системы
-- Возможность отмены болюса
+- Уведомления на смартфоне о состоянии системы и подключенных к ней устройств
 - Загрузка профиля в Nightscout
 - Виджет на рабочий стол
 - Приложение для часов
-- Удаленный ввод болюса и управление помпой
 - Плагины
 - Поддержка Dexcom
+- Поддержка Enlite
 - Пооддержка программы Здоровье
 - Поробное описание функций внутри приложения