diff --git a/Config.xcconfig b/Config.xcconfig index f37af165ef..b24f694e25 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -1,5 +1,5 @@ APP_DISPLAY_NAME = iAPS -APP_VERSION = 5.4.0 +APP_VERSION = 5.6.0 APP_BUILD_NUMBER = 1 COPYRIGHT_NOTICE = DEVELOPER_TEAM = ##TEAM_ID## diff --git a/Core_Data.xcdatamodeld/Core_Data.xcdatamodel/contents b/Core_Data.xcdatamodeld/Core_Data.xcdatamodel/contents index 170edafb5a..6a6c521bdd 100644 --- a/Core_Data.xcdatamodeld/Core_Data.xcdatamodel/contents +++ b/Core_Data.xcdatamodeld/Core_Data.xcdatamodel/contents @@ -1,5 +1,5 @@ - + @@ -22,6 +22,11 @@ + + + + + diff --git a/Dependencies/LibreTransmitter/Sources/LibreTransmitter/Bluetooth/LibreTransmitterMetadata.swift b/Dependencies/LibreTransmitter/Sources/LibreTransmitter/Bluetooth/LibreTransmitterMetadata.swift index b714c65440..cccbf84db2 100644 --- a/Dependencies/LibreTransmitter/Sources/LibreTransmitter/Bluetooth/LibreTransmitterMetadata.swift +++ b/Dependencies/LibreTransmitter/Sources/LibreTransmitter/Bluetooth/LibreTransmitterMetadata.swift @@ -77,13 +77,14 @@ extension String { } public enum SensorType: String, CustomStringConvertible { - case libre1 = "DF" - case libre1A2 = "A2" - case libre2 = "9D" + case libre1 = "DF" + case libre1A2 = "A2" + case libre2 = "9D" case libre2C5 = "C5" - case libreUS14day = "E5" + case libreUS14day = "E5" case libreUS14dayE6 = "E6" case libreProH = "70" + case libre2Plus = "C6" public var description: String { switch self { @@ -91,7 +92,7 @@ public enum SensorType: String, CustomStringConvertible { return "Libre 1" case .libre1A2: return "Libre 1 A2" - case .libre2, .libre2C5: + case .libre2, .libre2C5, .libre2Plus: return "Libre 2" case .libreUS14day, .libreUS14dayE6: return "Libre US" @@ -107,7 +108,7 @@ public extension SensorType { let start = patchInfo[0..<2].uppercased() - let choices: [String: SensorType] = ["DF": .libre1, "A2": .libre1A2, "9D": .libre2, "C5": .libre2, "E5": .libreUS14day, "E6": .libreUS14dayE6, "70": .libreProH] + let choices: [String: SensorType] = ["DF": .libre1, "A2": .libre1A2, "9D": .libre2, "C5": .libre2C5, "C6": .libre2Plus, "E5": .libreUS14day, "E6": .libreUS14dayE6, "70": .libreProH] if let res = choices[start] { self = res diff --git a/Dependencies/LibreTransmitter/Sources/LibreTransmitter/LibreSensor/SensorContents/PreLibre2.swift b/Dependencies/LibreTransmitter/Sources/LibreTransmitter/LibreSensor/SensorContents/PreLibre2.swift index 9ae09b6d83..478a8a6b1d 100644 --- a/Dependencies/LibreTransmitter/Sources/LibreTransmitter/LibreSensor/SensorContents/PreLibre2.swift +++ b/Dependencies/LibreTransmitter/Sources/LibreTransmitter/LibreSensor/SensorContents/PreLibre2.swift @@ -9,7 +9,7 @@ public enum Libre2 { /// - data: Encrypted FRAM data /// - Returns: Decrypted FRAM data static public func decryptFRAM(type: SensorType, id: [UInt8], info: [UInt8], data: [UInt8]) throws -> [UInt8] { - guard type == .libre2 || type == .libre2C5 || type == .libreUS14day || type == .libreUS14dayE6 else { + guard type == .libre2 || type == .libre2C5 || type == .libreUS14day || type == .libreUS14dayE6 || type == .libre2Plus else { struct DecryptFRAMError: Error { let errorDescription = "Unsupported sensor type" } @@ -24,8 +24,9 @@ public enum Libre2 { return 0xcadc } return UInt16(info[5], info[4]) - case .libre2, .libre2C5: + case .libre2, .libre2C5, .libre2Plus: return UInt16(info[5], info[4]) ^ 0x44 + default: fatalError("Unsupported sensor type") } } diff --git a/FreeAPS.xcodeproj/project.pbxproj b/FreeAPS.xcodeproj/project.pbxproj index 344710a6ac..92725fc1cf 100644 --- a/FreeAPS.xcodeproj/project.pbxproj +++ b/FreeAPS.xcodeproj/project.pbxproj @@ -14,6 +14,11 @@ 0F7A65FBD2CD8D6477ED4539 /* NotificationsConfigProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = E625985B47742D498CB1681A /* NotificationsConfigProvider.swift */; }; 17A9D0899046B45E87834820 /* CREditorProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C8D5F457B5AFF763F8CF3DF /* CREditorProvider.swift */; }; 19012CDC291D2CB900FB8210 /* LoopStats.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19012CDB291D2CB900FB8210 /* LoopStats.swift */; }; + 1901412D2CDB92D600ABD925 /* RestoreDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1901412C2CDB92CB00ABD925 /* RestoreDataFlow.swift */; }; + 1901412F2CDB92F200ABD925 /* RestoreProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1901412E2CDB92E600ABD925 /* RestoreProvider.swift */; }; + 190141312CDB930400ABD925 /* RestoreStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 190141302CDB92FB00ABD925 /* RestoreStateModel.swift */; }; + 190141342CDB931A00ABD925 /* RestoreRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 190141332CDB931000ABD925 /* RestoreRootView.swift */; }; + 190141362CDB9D4B00ABD925 /* Token.swift in Sources */ = {isa = PBXBuildFile; fileRef = 190141352CDB9D4600ABD925 /* Token.swift */; }; 190EBCC429FF136900BA767D /* StatConfigDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 190EBCC329FF136900BA767D /* StatConfigDataFlow.swift */; }; 190EBCC629FF138000BA767D /* StatConfigProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 190EBCC529FF138000BA767D /* StatConfigProvider.swift */; }; 190EBCC829FF13AA00BA767D /* StatConfigStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 190EBCC729FF13AA00BA767D /* StatConfigStateModel.swift */; }; @@ -564,6 +569,11 @@ 10A0C32B0DAB52726EF9B6D9 /* BolusRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BolusRootView.swift; sourceTree = ""; }; 12204445D7632AF09264A979 /* PreferencesEditorDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PreferencesEditorDataFlow.swift; sourceTree = ""; }; 19012CDB291D2CB900FB8210 /* LoopStats.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoopStats.swift; sourceTree = ""; }; + 1901412C2CDB92CB00ABD925 /* RestoreDataFlow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestoreDataFlow.swift; sourceTree = ""; }; + 1901412E2CDB92E600ABD925 /* RestoreProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestoreProvider.swift; sourceTree = ""; }; + 190141302CDB92FB00ABD925 /* RestoreStateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestoreStateModel.swift; sourceTree = ""; }; + 190141332CDB931000ABD925 /* RestoreRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestoreRootView.swift; sourceTree = ""; }; + 190141352CDB9D4600ABD925 /* Token.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Token.swift; sourceTree = ""; }; 190EBCC329FF136900BA767D /* StatConfigDataFlow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatConfigDataFlow.swift; sourceTree = ""; }; 190EBCC529FF138000BA767D /* StatConfigProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatConfigProvider.swift; sourceTree = ""; }; 190EBCC729FF13AA00BA767D /* StatConfigStateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatConfigStateModel.swift; sourceTree = ""; }; @@ -1196,6 +1206,25 @@ path = View; sourceTree = ""; }; + 1901412B2CDB92B500ABD925 /* Restore */ = { + isa = PBXGroup; + children = ( + 1901412C2CDB92CB00ABD925 /* RestoreDataFlow.swift */, + 1901412E2CDB92E600ABD925 /* RestoreProvider.swift */, + 190141302CDB92FB00ABD925 /* RestoreStateModel.swift */, + 190141322CDB930800ABD925 /* View */, + ); + path = Restore; + sourceTree = ""; + }; + 190141322CDB930800ABD925 /* View */ = { + isa = PBXGroup; + children = ( + 190141332CDB931000ABD925 /* RestoreRootView.swift */, + ); + path = View; + sourceTree = ""; + }; 190EBCC229FF134900BA767D /* StatConfig */ = { isa = PBXGroup; children = ( @@ -1440,28 +1469,24 @@ 3811DE0325C9D31700A708ED /* Modules */ = { isa = PBXGroup; children = ( - F2159A472BA60A0300A0B716 /* ContactTrick */, - 19F191D92BE4F93400F6297E /* Sharing */, - 195D80B22AF696EE00D25097 /* Dynamic */, - 190EBCC229FF134900BA767D /* StatConfig */, - BD7DA9A32AE06DBA00601B20 /* BolusCalculatorConfig */, - 19F95FF129F10F9C00314DDC /* Stat */, - CE94597C29E9E1CD0047C9C6 /* WatchConfig */, - 19E1F7E629D0828B005C8D20 /* IconConfig */, - 19D466A129AA2B0A004D5F33 /* FPUConfig */, - F90692CD274B99850037068D /* HealthKit */, 6DC5D590658EF8B8DF94F9F5 /* AddCarbs */, A9A4C88374496B3C89058A89 /* AddTempTarget */, 672F63EEAE27400625E14BAD /* AutotuneConfig */, A42F1FEDFFD0DDE00AAD54D3 /* BasalProfileEditor */, 3811DE0425C9D32E00A708ED /* Base */, C2C98283C436DB934D7E7994 /* Bolus */, + BD7DA9A32AE06DBA00601B20 /* BolusCalculatorConfig */, E8176B120B55CE89F1591542 /* Calibrations */, F75CB57ED6971B46F8756083 /* CGM */, 0610F7D6D2EC00E3BA1569F0 /* ConfigEditor */, + F2159A472BA60A0300A0B716 /* ContactTrick */, E42231DBF0DBE2B4B92D1B15 /* CREditor */, 9E56E3626FAD933385101B76 /* DataTable */, + 195D80B22AF696EE00D25097 /* Dynamic */, + 19D466A129AA2B0A004D5F33 /* FPUConfig */, + F90692CD274B99850037068D /* HealthKit */, 3811DE2725C9D49500A708ED /* Home */, + 19E1F7E629D0828B005C8D20 /* IconConfig */, D8F047E14D567F2B5DBEFD96 /* ISFEditor */, C11D545CED3ECEB525EDEE23 /* LibreConfig */, 3811DE1A25C9D48300A708ED /* Main */, @@ -1472,9 +1497,14 @@ 3E1C41D9301B7058AA7BF5EA /* PreferencesEditor */, 99C01B871ACAB3F32CE755C7 /* PumpConfig */, E493126EA71765130F64CCE5 /* PumpSettingsEditor */, + 1901412B2CDB92B500ABD925 /* Restore */, 3811DE3825C9D4A100A708ED /* Settings */, + 19F191D92BE4F93400F6297E /* Sharing */, 29B478DF61BF8D270F7D8954 /* Snooze */, + 19F95FF129F10F9C00314DDC /* Stat */, + 190EBCC229FF134900BA767D /* StatConfig */, 6517011F19F244F64E1FF14B /* TargetsEditor */, + CE94597C29E9E1CD0047C9C6 /* WatchConfig */, ); path = Modules; sourceTree = ""; @@ -1927,6 +1957,7 @@ 388E5A5A25B6F05F0019842D /* Helpers */ = { isa = PBXGroup; children = ( + 190141352CDB9D4600ABD925 /* Token.swift */, FEFA5C10299F814A00765C17 /* CoreDataStack.swift */, 38F37827261260DC009DB701 /* Color+Extensions.swift */, 389ECE042601144100D86C4F /* ConcurrentMap.swift */, @@ -2959,6 +2990,7 @@ 38C4D33725E9A1A300D30B77 /* DispatchQueue+Extensions.swift in Sources */, F90692CF274B999A0037068D /* HealthKitDataFlow.swift in Sources */, CE7CA3552A064973004BE681 /* ListStateIntent.swift in Sources */, + 190141362CDB9D4B00ABD925 /* Token.swift in Sources */, 19F191DE2BE4F97F00F6297E /* SharingProvider.swift in Sources */, 195D80B72AF697B800D25097 /* DynamicDataFlow.swift in Sources */, 3862CC2E2743F9F700BF832C /* CalendarManager.swift in Sources */, @@ -3014,6 +3046,7 @@ 38569348270B5DFB0002C50D /* GlucoseSource.swift in Sources */, CEB434E328B8F9DB00B70274 /* BluetoothStateManager.swift in Sources */, 3811DE4225C9D4A100A708ED /* SettingsDataFlow.swift in Sources */, + 1901412D2CDB92D600ABD925 /* RestoreDataFlow.swift in Sources */, 3811DE2525C9D48300A708ED /* MainRootView.swift in Sources */, CE94598229E9E3D30047C9C6 /* WatchConfigProvider.swift in Sources */, 191A9D162BED00A500028D48 /* Version.swift in Sources */, @@ -3033,6 +3066,7 @@ 1920BF5D2B9DF53200E861FE /* BolusShortcut.swift in Sources */, 38A13D3225E28B4B00EAA382 /* PumpHistoryEvent.swift in Sources */, E00EEC0627368630002FF094 /* UIAssembly.swift in Sources */, + 1901412F2CDB92F200ABD925 /* RestoreProvider.swift in Sources */, 3811DE1825C9D40400A708ED /* Router.swift in Sources */, CE7950262998056D00FA576E /* CGMSetupView.swift in Sources */, 38A0363B25ECF07E00FCBB52 /* GlucoseStorage.swift in Sources */, @@ -3102,6 +3136,7 @@ 3811DE3F25C9D4A100A708ED /* SettingsStateModel.swift in Sources */, CE7CA3582A064E2F004BE681 /* ListStateView.swift in Sources */, 193F6CDD2A512C8F001240FD /* Loops.swift in Sources */, + 190141342CDB931A00ABD925 /* RestoreRootView.swift in Sources */, 38B4F3CB25E502E200E76A18 /* WeakObjectSet.swift in Sources */, 38E989DD25F5021400C0CED0 /* PumpStatus.swift in Sources */, BDFD165A2AE40438007F0DDA /* AlternativeBolusCalcRootView.swift in Sources */, @@ -3135,6 +3170,7 @@ 19AEF4322B1F5A98006FFE8B /* TIRView.swift in Sources */, 38A43598262E0E4900E80935 /* FetchAnnouncementsManager.swift in Sources */, 642F76A05A4FF530463A9FD0 /* NightscoutConfigRootView.swift in Sources */, + 190141312CDB930400ABD925 /* RestoreStateModel.swift in Sources */, 190F8CF72BC6F70800EDB473 /* IllustrationView.swift in Sources */, 19DB70A72BF8F01E00C05381 /* ActiveCOBView.swift in Sources */, BD7DA9AC2AE06EB900601B20 /* BolusCalculatorConfigRootView.swift in Sources */, diff --git a/FreeAPS/Resources/Assets.xcassets/reservoir/pod_reservoir.imageset/Contents.json b/FreeAPS/Resources/Assets.xcassets/reservoir/pod_reservoir.imageset/Contents.json index 2f0731fe05..4d78daa6c6 100644 --- a/FreeAPS/Resources/Assets.xcassets/reservoir/pod_reservoir.imageset/Contents.json +++ b/FreeAPS/Resources/Assets.xcassets/reservoir/pod_reservoir.imageset/Contents.json @@ -20,6 +20,6 @@ "version" : 1 }, "properties" : { - "template-rendering-intent" : "template" + "template-rendering-intent" : "original" } } diff --git a/FreeAPS/Resources/javascript/prepare/determine-basal.js b/FreeAPS/Resources/javascript/prepare/determine-basal.js index 2c5b5a4610..31d9cad34e 100644 --- a/FreeAPS/Resources/javascript/prepare/determine-basal.js +++ b/FreeAPS/Resources/javascript/prepare/determine-basal.js @@ -23,8 +23,8 @@ function generate(iob, currenttemp, glucose, profile, autosens = null, meal = nu if (dynamicVariables && dynamicVariables.useOverride) { const factor = dynamicVariables.overridePercentage / 100; if (factor != 1) { - // Basal - profile.current_basal *= factor; + // Basal has already been adjusted in prepare/profile.js + console.log("Override active (" + factor + "), new basal: (" + profile.current_basal + ")") // ISF and CR if (dynamicVariables.isfAndCr) { profile.sens /= factor; @@ -236,12 +236,6 @@ function dynisf(profile, autosens_data, dynamicVariables, glucose) { if (enable_sigmoid) { console.log("Dynamic ISF enabled. Dynamic Ratio (Sigmoid function): " + newRatio + ". New ISF = " + isf + " mg/dl / " + round(0.0555 * isf, 1) + " mmol/l."); } - - // Basal Adjustment - if (profile.tddAdjBasal && dynISFenabled) { - profile.current_basal *= tdd_factor; - console.log("Dynamic ISF. Basal adjusted with TDD factor: " + round(tdd_factor, 2)); - } } function round(value, digits) { diff --git a/FreeAPS/Resources/javascript/prepare/middleware.js b/FreeAPS/Resources/javascript/prepare/middleware.js index e4f528ab44..904cb5a278 100644 --- a/FreeAPS/Resources/javascript/prepare/middleware.js +++ b/FreeAPS/Resources/javascript/prepare/middleware.js @@ -9,15 +9,6 @@ function generate(iob, currenttemp, glucose, profile, autosens = null, meal = nu console.log("Invalid middleware: " + error); string = String(error); }; - - if (profile.tddAdjBasal && dynamicVariables.average_total_data != 0) { - profile.tdd_factor = Math.round( (dynamicVariables.weightedAverage / dynamicVariables.average_total_data) * 100) / 100; - const adjusted = Math.min(Math.max(profile.autosens_min, profile.tdd_factor), profile.autosens_max); - if (profile.tdd_factor != adjusted) { - console.log("Dynamic basal adjustment limited by your autosens_min/max settings to: " + adjusted); - profile.tdd_factor = adjusted; - } - } profile.old_cr = profile.carb_ratio; profile.old_isf = profile.sens; diff --git a/FreeAPS/Resources/javascript/prepare/profile.js b/FreeAPS/Resources/javascript/prepare/profile.js index fd3f6e4b99..007b431bc2 100644 --- a/FreeAPS/Resources/javascript/prepare/profile.js +++ b/FreeAPS/Resources/javascript/prepare/profile.js @@ -75,10 +75,6 @@ function generate(pumpsettings_data, bgtargets_data, isf_data, basalprofile_data Math.max(35, Math.min(preferences.insulinPeakTime, 100)); } else { preferences.insulinPeakTime = 55; } } - // Migrate missing conversion from original freeaps - if (preferences.resistanceLowersTarget) { - preferences.resistance_lowers_target = true; - } } var tdd_factor = { }; @@ -140,7 +136,6 @@ function generate(pumpsettings_data, bgtargets_data, isf_data, basalprofile_data enableDynamicCR: false, sigmoid: false, weightPercentage: 0.65, - tddAdjBasal: false, // threshold_setting: temporary fix to test thomasvargiu/iAPS#original-oref0 branch before build. // We can remove it after merged and after build the new original bundles // because it's included in the current oref0 PR (https://github.com/openaps/oref0/pull/1465/files) diff --git a/FreeAPS/Resources/json/defaults/preferences.json b/FreeAPS/Resources/json/defaults/preferences.json index 6024243c87..671c2d6be5 100644 --- a/FreeAPS/Resources/json/defaults/preferences.json +++ b/FreeAPS/Resources/json/defaults/preferences.json @@ -46,7 +46,6 @@ "useNewFormula" : false, "useWeightedAverage" : true, "weightPercentage" : 0.65, - "tddAdjBasal" : false, "enableSMB_high_bg" : false, "enableSMB_high_bg_target" : 110, "threshold_setting" : 65, diff --git a/FreeAPS/Sources/APS/APSManager.swift b/FreeAPS/Sources/APS/APSManager.swift index 155ef01a25..e837d2a186 100644 --- a/FreeAPS/Sources/APS/APSManager.swift +++ b/FreeAPS/Sources/APS/APSManager.swift @@ -132,6 +132,10 @@ final class BaseAPSManager: APSManager, Injectable { set { settingsManager.settings = newValue } } + var concentration: (concentration: Double, increment: Double) { + CoreDataStorage().insulinConcentration() + } + init(resolver: Resolver) { injectServices(resolver) openAPS = OpenAPS(storage: storage, nightscout: nightscout, pumpStorage: pumpHistoryStorage) @@ -443,7 +447,7 @@ final class BaseAPSManager: APSManager, Injectable { guard let pump = pumpManager else { return } - let roundedAmout = pump.roundToSupportedBolusVolume(units: amount) + let roundedAmout = pump.roundToSupportedBolusVolume(units: amount / concentration.concentration) debug(.apsManager, "Enact bolus \(roundedAmout), manual \(!isSMB)") @@ -464,7 +468,7 @@ final class BaseAPSManager: APSManager, Injectable { self.determineBasal().sink { _ in }.store(in: &self.lifetime) } self.bolusProgress.send(0) - self.bolusAmount.send(Decimal(roundedAmout)) + self.bolusAmount.send(Decimal(amount)) } } receiveValue: { _ in } .store(in: &lifetime) @@ -511,7 +515,12 @@ final class BaseAPSManager: APSManager, Injectable { self.processError(APSError.pumpError(error)) } else { debug(.apsManager, "Temp Basal succeeded") - let temp = TempBasal(duration: Int(duration / 60), rate: Decimal(rate), temp: .absolute, timestamp: Date()) + let temp = TempBasal( + duration: Int(duration / 60), + rate: Decimal(rate * self.concentration.concentration), + temp: .absolute, + timestamp: Date() + ) self.storage.save(temp, as: OpenAPS.Monitor.tempBasal) if rate == 0, duration == 0 { self.pumpHistoryStorage.saveCancelTempEvents() @@ -552,6 +561,8 @@ final class BaseAPSManager: APSManager, Injectable { debug(.apsManager, "Start enact announcement: \(action)") + let insulinConcentration = concentration + switch action { case let .bolus(amount): if let error = verifyStatus() { @@ -565,7 +576,8 @@ final class BaseAPSManager: APSManager, Injectable { return } - let roundedAmount = pump.roundToSupportedBolusVolume(units: Double(amount)) + let roundedAmount = pump.roundToSupportedBolusVolume(units: Double(amount) / insulinConcentration.concentration) + pump.enactBolus(units: roundedAmount, activationType: .manualRecommendationAccepted) { error in if let error = error { // warning(.apsManager, "Announcement Bolus failed with error: \(error.localizedDescription)") @@ -585,7 +597,7 @@ final class BaseAPSManager: APSManager, Injectable { ) self.announcementsStorage.storeAnnouncements([announcement], enacted: true) self.bolusProgress.send(0) - self.bolusAmount.send(Decimal(roundedAmount)) + self.bolusAmount.send(amount.roundBolus(increment: insulinConcentration.increment)) } } case let .pump(pumpAction): @@ -642,15 +654,14 @@ final class BaseAPSManager: APSManager, Injectable { guard !settings.closedLoop else { return } - let roundedRate = pump.roundToSupportedBasalRate(unitsPerHour: Double(rate)) + + let roundedRate = pump.roundToSupportedBasalRate(unitsPerHour: Double(rate) / insulinConcentration.concentration) + pump.enactTempBasal(unitsPerHour: roundedRate, for: TimeInterval(duration) * 60) { error in if let error = error { warning(.apsManager, "Announcement TempBasal failed with error: \(error.localizedDescription)") } else { - debug( - .apsManager, - "Announcement TempBasal succeeded." - ) + debug(.apsManager, "Announcement TempBasal succeeded.") self.announcementsStorage.storeAnnouncements([announcement], enacted: true) } } @@ -762,6 +773,8 @@ final class BaseAPSManager: APSManager, Injectable { .eraseToAnyPublisher() } + let insulinSetting = concentration + let basalPublisher: AnyPublisher = Deferred { () -> AnyPublisher in if let error = self.verifyStatus() { return Fail(error: error).eraseToAnyPublisher() @@ -781,7 +794,11 @@ final class BaseAPSManager: APSManager, Injectable { return Fail(error: APSError.activeBolusViewBasal).eraseToAnyPublisher() } - return pump.enactTempBasal(unitsPerHour: Double(rate), for: TimeInterval(duration * 60)).map { _ in + return pump.enactTempBasal( + unitsPerHour: Double(rate) / insulinSetting.concentration, + for: TimeInterval(duration * 60) + ) + .map { _ in let temp = TempBasal(duration: duration, rate: rate, temp: .absolute, timestamp: Date()) self.storage.save(temp, as: OpenAPS.Monitor.tempBasal) return () @@ -805,7 +822,7 @@ final class BaseAPSManager: APSManager, Injectable { return Fail(error: APSError.activeBolusViewBolus).eraseToAnyPublisher() } - return pump.enactBolus(units: Double(units), automatic: true).map { _ in + return pump.enactBolus(units: Double(units) / insulinSetting.concentration, automatic: true).map { _ in self.bolusProgress.send(0) self.bolusAmount.send(units) return () diff --git a/FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift b/FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift index 73492a61c2..1dde45ce9c 100644 --- a/FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift +++ b/FreeAPS/Sources/APS/OpenAPS/OpenAPS.swift @@ -398,12 +398,12 @@ final class OpenAPS { coredataContext.perform { [self] in if let isf = readReason(reason: reason, variable: "ISF"), let minPredBG = readReason(reason: reason, variable: "minPredBG"), - let cr = readJSON(json: profile, variable: "carb_ratio"), + let cr = readReason(reason: reason, variable: "CR"), let iob = suggestion.iob, let cob = suggestion.cob, let target = targetGlucose { let saveSuggestion = Reasons(context: coredataContext) saveSuggestion.isf = isf as NSDecimalNumber - saveSuggestion.cr = (Decimal(string: cr) ?? 0) as NSDecimalNumber + saveSuggestion.cr = cr as NSDecimalNumber saveSuggestion.iob = iob as NSDecimalNumber saveSuggestion.cob = cob as NSDecimalNumber saveSuggestion.target = target as NSDecimalNumber diff --git a/FreeAPS/Sources/APS/Storage/CoreDataStorage.swift b/FreeAPS/Sources/APS/Storage/CoreDataStorage.swift index fe564b3e90..bc254c08d1 100644 --- a/FreeAPS/Sources/APS/Storage/CoreDataStorage.swift +++ b/FreeAPS/Sources/APS/Storage/CoreDataStorage.swift @@ -346,4 +346,16 @@ final class CoreDataStorage { } return lastLoop.first } + + func insulinConcentration() -> (concentration: Double, increment: Double) { + var conc = [InsulinConcentration]() + coredataContext.performAndWait { + let requestConc = InsulinConcentration.fetchRequest() as NSFetchRequest + let sort = NSSortDescriptor(key: "date", ascending: true) + requestConc.sortDescriptors = [sort] + try? conc = coredataContext.fetch(requestConc) + } + let recent = conc.last + return (recent?.concentration ?? 1.0, recent?.incrementSetting ?? 0.1) + } } diff --git a/FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift b/FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift index 45387e6d8b..848aceef18 100644 --- a/FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift +++ b/FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift @@ -26,14 +26,27 @@ final class BasePumpHistoryStorage: PumpHistoryStorage, Injectable { injectServices(resolver) } + var concentration: (concentration: Double, increment: Double) { + CoreDataStorage().insulinConcentration() + } + func storePumpEvents(_ events: [NewPumpEvent]) { + let insulinConcentration = concentration processQueue.async { let eventsToStore = events.flatMap { event -> [PumpHistoryEvent] in let id = event.raw.md5String switch event.type { case .bolus: guard let dose = event.dose else { return [] } - let amount = Decimal(string: dose.unitsInDeliverableIncrements.description) + + var amount = Decimal(string: dose.unitsInDeliverableIncrements.description) + + // Needing a bigger change? + if insulinConcentration.concentration != 1, var needingAdjustment = amount { + needingAdjustment *= Decimal(insulinConcentration.concentration) + amount = needingAdjustment.roundBolus(increment: insulinConcentration.increment) + } + let minutes = Int((dose.endDate - dose.startDate).timeInterval / 60) return [PumpHistoryEvent( id: id, @@ -51,7 +64,14 @@ final class BasePumpHistoryStorage: PumpHistoryStorage, Injectable { case .tempBasal: guard let dose = event.dose else { return [] } - let rate = Decimal(dose.unitsPerHour) + var rate = Decimal(dose.unitsPerHour) + + // Eventual adjustment for concentration + if insulinConcentration.concentration != 1, rate >= 0.05 { + rate *= Decimal(insulinConcentration.concentration) + rate = rate.roundBolus(increment: insulinConcentration.increment) + } + let minutes = (dose.endDate - dose.startDate).timeInterval / 60 let delivered = dose.deliveredUnits let date = event.date diff --git a/FreeAPS/Sources/Helpers/Token.swift b/FreeAPS/Sources/Helpers/Token.swift new file mode 100644 index 0000000000..cedba82c08 --- /dev/null +++ b/FreeAPS/Sources/Helpers/Token.swift @@ -0,0 +1,14 @@ +import Foundation + +final class Token { + func getIdentifier() -> String { + let keychain = BaseKeychain() + var identfier = keychain.getValue(String.self, forKey: IAPSconfig.id) ?? "" + guard identfier.count > 1 else { + identfier = UUID().uuidString + keychain.setValue(identfier, forKey: IAPSconfig.id) + return identfier + } + return identfier + } +} diff --git a/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings index a9d94f7830..e06dea7c32 100644 --- a/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings @@ -477,6 +477,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Max Bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Max Carbs"; @@ -1255,6 +1301,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1932,6 +1981,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2555,6 +2631,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings index 948705b67c..69117c66de 100644 --- a/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Max Bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Maks Kulhydrater"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "alle"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Konfiguration"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Lommeregner"; diff --git a/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings index 5bbc7fc73c..c684fb4772 100644 --- a/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Maximaler Bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Max Kohlenhydrate"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Die Insulinpumpe ist beschäftigt."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "alle"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Einstellungen"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Glukose-Delta anzeigen"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus-Rechner"; diff --git a/FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings index 6158acbc91..faa10bd63e 100644 --- a/FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings @@ -476,6 +476,54 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Max Bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; + +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; + /* Max setting */ "Max Carbs" = "Max Carbs"; @@ -1266,6 +1314,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1946,6 +1997,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2572,6 +2650,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings index 03617ea28a..18c185f116 100644 --- a/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Bolo máximo"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Carbohidratos máximos"; @@ -1255,6 +1301,9 @@ Solamente puedes emparejar una app con el sensor vía bluetooth. A continuación /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1942,6 +1991,33 @@ Ajustes predeterminados:\n /* HbA1c for all glucose storage days */ "all" = "todos"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "Configuración de MCG"; @@ -2671,6 +2747,15 @@ Un límite Autosens.máx > 1,5 no es recomendable cuando se utiliza la función /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Calculador de bolo"; diff --git a/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings index 36c3318a65..d4d3a28b80 100644 --- a/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Max Bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Max Carbs"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings index f64161cba6..bda8d17112 100644 --- a/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Bolus max"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Veuillez vérifier que vous avez sélectionné la bonne concentration d'insuline avant d'enregistrer vos paramètres.\n\nLe flacon ou le stylo d'insuline doit indiquer la concentration en unités par millilitre (p. ex. U-100 ou 100 U/ml indique une concentration de 100 unités internationales par millilitre, ce qui est le standard).\n\nLa sélection de la bonne valeur est essentielle pour un dosage adéquat."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Concentration de l'insuline"; + +/* Insulin Concentration View */ +"Change Insulin" = "Changer l'insuline"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insuline diluée à"; + +/* Insulin Concentration View */ +"standard concentration:" = "concentration standard :"; + +/* Insulin Concentration View */ +"units per ml" = "unités par ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Concentration standard (U-100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Concentration de l'insuline augmentée à"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Impossible d'enregistrer sur la pompe. Réessayez lorsque la pompe n'est pas occupée à donner un bolus."; + +/* Insulin Concentration View */ +"Saved" = "Enregistré"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U-100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U-200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U-50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U-10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Permettre les paramètres de concentration d'insuline diluée"; /* Max setting */ "Max Carbs" = "Glucides max"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "La pompe est occupée."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Un bolus est déjà en cours !"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1595,7 +1644,7 @@ Enact a temp Basal or a temp target */ "Hide" = "Masquer"; /* Bolus pop-up / Alert string. Make translations concise! */ -"Eventual Glucose > Target Glucose, but glucose is predicted to drop down to " = "Glycémie Eventuelle > Glycémie Cible, mais le glucose est prévu pour la première fois dans la liste déroulante à "; +"Eventual Glucose > Target Glucose, but glucose is predicted to drop down to " = "Glycémie éventuelle > Glycémie cible, mais le glucose est prévu pour la première fois dans la liste déroulante à "; /* Bolus pop-up / Alert string. Make translations concise! */ "which is below your Threshold (" = "qui est inférieur à votre seuil ("; @@ -1878,13 +1927,13 @@ Enact a temp Basal or a temp target */ "Errors" = "Erreurs"; /* Loop Statistics pop-up description */ -"Success = Started / Completed (loops)" = "Success = Started / Completed (loops)"; +"Success = Started / Completed (loops)" = "Succès = Boucles démarrées / Boucles terminées"; /* Loop Statistics pop-up */ -"Most Frequent Error" = "Most Frequent Error"; +"Most Frequent Error" = "Erreur la plus fréquente"; /* Loop Statistics pop-up */ -"Non-completed Loops" = "Non-completed Loops"; +"Non-completed Loops" = "Boucles non terminées"; /* Average loop interval */ "Interval" = "Intervalle"; @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "toutes"; +/* Active Insulin View */ +"Active Insulin" = "Insuline active"; + +/* Active Insulin View */ +"Time with negative insulin" = "Durée avec insuline négative"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insuline, comparée à hier"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insuline, comparée à la moyenne"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Moyenne d'insuline sur 10 jours"; + +/* Active Insulin View */ +"TDD yesterday" = "Dose quotidienne totale (DQT) hier"; + +/* Active Insulin View */ +"TDD 2 days ago" = "DQT il y a 2 jours"; + +/* Active Insulin View */ +"TDD 3 days ago" = "DQT il y a 3 jours"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Glucides actifs"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "Configuration du CGM"; @@ -2469,19 +2545,19 @@ Enact a temp Basal or a temp target */ "Threshold" = "Seuil"; /* Dynamic settings View */ -"Averages" = "Averages"; +"Averages" = "Moyennes"; /* Dynamic settings View */ -"Average ISF" = "Average ISF"; +"Average ISF" = "FSI moyen"; /* Dynamic settings View */ -"Average CR" = "Average CR"; +"Average CR" = "RIG moyen"; /* Dynamic settings View */ -"Average CSF" = "Average CSF"; +"Average CSF" = "FSG moyen"; /* Dynamic settings View */ -"ISF: Insulin Sensitivity, CR: Carb Ratio,\nCSF: Carb Sensitivity = ISF/CR" = "ISF: Insulin Sensitivity, CR: Carb Ratio,\nCSF: Carb Sensitivity = ISF/CR"; +"ISF: Insulin Sensitivity, CR: Carb Ratio,\nCSF: Carb Sensitivity = ISF/CR" = "FSI : Facteur de sensibilité à l'insuline, RIG : Ratio insuline/glucides,\nFSG : Facteur de sensibilité aux glucides = FSI/RIG"; /* Header */ "Calculator settings" = "Réglages de la calculatrice"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Afficher l'écart de glycémie"; +/* UI/UX option */ +"Hide Concentration Badge" = "Masquer la pastille indiquant la concentration de l'insuline"; + +/* UI/UX option */ +"Use insulin bars" = "Afficher l'insuline sous forme de barres"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Masquer les quantités de bolus si inférieures à"; + /* Setting title */ "Bolus Calculator" = "Calculateur de Bolus"; diff --git a/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings index e6e53c6c40..4e4c041617 100644 --- a/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Max Bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Max Carbs"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings index 88f82ba231..b61f58f39d 100644 --- a/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Maximum bólus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Maximum szénhidrát"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings index 44bf02fdf8..48d12c960e 100644 --- a/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Bolo massimo"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Carboidrati massimi"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Il microinfusore sta già erogando."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "tutti"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "Configurazione CGM"; @@ -2555,6 +2631,15 @@ Per gli utenti più giovani si consiglia di iniziare con un dosaggio ancora più /* UI/UX option */ "Display Glucose Delta" = "Mostra Delta Glicemia"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Calcolatore Bolo"; diff --git a/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings index c0ea4bc807..d33bdab1a4 100644 --- a/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Maks bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Maksimalt antall karbohydrater"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "alle"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM-konfigurasjon"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Boluskalkulator"; diff --git a/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings index 63788d5f3c..25f223cfc2 100644 --- a/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Max bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Verifieer dat je de juiste insuline concentratie hebt geselecteerd voordat je opslaat. \n\nHet insuline patroon geeft de concentratie in units per millimeter (U100 bevat 100 eenheden per millimeter, dit is de standaard concentratie).\n\nDe juiste selectie is noodzakelijk voor de juiste dosering."; + +/* Insulin Concentration View */ +"Concentration" = "Concentratie"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insuline concentratie"; + +/* Insulin Concentration View */ +"Change Insulin" = "Wijzig insuline"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insuline verdund naar"; + +/* Insulin Concentration View */ +"standard concentration:" = "standaard concentratie:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standaard concentratie (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insuline concentratie verhoogd naar"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Kan niet opslaan naar pomp. Probeer opnieuw wanneer de pomp geen bolus toedient."; + +/* Insulin Concentration View */ +"Saved" = "Opgeslagen"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Sta verdunde insuline concentratie instellingen toe"; /* Max setting */ "Max Carbs" = "Max koolhydraten"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Je pomp is bezig."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "alle "; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM instellingen"; @@ -2558,6 +2634,15 @@ Eenvoudig gezegd, de Dynamische Carb Ratio past de koolhydraatverhouding aan op /* UI/UX option */ "Display Glucose Delta" = "Glucose delta weergeven"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings index dee42629cf..c9a1a29a00 100644 --- a/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings @@ -478,6 +478,52 @@ Połączono z Nightscout!"; /* Max setting */ "Max Bolus" = "Max Bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Max Carbs"; @@ -1256,6 +1302,9 @@ Połączono z Nightscout!"; /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1933,6 +1982,33 @@ Połączono z Nightscout!"; /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2556,6 +2632,15 @@ Połączono z Nightscout!"; /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings index 42f3483348..24cbe83532 100644 --- a/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Bolus Máximo"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Max Carbs"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings index 7ec90d129f..d05c66592c 100644 --- a/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Bolus Máximo"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Max Carbs"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings index efe00d292b..b7aa7c566c 100644 --- a/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Макс. Болюс"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Пожалуйста, убедитесь, что вы выбрали правильную концентрацию инсулина, прежде чем сохранять настройки.\n\nНа флаконе или ручке с инсулином должна быть указана концентрация в единицах на миллилитр (например, 100 ЕД/мл или U100 означает 100 единиц на миллилитр, что является стандартной концентрацией).\n\nТочный выбор имеет решающее значение для правильного дозирования."; + +/* Insulin Concentration View */ +"Concentration" = "Концентрация"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Концентрация инсулина"; + +/* Insulin Concentration View */ +"Change Insulin" = "Изменить инсулин"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Инсулин разбавлен до"; + +/* Insulin Concentration View */ +"standard concentration:" = "стандартная концентрация:"; + +/* Insulin Concentration View */ +"units per ml" = "единиц на мл"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Стандартная концентрация (100 ЕД/мл)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Концентрация инсулина увеличилась до"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Не удаётся сохранить данные на помпу. Повторите попытку, когда помпа не будет занята введением болюса."; + +/* Insulin Concentration View */ +"Saved" = "Сохранено"; + +/* Label inusulin concentration, units per ml */ +"U100" = "100 ЕД/мл"; + +/* Label inusulin concentration, units per ml */ +"U200" = "200 ЕД/мл"; + +/* Label inusulin concentration, units per ml */ +"U50" = "50 ЕД/мл"; + +/* Label inusulin concentration, units per ml */ +"U10" = "10 ЕД/мл"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Разрешить настройку концентрации разбавленного инсулина"; /* Max setting */ "Max Carbs" = "Максимум углеводов"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Помпа занята."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Болюс уже вводится!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "все"; +/* Active Insulin View */ +"Active Insulin" = "Активный инсулин"; + +/* Active Insulin View */ +"Time with negative insulin" = "Отрицательный инсулин"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Инсулин по сравнению со вчера"; + +/* Active Insulin View */ +"Insulin compared to average" = "Инсулин по сравнению со средним"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Средний инсулин за 10 дней"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD за вчера"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 дня назад"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 дня назад"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Действующие углеводы"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "Конфигурация CGM"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Отображать дельту глюкозы"; +/* UI/UX option */ +"Hide Concentration Badge" = "Скрыть значок концентрации"; + +/* UI/UX option */ +"Use insulin bars" = "Отображать инсулин вертикально"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Скрыть строки объёма болюса, когда объём меньше"; + /* Setting title */ "Bolus Calculator" = "Калькулятор болюса"; diff --git a/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings index 610050ab97..a53de0a885 100644 --- a/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Maximálna dávka bolusu"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Maximum sacharidov"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "všetko"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "Konfigurácia CGM"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Kalkulátor bolusu"; diff --git a/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings index 66df691f53..9ce8ecfc22 100644 --- a/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Max bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Noga kontrollera att du valt rätt inställning för koncentration innan du sparar.\n\nDin flaska eller penna med insulin är märkt med insulinkoncentrationen i enheter per milliliter (t.ex U100, som betyder 100 enheter per milliliter, vilket är standardkoncentrationen för insulin).\n\nDitt val av koncentration kommer påverka tillförd mängd insulin."; + +/* Insulin Concentration View */ +"Concentration" = "Koncentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulinkoncentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Ändra koncentration"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin utspädd till"; + +/* Insulin Concentration View */ +"standard concentration:" = "standardkoncentration:"; + +/* Insulin Concentration View */ +"units per ml" = "enheter per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standardkoncentration (U100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulinkoncentration ökad till"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Det gick inte att spara till pump. Försök igen när pumpen inte är upptagen med att ge bolus."; + +/* Insulin Concentration View */ +"Saved" = "Sparad"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Tillåt utspätt insulin i pumpinställningar"; /* Max setting */ "Max Carbs" = "Max antal kolhydrater"; @@ -1266,6 +1312,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump är upptagen."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "En bolusdos pågår redan!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1896,7 +1945,7 @@ Enact a temp Basal or a temp target */ "Most Frequent Error" = "Vanligaste fel"; /* Loop Statistics pop-up */ -"Non-completed Loops" = "ej avslutade loopar"; +"Non-completed Loops" = "Ej avslutade loopar"; /* Average loop interval */ "Interval" = "Intervall"; @@ -1943,6 +1992,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "alla"; +/* Active Insulin View */ +"Active Insulin" = "Aktivt insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Tid med negativt insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin jämfört med igår"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin jämfört med genomsnitt"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Medelinsulin 10 dagar"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD igår"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD för 2 dagar sedan"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD för 3 dagar sedan"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Aktiva kolhydrater"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM-inställning"; @@ -2566,6 +2642,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Visa exakt glukosförändring"; +/* UI/UX option */ +"Hide Concentration Badge" = "Dölj koncentrationsmärke"; + +/* UI/UX option */ +"Use insulin bars" = "Använd insulinstänger"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Dölj bolusmängdtext när beloppet är under"; + /* Setting title */ "Bolus Calculator" = "Boluskalkylator"; diff --git a/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings index 01b4a6c9e0..ca499f6c85 100644 --- a/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Maks Bolus"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Max Carbs"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings index dc7cd4b805..d441138853 100644 --- a/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Максимальний Болюс"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Переконайтеся, що ви вибрали правильну концентрацію інсуліну, перш ніж зберігати налаштування.\n\nФлакон з інсуліном або шприц-ручка мають вказувати концентрацію в одиницях на мілілітр (наприклад, U100 означає 100 одиниць на мілілітр, що є стандартною концентрацією).\n \nТочний вибір має вирішальне значення для правильного дозування."; + +/* Insulin Concentration View */ +"Concentration" = "Концентрація"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Концентрація Інсуліну"; + +/* Insulin Concentration View */ +"Change Insulin" = "Змінити Інсулін"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Інсулін, розведений до"; + +/* Insulin Concentration View */ +"standard concentration:" = "стандартна концентрація:"; + +/* Insulin Concentration View */ +"units per ml" = "одиниць на ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Стандартна концентрація (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Концентрація інсуліну підвищена до"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Не вдалося зберегти для закачування. Спробуйте ще раз, коли помпа не буде зайнята болюсом."; + +/* Insulin Concentration View */ +"Saved" = "Зберегти"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Дозволити налаштування концентрації розведеного інсуліну"; /* Max setting */ "Max Carbs" = "Максимум вуглеводів"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Помпа зайнята"; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Болюс вже подається!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "все"; +/* Active Insulin View */ +"Active Insulin" = "Активний Інсулін"; + +/* Active Insulin View */ +"Time with negative insulin" = "Час з негативним інсуліном"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Інсулін порівняно з вчорашнім днем"; + +/* Active Insulin View */ +"Insulin compared to average" = "Інсулін порівняно із середнім"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Середній інсулін 10 днів"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD вчора"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 дні тому"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 дні тому"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Активні Вуглеводи"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "Конфігурація CGM"; @@ -2554,6 +2630,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Відображати дельту Глюкози"; +/* UI/UX option */ +"Hide Concentration Badge" = "Сховати значок Концентрації"; + +/* UI/UX option */ +"Use insulin bars" = "Відображати інсулін вертикально"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Приховати рядки об'єм болюса, коли об'єм менший"; + /* Setting title */ "Bolus Calculator" = "Калькулятор Болюса"; diff --git a/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings index 2aba906c7a..2f9a83af23 100644 --- a/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "Liều bolus tối đa"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Vui lòng xác minh rằng bạn đã chọn đúng nồng độ insulin trước khi lưu cài đặt.\n\nLọ hoặc bút tiêm insulin phải ghi rõ nồng độ theo đơn vị trên mililiter (ví dụ: U100 chỉ 100 đơn vị trên mililiter, đây là nồng độ chuẩn).\n\nViệc lựa chọn chính xác rất quan trọng để định lượng đúng liều lượng."; + +/* Insulin Concentration View */ +"Concentration" = "Nồng độ"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Nồng độ Insulin"; + +/* Insulin Concentration View */ +"Change Insulin" = "Thay đổi Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin pha loãng thành"; + +/* Insulin Concentration View */ +"standard concentration:" = "nồng độ tiêu chuẩn:"; + +/* Insulin Concentration View */ +"units per ml" = "đơn vị trên ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Nồng độ tiêu chuẩn (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Nồng độ insulin tăng lên"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Không thể lưu vào bơm. Hãy thử lại khi bơm không bận truyền thuốc."; + +/* Insulin Concentration View */ +"Saved" = "Đã lưu"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Cho phép cài đặt nồng độ insulin pha loãng"; /* Max setting */ "Max Carbs" = "Khối lượng carbs tối đa"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Bơm đang bận."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "Tất cả"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "Cấu hình CGM"; @@ -2555,6 +2631,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Hiển thị Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Tính toán Bolus"; diff --git a/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings index 25a9a9104f..5ace41422a 100644 --- a/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings @@ -476,6 +476,52 @@ Enact a temp Basal or a temp target */ /* Max setting */ "Max Bolus" = "最大大剂量"; +/* Insulin alert message */ +"Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing." = "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing."; + +/* Insulin Concentration View */ +"Concentration" = "Concentration"; + +/* Insulin Concentration View */ +"Insulin Concentration" = "Insulin Concentration"; + +/* Insulin Concentration View */ +"Change Insulin" = "Change Insulin"; + +/* Insulin Concentration View */ +"Insulin diluted to" = "Insulin diluted to"; + +/* Insulin Concentration View */ +"standard concentration:" = "standard concentration:"; + +/* Insulin Concentration View */ +"units per ml" = "units per ml"; + +/* Insulin Concentration View */ +"Standard concentration (U 100)" = "Standard concentration (U 100)"; + +/* Insulin Concentration View */ +"Insulin concentration increased to" = "Insulin concentration increased to"; + +/* Insulin Concentration View */ +"Couldn't save to pump. Try again when pump isn't busy bolusing." = "Couldn't save to pump. Try again when pump isn't busy bolusing."; + +/* Insulin Concentration View */ +"Saved" = "Saved"; + +/* Label inusulin concentration, units per ml */ +"U100" = "U100"; + +/* Label inusulin concentration, units per ml */ +"U200" = "U200"; + +/* Label inusulin concentration, units per ml */ +"U50" = "U50"; + +/* Label inusulin concentration, units per ml */ +"U10" = "U10"; +/* Debug option, allow U50 and U10 (diluted insulin) */ +"Allow diluted insulin concentration settings" = "Allow diluted insulin concentration settings"; /* Max setting */ "Max Carbs" = "Max Carbs"; @@ -1254,6 +1300,9 @@ Enact a temp Basal or a temp target */ /* Pump Error */ "Pump is Busy." = "Pump is Busy."; +/* Alert when bolus is already in progress (tapping the bolus button) */ +"Bolus already in Progress!" = "Bolus already in Progress!"; + /* -------------- Developer settings ---------------------- */ /* Debug options */ @@ -1931,6 +1980,33 @@ Enact a temp Basal or a temp target */ /* HbA1c for all glucose storage days */ "all" = "all"; +/* Active Insulin View */ +"Active Insulin" = "Active Insulin"; + +/* Active Insulin View */ +"Time with negative insulin" = "Time with negative insulin"; + +/* Active Insulin View */ +"Insulin compared to yesterday" = "Insulin compared to yesterday"; + +/* Active Insulin View */ +"Insulin compared to average" = "Insulin compared to average"; + +/* Active Insulin View */ +"Average Insulin 10 days" = "Average Insulin 10 days"; + +/* Active Insulin View */ +"TDD yesterday" = "TDD yesterday"; + +/* Active Insulin View */ +"TDD 2 days ago" = "TDD 2 days ago"; + +/* Active Insulin View */ +"TDD 3 days ago" = "TDD 3 days ago"; + +/* Active Carbohydrates View */ +"Active Carbohydrates" = "Active Carbohydrates"; + /* -------------------------------------------------------- Dexcom G7 --------------------------------------*/ "CGM Configuration" = "CGM Configuration"; @@ -2556,6 +2632,15 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; +/* UI/UX option */ +"Hide Concentration Badge" = "Hide Concentration Badge"; + +/* UI/UX option */ +"Use insulin bars" = "Use insulin bars"; + +/* UI/UX option */ +"Hide the bolus amount strings when amount is under" = "Hide the bolus amount strings when amount is under"; + /* Setting title */ "Bolus Calculator" = "Bolus Calculator"; diff --git a/FreeAPS/Sources/Models/Configs.swift b/FreeAPS/Sources/Models/Configs.swift index 80b7ab8060..703770f168 100644 --- a/FreeAPS/Sources/Models/Configs.swift +++ b/FreeAPS/Sources/Models/Configs.swift @@ -15,7 +15,7 @@ struct DateFilter { public enum IAPSconfig { static let padding: CGFloat = 60 - static let iconSize: CGFloat = 20 + static let iconSize: CGFloat = 34 static let backgroundOpacity: Double = 0.1 static let buttonSize: CGFloat = 26 static let shadowOpacity: CGFloat = 0.75 diff --git a/FreeAPS/Sources/Models/FreeAPSSettings.swift b/FreeAPS/Sources/Models/FreeAPSSettings.swift index db604addc1..7471a609f3 100644 --- a/FreeAPS/Sources/Models/FreeAPSSettings.swift +++ b/FreeAPS/Sources/Models/FreeAPSSettings.swift @@ -69,6 +69,8 @@ struct FreeAPSSettings: JSON, Equatable { var sexSetting: Int = 3 var displayDelta: Bool = false var profileID: String = "Hypo Treatment" + var allowDilution: Bool = false + var hideInsulinBadge: Bool = false } extension FreeAPSSettings: Decodable { @@ -354,6 +356,14 @@ extension FreeAPSSettings: Decodable { settings.profileID = profileID } + if let hideInsulinBadge = try? container.decode(Bool.self, forKey: .hideInsulinBadge) { + settings.hideInsulinBadge = hideInsulinBadge + } + + if let allowDilution = try? container.decode(Bool.self, forKey: .allowDilution) { + settings.allowDilution = allowDilution + } + self = settings } } diff --git a/FreeAPS/Sources/Models/Preferences.swift b/FreeAPS/Sources/Models/Preferences.swift index ee4057a3da..5bbf32a30c 100644 --- a/FreeAPS/Sources/Models/Preferences.swift +++ b/FreeAPS/Sources/Models/Preferences.swift @@ -48,7 +48,6 @@ struct Preferences: JSON { var useNewFormula: Bool = false var useWeightedAverage: Bool = false var weightPercentage: Decimal = 0.65 - var tddAdjBasal: Bool = false var enableSMB_high_bg: Bool = false var enableSMB_high_bg_target: Decimal = 110 var threshold_setting: Decimal = 65 @@ -67,7 +66,7 @@ extension Preferences { case highTemptargetRaisesSensitivity = "high_temptarget_raises_sensitivity" case lowTemptargetLowersSensitivity = "low_temptarget_lowers_sensitivity" case sensitivityRaisesTarget = "sensitivity_raises_target" - case resistanceLowersTarget + case resistanceLowersTarget = "resistance_lowers_target" case advTargetAdjustments = "adv_target_adjustments" case exerciseMode = "exercise_mode" case halfBasalExerciseTarget = "half_basal_exercise_target" @@ -103,7 +102,6 @@ extension Preferences { case useNewFormula case useWeightedAverage case weightPercentage - case tddAdjBasal case enableSMB_high_bg case enableSMB_high_bg_target case threshold_setting diff --git a/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorProvider.swift b/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorProvider.swift index 9e95e0ea39..ff65a86d5a 100644 --- a/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorProvider.swift +++ b/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorProvider.swift @@ -16,6 +16,10 @@ extension BasalProfileEditor { deviceManager.pumpManager?.supportedBasalRates.map { Decimal($0) } } + var concentration: Double { + CoreDataStorage().insulinConcentration().concentration + } + func saveProfile(_ profile: [BasalProfileEntry]) -> AnyPublisher { guard let pump = deviceManager?.pumpManager else { storage.save(profile, as: OpenAPS.Settings.basalProfile) @@ -23,7 +27,10 @@ extension BasalProfileEditor { } let syncValues = profile.map { - RepeatingScheduleValue(startTime: TimeInterval($0.minutes * 60), value: Double($0.rate)) + RepeatingScheduleValue( + startTime: TimeInterval($0.minutes * 60), + value: Double($0.rate) / concentration + ) } return Future { promise in diff --git a/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorStateModel.swift b/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorStateModel.swift index 477bd8ff91..89064fa621 100644 --- a/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorStateModel.swift +++ b/FreeAPS/Sources/Modules/BasalProfileEditor/BasalProfileEditorStateModel.swift @@ -5,6 +5,8 @@ extension BasalProfileEditor { @Published var syncInProgress = false @Published var items: [Item] = [] @Published var total: Decimal = 0.0 + @Published var saved = false + @Published var allowDilution = false let timeValues = stride(from: 0.0, to: 1.days.timeInterval, by: 30.minutes.timeInterval).map { $0 } @@ -24,6 +26,7 @@ extension BasalProfileEditor { return Item(rateIndex: rateIndex, timeIndex: timeIndex) } calcTotal() + allowDilution = settingsManager.settings.allowDilution } func calcTotal() { @@ -58,6 +61,7 @@ extension BasalProfileEditor { } func save() { + saved = false syncInProgress = true let profile = items.map { item -> BasalProfileEntry in let fotmatter = DateFormatter() @@ -72,7 +76,9 @@ extension BasalProfileEditor { .receive(on: DispatchQueue.main) .sink { _ in self.syncInProgress = false - } receiveValue: {} + } receiveValue: { + self.saved = true + } .store(in: &lifetime) } diff --git a/FreeAPS/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift b/FreeAPS/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift index 1a68aa50a6..4f99aa56cf 100644 --- a/FreeAPS/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift +++ b/FreeAPS/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift @@ -6,6 +6,14 @@ extension BasalProfileEditor { let resolver: Resolver @StateObject var state = StateModel() @State private var editMode = EditMode.inactive + @Environment(\.dismiss) var dismiss + + @FetchRequest( + entity: InsulinConcentration.entity(), sortDescriptors: [NSSortDescriptor(key: "date", ascending: true)] + ) var concentration: FetchedResults + + let saveNewConcentration: Bool + let coredataContext = CoreDataStack.shared.persistentContainer.viewContext private var dateFormatter: DateFormatter { let formatter = DateFormatter() @@ -20,43 +28,28 @@ extension BasalProfileEditor { return formatter } + @State var set: Decimal = 1 + @State var saving = false + @State var showAlert = false + @State var clean = false + var body: some View { Form { - Section(header: Text("Schedule")) { - list - addButton - } - Section { - HStack { - Text("Total") - .bold() - .foregroundColor(.primary) - Spacer() - Text(rateFormatter.string(from: state.total as NSNumber) ?? "0") - .foregroundColor(.primary) + - Text(" U/day") - .foregroundColor(.secondary) - } - } - Section { - HStack { - if state.syncInProgress { - ProgressView().padding(.trailing, 10) - } - Button { state.save() } - label: { - Text(state.syncInProgress ? "Saving..." : "Save on Pump") - } - .disabled(state.syncInProgress || state.items.isEmpty) - } + if !saveNewConcentration { + basalProfileView + } else { + concentrationView } } .dynamicTypeSize(...DynamicTypeSize.xxLarge) - .onAppear(perform: configureView) - .navigationTitle("Basal Profile") + .onAppear { + configureView() + set = Decimal(concentration.last?.concentration ?? 1) + } + .navigationTitle(saveNewConcentration ? "Insulin Concentration" : "Basal Profile") .navigationBarTitleDisplayMode(.automatic) .navigationBarItems( - trailing: EditButton() + trailing: !saveNewConcentration ? EditButton() : nil ) .environment(\.editMode, $editMode) .onAppear { @@ -140,6 +133,120 @@ extension BasalProfileEditor { } } + private var basalProfileView: some View { + Group { + Section { + list + addButton + } header: { + HStack { + Text("Schedule") + Text("(standard units / hour)") + } + } + + Section { + HStack { + Text("Total") + .bold() + .foregroundColor(.primary) + Spacer() + Text(rateFormatter.string(from: state.total as NSNumber) ?? "0") + .foregroundColor(.primary) + + Text(" U/day") + .foregroundColor(.secondary) + } + } + Section { + HStack { + if state.syncInProgress { + ProgressView().padding(.trailing, 10) + } + Button { state.save() } + label: { + Text(state.syncInProgress ? "Saving..." : "Save on Pump") + } + .disabled(state.syncInProgress || state.items.isEmpty) + } + } + } + } + + private var concentrationView: some View { + Group { + Section { + Text("U " + (rateFormatter.string(from: set * 100 as NSNumber) ?? "")) + } header: { Text("Insulin Concentration") } + + Section { + Picker("Insulin", selection: $set) { + Text("U100").tag(Decimal(1)) + Text("U200").tag(Decimal(2)) + if state.allowDilution { + Text("U50").tag(Decimal(0.5)) + Text("U10").tag(Decimal(0.1)) + } + }._onBindingChange($set) { _ in + clean = true + } + } header: { Text("Change Insulin") } + + footer: { + let diluted = NSLocalizedString("Insulin diluted to", comment: "") + " \(set) * " + + NSLocalizedString("standard concentration:", comment: "") + " \(set * 100) " + + NSLocalizedString("units per ml", comment: "") + let standard = NSLocalizedString("Standard concentration (U 100)", comment: "") + let concentrated = NSLocalizedString("Insulin concentration increased to", comment: "") + " \(set) * " + + NSLocalizedString("standard concentration:", comment: "") + " \(set * 100) " + + NSLocalizedString("units per ml", comment: "") + Text(set < 1 ? diluted : set == 1 ? standard : concentrated) + } + + Section { + HStack { + if state.syncInProgress { + ProgressView().padding(.trailing, 10) + } + Button { + showAlert.toggle() + } + label: { + Text(state.syncInProgress ? "Saving..." : "Save") + .frame(maxWidth: .infinity, alignment: .center) + } + .disabled( + state.syncInProgress || state.items + .isEmpty || set <= 0 + ) + } + } footer: { + Text( + state.syncInProgress ? "" : + (saving && !state.saved) ? "Couldn't save to pump. Try again when pump isn't busy bolusing." : + (saving && state.saved && !clean) ? "Saved" : "" + ) + .textCase(nil) + .frame(maxWidth: .infinity, alignment: .center) + .foregroundStyle((saving && !state.saved) ? .red : .secondary) } + } + .alert( + Text("Are you sure?"), + isPresented: $showAlert + ) { + Button("No", role: .cancel) {} + Button("Yes", role: .destructive) { + clean = false + saving = true + save() + } + } message: { + Text("\n" + NSLocalizedString( + "Please verify that you have selected the correct insulin concentration before saving your settings.\n\nThe insulin vial or pen should indicate the concentration in units per milliliter (e.g., U100 indicates 100 units per milliliter, which is the standard concentration).\n\nAccurate selection is critical for proper dosing.", + comment: "Insulin alert message" + )) + } + } + func onAdd() { state.add() } @@ -149,5 +256,19 @@ extension BasalProfileEditor { state.validate() state.calcTotal() } + + private func save() { + coredataContext.perform { [self] in + let newConfiguration = InsulinConcentration(context: self.coredataContext) + newConfiguration.concentration = Double(set) + newConfiguration.incrementSetting = Double(state.settingsManager.preferences.bolusIncrement) + newConfiguration.date = Date.now + do { try self.coredataContext.save() + } catch { + debug(.apsManager, "Insulin Concentration setting couldn't be saved to CoreData. Error: " + "\(error)") + } + self.state.save() + } + } } } diff --git a/FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift b/FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift index 836376080a..e511768cdf 100644 --- a/FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift +++ b/FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift @@ -70,7 +70,7 @@ extension Bolus { @Published var loopDate: Date = .distantFuture @Published var now = Date.now - let loopReminder: CGFloat = 20 + let loopReminder: CGFloat = 4 private var loopFormatter: NumberFormatter { let formatter = NumberFormatter() @@ -359,10 +359,17 @@ extension Bolus.StateModel: SuggestionObserver { setupInsulinRequired() loopDate = apsManager.lastLoopDate - if abs(loopDate.timeIntervalSinceNow / 60) > loopReminder * 1.5, abs(now.timeIntervalSinceNow / 60) > loopReminder { + if abs(now.timeIntervalSinceNow / 60) > loopReminder * 1.5 { hideModal() notActive() debug(.apsManager, "Force Closing Bolus View", printToConsole: true) } } } + +extension Decimal { + /// Account for increments + func roundBolus(increment: Double) -> Decimal { + Decimal(round(Double(self) / increment)) * Decimal(increment) + } +} diff --git a/FreeAPS/Sources/Modules/BolusCalculatorConfig/View/BolusCalculatorConfigRootView.swift b/FreeAPS/Sources/Modules/BolusCalculatorConfig/View/BolusCalculatorConfigRootView.swift index 6e4d126b02..968f2da4dc 100644 --- a/FreeAPS/Sources/Modules/BolusCalculatorConfig/View/BolusCalculatorConfigRootView.swift +++ b/FreeAPS/Sources/Modules/BolusCalculatorConfig/View/BolusCalculatorConfigRootView.swift @@ -15,7 +15,7 @@ extension BolusCalculatorConfig { private var conversionFormatter: NumberFormatter { let formatter = NumberFormatter() formatter.numberStyle = .decimal - formatter.maximumFractionDigits = 1 + formatter.maximumFractionDigits = 2 return formatter } diff --git a/FreeAPS/Sources/Modules/Dynamic/DynamicStateModel.swift b/FreeAPS/Sources/Modules/Dynamic/DynamicStateModel.swift index 232b221a65..627ca2e845 100644 --- a/FreeAPS/Sources/Modules/Dynamic/DynamicStateModel.swift +++ b/FreeAPS/Sources/Modules/Dynamic/DynamicStateModel.swift @@ -10,7 +10,6 @@ extension Dynamic { @Published var sigmoid: Bool = false @Published var adjustmentFactor: Decimal = 0.5 @Published var weightPercentage: Decimal = 0.65 - @Published var tddAdjBasal: Bool = false @Published var threshold_setting: Decimal = 65 @Published var unit: GlucoseUnits = .mmolL @Published var averages: (isf: Double, cr: Double, days: Double)? @@ -26,7 +25,6 @@ extension Dynamic { sigmoid = settings.preferences.sigmoid adjustmentFactor = settings.preferences.adjustmentFactor weightPercentage = settings.preferences.weightPercentage - tddAdjBasal = settings.preferences.tddAdjBasal averages = thirtyDaysAverages() if unit == .mmolL { @@ -40,7 +38,6 @@ extension Dynamic { preferences.enableDynamicCR == enableDynamicCR && preferences.adjustmentFactor == adjustmentFactor && preferences.sigmoid == sigmoid && - preferences.tddAdjBasal == tddAdjBasal && preferences.threshold_setting == convertBack(threshold_setting) && preferences.useNewFormula == useNewFormula && preferences.weightPercentage == weightPercentage @@ -59,7 +56,6 @@ extension Dynamic { newSettings.enableDynamicCR = enableDynamicCR newSettings.adjustmentFactor = adjustmentFactor newSettings.sigmoid = sigmoid - newSettings.tddAdjBasal = tddAdjBasal newSettings.threshold_setting = convertBack(threshold_setting) newSettings.useNewFormula = useNewFormula newSettings.weightPercentage = weightPercentage diff --git a/FreeAPS/Sources/Modules/Dynamic/View/DynamicRootView.swift b/FreeAPS/Sources/Modules/Dynamic/View/DynamicRootView.swift index b4da1b9bf0..a9cc4bac58 100644 --- a/FreeAPS/Sources/Modules/Dynamic/View/DynamicRootView.swift +++ b/FreeAPS/Sources/Modules/Dynamic/View/DynamicRootView.swift @@ -125,19 +125,6 @@ extension Dynamic { .disabled(isPresented) } - HStack { - Toggle(isOn: $state.tddAdjBasal) { - Text("Adjust basal") - .onTapGesture { - info( - header: "Adjust basal", - body: "Enable adjustment of basal based on the ratio of current TDD / 7 day average TDD", - useGraphics: nil - ) - } - }.disabled(isPresented) - } - } header: { Text("Settings") } } diff --git a/FreeAPS/Sources/Modules/Home/HomeStateModel.swift b/FreeAPS/Sources/Modules/Home/HomeStateModel.swift index 9dd5298471..0eb2a6001c 100644 --- a/FreeAPS/Sources/Modules/Home/HomeStateModel.swift +++ b/FreeAPS/Sources/Modules/Home/HomeStateModel.swift @@ -10,6 +10,7 @@ extension Home { @Injected() var apsManager: APSManager! @Injected() var nightscoutManager: NightscoutManager! @Injected() var storage: TempTargetsStorage! + @Injected() var keychain: Keychain! private let timer = DispatchTimer(timeInterval: 5) private(set) var filteredHours = 24 @Published var glucose: [BloodGlucose] = [] @@ -91,6 +92,7 @@ extension Home { @Published var tddActualAverage: Decimal = 0 @Published var skipGlucoseChart: Bool = false @Published var displayDelta: Bool = false + @Published var openAPSSettings: Preferences? let coredataContext = CoreDataStack.shared.persistentContainer.viewContext @@ -306,6 +308,23 @@ extension Home { } } + func fetchPreferences() { + let token = Token().getIdentifier() + let database = Database(token: token) + database.fetchPreferences("default") + .receive(on: DispatchQueue.main) + .sink { completion in + switch completion { + case .finished: + debug(.service, "Preferences fetched from database. Profile: default") + case let .failure(error): + debug(.service, "Preferences fetched from database failed. Error: " + error.localizedDescription) + } + } + receiveValue: { self.openAPSSettings = $0 } + .store(in: &lifetime) + } + private func setupGlucose() { DispatchQueue.main.async { [weak self] in guard let self = self else { return } diff --git a/FreeAPS/Sources/Modules/Home/View/Header/LoopView.swift b/FreeAPS/Sources/Modules/Home/View/Header/LoopView.swift index 6141813ba9..d0c097a725 100644 --- a/FreeAPS/Sources/Modules/Home/View/Header/LoopView.swift +++ b/FreeAPS/Sources/Modules/Home/View/Header/LoopView.swift @@ -31,7 +31,9 @@ struct LoopView: View { HStack(spacing: 0) { Text("i").font(.system(size: 10, design: .rounded)).offset(y: 0.35) Text("APS").font(.system(size: 12, design: .rounded)) - }.foregroundStyle(.secondary.opacity(0.5)) + } + .foregroundStyle(.secondary.opacity(0.7)) + .carvingOrRelief(carve: colorScheme == .light) LoopEllipse(stroke: color) .frame(width: minutesAgo > 9 ? 60 * multiplyForLargeFonts : 60 * multiplyForLargeFonts, height: 27) diff --git a/FreeAPS/Sources/Modules/Home/View/Header/PumpView.swift b/FreeAPS/Sources/Modules/Home/View/Header/PumpView.swift index d2bca79fbb..98c479ea64 100644 --- a/FreeAPS/Sources/Modules/Home/View/Header/PumpView.swift +++ b/FreeAPS/Sources/Modules/Home/View/Header/PumpView.swift @@ -38,12 +38,75 @@ struct PumpView: View { return dateFormatter } + @FetchRequest( + entity: InsulinConcentration.entity(), sortDescriptors: [NSSortDescriptor(key: "date", ascending: true)] + ) var concentration: FetchedResults + var body: some View { - HStack(spacing: 10) { - if let reservoir = reservoir { + HStack(spacing: 5) { + // OmniPods + if let date = expiresAtDate { + // Insulin amount (U) + if let insulin = reservoir { + // 120 % due to being non rectangular. +10 because of bottom inserter + let amountFraction = 1.0 - (Double(insulin + 10) * 1.2 / 200) + if insulin == 0xDEAD_BEEF { + podInsulinAmount(portion: amountFraction) + .padding(.leading, (concentration.last?.concentration ?? 1) != 1 ? 7 : 0) + .overlay { + if let timeZone = timeZone, + timeZone.secondsFromGMT() != TimeZone.current.secondsFromGMT() + { + ClockOffset(mdtPump: false) + } + if (concentration.last?.concentration ?? 1) != 1, + !state.settingsManager.settings + .hideInsulinBadge + { + NonStandardInsulin(concentration: concentration.last?.concentration ?? 1, pod: true) + } + } + } else { + HStack(spacing: 0) { + Text( + reservoirFormatter + .string(from: (insulin * Decimal(concentration.last?.concentration ?? 1)) as NSNumber) ?? "" + ) + Text("U").foregroundStyle(.secondary) + }.offset(x: 6) + podInsulinAmount(portion: amountFraction) + .padding(.leading, (concentration.last?.concentration ?? 1) != 1 ? 7 : 0) + .overlay { + if let timeZone = timeZone, + timeZone.secondsFromGMT() != TimeZone.current.secondsFromGMT() + { + ClockOffset(mdtPump: false) + } + if (concentration.last?.concentration ?? 1) != 1, + !state.settingsManager.settings.hideInsulinBadge + { + NonStandardInsulin(concentration: concentration.last?.concentration ?? 1, pod: true) + } + } + } + } + remainingTime(time: date.timeIntervalSince(timerDate)) + .font(.pumpFont) + .offset(x: -5, y: 0) + } else if state.pumpName.contains("Omni") { + Text("No Pod").font(.statusFont).foregroundStyle(.secondary) + .offset(x: 0, y: -4) + } + // Other pumps + else if let reservoir = reservoir { + if (concentration.last?.concentration ?? 1) != 1, !state.settingsManager.settings.hideInsulinBadge { + NonStandardInsulin(concentration: concentration.last?.concentration ?? 1, pod: false) + } + if reservoir == 0xDEAD_BEEF { HStack(spacing: 0) { - Text("50+ ").font(.statusFont).bold() + let units = 50 * (concentration.last?.concentration ?? 1) + Text("\(units)+ ").font(.statusFont).bold() Text(NSLocalizedString("U", comment: "Insulin unit")).font(.statusFont).foregroundStyle(.secondary) } .offset(x: 0, y: expiresAtDate == nil ? -4 : 0) @@ -51,7 +114,7 @@ struct PumpView: View { HStack(spacing: 0) { Text( reservoirFormatter - .string(from: reservoir as NSNumber)! + .string(from: (reservoir * Decimal(concentration.last?.concentration ?? 1)) as NSNumber)! ).font(.statusFont).bold() Text(NSLocalizedString(" U", comment: "Insulin unit")).font(.statusFont).foregroundStyle(.secondary) } @@ -62,6 +125,7 @@ struct PumpView: View { .offset(x: 0, y: -4) } + // MDT and Dana if let battery = battery, !state.pumpName.contains("Omni") { let percent = (battery.percent ?? 100) > 80 ? 100 : (battery.percent ?? 100) < 81 && (battery.percent ?? 100) > @@ -73,32 +137,13 @@ struct PumpView: View { .foregroundColor(batteryColor) .offset(x: 0, y: -4) .shadow(radius: 2) + .padding(.leading, (concentration.last?.concentration ?? 1) != 1 ? 4 : 0) .overlay { if let timeZone = timeZone, timeZone.secondsFromGMT() != TimeZone.current.secondsFromGMT() { ClockOffset(mdtPump: true) } } } - - if let date = expiresAtDate { - Image("pod_reservoir") - .resizable(resizingMode: .stretch) - .frame(width: IAPSconfig.iconSize * 1.15, height: IAPSconfig.iconSize * 1.6) - .foregroundColor(colorScheme == .dark ? .secondary : .white) - .offset(x: 0, y: -5) - .shadow(radius: 2) - .overlay { - if let timeZone = timeZone, timeZone.secondsFromGMT() != TimeZone.current.secondsFromGMT() { - ClockOffset(mdtPump: false) - } - } - remainingTime(time: date.timeIntervalSince(timerDate)) - .font(.pumpFont) - .offset(x: -7, y: 0) - } else if state.pumpName.contains("Omni") { - Text("No Pod").font(.statusFont).foregroundStyle(.secondary) - .offset(x: 0, y: -4) - } } .offset(x: 0, y: 5) } @@ -114,26 +159,23 @@ struct PumpView: View { if days >= 1 { HStack(spacing: 0) { Text(" \(days)") - spacer Text(NSLocalizedString("d", comment: "abbreviation for days")).foregroundStyle(.secondary) if adjustedHours >= 0 { Text(" ") Text("\(adjustedHours)") - spacer + // spacer Text(NSLocalizedString("h", comment: "abbreviation for days")).foregroundStyle(.secondary) } } } else if hours >= 1 { HStack(spacing: 0) { Text(" \(hours)") - spacer Text(NSLocalizedString("h", comment: "abbreviation for hours")) .foregroundStyle(time < 4 * 60 * 60 ? .red : .secondary) } } else { HStack(spacing: 0) { Text(" \(minutes)") - spacer Text(NSLocalizedString("m", comment: "abbreviation for minutes")) .foregroundStyle(time < 4 * 60 * 60 ? .red : .secondary) } @@ -190,7 +232,25 @@ struct PumpView: View { } } - private var spacer: Text { - Text(" ").tracking(-3) + private func podInsulinAmount(portion: Double) -> some View { + ZStack { + UIImage(imageLiteralResourceName: "pod_reservoir") + .fillImageUpToPortion(color: .insulin.opacity(0.8), portion: portion) + .resizable() + .aspectRatio(0.72, contentMode: .fit) + .frame(width: IAPSconfig.iconSize, height: IAPSconfig.iconSize) + .symbolRenderingMode(.palette) + .offset(x: 0, y: -5) + .shadow(radius: 1, x: 2, y: 2) + .foregroundStyle(.white) + .overlay { + let units = 50 * (concentration.last?.concentration ?? 1) + portion <= 0.3 ? + Text((reservoirFormatter.string(from: units as NSNumber) ?? "") + "+").foregroundStyle(.white) + .font(.system(size: 6)) + .offset(y: -4) + : nil + } + } } } diff --git a/FreeAPS/Sources/Modules/Home/View/HomeRootView.swift b/FreeAPS/Sources/Modules/Home/View/HomeRootView.swift index 23dbbda539..882697f47c 100644 --- a/FreeAPS/Sources/Modules/Home/View/HomeRootView.swift +++ b/FreeAPS/Sources/Modules/Home/View/HomeRootView.swift @@ -18,6 +18,7 @@ extension Home { @State var displayGlucose = false @State var animateLoop = Date.distantPast @State var animateTIR = Date.distantPast + @State var showBolusActiveAlert = false let buttonFont = Font.custom("TimeButtonFont", size: 14) let viewPadding: CGFloat = 5 @@ -48,6 +49,11 @@ extension Home { sortDescriptors: [NSSortDescriptor(key: "date", ascending: false)] ) var enactedSliderTT: FetchedResults + @FetchRequest( + entity: Onboarding.entity(), + sortDescriptors: [NSSortDescriptor(key: "date", ascending: false)] + ) var onboarded: FetchedResults + private var numberFormatter: NumberFormatter { let formatter = NumberFormatter() formatter.numberStyle = .decimal @@ -308,10 +314,11 @@ extension Home { }.buttonStyle(.borderless) Spacer() Button { - state.showModal(for: .bolus( - waitForSuggestion: state.useCalc ? true : false, - fetch: false - )) + (state.bolusProgress != nil) ? showBolusActiveAlert = true : + state.showModal(for: .bolus( + waitForSuggestion: state.useCalc ? true : false, + fetch: false + )) } label: { Image(systemName: "syringe") @@ -397,6 +404,11 @@ extension Home { state.cancelTempTarget() } } + .confirmationDialog("Bolus already in Progress", isPresented: $showBolusActiveAlert) { + Button("Bolus already in Progress!", role: .cancel) { + showBolusActiveAlert = false + } + } } var chart: some View { @@ -442,6 +454,9 @@ extension Home { }.offset(x: 0, y: 5) } + // Instead of Spacer + Text(" ") + // Insulin on Board HStack { let substance = Double(state.suggestion?.iob ?? 0) @@ -459,7 +474,7 @@ extension Home { HStack(spacing: 0) { if let loop = state.suggestion, let iob = loop.iob { Text( - numberFormatter.string(from: iob as NSNumber) ?? "0" + targetFormatter.string(from: iob as NSNumber) ?? "0" ).font(.statusFont).bold() } else { Text("?").font(.statusFont).bold() @@ -742,72 +757,84 @@ extension Home { var body: some View { GeometryReader { geo in - VStack(spacing: 0) { - // Header View - headerView(geo) - - ScrollView { - VStack { - // Main Chart - chart - // Adjust hours visible (X-Axis) - timeSetting - // TIR Chart - if !state.glucose.isEmpty { - preview.padding(.top, 15) - } - // Loops Chart - loopPreview.padding(.vertical, 15) + if onboarded.first?.firstRun ?? true, let openAPSSettings = state.openAPSSettings { + /// If old iAPS user pre v5.7.1 OpenAPS settings will be reset, but can be restored in View below + importResetSettingsView(settings: openAPSSettings) + } else { + VStack(spacing: 0) { + // Header View + headerView(geo) + + ScrollView { + VStack { + // Main Chart + chart + // Adjust hours visible (X-Axis) + timeSetting + // TIR Chart + if !state.glucose.isEmpty { + preview.padding(.top, 15) + } + // Loops Chart + loopPreview.padding(.vertical, 15) - if state.carbData > 0 { - activeCOBView - } + if state.carbData > 0 { + activeCOBView + } - // IOB Chart - if state.iobs > 0 { - activeIOBView - } + // IOB Chart + if state.iobs > 0 { + activeIOBView + } - }.background { - // Track vertical scroll - GeometryReader { proxy in - let scrollPosition = proxy.frame(in: .named("HomeScrollView")).minY - let yThreshold: CGFloat = -550 - Color.clear - .onChange(of: scrollPosition) { y in - if y < yThreshold, state.iobs > 0 || state.carbData > 0, !state.skipGlucoseChart { - withAnimation(.easeOut(duration: 0.3)) { displayGlucose = true } - } else { - withAnimation(.easeOut(duration: 0.4)) { displayGlucose = false } + }.background { + // Track vertical scroll + GeometryReader { proxy in + let scrollPosition = proxy.frame(in: .named("HomeScrollView")).minY + let yThreshold: CGFloat = -550 + Color.clear + .onChange(of: scrollPosition) { y in + if y < yThreshold, state.iobs > 0 || state.carbData > 0, !state.skipGlucoseChart { + withAnimation(.easeOut(duration: 0.3)) { displayGlucose = true } + } else { + withAnimation(.easeOut(duration: 0.4)) { displayGlucose = false } + } } - } + } } - } - }.coordinateSpace(name: "HomeScrollView") - // Buttons - buttonPanel(geo) - } + }.coordinateSpace(name: "HomeScrollView") + // Buttons + buttonPanel(geo) + } - .background( - colorScheme == .light ? .gray.opacity(IAPSconfig.backgroundOpacity * 2) : .white - .opacity(IAPSconfig.backgroundOpacity * 2) - ) - .ignoresSafeArea(edges: .vertical) - .overlay { - if let progress = state.bolusProgress, let amount = state.bolusAmount { - ZStack { - RoundedRectangle(cornerRadius: 15) - .fill(.gray.opacity(0.8)) - .frame(width: 320, height: 60) - bolusProgressView(progress: progress, amount: amount) + .background( + colorScheme == .light ? .gray.opacity(IAPSconfig.backgroundOpacity * 2) : .white + .opacity(IAPSconfig.backgroundOpacity * 2) + ) + .ignoresSafeArea(edges: .vertical) + .overlay { + if let progress = state.bolusProgress, let amount = state.bolusAmount { + ZStack { + RoundedRectangle(cornerRadius: 15) + .fill(.gray.opacity(0.8)) + .frame(width: 320, height: 60) + bolusProgressView(progress: progress, amount: amount) + } + .frame(maxWidth: .infinity, alignment: .center) + .offset(x: 0, y: -100) } - .frame(maxWidth: .infinity, alignment: .center) - .offset(x: 0, y: -100) } } } - .onAppear(perform: configureView) + .onAppear { + if onboarded.first?.firstRun ?? true { + state.fetchPreferences() + } + + configureView() + } + // .onAppear(perform: configureView) .navigationTitle("Home") .navigationBarHidden(true) .ignoresSafeArea(.keyboard) @@ -858,5 +885,12 @@ extension Home { } } } + + private func importResetSettingsView(settings: Preferences) -> some View { + Restore.RootView( + resolver: resolver, + openAPS: settings + ) + } } } diff --git a/FreeAPS/Sources/Modules/PumpSettingsEditor/View/PumpSettingsEditorRootView.swift b/FreeAPS/Sources/Modules/PumpSettingsEditor/View/PumpSettingsEditorRootView.swift index 5bf0884898..7d7750bc8c 100644 --- a/FreeAPS/Sources/Modules/PumpSettingsEditor/View/PumpSettingsEditorRootView.swift +++ b/FreeAPS/Sources/Modules/PumpSettingsEditor/View/PumpSettingsEditorRootView.swift @@ -12,6 +12,10 @@ extension PumpSettingsEditor { return formatter } + @FetchRequest( + entity: InsulinConcentration.entity(), sortDescriptors: [NSSortDescriptor(key: "date", ascending: true)] + ) var concentration: FetchedResults + var body: some View { Form { Section(header: Text("Delivery limits")) { @@ -32,6 +36,11 @@ extension PumpSettingsEditor { } } + Section { + Text("U " + (formatter.string(from: (concentration.last?.concentration ?? 1) * 100 as NSNumber) ?? "")) + .navigationLink(to: .basalProfileEditor(saveNewConcentration: true), from: self) + } header: { Text("Concentration") } + Section { HStack { if state.syncInProgress { diff --git a/FreeAPS/Sources/Modules/Restore/RestoreDataFlow.swift b/FreeAPS/Sources/Modules/Restore/RestoreDataFlow.swift new file mode 100644 index 0000000000..7154f89a21 --- /dev/null +++ b/FreeAPS/Sources/Modules/Restore/RestoreDataFlow.swift @@ -0,0 +1,5 @@ +enum Restore { + enum Config {} +} + +protocol RestoreProvider: Provider {} diff --git a/FreeAPS/Sources/Modules/Restore/RestoreProvider.swift b/FreeAPS/Sources/Modules/Restore/RestoreProvider.swift new file mode 100644 index 0000000000..d5e68a8f4a --- /dev/null +++ b/FreeAPS/Sources/Modules/Restore/RestoreProvider.swift @@ -0,0 +1,6 @@ +import Combine +import Foundation + +extension Restore { + final class Provider: BaseProvider, RestoreProvider {} +} diff --git a/FreeAPS/Sources/Modules/Restore/RestoreStateModel.swift b/FreeAPS/Sources/Modules/Restore/RestoreStateModel.swift new file mode 100644 index 0000000000..2e2c0fe5af --- /dev/null +++ b/FreeAPS/Sources/Modules/Restore/RestoreStateModel.swift @@ -0,0 +1,15 @@ +import Foundation +import SwiftUI +import Swinject + +extension Restore { + final class StateModel: BaseStateModel { + let coreData = CoreDataStorage() + + func saveFile(_ file: JSON, filename: String) { + let s = BaseFileStorage() + s.save(file, as: filename) + coreData.saveOnbarding() + } + } +} diff --git a/FreeAPS/Sources/Modules/Restore/View/RestoreRootView.swift b/FreeAPS/Sources/Modules/Restore/View/RestoreRootView.swift new file mode 100644 index 0000000000..a9ab1fd171 --- /dev/null +++ b/FreeAPS/Sources/Modules/Restore/View/RestoreRootView.swift @@ -0,0 +1,78 @@ +import SwiftUI +import Swinject + +extension Restore { + struct RootView: BaseView { + let resolver: Resolver + @StateObject var state = StateModel() + + var openAPS: Preferences? + + @Environment(\.dismiss) private var dismiss + + var fetchedVersionNumber = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown" + + var GlucoseFormatter: NumberFormatter { + let formatter = NumberFormatter() + formatter.numberStyle = .decimal + formatter.maximumFractionDigits = 1 + return formatter + } + + var body: some View { + Form { + importResetSettingsView + } + .onAppear(perform: configureView) + .navigationTitle("Restore OpenAPS Settings") + .navigationBarTitleDisplayMode(.inline) + .navigationBarItems(trailing: Button("Cancel") { + dismiss() + }) + } + + private var importResetSettingsView: some View { + Section { + HStack { + Button { + importOpenAPSOnly() + } + label: { Text("Yes") } + .buttonStyle(.borderless) + .padding(.leading, 10) + + Spacer() + + Button { + dismiss() + } + label: { Text("No") } + .buttonStyle(.borderless) + .tint(.red) + .padding(.trailing, 10) + } + } header: { + VStack { + Text("Welcome to iAPS, v\(fetchedVersionNumber)!") + .font(.previewHeadline).frame(maxWidth: .infinity, alignment: .center) + .padding(.bottom, 40) + + Text( + "In this new version the OpenAPS settings have been reset to default settings, due to a resolved Type error.\n\nFortunately you have a retrieved backup of your old OpenAPS settings in the cloud (open-iaps.app).\n\nIf you want to use these fetched settings tap \"Yes\"" + ) + .font(.previewNormal) + .frame(maxWidth: .infinity, alignment: .center) + } + .textCase(nil) + .foregroundStyle(.primary) + } + } + + private func importOpenAPSOnly() { + if let preferences = openAPS { + state.saveFile(preferences, filename: OpenAPS.Settings.preferences) + debug(.service, "Imported OpenAPS Settings have been saved to file storage.") + } + } + } +} diff --git a/FreeAPS/Sources/Modules/Settings/SettingsStateModel.swift b/FreeAPS/Sources/Modules/Settings/SettingsStateModel.swift index f4faa36201..25edfcab5d 100644 --- a/FreeAPS/Sources/Modules/Settings/SettingsStateModel.swift +++ b/FreeAPS/Sources/Modules/Settings/SettingsStateModel.swift @@ -11,6 +11,7 @@ extension Settings { @Published var animatedBackground = false @Published var disableCGMError = true @Published var profileID: String = "Hypo Treatment" + @Published var allowDilution = false private(set) var buildNumber = "" private(set) var versionNumber = "" @@ -23,6 +24,7 @@ extension Settings { subscribeSetting(\.closedLoop, on: $closedLoop) { closedLoop = $0 } subscribeSetting(\.disableCGMError, on: $disableCGMError) { disableCGMError = $0 } subscribeSetting(\.profileID, on: $profileID) { profileID = $0 } + subscribeSetting(\.allowDilution, on: $allowDilution) { allowDilution = $0 } broadcaster.register(SettingsObserver.self, observer: self) buildNumber = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown" @@ -88,5 +90,6 @@ extension Settings.StateModel: SettingsObserver { closedLoop = settings.closedLoop debugOptions = settings.debugOptions disableCGMError = settings.disableCGMError + allowDilution = settings.allowDilution } } diff --git a/FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift b/FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift index 134bedf2c3..8952432567 100644 --- a/FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift +++ b/FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift @@ -70,7 +70,7 @@ extension Settings { Section { Text("Pump Settings").navigationLink(to: .pumpSettingsEditor, from: self) - Text("Basal Profile").navigationLink(to: .basalProfileEditor, from: self) + Text("Basal Profile").navigationLink(to: .basalProfileEditor(saveNewConcentration: false), from: self) Text("Insulin Sensitivities").navigationLink(to: .isfEditor, from: self) Text("Carb Ratios").navigationLink(to: .crEditor, from: self) Text("Target Glucose").navigationLink(to: .targetsEditor, from: self) @@ -126,6 +126,10 @@ extension Settings { HStack { Toggle("Ignore flat CGM readings", isOn: $state.disableCGMError) } + + HStack { + Toggle("Allow diluted insulin concentration settings", isOn: $state.allowDilution) + } } Group { Text("Preferences") diff --git a/FreeAPS/Sources/Modules/Sharing/SharingStateModel.swift b/FreeAPS/Sources/Modules/Sharing/SharingStateModel.swift index 76fe12e4bb..a68eebead9 100644 --- a/FreeAPS/Sources/Modules/Sharing/SharingStateModel.swift +++ b/FreeAPS/Sources/Modules/Sharing/SharingStateModel.swift @@ -20,13 +20,7 @@ extension Sharing { } private func getIdentifier() -> String { - var identfier = keychain.getValue(String.self, forKey: IAPSconfig.id) ?? "" - guard identfier.count > 1 else { - identfier = UUID().uuidString - keychain.setValue(identfier, forKey: IAPSconfig.id) - return identfier - } - return identfier + keychain.getIdentifier() } func savedSettings() { @@ -56,3 +50,15 @@ extension Sharing { } } } + +extension Keychain { + func getIdentifier() -> String { + var identfier = getValue(String.self, forKey: IAPSconfig.id) ?? "" + guard identfier.count > 1 else { + identfier = UUID().uuidString + setValue(identfier, forKey: IAPSconfig.id) + return identfier + } + return identfier + } +} diff --git a/FreeAPS/Sources/Modules/StatConfig/StatConfigStateModel.swift b/FreeAPS/Sources/Modules/StatConfig/StatConfigStateModel.swift index 8055727a2e..1d037c75a8 100644 --- a/FreeAPS/Sources/Modules/StatConfig/StatConfigStateModel.swift +++ b/FreeAPS/Sources/Modules/StatConfig/StatConfigStateModel.swift @@ -18,6 +18,7 @@ extension StatConfig { @Published var useInsulinBars: Bool = false @Published var skipGlucoseChart: Bool = false @Published var displayDelta: Bool = false + @Published var hideInsulinBadge: Bool = false var units: GlucoseUnits = .mmolL @@ -37,6 +38,7 @@ extension StatConfig { subscribeSetting(\.oneDimensionalGraph, on: $oneDimensionalGraph) { oneDimensionalGraph = $0 } subscribeSetting(\.useInsulinBars, on: $useInsulinBars) { useInsulinBars = $0 } subscribeSetting(\.displayDelta, on: $displayDelta) { displayDelta = $0 } + subscribeSetting(\.hideInsulinBadge, on: $hideInsulinBadge) { hideInsulinBadge = $0 } subscribeSetting(\.low, on: $low, initial: { let value = max(min($0, 90), 40) diff --git a/FreeAPS/Sources/Modules/StatConfig/View/StatConfigRootView.swift b/FreeAPS/Sources/Modules/StatConfig/View/StatConfigRootView.swift index 5e5dc9fca2..a972b5d229 100644 --- a/FreeAPS/Sources/Modules/StatConfig/View/StatConfigRootView.swift +++ b/FreeAPS/Sources/Modules/StatConfig/View/StatConfigRootView.swift @@ -63,8 +63,8 @@ extension StatConfig { Toggle("Never display the small glucose chart when scrolling", isOn: $state.skipGlucoseChart) Toggle("Always Color Glucose Value (green, yellow etc)", isOn: $state.alwaysUseColors) Toggle("Display Glucose Delta", isOn: $state.displayDelta) + Toggle("Hide Concentration Badge", isOn: $state.hideInsulinBadge) } header: { Text("Header settings") } - footer: { Text("Normally glucose is colored red only when over or under your notification limits for high/low") } Section { HStack { diff --git a/FreeAPS/Sources/Modules/WatchConfig/WatchConfigStateModel.swift b/FreeAPS/Sources/Modules/WatchConfig/WatchConfigStateModel.swift index f14b6c8a19..2370bf6ef8 100644 --- a/FreeAPS/Sources/Modules/WatchConfig/WatchConfigStateModel.swift +++ b/FreeAPS/Sources/Modules/WatchConfig/WatchConfigStateModel.swift @@ -12,7 +12,7 @@ enum AwConfig: String, JSON, CaseIterable, Identifiable, Codable { var displayName: String { switch self { case .BGTarget: - return NSLocalizedString("Glucose Target", comment: "") + return NSLocalizedString("Eventual Glucose", comment: "") case .HR: return NSLocalizedString("Heart Rate", comment: "") case .steps: diff --git a/FreeAPS/Sources/Router/Screen.swift b/FreeAPS/Sources/Router/Screen.swift index 392fd2d572..b2f84d2155 100644 --- a/FreeAPS/Sources/Router/Screen.swift +++ b/FreeAPS/Sources/Router/Screen.swift @@ -10,7 +10,7 @@ enum Screen: Identifiable, Hashable { case nighscoutConfig case pumpConfig case pumpSettingsEditor - case basalProfileEditor + case basalProfileEditor(saveNewConcentration: Bool) case isfEditor case crEditor case targetsEditor @@ -57,8 +57,8 @@ extension Screen { PumpConfig.RootView(resolver: resolver) case .pumpSettingsEditor: PumpSettingsEditor.RootView(resolver: resolver) - case .basalProfileEditor: - BasalProfileEditor.RootView(resolver: resolver) + case let .basalProfileEditor(saveNewConcentration): + BasalProfileEditor.RootView(resolver: resolver, saveNewConcentration: saveNewConcentration) case .isfEditor: ISFEditor.RootView(resolver: resolver) case .crEditor: diff --git a/FreeAPS/Sources/Services/Network/NightscoutManager.swift b/FreeAPS/Sources/Services/Network/NightscoutManager.swift index 4dce324d90..46c2e487ed 100644 --- a/FreeAPS/Sources/Services/Network/NightscoutManager.swift +++ b/FreeAPS/Sources/Services/Network/NightscoutManager.swift @@ -996,13 +996,7 @@ final class BaseNightscoutManager: NightscoutManager, Injectable { } private func getIdentifier() -> String { - var identfier = keychain.getValue(String.self, forKey: IAPSconfig.id) ?? "" - guard identfier.count > 1 else { - identfier = UUID().uuidString - keychain.setValue(identfier, forKey: IAPSconfig.id) - return identfier - } - return identfier + keychain.getIdentifier() } func uploadManualGlucose() { diff --git a/FreeAPS/Sources/Views/ViewModifiers.swift b/FreeAPS/Sources/Views/ViewModifiers.swift index b66e776da2..a3ea388dda 100644 --- a/FreeAPS/Sources/Views/ViewModifiers.swift +++ b/FreeAPS/Sources/Views/ViewModifiers.swift @@ -49,6 +49,19 @@ struct CompactSectionSpacing: ViewModifier { } } +struct CarveOrDrop: ViewModifier { + let carve: Bool + func body(content: Content) -> some View { + if carve { + return content + .foregroundStyle(.shadow(.inner(color: .black, radius: 0.01, y: 1))) + } else { + return content + .foregroundStyle(.shadow(.drop(color: .black, radius: 0.02, y: 1))) + } + } +} + struct InfoPanelBackground: View { let colorScheme: ColorScheme var body: some View { @@ -133,7 +146,6 @@ struct FrostedGlass: View { struct ColouredRoundedBackground: View { @Environment(\.colorScheme) var colorScheme - var body: some View { Rectangle() // RoundedRectangle(cornerRadius: 15) @@ -204,10 +216,36 @@ struct ClockOffset: View { } } +struct NonStandardInsulin: View { + let concentration: Double + let pod: Bool + + private var formatter: NumberFormatter { + let formatter = NumberFormatter() + formatter.numberStyle = .decimal + formatter.maximumFractionDigits = 0 + return formatter + } + + var body: some View { + ZStack { + RoundedRectangle(cornerRadius: 15) + .fill(.red) + .frame(width: 33, height: 15) + .overlay { + Text("U" + (formatter.string(from: concentration * 100 as NSNumber) ?? "")) + .font(.system(size: 9)) + .foregroundStyle(.white) + } + } + .offset(x: pod ? -15 : -3, y: pod ? -24 : -4.5) + } +} + struct TooOldValue: View { var body: some View { ZStack { - Image(systemName: "cicle.fill") + Image(systemName: "circle.fill") .resizable() .frame(maxHeight: 20) .symbolRenderingMode(.palette) @@ -322,6 +360,10 @@ extension View { modifier(AddShadow()) } + func carvingOrRelief(carve: Bool) -> some View { + modifier(CarveOrDrop(carve: carve)) + } + func addBackground() -> some View { ColouredRoundedBackground() } @@ -372,3 +414,22 @@ extension UnevenRoundedRectangle { topTrailingRadius: 1.5 ) } + +extension UIImage { + /// Code suggested by Mamad Farrahi, but slightly modified. + func fillImageUpToPortion(color: Color, portion: Double) -> Image { + let rect = CGRect(x: 0, y: 0, width: size.width, height: size.height) + UIGraphicsBeginImageContextWithOptions(size, false, scale) + draw(in: rect) + let context = UIGraphicsGetCurrentContext()! + context.setBlendMode(CGBlendMode.sourceIn) + context.setFillColor(color.cgColor ?? UIColor(.insulin.opacity(portion <= 3 ? 0.8 : 1)).cgColor) + let height: CGFloat = 1 - portion + let rectToFill = CGRect(x: 0, y: size.height * portion, width: size.width, height: size.height * height) + context.fill(rectToFill) + let newImage = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + + return Image(uiImage: newImage!) + } +}