Skip to content

Commit

Permalink
Release 5.0.4 (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-b-m authored Sep 18, 2024
1 parent bd6e57e commit 32c3369
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 73 deletions.
2 changes: 1 addition & 1 deletion Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
APP_DISPLAY_NAME = iAPS
APP_VERSION = 5.0.3
APP_VERSION = 5.0.4
APP_BUILD_NUMBER = 1
COPYRIGHT_NOTICE =
DEVELOPER_TEAM = ##TEAM_ID##
Expand Down
46 changes: 23 additions & 23 deletions Dependencies/OmniBLE/Localizations/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -216,46 +216,46 @@
"Pod is not in a state ready for cannula insertion." = "البود ليس في حالة جاهزة لإدخال الإبرة.";

/* Error description for OmniBLEPumpManagerError.invalidSetting */
"Invalid Setting" = "Invalid Setting";
"Invalid Setting" = "إعدادات غير صالحة";

/* Recovery suggestion shown when no pod is paired */
"Please pair a new pod" = "Please pair a new pod";
"Please pair a new pod" = "الرجاء إقران بود جديد";

/* Generic title of the OmniBLE pump manager */
"Omnipod DASH" = "Omnipod DASH";
"Omnipod DASH" = "أومينبود داش";

/* Status highlight that delivery is uncertain. */
"Comms Issue" = "Comms Issue";
"Comms Issue" = "مشكلة في الاتصالات";

/* */
"Finish Pairing" = "Finish Pairing";
"Finish Pairing" = "إنهاء الاقتران";

/* Status highlight that when pod is deactivating */
"Finish Deactivation" = "Finish Deactivation";
"Finish Deactivation" = "أكمل إلغاء التفعيل";

/* Status highlight that when no pod is paired. */
"No Pod" = "لا يوجد بود";

/* Status highlight message for emptyReservoir alarm. */
"No Insulin" = "No Insulin";
"No Insulin" = "لا يوجد إنسولين";

/* Status highlight message for podExpired alarm. */
"Pod Expired" = "انتهت صلاحية البود";

/* Status highlight message for occlusion alarm. */
"Pod Occlusion" = "Pod Occlusion";
"Pod Occlusion" = "انسداد البود";

/* Status highlight message for other alarm. */
"Pod Error" = "Pod Error";
"Pod Error" = "خطأ في البود";

/* Status highlight that a pump is out of insulin. */
"No Insulin" = "No Insulin";
"No Insulin" = "لا يوجد إنسولين";

/* Status highlight that insulin delivery was suspended. */
"Insulin Suspended" = "Insulin Suspended";

/* Status highlight when communications with the pod haven't happened recently. */
"Signal Loss" = "Signal Loss";
"Signal Loss" = "فقدان الإشارة";

/* Status highlight when manual temp basal is running. */
"Manual Basal" = "Manual Basal";
Expand All @@ -264,37 +264,37 @@
"Insert Cannula" = "Insert Cannula";

/* Cannula insertion button text while inserting */
"Inserting..." = "Inserting...";
"Inserting..." = "جاري إدخال...";

/* Cannula insertion button text while showing error */
"Retry" = "Retry";
"Retry" = "أعد المحاولة";

/* Cannula insertion button text while checking insertion */
"Checking..." = "Checking...";
"Checking..." = "جارٍ التحقق...";

/* */
"Check cannula insertion finished" = "Check cannula insertion finished";
"Check cannula insertion finished" = "تحقق من انتهاء إدخال القنية";

/* */
"Get pod status" = "Get pod status";
"Get pod status" = "الحصول على حالة البود";

/* */
"Save Basal Profile" = "Save Basal Profile";
"Save Basal Profile" = "حفظ ملف الانسولين القاعدي";

/* */
"Save basal profile failed: %{public}@" = "Save basal profile failed: %{public}@";
"Save basal profile failed: %{public}@" = "فشل حفظ الملف الشخصي للأنسولين القاعدي: %{public}@";

/* */
"Skipping Play Test Beeps due to bolus still in progress." = "Skipping Play Test Beeps due to bolus still in progress.";
"Skipping Play Test Beeps due to bolus still in progress." = "تخطي نغمة الاختبار بسبب تنفيذ الجرعة.";

/* */
"Play Test Beeps" = "Play Test Beeps";
"Play Test Beeps" = "تشغيل نغمة الاختبار";

/* */
"Skipping Read Pulse Log due to bolus still in progress." = "Skipping Read Pulse Log due to bolus still in progress.";
"Skipping Read Pulse Log due to bolus still in progress." = "تخطي سجل النبض المقروء بسبب البولوس الذي لا يزال قيد التقدم.";

/* */
"Read Pulse Log" = "Read Pulse Log";
"Read Pulse Log" = "قراءة سجل النبض";

/* */
"Set Confirmation Beeps to %s" = "Set Confirmation Beeps to %s";
Expand Down Expand Up @@ -436,7 +436,7 @@
"Pod deactivated successfully. Continue." = "تم إلغاء تفعيل البود بنجاح. تابع.";

/* Action button description for deactivate after failed attempt */
"Retry" = "Retry";
"Retry" = "أعد المحاولة";

/* Action button description when deactivated */
"Continue" = "تابع";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"Command error %1$u" = "خطأ في الأمر %1$u";

/* Status highlight that delivery is uncertain. */
"Comms Issue" = "Comms Issue";
"Comms Issue" = "مشكلة في الاتصالات";

/* Error message when command is rejected because an unacknowledged command is pending. */
"Communication issue: Unacknowledged command pending." = "مشكلة إتصال: أمر غير معترف به معلق.";
Expand Down Expand Up @@ -105,10 +105,10 @@
"Fault event occurred" = "حدث خطأ";

/* Status highlight that when pod is deactivating. */
"Finish Deactivation" = "Finish Deactivation";
"Finish Deactivation" = "أكمل إلغاء التفعيل";

/* Status highlight that when pod is activating. */
"Finish Pairing" = "Finish Pairing";
"Finish Pairing" = "إنهاء الاقتران";

/* Description for finish setup */
"Finish setup " = "الانتهاء من الإعداد ";
Expand Down Expand Up @@ -147,7 +147,7 @@
"Invalid CRC" = "Invalid CRC";

/* Error description for OmniBLEPumpManagerError.invalidSetting */
"Invalid Setting" = "Invalid Setting";
"Invalid Setting" = "إعدادات غير صالحة";

/* Alert content title for lowReservoir pod alert */
"Low Reservoir" = "Low Reservoir";
Expand Down Expand Up @@ -188,7 +188,7 @@

/* Status highlight message for emptyReservoir alarm.
Status highlight that a pump is out of insulin. */
"No Insulin" = "No Insulin";
"No Insulin" = "لا يوجد إنسولين";

/* Status highlight that when no pod is paired. */
"No Pod" = "لا يوجد بود";
Expand Down Expand Up @@ -237,7 +237,7 @@
"Please finish pairing your pod." = "يرجى إكمال إقران البود.";

/* Recover suggestion shown when no pod is paired */
"Please pair a new pod" = "Please pair a new pod";
"Please pair a new pod" = "الرجاء إقران بود جديد";

/* Recovery suggestion when pairing signal strength is too high */
"Please reposition the RileyLink further from the pod" = "يرجى وضع RileyLink أبعد من الحجيرة";
Expand All @@ -252,7 +252,7 @@
"Pod already primed" = "تمت تهيأت المضخة مسبقاً";

/* Status highlight message for other alarm. */
"Pod Error" = "Pod Error";
"Pod Error" = "خطأ في البود";

/* Description for expiration advisory alarm */
"Pod expiration advisory alarm" = "انذار اقتراب وقت انتهاء صلاحية المضخة";
Expand All @@ -279,7 +279,7 @@
"Pod is suspended" = "تم تعليق المضخة";

/* Status highlight message for occlusion alarm. */
"Pod Occlusion" = "Pod Occlusion";
"Pod Occlusion" = "انسداد البود";

/* Alert content title for finishSetupReminder pod alert */
"Pod Pairing Incomplete" = "إقران البود غير مكتمل";
Expand Down Expand Up @@ -334,7 +334,7 @@
"Shutdown imminent alarm" = "Shutdown imminent alarm";

/* Status highlight when communications with the pod haven't happened recently. */
"Signal Loss" = "Signal Loss";
"Signal Loss" = "فقدان الإشارة";

/* Format string for pod signal strength too high */
"Signal strength too high" = "Signal strength too high";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"Checking Insertion" = "Checking Insertion";

/* Cannula insertion button text while checking insertion */
"Checking..." = "Checking...";
"Checking..." = "جارٍ التحقق...";

/* Title for uncertainty recovered screen */
"Comms Recovered" = "تم استرداد الاتصال";
Expand Down Expand Up @@ -324,7 +324,7 @@
"Inserting. Please wait." = "Inserting. Please wait.";

/* Cannula insertion button text while inserting */
"Inserting..." = "Inserting...";
"Inserting..." = "جاري إدخال...";

/* Text shown in insulin delivery space when insulin suspended */
"Insulin\nSuspended" = "Insulin\nSuspended";
Expand Down Expand Up @@ -405,7 +405,7 @@
"No\nDelivery" = "No\nDelivery";

/* Error message for reservoir view when reservoir empty */
"No Insulin" = "No Insulin";
"No Insulin" = "لا يوجد إنسولين";

/* Label for pod life state when no pod paired
Text shown in insulin remaining space when no pod is paired */
Expand Down Expand Up @@ -464,7 +464,7 @@
"PI Version" = "PI Version";

/* The title of the command to play test beeps */
"Play Test Beeps" = "Play Test Beeps";
"Play Test Beeps" = "تشغيل نغمة الاختبار";

/* Progress message for play test beeps. */
"Play Test Beeps…" = "Play Test Beeps…";
Expand Down Expand Up @@ -492,7 +492,7 @@
"Pod deactivated successfully. Continue." = "تم إلغاء تفعيل البود بنجاح. تابع.";

/* Error message for reservoir view during general pod fault */
"Pod Error" = "Pod Error";
"Pod Error" = "خطأ في البود";

/* Label for pod life state when within pod expiration window */
"Pod expired" = "انتهت صلاحية البود";
Expand All @@ -511,7 +511,7 @@
"Pod Fault Details" = "Pod Fault Details";

/* Error message for reservoir view when pod occlusion checks failed */
"Pod Occlusion" = "Pod Occlusion";
"Pod Occlusion" = "انسداد البود";

/* Pairing action button accessibility label when pairing succeeded */
"Pod paired successfully. Continue." = "تم إقران البود بنجاح. تابع.";
Expand Down Expand Up @@ -630,7 +630,7 @@
"Setup Complete" = "Setup Complete";

/* Error message for reservoir view during general pod fault */
"Signal Loss" = "Signal Loss";
"Signal Loss" = "فقدان الإشارة";

/* No comment provided by engineer. */
"Skip Omnipod Onboarding?" = "Skip Omnipod Onboarding?";
Expand Down
19 changes: 18 additions & 1 deletion FreeAPS/Sources/APS/Storage/OverrideStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,24 @@ final class OverrideStorage {
}
}

func activatePreset(_ id: String) {
coredataContext.performAndWait {
var presetsArray = [OverridePresets]()
coredataContext.performAndWait {
let requestPresets = OverridePresets.fetchRequest() as NSFetchRequest<OverridePresets>
requestPresets.predicate = NSPredicate(
format: "id == %@", id
)
try? presetsArray = self.coredataContext.fetch(requestPresets)

guard let overidePreset = presetsArray.first else {
return
}
overrideFromPreset(overidePreset)
}
}
}

func fetchProfilePreset(_ name: String) -> OverridePresets? {
var presetsArray = [OverridePresets]()
var preset: OverridePresets?
Expand Down Expand Up @@ -160,7 +178,6 @@ final class OverrideStorage {
}

func activateOverride(_ override: Override) {
var overrideArray = [Override]()
coredataContext.performAndWait {
let save = Override(context: coredataContext)
save.date = Date.now
Expand Down
10 changes: 5 additions & 5 deletions FreeAPS/Sources/Models/FreeAPSSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ struct FreeAPSSettings: JSON, Equatable {
var birthDate = Date.distantPast
// var sex: Sex = .secret
var sexSetting: Int = 3
var disableHypoTreatment: Bool = false
var displayDelta: Bool = false
var profileID: OverridePresets.ID = "Hypo Treatment"
}

extension FreeAPSSettings: Decodable {
Expand Down Expand Up @@ -347,14 +347,14 @@ extension FreeAPSSettings: Decodable {
settings.sexSetting = sexSetting
}

if let disableHypoTreatment = try? container.decode(Bool.self, forKey: .disableHypoTreatment) {
settings.disableHypoTreatment = disableHypoTreatment
}

if let displayDelta = try? container.decode(Bool.self, forKey: .displayDelta) {
settings.displayDelta = displayDelta
}

if let profileID = try? container.decode(String.self, forKey: .profileID) {
settings.profileID = profileID
}

self = settings
}
}
46 changes: 26 additions & 20 deletions FreeAPS/Sources/Modules/AddCarbs/AddCarbsStateModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ extension AddCarbs {
@Published var id_: String = ""
@Published var summary: String = ""
@Published var skipBolus: Bool = false
@Published var hypoTreatment: Bool = false
@Published var disableHypoTreatment: Bool = false
@Published var id: String?
@Published var hypoTreatment = false

let now = Date.now

Expand All @@ -33,10 +33,10 @@ extension AddCarbs {

override func subscribe() {
carbsRequired = provider.suggestion?.carbsReq
id = settings.settings.profileID
maxCarbs = settings.settings.maxCarbs
skipBolus = settingsManager.settings.skipBolusScreenAfterCarbs
useFPUconversion = settingsManager.settings.useFPUconversion
disableHypoTreatment = settingsManager.settings.disableHypoTreatment
}

func add(_ continue_: Bool, fetch: Bool) {
Expand Down Expand Up @@ -241,24 +241,30 @@ extension AddCarbs {
}
}

guard let profileID = id, profileID != "None" else {
return
}
// Enable New Override
let override = OverridePresets(context: coredataContextBackground)
override.percentage = 90
override.smbIsOff = true
override.duration = 45
override.name = "📉"
override.advancedSettings = true
override.target = 117
override.date = Date.now
override.indefinite = false

os.overrideFromPreset(override, UUID().uuidString)
// Upload to Nightscout
nightscoutManager.uploadOverride(
"📉",
Double(45),
override.date ?? Date.now
)
if profileID == "Hypo Treatment" {
let override = OverridePresets(context: coredataContextBackground)
override.percentage = 90
override.smbIsOff = true
override.duration = 45
override.name = "📉"
override.advancedSettings = true
override.target = 117
override.date = Date.now
override.indefinite = false
os.overrideFromPreset(override, profileID)
// Upload to Nightscout
nightscoutManager.uploadOverride(
"📉",
Double(45),
override.date ?? Date.now
)
} else {
os.activatePreset(profileID)
}
}
}
}
Loading

0 comments on commit 32c3369

Please sign in to comment.