Merge branch 'omnipod_eros_dev' into omnipod_eros_dev_wizard

This commit is contained in:
Bart Sopers 2020-09-26 15:45:44 +02:00
commit ee9079fdcf
120 changed files with 2072 additions and 1157 deletions

View file

@ -42,7 +42,7 @@ Hints
-----
* Start small, it is easier to review smaller changes that affect fewer parts of code
* Take a look into Issues list (https://github.com/MilosKozak/AndroidAPS/issues) - maybe there is somthing you can fix or implement
* Take a look into Issues list (https://github.com/nightscout/AndroidAPS/issues) - maybe there is something you can fix or implement
* For new features, make sure there is Issue to track progress and have on-topic discussion
* Reach out to community, discuss idea on Gitter (https://gitter.im/MilosKozak/AndroidAPS)
* Speak with other developers to minimise merge conflicts. Find out who worked, working or plan to work on speciffic issue or part of app

View file

@ -6,5 +6,5 @@ Reporting bugs
upper-right corner).
- Obtain the app's log files, which can be found on the phone in
_/storage/emulated/0/Android/data/info.nightscout.androidaps/_
See https://github.com/MilosKozak/AndroidAPS/wiki/Accessing-logfiles
- Open an issue at https://github.com/MilosKozak/AndroidAPS/issues/new
See https://androidaps.readthedocs.io/en/latest/EN/Usage/Accessing-logfiles.html
- Open an issue at https://github.com/nightscout/AndroidAPS/issues/new

View file

@ -4,7 +4,7 @@
* Everyone whos been looping with AndroidAPS needs to fill out the form after 3 days of looping https://docs.google.com/forms/d/14KcMjlINPMJHVt28MDRupa4sz4DDIooI4SrW0P3HSN8/viewform?c=0&w=1
[![Gitter](https://badges.gitter.im/MilosKozak/AndroidAPS.svg)](https://gitter.im/MilosKozak/AndroidAPS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build status](https://travis-ci.org/MilosKozak/AndroidAPS.svg?branch=master)](https://travis-ci.org/MilosKozak/AndroidAPS)
[![Build status](https://travis-ci.org/nightscout/AndroidAPS.svg?branch=master)](https://travis-ci.org/nightscout/AndroidAPS)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/androidaps/localized.svg)](https://translations.androidaps.org/project/androidaps)
[![Documentation Status](https://readthedocs.org/projects/androidaps/badge/?version=latest)](https://androidaps.readthedocs.io/en/latest/?badge=latest)
[![codecov](https://codecov.io/gh/MilosKozak/AndroidAPS/branch/master/graph/badge.svg)](https://codecov.io/gh/MilosKozak/AndroidAPS)

View file

@ -126,7 +126,7 @@ android {
targetSdkVersion 28
multiDexEnabled true
versionCode 1500
version "2.7-omnipod-0.4.1-SNAPSHOT"
version "2.7.0-omnipod-0.4-SNAPSHOT"
buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"'
buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"'

View file

@ -26,4 +26,5 @@ abstract class CommandQueueModule {
@ContributesAndroidInjector abstract fun commandTempBasalAbsoluteInjector(): CommandTempBasalAbsolute
@ContributesAndroidInjector abstract fun commandTempBasalPercentInjector(): CommandTempBasalPercent
@ContributesAndroidInjector abstract fun commandSetUserSettingsInjector(): CommandSetUserSettings
@ContributesAndroidInjector abstract fun commandCustomCommandInjector(): CommandCustomCommand
}

View file

@ -48,7 +48,7 @@ class SignatureVerifierPlugin @Inject constructor(
aapsLogger, resourceHelper, injector
), ConstraintsInterface {
private val REVOKED_CERTS_URL = "https://raw.githubusercontent.com/MilosKozak/AndroidAPS/master/app/src/main/assets/revoked_certs.txt"
private val REVOKED_CERTS_URL = "https://raw.githubusercontent.com/nightscout/AndroidAPS/master/app/src/main/assets/revoked_certs.txt"
private val UPDATE_INTERVAL = TimeUnit.DAYS.toMillis(1)
private val lock: Any = arrayOfNulls<Any>(0)

View file

@ -49,7 +49,7 @@ class VersionCheckerUtils @Inject constructor(
private fun checkVersion() = if (isConnected()) {
Thread {
try {
val version: String? = findVersion(URL("https://raw.githubusercontent.com/MilosKozak/AndroidAPS/master/app/build.gradle").readText())
val version: String? = findVersion(URL("https://raw.githubusercontent.com/nightscout/AndroidAPS/master/app/build.gradle").readText())
compareWithCurrentVersion(version, BuildConfig.VERSION_NAME)
} catch (e: IOException) {
aapsLogger.error(LTag.CORE, "Github master version check error: $e")

View file

@ -70,11 +70,15 @@ class AutomationPlugin @Inject constructor(
val automationEvents = ArrayList<AutomationEvent>()
var executionLog: MutableList<String> = ArrayList()
var btConnects : MutableList<EventBTChange> = ArrayList()
var btConnects: MutableList<EventBTChange> = ArrayList()
private val loopHandler : Handler = Handler(HandlerThread(AutomationPlugin::class.java.simpleName + "Handler").also { it.start() }.looper)
private val loopHandler: Handler = Handler(HandlerThread(AutomationPlugin::class.java.simpleName + "Handler").also { it.start() }.looper)
private lateinit var refreshLoop: Runnable
companion object {
const val event = "{\"title\":\"Low\",\"enabled\":true,\"trigger\":\"{\\\"type\\\":\\\"info.nightscout.androidaps.plugins.general.automation.triggers.TriggerConnector\\\",\\\"data\\\":{\\\"connectorType\\\":\\\"AND\\\",\\\"triggerList\\\":[\\\"{\\\\\\\"type\\\\\\\":\\\\\\\"info.nightscout.androidaps.plugins.general.automation.triggers.TriggerBg\\\\\\\",\\\\\\\"data\\\\\\\":{\\\\\\\"bg\\\\\\\":4,\\\\\\\"comparator\\\\\\\":\\\\\\\"IS_LESSER\\\\\\\",\\\\\\\"units\\\\\\\":\\\\\\\"mmol\\\\\\\"}}\\\",\\\"{\\\\\\\"type\\\\\\\":\\\\\\\"info.nightscout.androidaps.plugins.general.automation.triggers.TriggerDelta\\\\\\\",\\\\\\\"data\\\\\\\":{\\\\\\\"value\\\\\\\":-0.1,\\\\\\\"units\\\\\\\":\\\\\\\"mmol\\\\\\\",\\\\\\\"deltaType\\\\\\\":\\\\\\\"DELTA\\\\\\\",\\\\\\\"comparator\\\\\\\":\\\\\\\"IS_LESSER\\\\\\\"}}\\\"]}}\",\"actions\":[\"{\\\"type\\\":\\\"info.nightscout.androidaps.plugins.general.automation.actions.ActionStartTempTarget\\\",\\\"data\\\":{\\\"value\\\":8,\\\"units\\\":\\\"mmol\\\",\\\"durationInMinutes\\\":60}}\"]}"
}
init {
refreshLoop = Runnable {
processActions()
@ -162,7 +166,7 @@ class AutomationPlugin @Inject constructor(
private fun loadFromSP() {
automationEvents.clear()
val data = sp.getString(keyAutomationEvents, "")
if (data != "") {
if (data != "")
try {
val array = JSONArray(data)
for (i in 0 until array.length()) {
@ -173,7 +177,8 @@ class AutomationPlugin @Inject constructor(
} catch (e: JSONException) {
e.printStackTrace()
}
}
else
automationEvents.add(AutomationEvent(injector).fromJSON(event))
}
@Synchronized

View file

@ -510,7 +510,7 @@ class OpenHumansUploader @Inject constructor(
applicationInfo.put("versionName", BuildConfig.VERSION_NAME)
applicationInfo.put("versionCode", BuildConfig.VERSION_CODE)
val hasGitInfo = !BuildConfig.HEAD.endsWith("NoGitSystemAvailable", true)
val customRemote = !BuildConfig.REMOTE.equals("https://github.com/MilosKozak/AndroidAPS.git", true)
val customRemote = !BuildConfig.REMOTE.equals("https://github.com/nightscout/AndroidAPS.git", true)
applicationInfo.put("hasGitInfo", hasGitInfo)
applicationInfo.put("customRemote", customRemote)
applicationInfo.put("applicationId", appId.toString())

View file

@ -29,6 +29,7 @@ import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TDD;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventRefreshOverview;
import info.nightscout.androidaps.interfaces.CommandQueueProvider;
@ -36,6 +37,7 @@ import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.ConstraintsInterface;
import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.ProfileFunction;
import info.nightscout.androidaps.interfaces.PumpDescription;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.interfaces.PumpPluginBase;
@ -43,9 +45,9 @@ import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.interfaces.ProfileFunction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.queue.commands.CustomCommand;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
@ -64,7 +66,6 @@ import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpH
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistoryRequest;
import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Tdd;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.InstanceId;
@ -1395,7 +1396,10 @@ public class ComboPlugin extends PumpPluginBase implements PumpInterface, Constr
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
@Nullable @Override public PumpEnactResult executeCustomCommand(CustomCommand customCommand) {
return null;
}
@Override

View file

@ -12,6 +12,7 @@ import android.os.IBinder;
import android.os.Looper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.json.JSONException;
import org.json.JSONObject;
@ -56,6 +57,7 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.queue.commands.CustomCommand;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
@ -1171,7 +1173,10 @@ public class LocalInsightPlugin extends PumpPluginBase implements PumpInterface,
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
@Nullable @Override public PumpEnactResult executeCustomCommand(CustomCommand customCommand) {
return null;
}
private void readHistory() {

View file

@ -1,6 +1,7 @@
package info.nightscout.androidaps.plugins.pump.mdi;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.json.JSONException;
import org.json.JSONObject;
@ -27,6 +28,7 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.queue.commands.CustomCommand;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
@ -281,7 +283,10 @@ public class MDIPlugin extends PumpPluginBase implements PumpInterface {
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
@Nullable @Override public PumpEnactResult executeCustomCommand(CustomCommand customCommand) {
return null;
}
@Override

View file

@ -16,9 +16,9 @@ import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.common.ManufacturerType
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType
import info.nightscout.androidaps.queue.commands.CustomCommand
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
@ -133,6 +133,11 @@ class VirtualPumpPlugin @Inject constructor(
}
override fun executeCustomAction(customActionType: CustomActionType) {}
override fun executeCustomCommand(customCommand: CustomCommand?): PumpEnactResult? {
return null
}
override fun isInitialized(): Boolean {
return true
}

View file

@ -20,16 +20,16 @@ import info.nightscout.androidaps.events.EventProfileNeedsUpdate
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.CommandQueueProvider
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.queue.commands.CustomCommand
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
import info.nightscout.androidaps.queue.commands.Command
import info.nightscout.androidaps.queue.commands.*
import info.nightscout.androidaps.queue.commands.Command.CommandType
import info.nightscout.androidaps.utils.FabricPrivacy
@ -260,7 +260,7 @@ class CommandQueue @Inject constructor(
} else {
add(CommandBolus(injector, detailedBolusInfo, callback, type))
if (type == CommandType.BOLUS) { // Bring up bolus progress dialog (start here, so the dialog is shown when the bolus is requested,
// not when the Bolus command is starting. The command closes the dialog upon completion).
// not when the Bolus command is starting. The command closes the dialog upon completion).
showBolusProgressDialog(detailedBolusInfo.insulin, detailedBolusInfo.context)
// Notify Wear about upcoming bolus
rxBus.send(EventBolusRequested(detailedBolusInfo.insulin))
@ -485,6 +485,55 @@ class CommandQueue @Inject constructor(
return true
}
override fun customCommand(customCommand: CustomCommand, callback: Callback?): Boolean {
if (isCustomCommandInQueue(customCommand.javaClass)) {
callback?.result(executingNowError())?.run()
return false
}
// remove all unfinished
removeAllCustomCommands(customCommand.javaClass)
// add new command to queue
add(CommandCustomCommand(injector, customCommand, callback))
notifyAboutNewCommand()
return true
}
@Synchronized
override fun isCustomCommandInQueue(customCommandType: Class<out CustomCommand>): Boolean {
if(isCustomCommandRunning(customCommandType)) {
return true
}
synchronized(queue) {
for (i in queue.indices) {
val command = queue[i]
if (command is CommandCustomCommand && customCommandType.isInstance(command.customCommand)) {
return true
}
}
}
return false
}
override fun isCustomCommandRunning(customCommandType: Class<out CustomCommand>): Boolean {
val performing = this.performing
if (performing is CommandCustomCommand && customCommandType.isInstance(performing.customCommand)) {
return true
}
return false
}
@Synchronized
private fun removeAllCustomCommands(targetType: Class<out CustomCommand>) {
synchronized(queue) {
for (i in queue.indices.reversed()) {
val command = queue[i]
if (command is CustomCommand && targetType.isInstance(command.commandType)) {
queue.removeAt(i)
}
}
}
}
override fun spannedStatus(): Spanned {
var s = ""
var line = 0

View file

@ -0,0 +1,26 @@
package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.logging.LTag
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
class CommandCustomCommand(
injector: HasAndroidInjector,
val customCommand: CustomCommand,
callback: Callback?
) : Command(injector, CommandType.CUSTOM_COMMAND, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
override fun execute() {
val result = activePlugin.activePump.executeCustomCommand(customCommand)
aapsLogger.debug(LTag.PUMPQUEUE, "Result success: ${result?.success} enacted: ${result?.enacted}")
callback?.result(result)?.run()
}
override fun status(): String {
return customCommand.statusDescription
}
}

View file

@ -2,8 +2,6 @@ package info.nightscout.androidaps.queue.commands
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
import info.nightscout.androidaps.queue.Callback
import javax.inject.Inject
@ -14,17 +12,12 @@ class CommandStartPump(
) : Command(injector, CommandType.START_PUMP, callback) {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var profileFunction: ProfileFunction
override fun execute() {
val pump = activePlugin.activePump
if (pump is LocalInsightPlugin) {
val result = pump.startPump()
callback?.result(result)?.run()
} else if (pump.pumpDescription.pumpType == PumpType.Insulet_Omnipod) {
// When using CommandQueue.setProfile, it refuses to set the profile is the same as the current profile
// However we need to set the current profile to resume delivery in case the Pod is suspended
pump.setNewBasalProfile(profileFunction.getProfile())
}
}

View file

@ -655,7 +655,7 @@
<string name="apssetup">Konfigureer APS plugin</string>
<string name="sensitivitysetup">Konfigureer Sensitiwiteits plugin</string>
<string name="setupwizard_sensitivity_description">Sensitiwiteit plugin vir sensitiwiteit opsporing en KAB berekening. Vir meer inligting besoek:</string>
<string name="setupwizard_sensitivity_url">https://github.com/MilosKozak/AndroidAPS/wiki/Sensitivity-detection-and-COB</string>
<string name="setupwizard_sensitivity_url">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html</string>
<string name="diawarning">Onthou asseblief: dat nuwe insulien profiele vereis DIA van minstens 5h. DIA 5 6h op nuwe profiel is gelyk aan DIA 3h op ou insulien profiele.</string>
<string name="bgsourcesetup">Konfigureer BG bron</string>
<string name="setupwizard_profile_description">Kies asseblief bron van profiel. As Pasiënt \'n kind is gebruik NS profiel. As niemand jou volg op Nightscout sal jy waarskynlik plaaslike profiel kies. Onthou asseblief dat jy net die bron kies van profiel. Om dit te gebruik moet jy dit aktiveer deur uitvoering \"Profiel skakelaar\"</string>

View file

@ -174,6 +174,9 @@
<string name="preferences_import_canceled">Импорт неуспешен! Настройките не са импортирани!</string>
<string name="preferences_import_impossible">Импортирането неуспешно!</string>
<string name="goto_main_try_again">Моля, върнете се на началния екран и опитайте отново.</string>
<string name="old_master_password">Стара главна парола</string>
<string name="different_password_used">Този файл е експортиран и шифрован с различна главна парола. Използвайте старата главна парола за декриптиране на файла.</string>
<string name="master_password_will_be_replaced">Вашата главна парола ЩЕ БЪДЕ ПОДМЕНЕНА с друга от импортирания файл!</string>
<string name="preferences_import_list_title">Изберете файл</string>
<string name="check_preferences_before_import">Моля, проверете насстройките преди импортирането:</string>
<string name="check_preferences_cannot_import">Настройите не могат да бъдат импортирани!</string>
@ -1134,10 +1137,15 @@
<string name="loop_tbrexecution_time_label">Продължителност на временни базали</string>
<string name="insight_alert_notification_channel">Информация за Insight Pump</string>
<!-- SMS Communicator & OTP Authenticator -->
<string name="smscommunicator_code_from_authenticator_for" comment="This is continuation of sentence: To [ACTION] reply with code">от приложението AUTHENTICATOR за: %1$s , последвано от PIN</string>
<string name="smscommunicator_otp_enabled">Активиране на удостоверител</string>
<string name="smscommunicator_otp_enabled_summary">Удостоверяване чрез еднократна парола, генерирана с Google Authenticator или подобна програма за 2-факторна оторизация.</string>
<string name="smscommunicator_otp_pin">Допълнителен PIN в края на токен</string>
<string name="smscommunicator_otp_pin_summary">Допълнителни цифри, които следва да бъдат залепени в края на всяка генерирана еднократна парола</string>
<string name="smscomunicator_tab_otp_label">Настройка на удостоверителя</string>
<string name="smscommunicator_code_verify_label">Код за проверка:</string>
<string name="smscommunicator_code_verify_hint">OTP + PIN</string>
<string name="smscommunicator_code_verify_info">Кодът за проверката се състои от 6 цифри, от приложението за аудиентикация (известно като OTP), следвани от 3 или повече цифри на задължителния PIN.</string>
<string name="smscommunicator_otp_verify_label">ОТР за проверка:</string>
<string name="smscommunicator_otp_reset_btn">Нулиране на удостоверители</string>
<string name="smscommunicator_otp_reset_title">Нулиране на ключва</string>
@ -1176,4 +1184,33 @@
<string name="formatwithweight">Възраст: %1$.0f Тегло: %2$.0f кг</string>
<string name="basalpctfromtdd_label">% от базата</string>
<string name="dpvdefaultprofile">Профил по подразбиране</string>
<string name="open_humans">Open Humans</string>
<string name="finishing_open_humans_setup">Довършване на Open Humans инсталация…</string>
<string name="this_may_take_a_while">Това може да отнеме време. Не изключвайте телефона или тази приставка.</string>
<string name="setup_finished">Настройката е завършена</string>
<string name="your_phone_will_upload_data">Телефонът ви скоро ще качва данни в \"Open Humans\".</string>
<string name="your_phone_is_upload_data">Телефонът ви качва данни в \"Open Humans\".</string>
<string name="setup_failed">Настройката е НЕУСПЕШНА</string>
<string name="there_was_an_error">Имаше грешка. Моля, опитайте се да влезете отново, за да продължите. Съжаляваме и ви благодарим!</string>
<string name="open_humans_terms">Това е отворен код, който ще копира данните ви в Open Humans. Ние не запазваме никакви права да споделяме вашите данни с трети страни без изричното ви разрешение. Данните, които проектът и приложението получават, се идентифицират чрез случаен идентификатор на потребител и ще бъдат надеждно предадени на Open Humans акаунт с вашето разрешение за този процес. Можете да спрете качването и да изтриете данните за качване по всяко време чрез www.openhumans.org.</string>
<string name="i_understand_and_agree">Разбирам и съм съгласен.</string>
<string name="login">Вход</string>
<string name="logout">Изход</string>
<string name="oh_logout_confirmation">Наистина ли искате да излезете и да спрете да дарявате данни на науката?</string>
<string name="project_member_id">Project Member ID: %s</string>
<string name="queue_size">Големина на опашката: %d</string>
<string name="terms_of_use">Условия за ползване</string>
<string name="not_logged_in">Не сте влезнали в профила си</string>
<string name="you_need_to_accept_the_of_use_first">Трябва да се съгласите с условията за ползване.</string>
<string name="successfully_logged_in">Успешно влизане</string>
<string name="setup_will_continue_in_background">Настройката ще бъде завършена във фонов режим. Благодаря, че дарявате данните.\n\nМоля, задръжте този плъгин и телефона ви включени, докато настройката да завърши.</string>
<string name="completing_login">Завършване на вход…</string>
<string name="donate_your_data_to_science">Дарете данните си на науката.</string>
<string name="open_humans_short">OH</string>
<string name="you_have_been_signed_out_of_open_humans">Излязохте от \"Open Humans\".</string>
<string name="click_here_to_sign_in_again_if_this_wasnt_on_purpose">Натиснете тук за да влезете отново, ако това не е било нарочно.</string>
<string name="only_upload_if_connected_to_wifi">Качване, само при свързано WiFi</string>
<string name="only_upload_if_charging">Качване само при зареждане</string>
<string name="worker_state">Статус: %s</string>
<string name="uploaded_data">Качени данни</string>
</resources>

View file

@ -1213,5 +1213,5 @@
<string name="only_upload_if_charging">Odeslat pouze při nabíjení</string>
<string name="worker_state">Stav procesu: %s</string>
<string name="uploaded_data">Odeslaná data</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Následující data budou nahrána do vašeho účtu Open Humans: hodnoty glykémie, události péče (kromě poznámek), rozložené bolusy, přepnutí profilu, celkové denní dávky, dočasné bazály, nastavení, verze aplikace, model zařízení a rozměry obrazovky. Tajné nebo soukromé informace, jako je URL nebo API heslo vašeho Nightscoutu, nahrány nebudou.</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Následující data budou nahrána do vašeho účtu Open Humans: hodnoty glykémie, bolusy, sacharidy, události péče (kromě poznámek), rozložené bolusy, přepnutí profilu, celkové denní dávky, dočasné bazály, nastavení, verze aplikace, model zařízení a rozměry obrazovky. Tajné nebo soukromé informace, jako je URL nebo API heslo vašeho Nightscoutu, nahrány nebudou.</string>
</resources>

View file

@ -1214,5 +1214,5 @@ Unerwartetes Verhalten.</string>
<string name="only_upload_if_charging">Nur beim Laden hochladen</string>
<string name="worker_state">Worker State: %s</string>
<string name="uploaded_data">Daten hochgeladen</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Die folgenden Daten werden auf Dein Open Humans-Konto hochgeladen: Glukosewerte, Careportal-Ereignisse (außer Notizen), erweiterte Boli, Profilwechsel, Gesamttagesdosen, temporäre Basalwerte, Temporäre Ziele, Einstellungen, Anwendungsversion, Gerätemodell und Bildschirmabmessungen. Vertrauliche oder private Informationen wie z.B. Deine Nightscout-URL oder Dein API-Secret werden nicht hochgeladen.</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Die folgenden Daten werden auf Dein Open Humans-Konto hochgeladen: Glukosewerte, Boli, Kohlenhydrate, Careportal-Ereignisse (außer Notizen), erweiterte Boli, Profilwechsel, Gesamttagesdosen, temporäre Basalwerte, Temporäre Ziele, Einstellungen, Anwendungsversion, Gerätemodell und Bildschirmabmessungen. Vertrauliche oder private Informationen wie z.B. Deine Nightscout-URL oder Dein API-Secret werden nicht hochgeladen.</string>
</resources>

View file

@ -1138,10 +1138,15 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="loop_tbrexecution_time_label">Heure d\'exécution basal temp</string>
<string name="insight_alert_notification_channel">Alertes Pompe Insight</string>
<!-- SMS Communicator & OTP Authenticator -->
<string name="smscommunicator_code_from_authenticator_for" comment="This is continuation of sentence: To [ACTION] reply with code">depuis l\'application Authenticator pour : %1$s suivie du code PIN</string>
<string name="smscommunicator_otp_enabled">Activer l\'Authentificateur</string>
<string name="smscommunicator_otp_enabled_summary">Authentifier les commandes à l\'aide des mots de passe uniques (OTP) générés par Google Authenticator ou des applications 2FA similaires.</string>
<string name="smscommunicator_otp_pin">Code PIN obligatoire à la fin de l\'OTP</string>
<string name="smscommunicator_otp_pin_summary">Chiffres supplémentaires qui doivent être mémorisés et collés à la fin de chaque OTP généré</string>
<string name="smscomunicator_tab_otp_label">Configuration de l\'Authentificateur</string>
<string name="smscommunicator_code_verify_label">Code à vérifier :</string>
<string name="smscommunicator_code_verify_hint">OTP + PIN</string>
<string name="smscommunicator_code_verify_info">Le code de vérification est composé de 6 chiffres affichés par l\'application Authenticator (appelée OTP) suivi du code PIN obligatoire constitué de 3 chiffres ou plus.</string>
<string name="smscommunicator_otp_verify_label">OTP à vérifier :</string>
<string name="smscommunicator_otp_reset_btn">Réinitialiser les authentificateurs</string>
<string name="smscommunicator_otp_reset_title">Réinitialiser la clé de l\'Authentificateur</string>
@ -1209,4 +1214,5 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="only_upload_if_charging">Ne télécharger que si en charge</string>
<string name="worker_state">État du travail : %s</string>
<string name="uploaded_data">Données transférées</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Les données suivantes seront téléchargées sur votre compte Open Humans : glycémie, bolus, glucides, événements Careportal (sauf les notes), bolus étendus, changements de profil, doses quotidiennes totales, basales temporaires, cibles temporaires, préférences, version de l\'application, modèle de l\'appareil et dimensions de l\'écran. Les informations secrètes ou privées telles que votre URL Nightscout ou votre API secret ne seront pas téléchargés.</string>
</resources>

View file

@ -8,7 +8,7 @@
<string name="treatmentssafety_maxbolus_title">Max bolo consentito [U]</string>
<string name="treatmentssafety_maxcarbs_title">Max CHO consentiti [g]</string>
<string name="nav_preferences">Preferenze</string>
<string name="nav_refreshtreatments">Ricarica trattamenti da NS</string>
<string name="nav_refreshtreatments">Aggiorna trattamenti da NS</string>
<string name="nav_resetdb">Resetta database</string>
<string name="reset_db_confirm">Vuoi davvero resettare i database?</string>
<string name="nav_exit">Esci</string>
@ -178,7 +178,7 @@
<string name="different_password_used">Questo file è stato esportato e crittografato con una password master differente. Fornire la password master precedente per decrittare il file.</string>
<string name="master_password_will_be_replaced">Come risultato dell\'importazione riuscita, la password master corrente VERRÀ SOSTITUITA con la password master precedente contenuta nel file importato!</string>
<string name="preferences_import_list_title">Seleziona il file da importare</string>
<string name="check_preferences_before_import">Verifica le preferenze prima dell\'importazione:</string>
<string name="check_preferences_before_import">Controlla le preferenze prima dell\'importazione:</string>
<string name="check_preferences_cannot_import">Le preferenze non possono essere importate!</string>
<string name="check_preferences_dangerous_import">Le preferenze non dovrebbero essere importate!</string>
<string name="check_preferences_details_btn">Descrivi i problemi importazione…</string>
@ -337,7 +337,7 @@
<string name="openapsma_autosensdata_label">Dati autosens</string>
<string name="openapsma_scriptdebugdata_label">Script debug</string>
<string name="openapsama_useautosens">Usa la funzione Autosens</string>
<string name="refresheventsfromnightscout">Ricarica eventi da NS</string>
<string name="refresheventsfromnightscout">Aggiorna eventi da NS</string>
<string name="deletefuturetreatments">Elimina trattamenti nel futuro</string>
<string name="eatingsoon">Pasto a breve</string>
<string name="hypo">Ipoglicemia</string>
@ -603,7 +603,7 @@
<string name="maxiobset">Max IOB impostata correttamente</string>
<string name="hasbgdata">BG disponibile da sorgente selezionata</string>
<string name="combo_programming_bolus">Programmazione micro per erogazione</string>
<string name="combo_refresh">Ricarica</string>
<string name="combo_refresh">Aggiorna</string>
<string name="combo_pump_state_label">Stato</string>
<string name="combo_pump_activity_label">Attività</string>
<string name="combo_no_pump_connection">Nessuna connessione per %1$d min</string>
@ -635,7 +635,7 @@
<string name="combo_error_no_connection_no_bolus_delivered">Il micro potrebbe non essere raggiungibile. Nessun bolo erogato</string>
<string name="combo_error_no_bolus_delivered">Erogazione bolo fallita. Sembra che nessun bolo sia stato erogato. Per sicurezza, controlla il micro per evitare un doppio bolo e se è tutto ok, erogalo di nuovo. Come protezione da eventuali \"bug\", i boli non vengono ripetuti automaticamente.</string>
<string name="combo_error_partial_bolus_delivered">Solo la quantità di %1$.2f U del bolo richiesto di %2$.2f U è stata erogata a causa di un errore. Controlla il micro per verificare quanto accaduto e intraprendi le azioni necessarie.</string>
<string name="combo_error_bolus_verification_failed">Erogazione del bolo e verifica dello storico del micro fallite. Controllare il micro. Se è stato erogato un bolo, sarà aggiunto ai trattamenti durante la successiva connessione al micro.</string>
<string name="combo_error_bolus_verification_failed">Erogazione del bolo e verifica dello storico del micro fallite. Controlla il micro. Se è stato erogato un bolo, sarà aggiunto ai trattamenti durante la successiva connessione al micro.</string>
<string name="combo_reservoir_level_insufficient_for_bolus">Insulina nel serbatoio insufficiente per erogare il bolo</string>
<string name="extendedbolusdeliveryerror">Errore erogazione bolo esteso</string>
<string name="insightpump_shortname">Sight</string>
@ -701,7 +701,7 @@
<string name="not_eng_mode_or_release">Engineering mode non abilitata e non su \'release branch\'</string>
<string name="combo_actvity_reading_basal_profile">Lettura profilo basale</string>
<string name="combo_bolus_rejected_due_to_pump_history_change">Lo storico del micro è cambiato dopo il calcolo del bolo. Il bolo non è stato erogato. Ricalcolare se un bolo è ancora necessario.</string>
<string name="combo_error_updating_treatment_record">Bolo erogato con successo, ma non è possibile aggiungere la voce ai trattamenti. Questo può accadere se due piccoli boli della stessa quantità sono stati somministrati negli ultimi due minuti. Verifica lo storico del micro e le voci della sezione Trattamenti e utilizza la sezione Portale per aggiungere eventuali voci mancanti. Assicurati di non aggiungere voci che si riferiscano al medesimo minuto e alla stessa quantità.</string>
<string name="combo_error_updating_treatment_record">Bolo erogato con successo, ma non è possibile aggiungere la voce ai trattamenti. Questo può accadere se due piccoli boli della stessa quantità sono stati somministrati negli ultimi due minuti. Controlla lo storico del micro e le voci della sezione Trattamenti e utilizza la sezione Portale per aggiungere eventuali voci mancanti. Assicurati di non aggiungere voci che si riferiscano al medesimo minuto e alla stessa quantità.</string>
<string name="combo_high_temp_rejected_due_to_pump_history_changes">Rifiuto basale temporanea \"alta\" in quanto il calcolo non ha considerato i cambiamenti recenti allo storico del micro</string>
<string name="combo_activity_checking_pump_state">Aggiornamento stato micro</string>
<string name="combo_warning_pump_basal_rate_changed">La velocità basale sul micro è cambiata e verrà aggiornata a breve</string>
@ -908,7 +908,7 @@
<string name="eb_formatter">%1$.2f / %2$.2f U per %3$d min</string>
<string name="enable_tbr_over_notification">Abilita notifica di fine TBR\n(impostazione micro)</string>
<string name="disable_tbr_over_notification">Disabilita notifica di fine TBR\n(impostazione micro)</string>
<string name="refresh">Ricarica</string>
<string name="refresh">Aggiorna</string>
<string name="description_pump_insight_local">Integrazione del microinfusore Accu-Chek Insight</string>
<string name="not_inserted">Non inserito</string>
<string name="short_status_last_connected">Ultima conn: %1$d min fa</string>
@ -1143,6 +1143,7 @@
<string name="smscommunicator_otp_pin">PIN obbligatorio aggiuntivo a fine token</string>
<string name="smscommunicator_otp_pin_summary">Cifre aggiuntive che devono essere memorizzate e incollate alla fine di ogni OTP generata</string>
<string name="smscomunicator_tab_otp_label">Configurazione autenticatore</string>
<string name="smscommunicator_code_verify_label">Codice controllo:</string>
<string name="smscommunicator_code_verify_hint">OTP + PIN</string>
<string name="smscommunicator_code_verify_info">Il codice di verifica è composto da 6 cifre visualizzate dall\'app autenticatore (note come OTP) seguite da 3 o più cifre del PIN obbligatorio.</string>
<string name="smscommunicator_otp_verify_label">OTP per verifica:</string>
@ -1212,5 +1213,5 @@
<string name="only_upload_if_charging">Upload solo se in carica</string>
<string name="worker_state">Worker State: %s</string>
<string name="uploaded_data">Dati caricati</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">I seguenti dati verranno caricati sul tuo account Open Humans: valori glicemia, eventi portale (eccetto note), boli estesi, cambi profilo, dosi giornaliere totali (TDD), basali temporanee, target temporanei, preferenze, versione dell\'applicazione, modello del dispositivo e dimensioni dello schermo. Informazioni segrete o private come l\'URL di Nightscout o l\'API secret non verranno caricate.</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">I seguenti dati verranno caricati sul tuo account Open Humans: valori glicemia, boli, carboidrati, eventi portale (eccetto note), boli estesi, cambi profilo, dosi giornaliere totali (TDD), basali temporanee, target temporanei, preferenze, versione dell\'applicazione, modello del dispositivo e dimensioni dello schermo. Informazioni segrete o private come l\'URL di Nightscout o l\'API secret non verranno caricate.</string>
</resources>

View file

@ -1213,5 +1213,4 @@
<string name="only_upload_if_charging">Įkelti tik akumuliatoriaus įkrovimo metu</string>
<string name="worker_state">Darbinė Būklė: %s</string>
<string name="uploaded_data">Įkelti duomenis</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Į jūsų Open Humans paskyrą bus įkelti šie duomenys: glikemijos reikšmės, priežiūros portalo įvykiai (išskyrus pastabas), ištęstiniai bolusai, profilio pakeitimai, visos paros dozės, laikinos valandinės bazės, laikini tikslai, nustatymai, programos versija, įrenginio modelis ir ekrano matmenys. Konfidenciali ar privati informacija, pvz., Jūsų Nightscout URL arba API slaptažodis, nebus įkelta.</string>
</resources>

View file

@ -1139,10 +1139,15 @@ Context | Edit Context</string>
<string name="loop_tbrexecution_time_label">Время выполнения временной базальной скорости</string>
<string name="insight_alert_notification_channel">Оповещения помпы Insight</string>
<!-- SMS Communicator & OTP Authenticator -->
<string name="smscommunicator_code_from_authenticator_for" comment="This is continuation of sentence: To [ACTION] reply with code">из приложения Authenticator для %1$s и дополните пином в конце</string>
<string name="smscommunicator_otp_enabled">Включить аутентификатор</string>
<string name="smscommunicator_otp_enabled_summary">Аутентифицировать команды с помощью одноразовых паролей, сгенерированных Google Authenticator или похожими приложениями 2FA.</string>
<string name="smscommunicator_otp_pin">Дополнительный обязательный пин-код в конце маркера</string>
<string name="smscommunicator_otp_pin_summary">Дополнительные цифры, которые должны быть запомнены и добавлены в конце каждого сгенерированного одноразового пароля</string>
<string name="smscomunicator_tab_otp_label">Настройка аутентификации</string>
<string name="smscommunicator_code_verify_label">Код для проверки:</string>
<string name="smscommunicator_code_verify_hint">OTP + ПИН-код</string>
<string name="smscommunicator_code_verify_info">Проверочный код состоит из 6 цифр, отображаемых приложением Authenticator (известным как OTP), за которым следует 3 или более цифр обязательного PIN-кода.</string>
<string name="smscommunicator_otp_verify_label">OTP для проверки:</string>
<string name="smscommunicator_otp_reset_btn">Сбросить аутентификаторы</string>
<string name="smscommunicator_otp_reset_title">Сбросить ключ идентификации</string>

View file

@ -1213,5 +1213,4 @@
<string name="only_upload_if_charging">Odoslať iba pri nabíjaní</string>
<string name="worker_state">Stav procesu: %s</string>
<string name="uploaded_data">Odoslané údaje</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Nasledujúce dáta budú nahrané na váš účet Open Humans: hodnoty glykémie, udalosti starostlivosti (okrem poznámok), rozložené bolusy, prepnutia profilu, celkové denné dávky, dočasné bazály, nastavenia, verzie aplikácie, model zariadenia a rozmery obrazovky. Tajné, alebo súkromné informácie, ako je URL, alebo API heslo vašeho Nightscoutu, nahrané nebudú.</string>
</resources>

View file

@ -4,7 +4,7 @@
<!-- <string name="he_lang" translatable="false">Hebrew</string> -->
<!-- <string name="ga_lang" translatable="false">Irish</string> -->
<!-- <string name="ja_lang" translatable="false">Japanese</string> -->
<string name="treatmentssafety_title">Säkerhetsbegränsningar för behandlingar</string>
<string name="treatmentssafety_title">Säkerhetsbegränsningar</string>
<string name="treatmentssafety_maxbolus_title">Max tillåten bolus [U]</string>
<string name="treatmentssafety_maxcarbs_title">Max tillåtna KH [g]</string>
<string name="nav_preferences">Inställningar</string>
@ -1138,10 +1138,15 @@ Eversense-appen.</string>
<string name="loop_tbrexecution_time_label">Basalförändring utförd</string>
<string name="insight_alert_notification_channel">Pumpvarningar Insight</string>
<!-- SMS Communicator & OTP Authenticator -->
<string name="smscommunicator_code_from_authenticator_for" comment="This is continuation of sentence: To [ACTION] reply with code">från autentiseringsapp för: %1$s följt av PIN-kod</string>
<string name="smscommunicator_otp_enabled">Aktivera autentiseraren</string>
<string name="smscommunicator_otp_enabled_summary">Autentisera kommandon med hjälp av engångslösenord som genererats av Google Authenticator eller liknande appar för tvåfaktorsautentisering.</string>
<string name="smscommunicator_otp_pin">PIN-kod som läggs till på slutet</string>
<string name="smscommunicator_otp_pin_summary">Ytterligare siffror som ska memoreras och läggas till i slutet av varje genererat engångslösenord</string>
<string name="smscomunicator_tab_otp_label">Konfiguration av tvåfaktorsautentisering</string>
<string name="smscommunicator_code_verify_label">Kod att kontrollera:</string>
<string name="smscommunicator_code_verify_hint">OTP + PIN-kod</string>
<string name="smscommunicator_code_verify_info">Verifieringskoden består av sex siffror som visas av autentiseringsappen (känd som OTP) följt av 3 eller fler siffror som är en valbar PIN-kod.</string>
<string name="smscommunicator_otp_verify_label">Engångslösenord att kontrollera:</string>
<string name="smscommunicator_otp_reset_btn">Återställ autentiserare</string>
<string name="smscommunicator_otp_reset_title">Återställ autentiseringsnyckel</string>

View file

@ -1443,5 +1443,5 @@
<string name="only_upload_if_charging">Only upload if charging</string>
<string name="worker_state">Worker State: %s</string>
<string name="uploaded_data">Uploaded Data</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">The following data will be uploaded to your Open Humans account: Glucose values, careportal events (except notes), extended boluses, profile switches, total daily doses, temporary basals, temp targets, preferences, application version, device model and screen dimensions. Secret or private information such as your Nightscout URL or API secret will not be uploaded.</string>
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">The following data will be uploaded to your Open Humans account: Glucose values, boluses, carbs, careportal events (except notes), extended boluses, profile switches, total daily doses, temporary basals, temp targets, preferences, application version, device model and screen dimensions. Secret or private information such as your Nightscout URL or API secret will not be uploaded.</string>
</resources>

View file

@ -154,11 +154,12 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
`when`(sp.getString(R.string.key_aps_mode, "open")).thenReturn("closed")
objectivesPlugin.objectives[ObjectivesPlugin.MAXIOB_ZERO_CL_OBJECTIVE].startedOn = 0
var c: Constraint<Boolean> = constraintChecker.isClosedLoopAllowed()
Assert.assertEquals(true, c.reasonList.size == 2) // Safety & Objectives
Assert.assertTrue(c.reasonList[0].toString().contains("Closed loop is disabled")) // Safety & Objectives
Assert.assertEquals(false, c.value())
`when`(sp.getString(R.string.key_aps_mode, "open")).thenReturn("open")
c = constraintChecker.isClosedLoopAllowed()
Assert.assertEquals(true, c.reasonList.size == 3) // 2x Safety & Objectives
Assert.assertTrue(c.reasonList[0].toString().contains("Closed loop mode disabled in preferences")) // Safety & Objectives
Assert.assertEquals(3, c.reasonList.size) // 2x Safety & Objectives
Assert.assertEquals(false, c.value())
}

View file

@ -11,6 +11,7 @@ import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.Constraint
import info.nightscout.androidaps.interfaces.PumpDescription
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.queue.commands.CustomCommand
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
import info.nightscout.androidaps.queue.commands.Command
@ -192,4 +193,92 @@ class CommandQueueTest : TestBaseWithProfile() {
Assert.assertFalse(queued)
Assert.assertEquals(commandQueue.size(), 0)
}
@Test
fun isCustomCommandRunning() {
// given
Assert.assertEquals(0, commandQueue.size())
// when
val queued1 = commandQueue.customCommand(CustomCommand1(), null)
val queued2 = commandQueue.customCommand(CustomCommand2(), null)
commandQueue.pickup()
// then
Assert.assertTrue(queued1)
Assert.assertTrue(queued2)
Assert.assertTrue(commandQueue.isCustomCommandInQueue(CustomCommand1::class.java))
Assert.assertTrue(commandQueue.isCustomCommandInQueue(CustomCommand2::class.java))
Assert.assertFalse(commandQueue.isCustomCommandInQueue(CustomCommand3::class.java))
Assert.assertTrue(commandQueue.isCustomCommandRunning(CustomCommand1::class.java))
Assert.assertFalse(commandQueue.isCustomCommandRunning(CustomCommand2::class.java))
Assert.assertFalse(commandQueue.isCustomCommandRunning(CustomCommand3::class.java))
Assert.assertEquals(1, commandQueue.size())
}
@Test
fun isCustomCommandInQueue() {
// given
Assert.assertEquals(0, commandQueue.size())
// when
val queued1 = commandQueue.customCommand(CustomCommand1(), null)
val queued2 = commandQueue.customCommand(CustomCommand2(), null)
// then
Assert.assertTrue(queued1)
Assert.assertTrue(queued2)
Assert.assertTrue(commandQueue.isCustomCommandInQueue(CustomCommand1::class.java))
Assert.assertTrue(commandQueue.isCustomCommandInQueue(CustomCommand2::class.java))
Assert.assertFalse(commandQueue.isCustomCommandInQueue(CustomCommand3::class.java))
Assert.assertEquals(2, commandQueue.size())
}
@Test
fun differentCustomCommandsAllowed() {
// given
Assert.assertEquals(0, commandQueue.size())
// when
val queued1 = commandQueue.customCommand(CustomCommand1(), null)
val queued2 = commandQueue.customCommand(CustomCommand2(), null)
// then
Assert.assertTrue(queued1)
Assert.assertTrue(queued2)
Assert.assertEquals(2, commandQueue.size())
}
@Test
fun sameCustomCommandNotAllowed() {
// given
Assert.assertEquals(0, commandQueue.size())
// when
val queued1 = commandQueue.customCommand(CustomCommand1(), null)
val queued2 = commandQueue.customCommand(CustomCommand1(), null)
// then
Assert.assertTrue(queued1)
Assert.assertFalse(queued2)
Assert.assertEquals(1, commandQueue.size())
}
private class CustomCommand1 : CustomCommand {
override val statusDescription: String
get() = "CUSTOM COMMAND 1"
}
private class CustomCommand2 : CustomCommand {
override val statusDescription: String
get() = "CUSTOM COMMAND 2"
}
private class CustomCommand3 : CustomCommand {
override val statusDescription: String
get() = "CUSTOM COMMAND 3"
}
}

2
codecov.yml Normal file
View file

@ -0,0 +1,2 @@
github_checks:
annotations: false

View file

@ -3,6 +3,7 @@ package info.nightscout.androidaps.interfaces
import android.text.Spanned
import info.nightscout.androidaps.data.DetailedBolusInfo
import info.nightscout.androidaps.data.Profile
import info.nightscout.androidaps.queue.commands.CustomCommand
import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.queue.commands.Command
@ -33,6 +34,9 @@ interface CommandQueueProvider {
fun setUserOptions(callback: Callback?): Boolean
fun loadTDDs(callback: Callback?): Boolean
fun loadEvents(callback: Callback?): Boolean
fun customCommand(customCommand: CustomCommand, callback: Callback?): Boolean
fun isCustomCommandRunning(customCommandType: Class<out CustomCommand>): Boolean
fun isCustomCommandInQueue(customCommandType: Class<out CustomCommand>): Boolean
fun spannedStatus(): Spanned
fun isThisProfileSet(profile: Profile): Boolean
}

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.interfaces;
import androidx.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
@ -11,7 +13,9 @@ import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.queue.commands.CustomCommand;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.TimeChangeType;
/**
@ -105,10 +109,32 @@ public interface PumpInterface {
boolean canHandleDST();
/**
* Provides a list of custom actions to be displayed in the Actions tab.
* Plese note that these actions will not be queued upon execution
*
* @return list of custom actions
*/
@Nullable
List<CustomAction> getCustomActions();
/**
* Executes a custom action. Please note that these actions will not be queued
*
* @param customActionType action to be executed
*/
void executeCustomAction(CustomActionType customActionType);
/**
* Executes a custom queued command
* See {@link CommandQueueProvider#customCommand(CustomCommand, Callback)} for queuing a custom command.
*
* @param customCommand the custom command to be executed
* @return PumpEnactResult that represents the command execution result
*/
@Nullable
PumpEnactResult executeCustomCommand(CustomCommand customCommand);
/**
* This method will be called when time or Timezone changes, and pump driver can then do a specific action (for
* example update clock on pump).

View file

@ -31,7 +31,8 @@ abstract class Command(
SET_USER_SETTINGS, // so far only Dana specific,
START_PUMP,
STOP_PUMP,
INSIGHT_SET_TBR_OVER_ALARM // insight only
INSIGHT_SET_TBR_OVER_ALARM, // insight only
CUSTOM_COMMAND
}
init {

View file

@ -0,0 +1,16 @@
package info.nightscout.androidaps.queue.commands
import java.io.Serializable
/**
* Implement this interface for every custom pump command that you want to be able to queue
* See [info.nightscout.androidaps.interfaces.CommandQueueProvider.customCommand] for queuing a custom command.
*/
interface CustomCommand : Serializable {
/**
* @return short description of this command to be used in [info.nightscout.androidaps.queue.commands.Command.status]
* The description is typically all caps.
*/
val statusDescription: String
}

View file

@ -1,6 +1,7 @@
package info.nightscout.androidaps.danar;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.json.JSONException;
import org.json.JSONObject;
@ -9,9 +10,9 @@ import java.util.Date;
import java.util.List;
import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.dana.DanaPumpInterface;
import info.nightscout.androidaps.dana.DanaFragment;
import info.nightscout.androidaps.dana.DanaPump;
import info.nightscout.androidaps.dana.DanaPumpInterface;
import info.nightscout.androidaps.dana.comm.RecordTypes;
import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService;
import info.nightscout.androidaps.data.Profile;
@ -37,6 +38,7 @@ import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.queue.commands.CustomCommand;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
@ -511,7 +513,10 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump
@Override
public void executeCustomAction(CustomActionType customActionType) {
}
@Nullable @Override public PumpEnactResult executeCustomCommand(CustomCommand customCommand) {
return null;
}
@Override

View file

@ -26,6 +26,7 @@ import info.nightscout.androidaps.plugins.common.ManufacturerType
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType
import info.nightscout.androidaps.queue.commands.CustomCommand
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
@ -658,6 +659,7 @@ class DanaRSPlugin @Inject constructor(
override fun loadTDDs(): PumpEnactResult = loadHistory(info.nightscout.androidaps.dana.comm.RecordTypes.RECORD_TYPE_DAILY)
override fun getCustomActions(): List<CustomAction>? = null
override fun executeCustomAction(customActionType: CustomActionType) {}
override fun executeCustomCommand(customCommand: CustomCommand?): PumpEnactResult? = null
override fun canHandleDST(): Boolean = false
override fun timezoneOrDSTChanged(timeChangeType: TimeChangeType?) {}
override fun clearPairing() {

View file

@ -48,6 +48,7 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.queue.commands.CustomCommand;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract;
@ -1583,6 +1584,10 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter
}
@Nullable @Override public PumpEnactResult executeCustomCommand(CustomCommand customCommand) {
return null;
}
@Override
public void timezoneOrDSTChanged(TimeChangeType changeType) {

View file

@ -13,13 +13,11 @@ import javax.inject.Inject;
import javax.inject.Singleton;
import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RFSpyResponse;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioPacket;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RLMessageType;
@ -56,7 +54,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
* functionality added.
*/
@Singleton
public class MedtronicCommunicationManager extends RileyLinkCommunicationManager {
public class MedtronicCommunicationManager extends RileyLinkCommunicationManager<PumpMessage> {
@Inject MedtronicPumpStatus medtronicPumpStatus;
@Inject MedtronicPumpPlugin medtronicPumpPlugin;
@ -75,7 +73,8 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager
// This empty constructor must be kept, otherwise dagger injection might break!
@Inject
public MedtronicCommunicationManager() {}
public MedtronicCommunicationManager() {
}
@Inject
public void onInit() {
@ -85,9 +84,8 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager
}
@Override
public RLMessage createResponseMessage(byte[] payload) {
PumpMessage pumpMessage = new PumpMessage(aapsLogger, payload);
return pumpMessage;
public PumpMessage createResponseMessage(byte[] payload) {
return new PumpMessage(aapsLogger, payload);
}
@Override
@ -170,7 +168,7 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager
if (radioResponse.isValid()) {
PumpMessage pumpResponse = (PumpMessage) createResponseMessage(radioResponse.getPayload());
PumpMessage pumpResponse = createResponseMessage(radioResponse.getPayload());
if (!pumpResponse.isValid()) {
aapsLogger.warn(LTag.PUMPCOMM, "Response is invalid ! [interrupted={}, timeout={}]", rfSpyResponse.wasInterrupted(),
@ -545,14 +543,15 @@ public class MedtronicCommunicationManager extends RileyLinkCommunicationManager
}
private PumpMessage sendAndListen(RLMessage msg) throws RileyLinkCommunicationException {
private PumpMessage sendAndListen(PumpMessage msg) throws RileyLinkCommunicationException {
return sendAndListen(msg, 4000); // 2000
}
// All pump communications go through this function.
protected PumpMessage sendAndListen(RLMessage msg, int timeout_ms) throws RileyLinkCommunicationException {
return (PumpMessage) super.sendAndListen(msg, timeout_ms);
@Override
protected PumpMessage sendAndListen(PumpMessage msg, int timeout_ms) throws RileyLinkCommunicationException {
return super.sendAndListen(msg, timeout_ms);
}

View file

@ -12,21 +12,16 @@ import android.os.SystemClock;
import androidx.annotation.NonNull;
import org.jetbrains.annotations.NotNull;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.EnumSet;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.Supplier;
import javax.inject.Inject;
@ -47,6 +42,7 @@ import info.nightscout.androidaps.interfaces.ActivePluginProvider;
import info.nightscout.androidaps.interfaces.CommandQueueProvider;
import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.ProfileFunction;
import info.nightscout.androidaps.interfaces.PumpDescription;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.interfaces.PumpPluginBase;
@ -56,7 +52,6 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair;
@ -74,7 +69,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.data.ActiveBolus;
import info.nightscout.androidaps.plugins.pump.omnipod.data.RLHistoryItemOmnipod;
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodCommandType;
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodCustomActionType;
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodStatusRequestType;
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodStorageKeys;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.ExpirationReminderBuilder;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoRecentPulseLog;
@ -84,10 +78,15 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateMa
import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPumpValuesChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodTbrChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager;
import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandHandleTimeChange;
import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.CommandUpdateAlertConfiguration;
import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.OmnipodCustomCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.OmnipodCustomCommandType;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.service.RileyLinkOmnipodService;
import info.nightscout.androidaps.plugins.pump.omnipod.ui.OmnipodFragment;
import info.nightscout.androidaps.plugins.pump.omnipod.util.AapsOmnipodUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodAlertUtil;
import info.nightscout.androidaps.queue.commands.CustomCommand;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
@ -107,6 +106,7 @@ import io.reactivex.schedulers.Schedulers;
public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface, RileyLinkPumpDevice {
private static final long RILEY_LINK_CONNECT_TIMEOUT_MILLIS = 3 * 60 * 1000L; // 3 minutes
private static final long STATUS_CHECK_INTERVAL_MILLIS = 60 * 1000L; // 1 minute
public static final int STARTUP_STATUS_REQUEST_TRIES = 2;
private final PodStateManager podStateManager;
private final RileyLinkServiceData rileyLinkServiceData;
@ -115,6 +115,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
private final AapsOmnipodUtil aapsOmnipodUtil;
private final RileyLinkUtil rileyLinkUtil;
private final OmnipodAlertUtil omnipodAlertUtil;
private final ProfileFunction profileFunction;
private final AAPSLogger aapsLogger;
private final RxBusWrapper rxBus;
private final ActivePluginProvider activePlugin;
@ -127,8 +128,8 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
private final ServiceConnection serviceConnection;
private final PumpType pumpType = PumpType.Insulet_Omnipod;
private final List<CustomAction> customActions = new ArrayList<>();
private final Set<OmnipodStatusRequestType> statusRequests = Collections.synchronizedSet(EnumSet.noneOf(OmnipodStatusRequestType.class));
private final List<CustomAction> customActions = Collections.singletonList(new CustomAction(
R.string.omnipod_custom_action_reset_rileylink, OmnipodCustomActionType.RESET_RILEY_LINK_CONFIGURATION, true));
private final CompositeDisposable disposables = new CompositeDisposable();
// variables for handling statuses and history
@ -139,12 +140,11 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
private boolean busy = false;
private int timeChangeRetries;
private long nextPodCheck;
private boolean sentIdToFirebase;
private long lastConnectionTimeMillis;
private final Handler loopHandler = new Handler(Looper.getMainLooper());
private final Runnable statusChecker;
private OmnipodCommandType currentCommand;
private boolean isCancelTempBasalRunning;
@Inject
public OmnipodPumpPlugin(
@ -164,7 +164,8 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
DateUtil dateUtil,
AapsOmnipodUtil aapsOmnipodUtil,
RileyLinkUtil rileyLinkUtil,
OmnipodAlertUtil omnipodAlertUtil
OmnipodAlertUtil omnipodAlertUtil,
ProfileFunction profileFunction
) {
super(new PluginDescription() //
.mainType(PluginType.PUMP) //
@ -189,12 +190,10 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
this.aapsOmnipodUtil = aapsOmnipodUtil;
this.rileyLinkUtil = rileyLinkUtil;
this.omnipodAlertUtil = omnipodAlertUtil;
this.profileFunction = profileFunction;
pumpDescription = new PumpDescription(pumpType);
customActions.add(new CustomAction(
R.string.omnipod_custom_action_reset_rileylink, OmnipodCustomActionType.RESET_RILEY_LINK_CONFIGURATION, true));
this.serviceConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
@ -231,14 +230,11 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
aapsOmnipodManager.createSuspendedFakeTbrIfNotExists();
}
if (!getCommandQueue().statusInQueue()) {
if (!OmnipodPumpPlugin.this.statusRequests.isEmpty()) {
getCommandQueue().readStatus("Status Refresh Requested", null);
} else if (OmnipodPumpPlugin.this.hasTimeDateOrTimeZoneChanged) {
getCommandQueue().readStatus("Date or Time Zone Changed", null);
} else if (!OmnipodPumpPlugin.this.verifyPodAlertConfiguration()) {
getCommandQueue().readStatus("Expiration Alerts Changed", null);
}
if (OmnipodPumpPlugin.this.hasTimeDateOrTimeZoneChanged) {
getCommandQueue().customCommand(new CommandHandleTimeChange(false), null);
}
if (!OmnipodPumpPlugin.this.verifyPodAlertConfiguration()) {
getCommandQueue().customCommand(new CommandUpdateAlertConfiguration(), null);
}
doPodCheck();
@ -291,7 +287,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
event.isChanged(getResourceHelper(), R.string.key_omnipod_low_reservoir_alert_enabled) ||
event.isChanged(getResourceHelper(), R.string.key_omnipod_low_reservoir_alert_units)) {
if (!verifyPodAlertConfiguration() && !getCommandQueue().statusInQueue()) {
getCommandQueue().readStatus("Expiration Alerts Changed", null);
getCommandQueue().customCommand(new CommandUpdateAlertConfiguration(), null);
}
}
}, fabricPrivacy::logException)
@ -335,7 +331,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
// The pod is not running a TBR, while AAPS thinks it is
if (!podStateManager.isTempBasalRunning()) {
// Only report TBR cancellations if they haven't been explicitly requested
if (currentCommand != OmnipodCommandType.CANCEL_TEMPORARY_BASAL) {
if (!isCancelTempBasalRunning) {
if (activePlugin.getActiveTreatments().isTempBasalInProgress() && !aapsOmnipodManager.hasSuspendedFakeTbr()) {
aapsOmnipodManager.reportCancelledTbr();
}
@ -361,13 +357,9 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
Notification notification = new Notification(Notification.OMNIPOD_POD_NOT_ATTACHED, resourceHelper.gs(R.string.omnipod_error_pod_not_attached), Notification.NORMAL);
rxBus.send(new EventNewNotification(notification));
} else {
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED));
if (podStateManager.isSuspended()) {
Notification notification = new Notification(Notification.OMNIPOD_POD_SUSPENDED, resourceHelper.gs(R.string.omnipod_error_pod_suspended), Notification.NORMAL);
Notification notification = new Notification(Notification.OMNIPOD_POD_SUSPENDED, resourceHelper.gs(R.string.omnipod_pod_suspended), Notification.NORMAL);
rxBus.send(new EventNewNotification(notification));
} else {
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED));
}
}
@ -375,7 +367,6 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
}
}
// TODO is this correct?
@Override
public boolean isInitialized() {
return isConnected() && podStateManager.isPodActivationCompleted();
@ -455,130 +446,23 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
lastConnectionTimeMillis = System.currentTimeMillis();
}
// We abuse getPumpStatus to squeeze commands in the queue
// The only actual status requests we send to the Pod are on startup (in initializeAfterRileyLinkConnection)
// And when the user explicitly requested it by clicking the Refresh button on the Omnipod tab
// We don't do periodical status requests because that can drain the Pod's battery
// However that should be fine because we get a StatusResponse from all insulin commands sent to the Pod
/**
* The only actual status requests we send to the Pod here are on startup (in {@link #initializeAfterRileyLinkConnection() initializeAfterRileyLinkConnection()})
* And when the user explicitly requested it by clicking the Refresh button on the Omnipod tab (which is executed through {@link #executeCustomCommand(CustomCommand)})
* We don't do periodical status requests because that could drain the Pod's battery
*/
@Override
public void getPumpStatus() {
if (firstRun) {
initializeAfterRileyLinkConnection();
} else if (!statusRequests.isEmpty()) {
synchronized (statusRequests) {
Iterator<OmnipodStatusRequestType> iterator = statusRequests.iterator();
while (iterator.hasNext()) {
OmnipodStatusRequestType statusRequest = iterator.next();
switch (statusRequest) {
case GET_PULSE_LOG:
try {
PodInfoRecentPulseLog result = executeCommand(OmnipodCommandType.GET_POD_PULSE_LOG, aapsOmnipodManager::readPulseLog);
Intent i = new Intent(context, ErrorHelperActivity.class);
i.putExtra("soundid", 0);
i.putExtra("status", "Pulse Log (copied to clipboard):\n" + result.toString());
i.putExtra("title", resourceHelper.gs(R.string.omnipod_warning));
i.putExtra("clipboardContent", result.toString());
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
} catch (Exception ex) {
aapsLogger.warn(LTag.PUMP, "Failed to retrieve pulse log", ex);
Intent i = new Intent(context, ErrorHelperActivity.class);
i.putExtra("soundid", 0);
i.putExtra("status", "Failed to retrieve pulse log");
i.putExtra("title", resourceHelper.gs(R.string.omnipod_warning));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
break;
case ACKNOWLEDGE_ALERTS:
executeCommand(OmnipodCommandType.ACKNOWLEDGE_ALERTS, aapsOmnipodManager::acknowledgeAlerts);
break;
case GET_POD_STATE:
executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodManager::getPodStatus);
break;
case SUSPEND_DELIVERY:
executeCommand(OmnipodCommandType.SUSPEND_DELIVERY, aapsOmnipodManager::suspendDelivery);
break;
case SET_TIME:
executeCommand(OmnipodCommandType.SET_TIME, aapsOmnipodManager::setTime);
break;
default:
aapsLogger.error(LTag.PUMP, "Unknown status request: " + statusRequest.name());
}
iterator.remove();
}
}
} else if (this.hasTimeDateOrTimeZoneChanged) {
PumpEnactResult result;
if (aapsOmnipodManager.isTimeChangeEventEnabled()) {
result = executeCommand(OmnipodCommandType.SET_TIME, aapsOmnipodManager::setTime);
} else {
// Even if automatically changing the time is disabled, we still want to at least do a GetStatus request,
// in order to update the Pod's activation time, which we need for calculating the time on the Pod
result = executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodManager::getPodStatus);
}
if (result.success) {
this.hasTimeDateOrTimeZoneChanged = false;
timeChangeRetries = 0;
if (aapsOmnipodManager.isTimeChangeEventEnabled()) {
Notification notification = new Notification(
Notification.TIME_OR_TIMEZONE_CHANGE,
resourceHelper.gs(R.string.omnipod_time_or_timezone_change),
Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification));
}
} else {
timeChangeRetries++;
if (timeChangeRetries > 3) {
if (aapsOmnipodManager.isTimeChangeEventEnabled()) {
Notification notification = new Notification(
Notification.TIME_OR_TIMEZONE_CHANGE,
resourceHelper.gs(R.string.omnipod_time_or_timezone_change_failed),
Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification));
}
this.hasTimeDateOrTimeZoneChanged = false;
timeChangeRetries = 0;
}
}
} else if (!verifyPodAlertConfiguration()) {
Duration expirationReminderTimeBeforeShutdown = omnipodAlertUtil.getExpirationReminderTimeBeforeShutdown();
Integer lowReservoirAlertUnits = omnipodAlertUtil.getLowReservoirAlertUnits();
List<AlertConfiguration> alertConfigurations = new ExpirationReminderBuilder(podStateManager) //
.expirationAdvisory(expirationReminderTimeBeforeShutdown != null,
Optional.ofNullable(expirationReminderTimeBeforeShutdown).orElse(Duration.ZERO)) //
.lowReservoir(lowReservoirAlertUnits != null, Optional.ofNullable(lowReservoirAlertUnits).orElse(0)) //
.build();
PumpEnactResult result = executeCommand(OmnipodCommandType.CONFIGURE_ALERTS, () -> aapsOmnipodManager.configureAlerts(alertConfigurations));
if (result.success) {
aapsLogger.info(LTag.PUMP, "Successfully configured alerts in Pod");
podStateManager.setExpirationAlertTimeBeforeShutdown(expirationReminderTimeBeforeShutdown);
podStateManager.setLowReservoirAlertUnits(lowReservoirAlertUnits);
Notification notification = new Notification(
Notification.OMNIPOD_POD_ALERTS_UPDATED,
resourceHelper.gs(R.string.omnipod_expiration_alerts_updated),
Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification));
} else {
aapsLogger.warn(LTag.PUMP, "Failed to configure alerts in Pod");
}
firstRun = false;
}
}
@NotNull
@NonNull
@Override
public PumpEnactResult setNewBasalProfile(Profile profile) {
PumpEnactResult result = executeCommand(OmnipodCommandType.SET_BASAL_PROFILE, () -> aapsOmnipodManager.setBasalProfile(profile));
PumpEnactResult result = executeCommand(OmnipodCommandType.SET_BASAL_PROFILE, () -> aapsOmnipodManager.setBasalProfile(profile, true));
aapsLogger.info(LTag.PUMP, "Basal Profile was set: " + result.success);
@ -597,7 +481,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
@Override
public long lastDataTime() {
return podStateManager.isPodActivationCompleted() ? podStateManager.getLastSuccessfulCommunication().getMillis() : 0;
return podStateManager.isPodInitialized() ? podStateManager.getLastSuccessfulCommunication().getMillis() : 0;
}
@Override
@ -652,7 +536,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
executeCommand(OmnipodCommandType.CANCEL_BOLUS, aapsOmnipodManager::cancelBolus);
}
// if enforceNew===true current temp basal is cancelled and new TBR set (duration is prolonged),
// if enforceNew is true, current temp basal is cancelled and new TBR set (duration is prolonged),
// if false and the same rate is requested enacted=false and success=true is returned and TBR is not changed
@Override
public PumpEnactResult setTempBasalAbsolute(Double absoluteRate, Integer
@ -694,7 +578,12 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
return new PumpEnactResult(getInjector()).success(true).enacted(false);
}
return executeCommand(OmnipodCommandType.CANCEL_TEMPORARY_BASAL, aapsOmnipodManager::cancelTemporaryBasal);
isCancelTempBasalRunning = true;
try {
return executeCommand(OmnipodCommandType.CANCEL_TEMPORARY_BASAL, aapsOmnipodManager::cancelTemporaryBasal);
} finally {
isCancelTempBasalRunning = false;
}
}
// TODO improve (i8n and more)
@ -753,12 +642,12 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
return pumpType.getManufacturer();
}
@Override @NotNull
@Override @NonNull
public PumpType model() {
return pumpType;
}
@NotNull
@NonNull
@Override
public String serialNumber() {
return podStateManager.isPodInitialized() ? String.valueOf(podStateManager.getAddress()) : "-";
@ -813,18 +702,143 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
break;
default:
aapsLogger.warn(LTag.PUMP, "Unknown custom action: {}" + mcat);
aapsLogger.warn(LTag.PUMP, "Unknown custom action: " + mcat);
break;
}
}
@Override
public PumpEnactResult executeCustomCommand(CustomCommand command) {
if (!(command instanceof OmnipodCustomCommand)) {
aapsLogger.warn(LTag.PUMP, "Unknown custom command: " + command.getClass().getName());
return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(resourceHelper.gs(R.string.omnipod_error_unknown_custom_command, command.getClass().getName()));
}
OmnipodCustomCommandType commandType = ((OmnipodCustomCommand) command).getType();
aapsLogger.debug(LTag.PUMP, "Executing custom command: " + commandType);
switch (commandType) {
case ACKNOWLEDGE_ALERTS:
return executeCommand(OmnipodCommandType.ACKNOWLEDGE_ALERTS, aapsOmnipodManager::acknowledgeAlerts);
case GET_POD_STATUS:
return executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodManager::getPodStatus);
case READ_PULSE_LOG:
return retrievePulseLog();
case SUSPEND_DELIVERY:
return executeCommand(OmnipodCommandType.SUSPEND_DELIVERY, aapsOmnipodManager::suspendDelivery);
case RESUME_DELIVERY:
return executeCommand(OmnipodCommandType.RESUME_DELIVERY, () -> aapsOmnipodManager.setBasalProfile(profileFunction.getProfile(), false));
case HANDLE_TIME_CHANGE:
return handleTimeChange(((CommandHandleTimeChange) command).isRequestedByUser());
case UPDATE_ALERT_CONFIGURATION:
return updateAlertConfiguration();
default:
aapsLogger.warn(LTag.PUMP, "Unknown custom command: " + commandType);
return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(resourceHelper.gs(R.string.omnipod_error_unknown_custom_command, commandType));
}
}
private PumpEnactResult retrievePulseLog() {
PodInfoRecentPulseLog result;
try {
result = executeCommand(OmnipodCommandType.READ_POD_PULSE_LOG, aapsOmnipodManager::readPulseLog);
} catch (Exception ex) {
return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(aapsOmnipodManager.translateException(ex));
}
Intent i = new Intent(context, ErrorHelperActivity.class);
i.putExtra("soundid", 0);
i.putExtra("status", resourceHelper.gs(R.string.omnipod_pulse_log_value) + ":\n" + result.toString());
i.putExtra("title", resourceHelper.gs(R.string.omnipod_pulse_log));
i.putExtra("clipboardContent", result.toString());
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
return new PumpEnactResult(getInjector()).success(true).enacted(false);
}
@NonNull private PumpEnactResult updateAlertConfiguration() {
Duration expirationReminderTimeBeforeShutdown = omnipodAlertUtil.getExpirationReminderTimeBeforeShutdown();
Integer lowReservoirAlertUnits = omnipodAlertUtil.getLowReservoirAlertUnits();
List<AlertConfiguration> alertConfigurations = new ExpirationReminderBuilder(podStateManager) //
.expirationAdvisory(expirationReminderTimeBeforeShutdown != null,
Optional.ofNullable(expirationReminderTimeBeforeShutdown).orElse(Duration.ZERO)) //
.lowReservoir(lowReservoirAlertUnits != null, Optional.ofNullable(lowReservoirAlertUnits).orElse(0)) //
.build();
PumpEnactResult result = executeCommand(OmnipodCommandType.CONFIGURE_ALERTS, () -> aapsOmnipodManager.configureAlerts(alertConfigurations));
if (result.success) {
aapsLogger.info(LTag.PUMP, "Successfully configured alerts in Pod");
podStateManager.setExpirationAlertTimeBeforeShutdown(expirationReminderTimeBeforeShutdown);
podStateManager.setLowReservoirAlertUnits(lowReservoirAlertUnits);
Notification notification = new Notification(
Notification.OMNIPOD_POD_ALERTS_UPDATED,
resourceHelper.gs(R.string.omnipod_confirmation_expiration_alerts_updated),
Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification));
} else {
aapsLogger.warn(LTag.PUMP, "Failed to configure alerts in Pod");
}
return result;
}
@NonNull private PumpEnactResult handleTimeChange(boolean requestedByUser) {
aapsLogger.debug(LTag.PUMP, "Setting time, requestedByUser={}", requestedByUser);
PumpEnactResult result;
if (requestedByUser || aapsOmnipodManager.isTimeChangeEventEnabled()) {
result = executeCommand(OmnipodCommandType.SET_TIME, () -> aapsOmnipodManager.setTime(!requestedByUser));
} else {
// Even if automatically changing the time is disabled, we still want to at least do a GetStatus request,
// in order to update the Pod's activation time, which we need for calculating the time on the Pod
result = executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodManager::getPodStatus);
}
if (result.success) {
this.hasTimeDateOrTimeZoneChanged = false;
timeChangeRetries = 0;
if (!requestedByUser && aapsOmnipodManager.isTimeChangeEventEnabled()) {
Notification notification = new Notification(
Notification.TIME_OR_TIMEZONE_CHANGE,
resourceHelper.gs(R.string.omnipod_confirmation_time_or_timezone_change),
Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification));
}
} else {
if (!requestedByUser) {
timeChangeRetries++;
if (timeChangeRetries > 3) {
if (aapsOmnipodManager.isTimeChangeEventEnabled()) {
Notification notification = new Notification(
Notification.TIME_OR_TIMEZONE_CHANGE,
resourceHelper.gs(R.string.omnipod_error_automatic_time_or_timezone_change_failed),
Notification.INFO, 60);
rxBus.send(new EventNewNotification(notification));
}
this.hasTimeDateOrTimeZoneChanged = false;
timeChangeRetries = 0;
}
}
}
return result;
}
@Override
public void timezoneOrDSTChanged(TimeChangeType timeChangeType) {
aapsLogger.warn(LTag.PUMP, "Time, Date and/or TimeZone changed. [changeType=" + timeChangeType.name() + ", eventHandlingEnabled=" + aapsOmnipodManager.isTimeChangeEventEnabled() + "]");
if (podStateManager.isPodRunning()) {
aapsLogger.info(LTag.PUMP, "Time, Date and/or TimeZone changed event received and will be consumed by driver.");
this.hasTimeDateOrTimeZoneChanged = true;
hasTimeDateOrTimeZoneChanged = true;
}
}
@ -853,10 +867,6 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
return false;
}
public void addPodStatusRequest(OmnipodStatusRequestType pumpStatusRequest) {
statusRequests.add(pumpStatusRequest);
}
@Override
public boolean isFakingTempsByExtendedBoluses() {
return false;
@ -887,54 +897,47 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
aapsLogger.debug(LTag.PUMP, "stopConnecting [PumpPluginAbstract] - default (empty) implementation.");
}
@NotNull @Override public PumpEnactResult setTempBasalPercent(Integer percent, Integer
@NonNull @Override public PumpEnactResult setTempBasalPercent(Integer percent, Integer
durationInMinutes, Profile profile, boolean enforceNew) {
aapsLogger.debug(LTag.PUMP, "setTempBasalPercent [OmnipodPumpPlugin] - Not implemented.");
return getOperationNotSupportedWithCustomText(info.nightscout.androidaps.core.R.string.pump_operation_not_supported_by_pump_driver);
}
@NotNull @Override public PumpEnactResult setExtendedBolus(Double insulin, Integer
@NonNull @Override public PumpEnactResult setExtendedBolus(Double insulin, Integer
durationInMinutes) {
aapsLogger.debug(LTag.PUMP, "setExtendedBolus [OmnipodPumpPlugin] - Not implemented.");
return getOperationNotSupportedWithCustomText(info.nightscout.androidaps.core.R.string.pump_operation_not_supported_by_pump_driver);
}
@NotNull @Override public PumpEnactResult cancelExtendedBolus() {
@NonNull @Override public PumpEnactResult cancelExtendedBolus() {
aapsLogger.debug(LTag.PUMP, "cancelExtendedBolus [OmnipodPumpPlugin] - Not implemented.");
return getOperationNotSupportedWithCustomText(info.nightscout.androidaps.core.R.string.pump_operation_not_supported_by_pump_driver);
}
@NotNull @Override public PumpEnactResult loadTDDs() {
@NonNull @Override public PumpEnactResult loadTDDs() {
aapsLogger.debug(LTag.PUMP, "loadTDDs [OmnipodPumpPlugin] - Not implemented.");
return getOperationNotSupportedWithCustomText(info.nightscout.androidaps.core.R.string.pump_operation_not_supported_by_pump_driver);
}
public OmnipodCommandType getCurrentCommand() {
return currentCommand;
}
private void initializeAfterRileyLinkConnection() {
if (podStateManager.isPodInitialized() && podStateManager.getPodProgressStatus().isAtLeast(PodProgressStatus.PAIRING_COMPLETED)) {
PumpEnactResult result = executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodManager::getPodStatus);
if (result.success) {
aapsLogger.debug(LTag.PUMP, "Successfully retrieved Pod status on startup");
} else {
aapsLogger.warn(LTag.PUMP, "Failed to retrieve Pod status on startup");
for (int i = 0; STARTUP_STATUS_REQUEST_TRIES > i; i++) {
PumpEnactResult result = executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodManager::getPodStatus);
if (result.success) {
aapsLogger.debug(LTag.PUMP, "Successfully retrieved Pod status on startup");
break;
} else {
aapsLogger.warn(LTag.PUMP, "Failed to retrieve Pod status on startup");
}
}
} else {
aapsLogger.debug(LTag.PUMP, "Not retrieving Pod status on startup: no Pod running");
}
if (!sentIdToFirebase) {
Bundle params = new Bundle();
params.putString("version", BuildConfig.VERSION);
Bundle params = new Bundle();
params.putString("version", BuildConfig.VERSION);
fabricPrivacy.getFirebaseAnalytics().logEvent("OmnipodPumpInit", params);
sentIdToFirebase = true;
}
this.firstRun = false;
fabricPrivacy.getFirebaseAnalytics().logEvent("OmnipodPumpInit", params);
}
@NonNull private PumpEnactResult deliverBolus(final DetailedBolusInfo detailedBolusInfo) {
@ -952,14 +955,12 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
private <T> T executeCommand(OmnipodCommandType commandType, Supplier<T> supplier) {
try {
currentCommand = commandType;
aapsLogger.debug(LTag.PUMP, "Executing command: {}", commandType);
rileyLinkUtil.getRileyLinkHistory().add(new RLHistoryItemOmnipod(getInjector(), commandType));
return supplier.get();
} finally {
currentCommand = null;
rxBus.send(new EventRefreshOverview("Omnipod command: " + commandType.name(), false));
rxBus.send(new EventOmnipodPumpValuesChanged());
}
@ -981,7 +982,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
return true;
}
private void incrementStatistics(String statsKey) {
private void incrementStatistics(int statsKey) {
long currentCount = sp.getLong(statsKey, 0L);
currentCount++;
sp.putLong(statsKey, currentCount);

View file

@ -11,7 +11,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.ui.PodHistoryActivity
import info.nightscout.androidaps.plugins.pump.omnipod.ui.PodManagementActivity
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.initpod.InitActionFragment
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.initpod.InitPodTask
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.pages.InitPodRefreshAction
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.pages.PodInfoFragment
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.removepod.RemoveActionFragment
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard2.WizardActivity
@ -39,7 +38,6 @@ abstract class OmnipodModule {
abstract fun omnipodCommunicationManagerProvider(): OmnipodRileyLinkCommunicationManager
// Data
@ContributesAndroidInjector abstract fun initPodRefreshAction(): InitPodRefreshAction
@ContributesAndroidInjector abstract fun initPodTask(): InitPodTask
@ContributesAndroidInjector abstract fun rlHistoryItemOmnipod(): RLHistoryItemOmnipod

View file

@ -19,8 +19,9 @@ public enum OmnipodCommandType {
SET_TIME(R.string.omnipod_cmd_set_time), //
CONFIGURE_ALERTS(R.string.omnipod_cmd_configure_alerts), //
ACKNOWLEDGE_ALERTS(R.string.omnipod_cmd_acknowledge_alerts), //
GET_POD_PULSE_LOG(R.string.omnipod_cmd_get_pulse_log), //
SUSPEND_DELIVERY(R.string.omnipod_cmd_suspend_delivery);
READ_POD_PULSE_LOG(R.string.omnipod_cmd_read_pulse_log), //
SUSPEND_DELIVERY(R.string.omnipod_cmd_suspend_delivery),
RESUME_DELIVERY(R.string.omnipod_cmd_resume_delivery);
private int resourceId;

View file

@ -1,9 +0,0 @@
package info.nightscout.androidaps.plugins.pump.omnipod.definition;
public enum OmnipodStatusRequestType {
ACKNOWLEDGE_ALERTS,
GET_POD_STATE,
GET_PULSE_LOG,
SUSPEND_DELIVERY,
SET_TIME
}

View file

@ -3,11 +3,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.definition;
import info.nightscout.androidaps.plugins.pump.omnipod.R;
public class OmnipodStorageKeys {
private static final String PREFIX = "AAPS.Omnipod.";
public static class Preferences {
public static final String POD_STATE = PREFIX + "pod_state";
public static final String ACTIVE_BOLUS = PREFIX + "current_bolus";
public static final int POD_STATE = R.string.key_omnipod_pod_state;
public static final int ACTIVE_BOLUS = R.string.key_omnipod_current_bolus;
public static final int BASAL_BEEPS_ENABLED = R.string.key_omnipod_basal_beeps_enabled;
public static final int BOLUS_BEEPS_ENABLED = R.string.key_omnipod_bolus_beeps_enabled;
public static final int SMB_BEEPS_ENABLED = R.string.key_omnipod_smb_beeps_enabled;
@ -22,8 +20,8 @@ public class OmnipodStorageKeys {
}
public static class Statistics {
public static final String TBRS_SET = PREFIX + "tbrs_set";
public static final String STANDARD_BOLUSES_DELIVERED = PREFIX + "std_boluses_delivered";
public static final String SMB_BOLUSES_DELIVERED = PREFIX + "smb_boluses_delivered";
public static final int TBRS_SET = R.string.key_omnipod_tbrs_set;
public static final int STANDARD_BOLUSES_DELIVERED = R.string.key_omnipod_std_boluses_delivered;
public static final int SMB_BOLUSES_DELIVERED = R.string.key_omnipod_smb_boluses_delivered;
}
}

View file

@ -16,7 +16,7 @@ public enum PodHistoryEntryType {
PAIR_AND_PRIME(1, R.string.omnipod_init_pod_wizard_step2_title, PumpHistoryEntryGroup.Prime),
FILL_CANNULA_SET_BASAL_PROFILE(2, R.string.omnipod_init_pod_wizard_step4_title, PumpHistoryEntryGroup.Prime),
DEACTIVATE_POD(3, R.string.omnipod_cmd_deactivate_pod, PumpHistoryEntryGroup.Prime),
RESET_POD_STATE(4, R.string.omnipod_cmd_discard_pod, PumpHistoryEntryGroup.Prime),
DISCARD_POD_STATE(4, R.string.omnipod_cmd_discard_pod, PumpHistoryEntryGroup.Prime),
SET_TEMPORARY_BASAL(10, R.string.omnipod_cmd_set_tbr, PumpHistoryEntryGroup.Basal),
CANCEL_TEMPORARY_BASAL_BY_DRIVER(11, R.string.omnipod_cmd_cancel_tbr_by_driver, PumpHistoryEntryGroup.Basal),

View file

@ -6,7 +6,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSet;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertSlot;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -16,12 +15,12 @@ public class AcknowledgeAlertsAction implements OmnipodAction<StatusResponse> {
public AcknowledgeAlertsAction(PodStateManager podStateManager, AlertSet alerts) {
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
if (alerts == null) {
throw new ActionInitializationException("Alert set can not be null");
throw new IllegalArgumentException("Alert set can not be null");
} else if (alerts.size() == 0) {
throw new ActionInitializationException("Alert set can not be empty");
throw new IllegalArgumentException("Alert set can not be empty");
}
this.podStateManager = podStateManager;
this.alerts = alerts;

View file

@ -9,7 +9,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetInsulinScheduleCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BolusDeliverySchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -23,10 +22,10 @@ public class BolusAction implements OmnipodAction<StatusResponse> {
public BolusAction(PodStateManager podStateManager, double units, Duration timeBetweenPulses,
boolean acknowledgementBeep, boolean completionBeep) {
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
if (timeBetweenPulses == null) {
throw new ActionInitializationException("Time between pulses cannot be null");
throw new IllegalArgumentException("Time between pulses cannot be null");
}
this.podStateManager = podStateManager;
this.units = units;

View file

@ -10,7 +10,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.BeepType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -22,10 +21,10 @@ public class CancelDeliveryAction implements OmnipodAction<StatusResponse> {
public CancelDeliveryAction(PodStateManager podStateManager, EnumSet<DeliveryType> deliveryTypes,
boolean acknowledgementBeep) {
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
if (deliveryTypes == null) {
throw new ActionInitializationException("Delivery types cannot be null");
throw new IllegalArgumentException("Delivery types cannot be null");
}
this.podStateManager = podStateManager;
this.deliveryTypes = deliveryTypes;

View file

@ -5,7 +5,6 @@ import java.util.List;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.ConfigureAlertsCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertConfiguration;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -15,10 +14,10 @@ public class ConfigureAlertsAction implements OmnipodAction<StatusResponse> {
public ConfigureAlertsAction(PodStateManager podStateManager, List<AlertConfiguration> alertConfigurations) {
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
if (alertConfigurations == null) {
throw new ActionInitializationException("Alert configurations cannot be null");
throw new IllegalArgumentException("Alert configurations cannot be null");
}
this.podStateManager = podStateManager;
this.alertConfigurations = alertConfigurations;

View file

@ -5,7 +5,6 @@ import java.util.EnumSet;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.DeactivatePodCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.DeliveryType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFaultException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -16,7 +15,7 @@ public class DeactivatePodAction implements OmnipodAction<StatusResponse> {
public DeactivatePodAction(PodStateManager podStateManager, boolean acknowledgementBeep) {
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
this.podStateManager = podStateManager;
this.acknowledgementBeep = acknowledgementBeep;

View file

@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.act
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.GetStatusCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.podinfo.PodInfoResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -13,10 +12,10 @@ public class GetPodInfoAction implements OmnipodAction<PodInfoResponse> {
public GetPodInfoAction(PodStateManager podStateManager, PodInfoType podInfoType) {
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
if (podInfoType == null) {
throw new ActionInitializationException("Pod info type cannot be null");
throw new IllegalArgumentException("Pod info type cannot be null");
}
this.podStateManager = podStateManager;
this.podInfoType = podInfoType;

View file

@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.act
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.GetStatusCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -12,7 +11,7 @@ public class GetStatusAction implements OmnipodAction<StatusResponse> {
public GetStatusAction(PodStateManager podState) {
if (podState == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
this.podStateManager = podState;
}

View file

@ -11,7 +11,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.AlertCo
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -26,10 +25,10 @@ public class InsertCannulaAction implements OmnipodAction<StatusResponse> {
public InsertCannulaAction(PodStateManager podStateManager, BasalSchedule initialBasalSchedule,
Duration expirationReminderTimeBeforeShutdown, Integer lowReservoirAlertUnits) {
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
if (initialBasalSchedule == null) {
throw new ActionInitializationException("Initial basal schedule cannot be null");
throw new IllegalArgumentException("Initial basal schedule cannot be null");
}
this.podStateManager = podStateManager;
this.initialBasalSchedule = initialBasalSchedule;

View file

@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.act
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.action.service.PrimeService;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPodProgressException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -15,10 +14,10 @@ public class PrimeAction implements OmnipodAction<StatusResponse> {
public PrimeAction(PrimeService primeService, PodStateManager podStateManager) {
if (primeService == null) {
throw new ActionInitializationException("Prime service cannot be null");
throw new IllegalArgumentException("Prime service cannot be null");
}
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
this.service = primeService;
this.podStateManager = podStateManager;

View file

@ -9,7 +9,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetInsulinScheduleCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -23,13 +22,13 @@ public class SetBasalScheduleAction implements OmnipodAction<StatusResponse> {
public SetBasalScheduleAction(PodStateManager podStateManager, BasalSchedule basalSchedule,
boolean confidenceReminder, Duration scheduleOffset, boolean acknowledgementBeep) {
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
if (basalSchedule == null) {
throw new ActionInitializationException("Basal schedule cannot be null");
throw new IllegalArgumentException("Basal schedule cannot be null");
}
if (scheduleOffset == null) {
throw new ActionInitializationException("Schedule offset cannot be null");
throw new IllegalArgumentException("Schedule offset cannot be null");
}
this.podStateManager = podStateManager;
this.basalSchedule = basalSchedule;

View file

@ -10,7 +10,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.SetInsulinScheduleCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.TempBasalExtraCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.response.StatusResponse;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
@ -24,10 +23,10 @@ public class SetTempBasalAction implements OmnipodAction<StatusResponse> {
public SetTempBasalAction(PodStateManager podStateManager, double rate, Duration duration,
boolean acknowledgementBeep, boolean completionBeep) {
if (podStateManager == null) {
throw new ActionInitializationException("Pod state manager cannot be null");
throw new IllegalArgumentException("Pod state manager cannot be null");
}
if (duration == null) {
throw new ActionInitializationException("Duration cannot be null");
throw new IllegalArgumentException("Duration cannot be null");
}
this.podStateManager = podStateManager;
this.rate = rate;

View file

@ -17,11 +17,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.util.AlertConfigur
public final class ExpirationReminderBuilder {
private final Map<AlertSlot, AlertConfiguration> alerts = new HashMap<>();
private final DateTime endOfServiceTime;
private final PodStateManager podStateManager;
public ExpirationReminderBuilder(PodStateManager podStateManager) {
this.endOfServiceTime = podStateManager.getActivatedAt().plus(OmnipodConstants.SERVICE_DURATION);
this.podStateManager = podStateManager;
}
public ExpirationReminderBuilder defaults() {
@ -45,21 +43,17 @@ public final class ExpirationReminderBuilder {
public ExpirationReminderBuilder expirationAdvisory(boolean active, Duration timeBeforeShutdown) {
DateTime expirationAdvisoryAlarmTime = endOfServiceTime.minus(timeBeforeShutdown);
if (DateTime.now().isBefore(expirationAdvisoryAlarmTime)) {
Duration timeUntilExpirationAdvisoryAlarm = new Duration(DateTime.now(),
expirationAdvisoryAlarmTime);
AlertConfiguration expirationAdvisoryAlertConfiguration = AlertConfigurationUtil.createExpirationAdvisoryAlertConfiguration(active,
timeUntilExpirationAdvisoryAlarm, timeBeforeShutdown);
alerts.put(expirationAdvisoryAlertConfiguration.getAlertSlot(), expirationAdvisoryAlertConfiguration);
}
Duration timeUntilExpirationAdvisoryAlarm = DateTime.now().isBefore(expirationAdvisoryAlarmTime) ? new Duration(DateTime.now(),
expirationAdvisoryAlarmTime) : Duration.ZERO;
AlertConfiguration expirationAdvisoryAlertConfiguration = AlertConfigurationUtil.createExpirationAdvisoryAlertConfiguration(active,
timeUntilExpirationAdvisoryAlarm, timeBeforeShutdown);
alerts.put(expirationAdvisoryAlertConfiguration.getAlertSlot(), expirationAdvisoryAlertConfiguration);
return this;
}
public ExpirationReminderBuilder lowReservoir(boolean active, int units) {
if (podStateManager.getReservoirLevel() == null || podStateManager.getReservoirLevel().intValue() >= units) {
AlertConfiguration lowReservoirAlertConfiguration = AlertConfigurationUtil.createLowReservoirAlertConfiguration(active, (double) units);
alerts.put(lowReservoirAlertConfiguration.getAlertSlot(), lowReservoirAlertConfiguration);
}
AlertConfiguration lowReservoirAlertConfiguration = AlertConfigurationUtil.createLowReservoirAlertConfiguration(active, (double) units);
alerts.put(lowReservoirAlertConfiguration.getAlertSlot(), lowReservoirAlertConfiguration);
return this;
}

View file

@ -3,10 +3,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mes
import java.util.ArrayList;
import java.util.List;
import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.command.GetStatusCommand;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodCrc;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PacketType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CrcMismatchException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.MessageDecodingException;
@ -91,8 +94,11 @@ public class OmnipodMessage {
return encodedData;
}
public void padWithGetStatusCommands(int packetSize) {
while (getEncoded().length < packetSize) {
public void padWithGetStatusCommands(int packetSize, AAPSLogger aapsLogger) {
while (getEncoded().length <= packetSize) {
if (getEncoded().length == PacketType.PDM.getMaxBodyLength()) {
aapsLogger.debug(LTag.PUMPBTCOMM, "Message length equals max body length: {}", this);
}
messageBlocks.add(new GetStatusCommand(PodInfoType.NORMAL));
}
}

View file

@ -6,7 +6,6 @@ import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.message.MessageBlock;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
public class BolusExtraCommand extends MessageBlock {
private final boolean acknowledgementBeep;
@ -29,9 +28,9 @@ public class BolusExtraCommand extends MessageBlock {
boolean acknowledgementBeep, boolean completionBeep,
Duration programReminderInterval, Duration timeBetweenPulses) {
if (units <= 0D) {
throw new CommandInitializationException("Units should be > 0");
throw new IllegalArgumentException("Units should be > 0");
} else if (units > OmnipodConstants.MAX_BOLUS) {
throw new CommandInitializationException("Units exceeds max bolus");
throw new IllegalArgumentException("Units exceeds max bolus");
}
this.units = units;
this.squareWaveUnits = squareWaveUnits;

View file

@ -12,7 +12,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedul
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BolusDeliverySchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.DeliverySchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.TempBasalDeliverySchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
public class SetInsulinScheduleCommand extends NonceResyncableMessageBlock {
@ -51,12 +50,12 @@ public class SetInsulinScheduleCommand extends NonceResyncableMessageBlock {
// Temp basal
public SetInsulinScheduleCommand(int nonce, double tempBasalRate, Duration duration) {
if (tempBasalRate < 0D) {
throw new CommandInitializationException("Rate should be >= 0");
throw new IllegalArgumentException("Rate should be >= 0");
} else if (tempBasalRate > OmnipodConstants.MAX_BASAL_RATE) {
throw new CommandInitializationException("Rate exceeds max basal rate");
throw new IllegalArgumentException("Rate exceeds max basal rate");
}
if (duration.isLongerThan(OmnipodConstants.MAX_TEMP_BASAL_DURATION)) {
throw new CommandInitializationException("Duration exceeds max temp basal duration");
throw new IllegalArgumentException("Duration exceeds max temp basal duration");
}
int pulsesPerHour = (int) Math.round(tempBasalRate / OmnipodConstants.POD_PULSE_SIZE);
int pulsesPerSegment = pulsesPerHour / 2;

View file

@ -10,7 +10,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.communication.mess
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.MessageBlockType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.RateEntry;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
public class TempBasalExtraCommand extends MessageBlock {
private final boolean acknowledgementBeep;
@ -24,12 +23,12 @@ public class TempBasalExtraCommand extends MessageBlock {
public TempBasalExtraCommand(double rate, Duration duration, boolean acknowledgementBeep, boolean completionBeep,
Duration programReminderInterval) {
if (rate < 0D) {
throw new CommandInitializationException("Rate should be >= 0");
throw new IllegalArgumentException("Rate should be >= 0");
} else if (rate > OmnipodConstants.MAX_BASAL_RATE) {
throw new CommandInitializationException("Rate exceeds max basal rate");
throw new IllegalArgumentException("Rate exceeds max basal rate");
}
if (duration.isLongerThan(OmnipodConstants.MAX_TEMP_BASAL_DURATION)) {
throw new CommandInitializationException("Duration exceeds max temp basal duration");
throw new IllegalArgumentException("Duration exceeds max temp basal duration");
}
this.acknowledgementBeep = acknowledgementBeep;

View file

@ -1,7 +0,0 @@
package info.nightscout.androidaps.plugins.pump.omnipod.driver.exception;
public class ActionInitializationException extends OmnipodException {
public ActionInitializationException(String message) {
super(message, true);
}
}

View file

@ -1,11 +0,0 @@
package info.nightscout.androidaps.plugins.pump.omnipod.driver.exception;
public class CommandInitializationException extends OmnipodException {
public CommandInitializationException(String message) {
super(message, true);
}
public CommandInitializationException(String message, Throwable cause) {
super(message, cause, true);
}
}

View file

@ -1,34 +0,0 @@
package info.nightscout.androidaps.plugins.pump.omnipod.driver.exception;
public class CommunicationException extends OmnipodException {
private final Type type;
public CommunicationException(Type type) {
super(type.getDescription(), false);
this.type = type;
}
public CommunicationException(Type type, Throwable cause) {
super(type.getDescription() + ": " + cause, cause, false);
this.type = type;
}
public Type getType() {
return type;
}
public enum Type {
TIMEOUT("Communication timeout"),
UNEXPECTED_EXCEPTION("Caught an unexpected Exception");
private final String description;
Type(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
}
}

View file

@ -0,0 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.driver.exception;
public class RileyLinkInterruptedException extends OmnipodException {
public RileyLinkInterruptedException() {
super("RileyLink interrupted", false);
}
}

View file

@ -0,0 +1,8 @@
package info.nightscout.androidaps.plugins.pump.omnipod.driver.exception;
// Response indicating that there was a timeout in communication between the RileyLink and the Pod
public class RileyLinkTimeoutException extends OmnipodException {
public RileyLinkTimeoutException() {
super("Timeout in communication between RileyLink and Pod", false);
}
}

View file

@ -0,0 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.driver.exception;
public class RileyLinkUnexpectedException extends OmnipodException {
public RileyLinkUnexpectedException(Throwable cause) {
super("Unexpected Exception during RileyLink communication", cause, false);
}
}

View file

@ -0,0 +1,8 @@
package info.nightscout.androidaps.plugins.pump.omnipod.driver.exception;
// Indicates that we didn't get any response from the RL
public class RileyLinkUnreachableException extends OmnipodException {
public RileyLinkUnreachableException() {
super("Timeout in communication between phone and RileyLink", false);
}
}

View file

@ -41,7 +41,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfo
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandFailedAfterChangingDeliveryStatusException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommunicationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.DeliveryStatusVerificationFailedException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalDeliveryStatusException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPacketTypeException;
@ -59,7 +58,7 @@ import io.reactivex.schedulers.Schedulers;
import io.reactivex.subjects.SingleSubject;
public class OmnipodManager {
private static final int ACTION_VERIFICATION_TRIES = 3;
private static final int ACTION_VERIFICATION_TRIES = 2;
private final OmnipodRileyLinkCommunicationManager communicationService;
private PodStateManager podStateManager;
@ -224,13 +223,10 @@ public class OmnipodManager {
suspendDelivery(acknowledgementBeep);
}
// Store the new Basal schedule after successfully suspending delivery, so that if setting the Basal schedule fails,
// And we later try to resume delivery, the new schedule is used
podStateManager.setBasalSchedule(schedule);
try {
executeAndVerify(() -> communicationService.executeAction(new SetBasalScheduleAction(podStateManager, schedule,
false, podStateManager.getScheduleOffset(), acknowledgementBeep)));
podStateManager.setBasalSchedule(schedule);
} catch (OmnipodException ex) {
if (ex.isCertainFailure()) {
if (!wasSuspended) {
@ -240,7 +236,9 @@ public class OmnipodManager {
}
// verifyDeliveryStatus will throw an exception if verification fails
if (!verifyDeliveryStatus(DeliveryStatus.NORMAL, ex)) {
if (verifyDeliveryStatus(DeliveryStatus.NORMAL, ex)) {
podStateManager.setBasalSchedule(schedule);
} else {
if (!wasSuspended) {
throw new CommandFailedAfterChangingDeliveryStatusException("Suspending delivery succeeded but setting the new basal schedule did not", ex);
}
@ -248,6 +246,8 @@ public class OmnipodManager {
throw ex;
}
}
} finally {
logCommandExecutionFinished("setBasalSchedule");
}
@ -420,7 +420,7 @@ public class OmnipodManager {
bolusCommandExecutionSubject = null;
disposables.add(Completable.complete() //
.delay(estimatedRemainingBolusDuration.getMillis() + 250, TimeUnit.MILLISECONDS) //
.delay(estimatedRemainingBolusDuration.getMillis(), TimeUnit.MILLISECONDS) //
.observeOn(Schedulers.io()) //
.doOnComplete(() -> {
synchronized (bolusDataMutex) {
@ -432,9 +432,8 @@ public class OmnipodManager {
StatusResponse statusResponse = getPodStatus();
if (statusResponse.getDeliveryStatus().isBolusing()) {
throw new IllegalDeliveryStatusException(DeliveryStatus.NORMAL, statusResponse.getDeliveryStatus());
} else {
break;
}
break;
} catch (PodFaultException ex) {
// Subtract units not delivered in case of a Pod failure
bolusNotDelivered = ex.getFaultEvent().getBolusNotDelivered();
@ -551,9 +550,9 @@ public class OmnipodManager {
try {
PodInfoResponse podInfoResponse = communicationService.executeAction(new GetPodInfoAction(podStateManager, PodInfoType.RECENT_PULSE_LOG));
PodInfoRecentPulseLog pulseLogInfo = (PodInfoRecentPulseLog) podInfoResponse.getPodInfo();
aapsLogger.info(LTag.PUMPCOMM, "Retrieved pulse log from the pod: {}", pulseLogInfo.toString());
aapsLogger.info(LTag.PUMPCOMM, "Read pulse log from the pod: {}", pulseLogInfo.toString());
} catch (Exception ex) {
aapsLogger.warn(LTag.PUMPCOMM, "Failed to retrieve pulse log from the pod", ex);
aapsLogger.warn(LTag.PUMPCOMM, "Failed to read pulse log", ex);
}
try {
@ -595,7 +594,7 @@ public class OmnipodManager {
logStartingCommandExecution("verifyCommand");
try {
return supplier.get();
} catch (Exception originalException) {
} catch (OmnipodException originalException) {
if (isCertainFailure(originalException)) {
throw originalException;
} else {
@ -608,18 +607,11 @@ public class OmnipodManager {
return statusResponse;
} catch (NonceOutOfSyncException verificationException) {
aapsLogger.error(LTag.PUMPCOMM, "Command resolved to FAILURE (CERTAIN_FAILURE)", verificationException);
if (originalException instanceof OmnipodException) {
((OmnipodException) originalException).setCertainFailure(true);
throw originalException;
} else {
OmnipodException newException = new CommunicationException(CommunicationException.Type.UNEXPECTED_EXCEPTION, originalException);
newException.setCertainFailure(true);
throw newException;
}
aapsLogger.info(LTag.PUMPCOMM, "Command resolved to FAILURE (CERTAIN_FAILURE)", verificationException);
originalException.setCertainFailure(true);
throw originalException;
} catch (Exception verificationException) {
aapsLogger.error(LTag.PUMPCOMM, "Command unresolved (UNCERTAIN_FAILURE)", verificationException);
aapsLogger.warn(LTag.PUMPCOMM, "Command unresolved (UNCERTAIN_FAILURE)", verificationException);
throw originalException;
}
}

View file

@ -18,12 +18,12 @@ public class AlertConfigurationUtil {
public static AlertConfiguration createExpirationAdvisoryAlertConfiguration(boolean active, Duration timeUntilAlert, Duration duration) {
return new AlertConfiguration(AlertType.EXPIRATION_ADVISORY_ALERT, AlertSlot.SLOT7, active, false, duration,
new TimerAlertTrigger(timeUntilAlert), BeepType.BIP_BEEP_BIP_BEEP_BIP_BEEP_BIP_BEEP, BeepRepeat.EVERY_15_MINUTES);
new TimerAlertTrigger(timeUntilAlert), BeepType.BIP_BEEP_BIP_BEEP_BIP_BEEP_BIP_BEEP, BeepRepeat.EVERY_MINUTE_FOR_3_MINUTES_REPEAT_EVERY_15_MINUTES);
}
public static AlertConfiguration createShutdownImminentAlertConfiguration(Duration timeUntilAlert) {
return new AlertConfiguration(AlertType.SHUTDOWN_IMMINENT_ALARM, AlertSlot.SLOT2, true, false, Duration.ZERO,
new TimerAlertTrigger(timeUntilAlert), BeepType.BIP_BEEP_BIP_BEEP_BIP_BEEP_BIP_BEEP, BeepRepeat.EVERY_MINUTE_FOR_3_MINUTES_REPEAT_EVERY_15_MINUTES);
new TimerAlertTrigger(timeUntilAlert), BeepType.BIP_BEEP_BIP_BEEP_BIP_BEEP_BIP_BEEP, BeepRepeat.EVERY_15_MINUTES);
}
public static AlertConfiguration createAutoOffAlertConfiguration(boolean active, Duration countdownDuration) {

View file

@ -2,10 +2,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.manager;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.function.Supplier;
import javax.inject.Inject;
import javax.inject.Singleton;
@ -14,15 +17,18 @@ import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.OmnipodHistoryRecord;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.events.Event;
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface;
import info.nightscout.androidaps.interfaces.ProfileFunction;
import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress;
@ -46,10 +52,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.Omnipod
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalSchedule;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.schedule.BasalScheduleEntry;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.ActionInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandFailedAfterChangingDeliveryStatusException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommandInitializationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommunicationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CrcMismatchException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.DeliveryStatusVerificationFailedException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalDeliveryStatusException;
@ -66,6 +69,10 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NotEnoug
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.OmnipodException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFaultException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodReturnedErrorResponseException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.RileyLinkInterruptedException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.RileyLinkTimeoutException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.RileyLinkUnexpectedException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.RileyLinkUnreachableException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.OmnipodManager;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.SetupActionResult;
@ -73,9 +80,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPumpVal
import info.nightscout.androidaps.plugins.pump.omnipod.rileylink.manager.OmnipodRileyLinkCommunicationManager;
import info.nightscout.androidaps.plugins.pump.omnipod.util.AapsOmnipodUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodAlertUtil;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.resources.ResourceHelper;
import info.nightscout.androidaps.utils.sharedPreferences.SP;
import io.reactivex.disposables.Disposable;
import io.reactivex.subjects.SingleSubject;
@Singleton
@ -92,6 +99,8 @@ public class AapsOmnipodManager {
private final OmnipodManager delegate;
private final DatabaseHelperInterface databaseHelper;
private final OmnipodAlertUtil omnipodAlertUtil;
private final NSUpload nsUpload;
private final ProfileFunction profileFunction;
private boolean basalBeepsEnabled;
private boolean bolusBeepsEnabled;
@ -112,20 +121,22 @@ public class AapsOmnipodManager {
HasAndroidInjector injector,
ActivePluginProvider activePlugin,
DatabaseHelperInterface databaseHelper,
OmnipodAlertUtil omnipodAlertUtil) {
if (podStateManager == null) {
throw new IllegalArgumentException("Pod state manager can not be null");
}
OmnipodAlertUtil omnipodAlertUtil,
NSUpload nsUpload,
ProfileFunction profileFunction
) {
this.podStateManager = podStateManager;
this.aapsOmnipodUtil = aapsOmnipodUtil;
this.aapsLogger = aapsLogger;
this.rxBus = rxBus;
this.sp = sp;
this.resourceHelper = resourceHelper;
this.injector = injector;
this.activePlugin = activePlugin;
this.databaseHelper = databaseHelper;
this.sp = sp;
this.omnipodAlertUtil = omnipodAlertUtil;
this.nsUpload = nsUpload;
this.profileFunction = profileFunction;
delegate = new OmnipodManager(aapsLogger, sp, communicationService, podStateManager);
@ -148,15 +159,15 @@ public class AapsOmnipodManager {
}
try {
Disposable disposable = delegate.pairAndPrime().subscribe(res -> //
handleSetupActionResult(podInitActionType, podInitReceiver, res, System.currentTimeMillis(), null));
executeCommand(() -> delegate.pairAndPrime().subscribe(res -> //
handleSetupActionResult(podInitActionType, podInitReceiver, res, System.currentTimeMillis(), null)));
return new PumpEnactResult(injector).success(true).enacted(true);
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
podInitReceiver.returnInitTaskStatus(podInitActionType, false, comment);
addFailureToHistory(System.currentTimeMillis(), PodHistoryEntryType.PAIR_AND_PRIME, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
podInitReceiver.returnInitTaskStatus(podInitActionType, false, errorMessage);
addFailureToHistory(System.currentTimeMillis(), PodHistoryEntryType.PAIR_AND_PRIME, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
}
@ -173,123 +184,126 @@ public class AapsOmnipodManager {
}
try {
BasalSchedule basalSchedule;
try {
basalSchedule = mapProfileToBasalSchedule(profile);
} catch (Exception ex) {
throw new CommandInitializationException("Basal profile mapping failed", ex);
}
BasalSchedule basalSchedule = mapProfileToBasalSchedule(profile);
Disposable disposable = delegate.insertCannula(basalSchedule, omnipodAlertUtil.getExpirationReminderTimeBeforeShutdown(), omnipodAlertUtil.getLowReservoirAlertUnits()).subscribe(res -> //
handleSetupActionResult(podInitActionType, podInitReceiver, res, System.currentTimeMillis(), profile));
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED));
cancelSuspendedFakeTbrIfExists();
return new PumpEnactResult(injector).success(true).enacted(true);
executeCommand(() -> delegate.insertCannula(basalSchedule, omnipodAlertUtil.getExpirationReminderTimeBeforeShutdown(), omnipodAlertUtil.getLowReservoirAlertUnits()).subscribe(res -> //
handleSetupActionResult(podInitActionType, podInitReceiver, res, System.currentTimeMillis(), profile)));
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
podInitReceiver.returnInitTaskStatus(podInitActionType, false, comment);
addFailureToHistory(PodHistoryEntryType.FILL_CANNULA_SET_BASAL_PROFILE, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
podInitReceiver.returnInitTaskStatus(podInitActionType, false, errorMessage);
addFailureToHistory(PodHistoryEntryType.FILL_CANNULA_SET_BASAL_PROFILE, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
uploadCareportalEvent(System.currentTimeMillis() - 2000, CareportalEvent.PUMPBATTERYCHANGE);
uploadCareportalEvent(System.currentTimeMillis() - 1000, CareportalEvent.INSULINCHANGE);
uploadCareportalEvent(System.currentTimeMillis(), CareportalEvent.SITECHANGE);
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED));
cancelSuspendedFakeTbrIfExists();
return new PumpEnactResult(injector).success(true).enacted(true);
}
public PumpEnactResult configureAlerts(List<AlertConfiguration> alertConfigurations) {
try {
StatusResponse statusResponse = delegate.configureAlerts(alertConfigurations);
addSuccessToHistory(PodHistoryEntryType.CONFIGURE_ALERTS, alertConfigurations);
return new PumpEnactResult(injector).success(true).enacted(false);
executeCommand(() -> delegate.configureAlerts(alertConfigurations));
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
addFailureToHistory(PodHistoryEntryType.CONFIGURE_ALERTS, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
addFailureToHistory(PodHistoryEntryType.CONFIGURE_ALERTS, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
addSuccessToHistory(PodHistoryEntryType.CONFIGURE_ALERTS, alertConfigurations);
return new PumpEnactResult(injector).success(true).enacted(false);
}
public PumpEnactResult getPodStatus() {
StatusResponse statusResponse;
try {
StatusResponse statusResponse = delegate.getPodStatus();
addSuccessToHistory(PodHistoryEntryType.GET_POD_STATUS, statusResponse);
return new PumpEnactResult(injector).success(true).enacted(false);
statusResponse = executeCommand(delegate::getPodStatus);
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
addFailureToHistory(PodHistoryEntryType.GET_POD_STATUS, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
addFailureToHistory(PodHistoryEntryType.GET_POD_STATUS, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
addSuccessToHistory(PodHistoryEntryType.GET_POD_STATUS, statusResponse);
return new PumpEnactResult(injector).success(true).enacted(false);
}
public PumpEnactResult deactivatePod(PodInitReceiver podInitReceiver) {
try {
delegate.deactivatePod();
executeCommand(delegate::deactivatePod);
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
podInitReceiver.returnInitTaskStatus(PodInitActionType.DEACTIVATE_POD_WIZARD_STEP, false, comment);
addFailureToHistory(PodHistoryEntryType.DEACTIVATE_POD, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
podInitReceiver.returnInitTaskStatus(PodInitActionType.DEACTIVATE_POD_WIZARD_STEP, false, errorMessage);
addFailureToHistory(PodHistoryEntryType.DEACTIVATE_POD, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
addSuccessToHistory(PodHistoryEntryType.DEACTIVATE_POD, null);
createSuspendedFakeTbrIfNotExists();
podInitReceiver.returnInitTaskStatus(PodInitActionType.DEACTIVATE_POD_WIZARD_STEP, true, null);
return new PumpEnactResult(injector).success(true).enacted(true);
}
public PumpEnactResult setBasalProfile(Profile profile) {
public PumpEnactResult setBasalProfile(Profile profile, boolean showNotifications) {
if (profile == null) {
String comment = getStringResource(R.string.omnipod_error_failed_to_set_profile_empty_profile);
showNotification(Notification.FAILED_UDPATE_PROFILE, comment, Notification.URGENT, R.raw.boluserror);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String note = getStringResource(R.string.omnipod_error_failed_to_set_profile_empty_profile);
showNotification(Notification.FAILED_UDPATE_PROFILE, note, Notification.URGENT, R.raw.boluserror);
return new PumpEnactResult(injector).success(false).enacted(false).comment(note);
}
PodHistoryEntryType historyEntryType = podStateManager.isSuspended() ? PodHistoryEntryType.RESUME_DELIVERY : PodHistoryEntryType.SET_BASAL_SCHEDULE;
try {
BasalSchedule basalSchedule;
try {
basalSchedule = mapProfileToBasalSchedule(profile);
} catch (Exception ex) {
throw new CommandInitializationException("Basal profile mapping failed", ex);
}
delegate.setBasalSchedule(basalSchedule, isBasalBeepsEnabled());
if (historyEntryType == PodHistoryEntryType.RESUME_DELIVERY) {
cancelSuspendedFakeTbrIfExists();
}
addSuccessToHistory(historyEntryType, profile.getBasalValues());
BasalSchedule basalSchedule = mapProfileToBasalSchedule(profile);
executeCommand(() -> delegate.setBasalSchedule(basalSchedule, isBasalBeepsEnabled()));
} catch (CommandFailedAfterChangingDeliveryStatusException ex) {
createSuspendedFakeTbrIfNotExists();
String comment = getStringResource(R.string.omnipod_error_set_basal_failed_delivery_suspended);
showNotification(Notification.FAILED_UDPATE_PROFILE, comment, Notification.URGENT, R.raw.boluserror);
addFailureToHistory(historyEntryType, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
} catch (DeliveryStatusVerificationFailedException ex) {
String comment;
if (ex.getExpectedStatus() == DeliveryStatus.SUSPENDED) {
// Happened when suspending delivery before setting the new profile
comment = getStringResource(R.string.omnipod_error_set_basal_failed_delivery_might_be_suspended);
} else {
// Happened when setting the new profile (after suspending delivery)
comment = getStringResource(R.string.omnipod_error_set_basal_might_have_failed_delivery_might_be_suspended);
if (showNotifications) {
showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_error_set_basal_failed_delivery_suspended), Notification.URGENT, R.raw.boluserror);
}
showNotification(Notification.FAILED_UDPATE_PROFILE, comment, Notification.URGENT, R.raw.boluserror);
addFailureToHistory(historyEntryType, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex.getCause());
addFailureToHistory(historyEntryType, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (DeliveryStatusVerificationFailedException ex) {
if (showNotifications) {
String note;
if (ex.getExpectedStatus() == DeliveryStatus.SUSPENDED) {
// Happened when suspending delivery before setting the new profile
note = getStringResource(R.string.omnipod_error_set_basal_failed_delivery_might_be_suspended);
} else {
// Happened when setting the new profile (after suspending delivery)
note = getStringResource(R.string.omnipod_error_set_basal_might_have_failed_delivery_might_be_suspended);
}
showNotification(Notification.FAILED_UDPATE_PROFILE, note, Notification.URGENT, R.raw.boluserror);
}
String errorMessage = translateException(ex.getCause());
addFailureToHistory(historyEntryType, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
showNotification(Notification.FAILED_UDPATE_PROFILE, comment, Notification.URGENT, R.raw.boluserror);
addFailureToHistory(historyEntryType, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
if (showNotifications) {
showNotification(Notification.FAILED_UDPATE_PROFILE, getStringResource(R.string.omnipod_error_set_basal_failed), Notification.URGENT, R.raw.boluserror);
}
String errorMessage = translateException(ex);
addFailureToHistory(historyEntryType, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED));
showNotification(Notification.PROFILE_SET_OK,
resourceHelper.gs(R.string.profile_set_ok),
Notification.INFO, null);
if (historyEntryType == PodHistoryEntryType.RESUME_DELIVERY) {
cancelSuspendedFakeTbrIfExists();
rxBus.send(new EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED));
}
addSuccessToHistory(historyEntryType, profile.getBasalValues());
if (showNotifications) {
showNotification(Notification.PROFILE_SET_OK, resourceHelper.gs(R.string.profile_set_ok), Notification.INFO, null);
}
return new PumpEnactResult(injector).success(true).enacted(true);
}
@ -297,7 +311,7 @@ public class AapsOmnipodManager {
public PumpEnactResult discardPodState() {
podStateManager.discardState();
addSuccessToHistory(System.currentTimeMillis(), PodHistoryEntryType.RESET_POD_STATE, null);
addSuccessToHistory(System.currentTimeMillis(), PodHistoryEntryType.DISCARD_POD_STATE, null);
createSuspendedFakeTbrIfNotExists();
@ -311,27 +325,27 @@ public class AapsOmnipodManager {
Date bolusStarted;
try {
bolusCommandResult = delegate.bolus(PumpType.Insulet_Omnipod.determineCorrectBolusSize(detailedBolusInfo.insulin), beepsEnabled, beepsEnabled, detailedBolusInfo.isSMB ? null :
bolusCommandResult = executeCommand(() -> delegate.bolus(PumpType.Insulet_Omnipod.determineCorrectBolusSize(detailedBolusInfo.insulin), beepsEnabled, beepsEnabled, detailedBolusInfo.isSMB ? null :
(estimatedUnitsDelivered, percentage) -> {
EventOverviewBolusProgress progressUpdateEvent = EventOverviewBolusProgress.INSTANCE;
progressUpdateEvent.setStatus(getStringResource(R.string.bolusdelivering, detailedBolusInfo.insulin));
progressUpdateEvent.setPercent(percentage);
sendEvent(progressUpdateEvent);
});
}));
bolusStarted = new Date();
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
addFailureToHistory(System.currentTimeMillis(), PodHistoryEntryType.SET_BOLUS, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
addFailureToHistory(System.currentTimeMillis(), PodHistoryEntryType.SET_BOLUS, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
if (OmnipodManager.CommandDeliveryStatus.UNCERTAIN_FAILURE.equals(bolusCommandResult.getCommandDeliveryStatus())) {
// For safety reasons, we treat this as a bolus that has successfully been delivered, in order to prevent insulin overdose
if (detailedBolusInfo.isSMB) {
showNotification(getStringResource(R.string.omnipod_bolus_failed_uncertain_smb, detailedBolusInfo.insulin), Notification.URGENT, R.raw.boluserror);
showNotification(getStringResource(R.string.omnipod_error_bolus_failed_uncertain_smb, detailedBolusInfo.insulin), Notification.URGENT, R.raw.boluserror);
} else {
showNotification(getStringResource(R.string.omnipod_bolus_failed_uncertain), Notification.URGENT, R.raw.boluserror);
showNotification(getStringResource(R.string.omnipod_error_bolus_failed_uncertain), Notification.URGENT, R.raw.boluserror);
}
}
@ -391,7 +405,7 @@ public class AapsOmnipodManager {
aapsLogger.debug(LTag.PUMP, "Bolus command successfully executed. Proceeding bolus cancellation");
} else {
aapsLogger.debug(LTag.PUMP, "Not cancelling bolus: bolus command failed");
String comment = getStringResource(R.string.omnipod_bolus_did_not_succeed);
String comment = getStringResource(R.string.omnipod_error_bolus_did_not_succeed);
addFailureToHistory(System.currentTimeMillis(), PodHistoryEntryType.CANCEL_BOLUS, comment);
return new PumpEnactResult(injector).success(true).enacted(false).comment(comment);
}
@ -400,19 +414,19 @@ public class AapsOmnipodManager {
String comment = null;
for (int i = 1; delegate.hasActiveBolus(); i++) {
aapsLogger.debug(LTag.PUMP, "Attempting to cancel bolus (#{})", i);
try {
delegate.cancelBolus(isBolusBeepsEnabled());
executeCommand(() -> delegate.cancelBolus(isBolusBeepsEnabled()));
aapsLogger.debug(LTag.PUMP, "Successfully cancelled bolus", i);
addSuccessToHistory(System.currentTimeMillis(), PodHistoryEntryType.CANCEL_BOLUS, null);
return new PumpEnactResult(injector).success(true).enacted(true);
} catch (PodFaultException ex) {
aapsLogger.debug(LTag.PUMP, "Successfully cancelled bolus (implicitly because of a Pod Fault)");
showPodFaultNotification(ex.getFaultEvent().getFaultEventCode());
addSuccessToHistory(System.currentTimeMillis(), PodHistoryEntryType.CANCEL_BOLUS, null);
return new PumpEnactResult(injector).success(true).enacted(true);
} catch (Exception ex) {
aapsLogger.debug(LTag.PUMP, "Failed to cancel bolus", ex);
comment = handleAndTranslateException(ex);
comment = translateException(ex);
}
}
@ -423,19 +437,18 @@ public class AapsOmnipodManager {
public PumpEnactResult setTemporaryBasal(TempBasalPair tempBasalPair) {
boolean beepsEnabled = isTbrBeepsEnabled();
try {
delegate.setTemporaryBasal(PumpType.Insulet_Omnipod.determineCorrectBasalSize(tempBasalPair.getInsulinRate()), Duration.standardMinutes(tempBasalPair.getDurationMinutes()), beepsEnabled, beepsEnabled);
executeCommand(() -> delegate.setTemporaryBasal(PumpType.Insulet_Omnipod.determineCorrectBasalSize(tempBasalPair.getInsulinRate()), Duration.standardMinutes(tempBasalPair.getDurationMinutes()), beepsEnabled, beepsEnabled));
} catch (CommandFailedAfterChangingDeliveryStatusException ex) {
String comment = getStringResource(R.string.omnipod_cancelled_old_tbr_failed_to_set_new);
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, comment);
showNotification(comment, Notification.NORMAL, null);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (DeliveryStatusVerificationFailedException ex) {
String comment;
String errorMessage = translateException(ex.getCause());
String note;
if (ex.getExpectedStatus() == DeliveryStatus.TEMP_BASAL_RUNNING) {
// Happened after cancelling the old TBR, when attempting to set new TBR
comment = getStringResource(R.string.omnipod_error_set_temp_basal_failed_old_tbr_cancelled_new_might_have_failed);
long pumpId = addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, comment);
note = getStringResource(R.string.omnipod_error_set_temp_basal_failed_old_tbr_cancelled_new_might_have_failed);
// Assume that setting the temp basal succeeded here, because in case it didn't succeed,
// The next StatusResponse that we receive will allow us to recover from the wrong state
@ -443,19 +456,20 @@ public class AapsOmnipodManager {
// If we would assume that the TBR didn't succeed, we couldn't properly recover upon the next StatusResponse,
// as we could only see that the Pod is running a TBR, but we don't know the rate and duration as
// the Pod doesn't provide this information
long pumpId = addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage);
addTempBasalTreatment(System.currentTimeMillis(), pumpId, tempBasalPair);
} else {
// Happened when attempting to cancel the old TBR
comment = getStringResource(R.string.omnipod_error_set_temp_basal_failed_old_tbr_might_be_cancelled);
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, comment);
note = getStringResource(R.string.omnipod_error_set_temp_basal_failed_old_tbr_might_be_cancelled);
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage);
}
showNotification(note, Notification.URGENT, R.raw.boluserror);
showNotification(comment, Notification.URGENT, R.raw.boluserror);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
addFailureToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
long pumpId = addSuccessToHistory(PodHistoryEntryType.SET_TEMPORARY_BASAL, tempBasalPair);
@ -467,17 +481,14 @@ public class AapsOmnipodManager {
public PumpEnactResult cancelTemporaryBasal() {
try {
delegate.cancelTemporaryBasal(isTbrBeepsEnabled());
executeCommand(() -> delegate.cancelTemporaryBasal(isTbrBeepsEnabled()));
} catch (Exception ex) {
String comment;
if (ex instanceof OmnipodException && !((OmnipodException) ex).isCertainFailure()) {
comment = getStringResource(R.string.omnipod_error_cancel_temp_basal_failed_uncertain);
showNotification(comment, Notification.URGENT, R.raw.boluserror);
} else {
comment = handleAndTranslateException(ex);
showNotification(getStringResource(R.string.omnipod_error_cancel_temp_basal_failed_uncertain), Notification.URGENT, R.raw.boluserror);
}
addFailureToHistory(PodHistoryEntryType.CANCEL_TEMPORARY_BASAL, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
addFailureToHistory(PodHistoryEntryType.CANCEL_TEMPORARY_BASAL, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
long pumpId = addSuccessToHistory(PodHistoryEntryType.CANCEL_TEMPORARY_BASAL, null);
@ -495,59 +506,63 @@ public class AapsOmnipodManager {
public PumpEnactResult acknowledgeAlerts() {
try {
delegate.acknowledgeAlerts();
addSuccessToHistory(PodHistoryEntryType.ACKNOWLEDGE_ALERTS, null);
executeCommand(delegate::acknowledgeAlerts);
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
addFailureToHistory(PodHistoryEntryType.ACKNOWLEDGE_ALERTS, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
addFailureToHistory(PodHistoryEntryType.ACKNOWLEDGE_ALERTS, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
addSuccessToHistory(PodHistoryEntryType.ACKNOWLEDGE_ALERTS, null);
return new PumpEnactResult(injector).success(true).enacted(true);
}
public PumpEnactResult suspendDelivery() {
try {
delegate.suspendDelivery(isBasalBeepsEnabled());
executeCommand(() -> delegate.suspendDelivery(isBasalBeepsEnabled()));
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
addFailureToHistory(PodHistoryEntryType.SUSPEND_DELIVERY, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
addFailureToHistory(PodHistoryEntryType.SUSPEND_DELIVERY, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
addSuccessToHistory(PodHistoryEntryType.SUSPEND_DELIVERY, null);
createSuspendedFakeTbrIfNotExists();
return new PumpEnactResult(injector).success(true).enacted(true);
}
// Updates the pods current time based on the device timezone and the pod's time zone
public PumpEnactResult setTime() {
public PumpEnactResult setTime(boolean showNotifications) {
try {
delegate.setTime(isBasalBeepsEnabled());
addSuccessToHistory(PodHistoryEntryType.SET_TIME, null);
executeCommand(() -> delegate.setTime(isBasalBeepsEnabled()));
} catch (CommandFailedAfterChangingDeliveryStatusException ex) {
createSuspendedFakeTbrIfNotExists();
String comment = getStringResource(R.string.omnipod_error_set_time_failed_delivery_suspended);
showNotification(comment, Notification.URGENT, R.raw.boluserror);
addFailureToHistory(PodHistoryEntryType.SET_TIME, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
if (showNotifications) {
showNotification(getStringResource(R.string.omnipod_error_set_time_failed_delivery_suspended), Notification.URGENT, R.raw.boluserror);
}
String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (DeliveryStatusVerificationFailedException ex) {
String comment = getStringResource(R.string.omnipod_error_set_time_failed_delivery_might_be_suspended);
showNotification(comment, Notification.URGENT, R.raw.boluserror);
addFailureToHistory(PodHistoryEntryType.SET_TIME, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
if (showNotifications) {
showNotification(getStringResource(R.string.omnipod_error_set_time_failed_delivery_might_be_suspended), Notification.URGENT, R.raw.boluserror);
}
String errorMessage = translateException(ex.getCause());
addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
} catch (Exception ex) {
String comment = handleAndTranslateException(ex);
addFailureToHistory(PodHistoryEntryType.SET_TIME, comment);
return new PumpEnactResult(injector).success(false).enacted(false).comment(comment);
String errorMessage = translateException(ex);
addFailureToHistory(PodHistoryEntryType.SET_TIME, errorMessage);
return new PumpEnactResult(injector).success(false).enacted(false).comment(errorMessage);
}
addSuccessToHistory(PodHistoryEntryType.SET_TIME, null);
return new PumpEnactResult(injector).success(true).enacted(true);
}
public PodInfoRecentPulseLog readPulseLog() {
PodInfoResponse response = delegate.getPodInfo(PodInfoType.RECENT_PULSE_LOG);
PodInfoResponse response = executeCommand(() -> delegate.getPodInfo(PodInfoType.RECENT_PULSE_LOG));
return (PodInfoRecentPulseLog) response.getPodInfo();
}
@ -715,12 +730,12 @@ public class AapsOmnipodManager {
switch (res.getResultType()) {
case FAILURE: {
aapsLogger.error(LTag.PUMP, "Setup action failed: illegal setup progress: {}", res.getPodProgressStatus());
comment = getStringResource(R.string.omnipod_driver_error_invalid_progress_state, res.getPodProgressStatus());
comment = getStringResource(R.string.omnipod_error_invalid_progress_state, res.getPodProgressStatus());
}
break;
case VERIFICATION_FAILURE: {
aapsLogger.error(LTag.PUMP, "Setup action verification failed: caught exception", res.getException());
comment = getStringResource(R.string.omnipod_driver_error_setup_action_verification_failed);
comment = getStringResource(R.string.omnipod_error_setup_action_verification_failed);
}
break;
}
@ -734,54 +749,78 @@ public class AapsOmnipodManager {
podInitReceiver.returnInitTaskStatus(podInitActionType, res.getResultType().isSuccess(), comment);
}
private String handleAndTranslateException(Exception ex) {
String comment;
private void executeCommand(Runnable runnable) {
try {
runnable.run();
} catch (Exception ex) {
handleException(ex);
throw ex;
}
}
private <T> T executeCommand(Supplier<T> supplier) {
try {
return supplier.get();
} catch (Exception ex) {
handleException(ex);
throw ex;
}
}
private void handleException(Exception ex) {
if (ex instanceof OmnipodException) {
if (ex instanceof ActionInitializationException || ex instanceof CommandInitializationException) {
comment = getStringResource(R.string.omnipod_driver_error_invalid_parameters);
} else if (ex instanceof CommunicationException) {
if (((CommunicationException) ex).getType() == CommunicationException.Type.TIMEOUT) {
comment = getStringResource(R.string.omnipod_driver_error_communication_failed_timeout);
} else {
comment = getStringResource(R.string.omnipod_driver_error_communication_failed_unexpected_exception);
}
} else if (ex instanceof CrcMismatchException) {
comment = getStringResource(R.string.omnipod_driver_error_crc_mismatch);
} else if (ex instanceof IllegalPacketTypeException) {
comment = getStringResource(R.string.omnipod_driver_error_invalid_packet_type);
} else if (ex instanceof IllegalPodProgressException || ex instanceof IllegalDeliveryStatusException) {
comment = getStringResource(R.string.omnipod_driver_error_invalid_progress_state);
} else if (ex instanceof IllegalVersionResponseTypeException) {
comment = getStringResource(R.string.omnipod_driver_error_invalid_response);
} else if (ex instanceof IllegalResponseException) {
comment = getStringResource(R.string.omnipod_driver_error_invalid_response);
} else if (ex instanceof IllegalMessageSequenceNumberException) {
comment = getStringResource(R.string.omnipod_driver_error_invalid_message_sequence_number);
} else if (ex instanceof IllegalMessageAddressException) {
comment = getStringResource(R.string.omnipod_driver_error_invalid_message_address);
} else if (ex instanceof MessageDecodingException) {
comment = getStringResource(R.string.omnipod_driver_error_message_decoding_failed);
} else if (ex instanceof NonceOutOfSyncException) {
comment = getStringResource(R.string.omnipod_driver_error_nonce_out_of_sync);
} else if (ex instanceof NonceResyncException) {
comment = getStringResource(R.string.omnipod_driver_error_nonce_resync_failed);
} else if (ex instanceof NotEnoughDataException) {
comment = getStringResource(R.string.omnipod_driver_error_not_enough_data);
} else if (ex instanceof PodFaultException) {
aapsLogger.error(LTag.PUMP, String.format("Caught OmnipodException[certainFailure=%s] from OmnipodManager", ((OmnipodException) ex).isCertainFailure()), ex);
if (ex instanceof PodFaultException) {
FaultEventCode faultEventCode = ((PodFaultException) ex).getFaultEvent().getFaultEventCode();
showPodFaultNotification(faultEventCode);
comment = createPodFaultErrorMessage(faultEventCode);
} else if (ex instanceof PodReturnedErrorResponseException) {
comment = getStringResource(R.string.omnipod_driver_error_pod_returned_error_response);
} else {
// Shouldn't be reachable
comment = getStringResource(R.string.omnipod_driver_error_unexpected_exception_type, ex.getClass().getName());
}
aapsLogger.error(LTag.PUMP, String.format("Caught OmnipodException[certainFailure=%s] from OmnipodManager (user-friendly error message: %s)", ((OmnipodException) ex).isCertainFailure(), comment), ex);
} else {
comment = getStringResource(R.string.omnipod_driver_error_unexpected_exception_type, ex.getClass().getName(), ex.getMessage());
aapsLogger.error(LTag.PUMP, String.format("Caught unexpected exception type[certainFailure=false] from OmnipodManager (user-friendly error message: %s)", comment), ex);
aapsLogger.error(LTag.PUMP, "Caught an unexpected non-OmnipodException from OmnipodManager", ex);
}
}
public String translateException(Throwable ex) {
String comment;
if (ex instanceof CrcMismatchException) {
comment = getStringResource(R.string.omnipod_error_crc_mismatch);
} else if (ex instanceof IllegalPacketTypeException) {
comment = getStringResource(R.string.omnipod_error_invalid_packet_type);
} else if (ex instanceof IllegalPodProgressException || ex instanceof IllegalDeliveryStatusException) {
comment = getStringResource(R.string.omnipod_error_invalid_progress_state);
} else if (ex instanceof IllegalVersionResponseTypeException) {
comment = getStringResource(R.string.omnipod_error_invalid_response);
} else if (ex instanceof IllegalResponseException) {
comment = getStringResource(R.string.omnipod_error_invalid_response);
} else if (ex instanceof IllegalMessageSequenceNumberException) {
comment = getStringResource(R.string.omnipod_error_invalid_message_sequence_number);
} else if (ex instanceof IllegalMessageAddressException) {
comment = getStringResource(R.string.omnipod_error_invalid_message_address);
} else if (ex instanceof MessageDecodingException) {
comment = getStringResource(R.string.omnipod_error_message_decoding_failed);
} else if (ex instanceof NonceOutOfSyncException) {
comment = getStringResource(R.string.omnipod_error_nonce_out_of_sync);
} else if (ex instanceof NonceResyncException) {
comment = getStringResource(R.string.omnipod_error_nonce_resync_failed);
} else if (ex instanceof NotEnoughDataException) {
comment = getStringResource(R.string.omnipod_error_not_enough_data);
} else if (ex instanceof PodFaultException) {
FaultEventCode faultEventCode = ((PodFaultException) ex).getFaultEvent().getFaultEventCode();
comment = createPodFaultErrorMessage(faultEventCode);
} else if (ex instanceof PodReturnedErrorResponseException) {
comment = getStringResource(R.string.omnipod_error_pod_returned_error_response);
} else if (ex instanceof RileyLinkUnreachableException) {
comment = getStringResource(R.string.omnipod_error_communication_failed_no_response_from_riley_link);
} else if (ex instanceof RileyLinkInterruptedException) {
comment = getStringResource(R.string.omnipod_error_communication_failed_riley_link_interrupted);
} else if (ex instanceof RileyLinkTimeoutException) {
comment = getStringResource(R.string.omnipod_error_communication_failed_no_response_from_pod);
} else if (ex instanceof RileyLinkUnexpectedException) {
Throwable cause = ex.getCause();
comment = getStringResource(R.string.omnipod_error_unexpected_exception, cause.getClass().getName(), cause.getMessage());
} else {
// Shouldn't be reachable
comment = getStringResource(R.string.omnipod_error_unexpected_exception, ex.getClass().getName(), ex.getMessage());
}
return comment;
@ -789,7 +828,7 @@ public class AapsOmnipodManager {
private String createPodFaultErrorMessage(FaultEventCode faultEventCode) {
String comment;
comment = getStringResource(R.string.omnipod_driver_error_pod_fault,
comment = getStringResource(R.string.omnipod_error_pod_fault,
ByteUtil.convertUnsignedByteToInt(faultEventCode.getValue()), faultEventCode.name());
return comment;
}
@ -841,4 +880,29 @@ public class AapsOmnipodManager {
return new BasalSchedule(entries);
}
private void uploadCareportalEvent(long date, String event) {
if (databaseHelper.getCareportalEventFromTimestamp(date) != null)
return;
try {
JSONObject data = new JSONObject();
String enteredBy = sp.getString("careportal_enteredby", "");
if (enteredBy.isEmpty()) {
data.put("enteredBy", enteredBy);
}
data.put("created_at", DateUtil.toISOString(date));
data.put("mills", date);
data.put("eventType", event);
data.put("units", profileFunction.getUnits());
CareportalEvent careportalEvent = new CareportalEvent(injector);
careportalEvent.date = date;
careportalEvent.source = Source.USER;
careportalEvent.eventType = event;
careportalEvent.json = data.toString();
databaseHelper.createOrUpdate(careportalEvent);
nsUpload.uploadCareportalEntryToNS(data);
} catch (JSONException e) {
aapsLogger.error(LTag.PUMPCOMM, "Unhandled exception when uploading SiteChange event.", e);
}
}
}

View file

@ -0,0 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.queue.command;
public final class CommandAcknowledgeAlerts extends OmnipodCustomCommand {
public CommandAcknowledgeAlerts() {
super(OmnipodCustomCommandType.ACKNOWLEDGE_ALERTS);
}
}

View file

@ -0,0 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.queue.command;
public final class CommandGetPodStatus extends OmnipodCustomCommand {
public CommandGetPodStatus() {
super(OmnipodCustomCommandType.GET_POD_STATUS);
}
}

View file

@ -0,0 +1,14 @@
package info.nightscout.androidaps.plugins.pump.omnipod.queue.command;
public final class CommandHandleTimeChange extends OmnipodCustomCommand {
private final boolean requestedByUser;
public CommandHandleTimeChange(boolean requestedByUser) {
super(OmnipodCustomCommandType.HANDLE_TIME_CHANGE);
this.requestedByUser = requestedByUser;
}
public boolean isRequestedByUser() {
return requestedByUser;
}
}

View file

@ -0,0 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.queue.command;
public final class CommandReadPulseLog extends OmnipodCustomCommand {
public CommandReadPulseLog() {
super(OmnipodCustomCommandType.READ_PULSE_LOG);
}
}

View file

@ -0,0 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.queue.command;
public final class CommandResumeDelivery extends OmnipodCustomCommand {
public CommandResumeDelivery() {
super(OmnipodCustomCommandType.RESUME_DELIVERY);
}
}

View file

@ -0,0 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.queue.command;
public final class CommandSuspendDelivery extends OmnipodCustomCommand {
public CommandSuspendDelivery() {
super(OmnipodCustomCommandType.SUSPEND_DELIVERY);
}
}

View file

@ -0,0 +1,7 @@
package info.nightscout.androidaps.plugins.pump.omnipod.queue.command;
public final class CommandUpdateAlertConfiguration extends OmnipodCustomCommand {
public CommandUpdateAlertConfiguration() {
super(OmnipodCustomCommandType.UPDATE_ALERT_CONFIGURATION);
}
}

View file

@ -0,0 +1,21 @@
package info.nightscout.androidaps.plugins.pump.omnipod.queue.command;
import androidx.annotation.NonNull;
import info.nightscout.androidaps.queue.commands.CustomCommand;
public abstract class OmnipodCustomCommand implements CustomCommand {
private final OmnipodCustomCommandType type;
OmnipodCustomCommand(@NonNull OmnipodCustomCommandType type) {
this.type = type;
}
public final OmnipodCustomCommandType getType() {
return type;
}
@Override public final String getStatusDescription() {
return type.getDescription();
}
}

View file

@ -0,0 +1,21 @@
package info.nightscout.androidaps.plugins.pump.omnipod.queue.command;
public enum OmnipodCustomCommandType {
ACKNOWLEDGE_ALERTS("ACKNOWLEDGE ALERTS"),
GET_POD_STATUS("GET POD STATUS"),
READ_PULSE_LOG("READ PULSE LOG"),
SUSPEND_DELIVERY("SUSPEND DELIVERY"),
RESUME_DELIVERY("RESUME DELIVERY"),
HANDLE_TIME_CHANGE("HANDLE TIME CHANGE"),
UPDATE_ALERT_CONFIGURATION("UPDATE ALERT CONFIGURATION");
private final String description;
OmnipodCustomCommandType(String description) {
this.description = description;
}
String getDescription() {
return description;
}
}

View file

@ -12,7 +12,6 @@ import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RLMessageType;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkBLEError;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
@ -30,7 +29,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.Message
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PacketType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodInfoType;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.CommunicationException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalMessageAddressException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalMessageSequenceNumberException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.IllegalPacketTypeException;
@ -41,13 +39,16 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.NotEnoug
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.OmnipodException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodFaultException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.PodReturnedErrorResponseException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.RileyLinkTimeoutException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.RileyLinkUnexpectedException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.exception.RileyLinkUnreachableException;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
/**
* Created by andy on 6/29/18.
*/
@Singleton
public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunicationManager {
public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunicationManager<OmnipodPacket> {
// This empty constructor must be kept, otherwise dagger injection might break!
@Inject
public OmnipodRileyLinkCommunicationManager() {
@ -69,7 +70,7 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
}
@Override
public RLMessage createResponseMessage(byte[] payload) {
public OmnipodPacket createResponseMessage(byte[] payload) {
return new OmnipodPacket(payload);
}
@ -137,7 +138,7 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
if (responseClass.isInstance(responseMessageBlock)) {
podStateManager.setLastSuccessfulCommunication(DateTime.now());
return (T) responseMessageBlock;
return responseClass.cast(responseMessageBlock);
} else {
if (responseMessageBlock.getType() == MessageBlockType.ERROR_RESPONSE) {
ErrorResponse error = (ErrorResponse) responseMessageBlock;
@ -194,13 +195,13 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
// receive an ACK instead of a normal response, or a partial response and a communication timeout
if (message.isNonceResyncable() && !message.containsBlock(DeactivatePodCommand.class)) {
OmnipodMessage paddedMessage = new OmnipodMessage(message);
// If messages are nonce resyncable, we want do distinguish between certain and uncertain failures for verification purposes
// If messages are nonce resyncable, we want to distinguish between certain and uncertain failures for verification purposes
// However, some commands (e.g. cancel delivery) are single packet command by nature. When we get a timeout with a single packet,
// we are unsure whether or not the command was received by the pod
// However, if we send > 1 packet, we know that the command wasn't received if we never send the subsequent packets,
// because the last packet contains the CRC.
// So we pad the message with get status commands to make it > packet
paddedMessage.padWithGetStatusCommands(PacketType.PDM.getMaxBodyLength()); // First packet is of type PDM
paddedMessage.padWithGetStatusCommands(PacketType.PDM.getMaxBodyLength(), aapsLogger); // First packet is of type PDM
encodedMessage = paddedMessage.getEncoded();
} else {
encodedMessage = message.getEncoded();
@ -219,23 +220,16 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
try {
// We actually ignore previous (ack) responses if it was not last packet to send
response = exchangePackets(podStateManager, packet);
} catch (Exception ex) {
OmnipodException newException;
if (ex instanceof OmnipodException) {
newException = (OmnipodException) ex;
} else {
newException = new CommunicationException(CommunicationException.Type.UNEXPECTED_EXCEPTION, ex);
}
} catch (OmnipodException ex) {
boolean lastPacket = encodedMessage.length == 0;
// If this is not the last packet, the message wasn't fully sent,
// so it's impossible for the pod to have received the message
newException.setCertainFailure(!lastPacket);
ex.setCertainFailure(!lastPacket);
aapsLogger.debug(LTag.PUMPBTCOMM, "Caught exception in transportMessages. Set certainFailure to {} because encodedMessage.length={}", newException.isCertainFailure(), encodedMessage.length);
aapsLogger.debug(LTag.PUMPBTCOMM, "Caught OmnipodException in transportMessages. Set certainFailure to {} because encodedMessage.length={}", ex.isCertainFailure(), encodedMessage.length);
throw newException;
throw ex;
}
}
@ -261,18 +255,11 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
OmnipodPacket ackForCon = createAckPacket(podStateManager, packetAddress, ackAddressOverride);
try {
OmnipodPacket conPacket = exchangePackets(podStateManager, ackForCon, 3, 40);
if (conPacket.getPacketType() != PacketType.CON) {
throw new IllegalPacketTypeException(PacketType.CON, conPacket.getPacketType());
}
receivedMessageData = ByteUtil.concat(receivedMessageData, conPacket.getEncodedMessage());
} catch (OmnipodException ex2) {
throw ex2;
} catch (Exception ex2) {
throw new CommunicationException(CommunicationException.Type.UNEXPECTED_EXCEPTION, ex2);
OmnipodPacket conPacket = exchangePackets(podStateManager, ackForCon, 3, 40);
if (conPacket.getPacketType() != PacketType.CON) {
throw new IllegalPacketTypeException(PacketType.CON, conPacket.getPacketType());
}
receivedMessageData = ByteUtil.concat(receivedMessageData, conPacket.getEncodedMessage());
}
}
@ -317,8 +304,6 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
}
} catch (OmnipodException ex) {
aapsLogger.debug(LTag.PUMPBTCOMM, "Ignoring exception in ackUntilQuiet", ex);
} catch (Exception ex) {
throw new CommunicationException(CommunicationException.Type.UNEXPECTED_EXCEPTION, ex);
}
podStateManager.increasePacketNumber();
@ -337,24 +322,32 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
podStateManager.increasePacketNumber();
boolean gotResponseFromRileyLink = false;
while (System.currentTimeMillis() < timeoutTime) {
OmnipodPacket response;
try {
response = (OmnipodPacket) sendAndListen(packet, responseTimeoutMilliseconds, repeatCount, 9, preambleExtensionMilliseconds);
} catch (RileyLinkCommunicationException | OmnipodException ex) {
response = sendAndListen(packet, responseTimeoutMilliseconds, repeatCount, 9, preambleExtensionMilliseconds);
gotResponseFromRileyLink = true;
} catch (RileyLinkCommunicationException ex) {
if (ex.getErrorCode() != RileyLinkBLEError.NoResponse) {
gotResponseFromRileyLink = true;
}
aapsLogger.debug(LTag.PUMPBTCOMM, "Ignoring exception in exchangePackets: " + ex.getClass().getSimpleName() + ": " + ex.getMessage());
continue;
} catch (OmnipodException ex) {
gotResponseFromRileyLink = true;
aapsLogger.debug(LTag.PUMPBTCOMM, "Ignoring exception in exchangePackets: " + ex.getClass().getSimpleName() + ": " + ex.getMessage());
continue;
} catch (Exception ex) {
throw new CommunicationException(CommunicationException.Type.UNEXPECTED_EXCEPTION, ex);
throw new RileyLinkUnexpectedException(ex);
}
if (response == null) {
aapsLogger.debug(LTag.PUMPBTCOMM, "exchangePackets response is null");
continue;
} else if (!response.isValid()) {
if (!response.isValid()) {
aapsLogger.debug(LTag.PUMPBTCOMM, "exchangePackets response is invalid: " + response);
continue;
}
if (response.getAddress() != packet.getAddress() &&
response.getAddress() != OmnipodConstants.DEFAULT_ADDRESS) { // In some (strange) cases, the Pod remains a packet address of 0xffffffff during it's lifetime
aapsLogger.debug(LTag.PUMPBTCOMM, "Packet address " + response.getAddress() + " doesn't match " + packet.getAddress());
@ -371,7 +364,12 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
return response;
}
throw new CommunicationException(CommunicationException.Type.TIMEOUT);
if (gotResponseFromRileyLink) {
throw new RileyLinkTimeoutException();
}
throw new RileyLinkUnreachableException();
}
}

View file

@ -11,6 +11,7 @@ import android.view.View
import android.view.ViewGroup
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.Constants
import info.nightscout.androidaps.activities.ErrorHelperActivity
import info.nightscout.androidaps.events.EventPreferenceChange
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.CommandQueueProvider
@ -22,15 +23,14 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyL
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData
import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.R
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodCommandType
import info.nightscout.androidaps.plugins.pump.omnipod.definition.OmnipodStatusRequestType
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.OmnipodConstants
import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProgressStatus
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager
import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPumpValuesChanged
import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager
import info.nightscout.androidaps.plugins.pump.omnipod.queue.command.*
import info.nightscout.androidaps.plugins.pump.omnipod.util.AapsOmnipodUtil
import info.nightscout.androidaps.queue.commands.Command
import info.nightscout.androidaps.queue.Callback
import info.nightscout.androidaps.queue.events.EventQueueChanged
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
@ -92,11 +92,6 @@ class OmnipodFragment : DaggerFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
omnipod_button_resume_delivery.setOnClickListener {
disablePodActionButtons()
commandQueue.startPump(null)
}
omnipod_button_pod_mgmt.setOnClickListener {
if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
activity?.let { activity ->
@ -110,10 +105,16 @@ class OmnipodFragment : DaggerFragment() {
}
}
omnipod_button_resume_delivery.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandResumeDelivery(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_resume_delivery), true).messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_delivery_resumed)))
}
omnipod_button_refresh_status.setOnClickListener {
disablePodActionButtons()
omnipodPumpPlugin.addPodStatusRequest(OmnipodStatusRequestType.GET_POD_STATE);
commandQueue.readStatus("Clicked Refresh", null)
commandQueue.customCommand(CommandGetPodStatus(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_refresh_status), false))
}
omnipod_button_rileylink_stats.setOnClickListener {
@ -126,26 +127,29 @@ class OmnipodFragment : DaggerFragment() {
omnipod_button_acknowledge_active_alerts.setOnClickListener {
disablePodActionButtons()
omnipodPumpPlugin.addPodStatusRequest(OmnipodStatusRequestType.ACKNOWLEDGE_ALERTS);
commandQueue.readStatus("Clicked Acknowledge Alert", null)
commandQueue.customCommand(CommandAcknowledgeAlerts(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_acknowledge_alerts), false)
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_acknowledged_alerts)))
}
omnipod_button_suspend_delivery.setOnClickListener {
disablePodActionButtons()
omnipodPumpPlugin.addPodStatusRequest(OmnipodStatusRequestType.SUSPEND_DELIVERY);
commandQueue.readStatus("Clicked Suspend Delivery", null)
commandQueue.customCommand(CommandSuspendDelivery(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_suspend_delivery), true)
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_suspended_delivery)))
}
omnipod_button_set_time.setOnClickListener {
disablePodActionButtons()
omnipodPumpPlugin.addPodStatusRequest(OmnipodStatusRequestType.SET_TIME);
commandQueue.readStatus("Clicked Set Time", null)
commandQueue.customCommand(CommandHandleTimeChange(true),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_set_time), true)
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_confirmation_time_on_pod_updated)))
}
omnipod_button_pulse_log.setOnClickListener {
disablePodActionButtons()
omnipodPumpPlugin.addPodStatusRequest(OmnipodStatusRequestType.GET_PULSE_LOG);
commandQueue.readStatus("Clicked Pulse Log", null)
commandQueue.customCommand(CommandReadPulseLog(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_error_failed_to_read_pulse_log), false))
}
}
@ -219,7 +223,7 @@ class OmnipodFragment : DaggerFragment() {
updateTempBasal()
updatePodStatus()
val errors = ArrayList<String>();
val errors = ArrayList<String>()
if (omnipodPumpPlugin.rileyLinkService != null) {
val rileyLinkErrorDescription = omnipodPumpPlugin.rileyLinkService.errorDescription
if (StringUtils.isNotEmpty(rileyLinkErrorDescription)) {
@ -285,7 +289,7 @@ class OmnipodFragment : DaggerFragment() {
// total delivered
omnipod_total_delivered.text = if (podStateManager.isPodActivationCompleted && podStateManager.totalInsulinDelivered != null) {
resourceHelper.gs(R.string.omnipod_total_delivered, podStateManager.totalInsulinDelivered - OmnipodConstants.POD_SETUP_UNITS);
resourceHelper.gs(R.string.omnipod_total_delivered, podStateManager.totalInsulinDelivered - OmnipodConstants.POD_SETUP_UNITS)
} else {
PLACEHOLDER
}
@ -376,7 +380,7 @@ class OmnipodFragment : DaggerFragment() {
private fun updateLastBolus() {
if (podStateManager.isPodActivationCompleted && podStateManager.hasLastBolus()) {
var text = resourceHelper.gs(R.string.omnipod_last_bolus, omnipodPumpPlugin.model().determineCorrectBolusSize(podStateManager.lastBolusAmount), resourceHelper.gs(R.string.insulin_unit_shortname), readableDuration(podStateManager.lastBolusStartTime))
var text = resourceHelper.gs(R.string.omnipod_last_bolus_value, omnipodPumpPlugin.model().determineCorrectBolusSize(podStateManager.lastBolusAmount), resourceHelper.gs(R.string.insulin_unit_shortname), readableDuration(podStateManager.lastBolusStartTime))
val textColor: Int
if (podStateManager.isLastBolusCertain) {
@ -386,7 +390,7 @@ class OmnipodFragment : DaggerFragment() {
text += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")"
}
omnipod_last_bolus.text = text;
omnipod_last_bolus.text = text
omnipod_last_bolus.setTextColor(textColor)
} else {
@ -399,15 +403,15 @@ class OmnipodFragment : DaggerFragment() {
if (podStateManager.isPodActivationCompleted && podStateManager.isTempBasalRunning) {
val now = DateTime.now()
val startTime = podStateManager.tempBasalStartTime;
val startTime = podStateManager.tempBasalStartTime
val amount = podStateManager.tempBasalAmount
val duration = podStateManager.tempBasalDuration;
val duration = podStateManager.tempBasalDuration
val minutesRunning = Duration(startTime, now).standardMinutes
var text: String
val textColor: Int
text = resourceHelper.gs(R.string.omnipod_temp_basal, amount, dateUtil.timeString(startTime.millis), minutesRunning, duration.standardMinutes)
text = resourceHelper.gs(R.string.omnipod_temp_basal_value, amount, dateUtil.timeString(startTime.millis), minutesRunning, duration.standardMinutes)
if (podStateManager.isTempBasalCertain) {
textColor = Color.WHITE
} else {
@ -415,7 +419,7 @@ class OmnipodFragment : DaggerFragment() {
text += " (" + resourceHelper.gs(R.string.omnipod_uncertain) + ")"
}
omnipod_temp_basal.text = text;
omnipod_temp_basal.text = text
omnipod_temp_basal.setTextColor(textColor)
} else {
omnipod_temp_basal.text = PLACEHOLDER
@ -456,8 +460,7 @@ class OmnipodFragment : DaggerFragment() {
}
private fun updateResumeDeliveryButton() {
val queueEmptyOrStartingPump = isQueueEmpty() || commandQueue.isRunning(Command.CommandType.START_PUMP)
if (podStateManager.isPodActivationCompleted && podStateManager.isSuspended && queueEmptyOrStartingPump) {
if (podStateManager.isPodRunning && (podStateManager.isSuspended || commandQueue.isCustomCommandInQueue(CommandResumeDelivery::class.java))) {
omnipod_button_resume_delivery.visibility = View.VISIBLE
omnipod_button_resume_delivery.isEnabled = rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
} else {
@ -466,7 +469,7 @@ class OmnipodFragment : DaggerFragment() {
}
private fun updateAcknowledgeAlertsButton() {
if (podStateManager.isPodRunning && podStateManager.hasActiveAlerts()) {
if (podStateManager.isPodRunning && (podStateManager.hasActiveAlerts() || commandQueue.isCustomCommandInQueue(CommandAcknowledgeAlerts::class.java))) {
omnipod_button_acknowledge_active_alerts.visibility = View.VISIBLE
omnipod_button_acknowledge_active_alerts.isEnabled = rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
} else {
@ -476,7 +479,7 @@ class OmnipodFragment : DaggerFragment() {
private fun updateSuspendDeliveryButton() {
// If the Pod is currently suspended, we show the Resume delivery button instead.
if (omnipodManager.isSuspendDeliveryButtonEnabled && !(podStateManager.isPodRunning && podStateManager.isSuspended)) {
if (omnipodManager.isSuspendDeliveryButtonEnabled && podStateManager.isPodRunning && (!podStateManager.isSuspended || commandQueue.isCustomCommandInQueue(CommandSuspendDelivery::class.java))) {
omnipod_button_suspend_delivery.visibility = View.VISIBLE
omnipod_button_suspend_delivery.isEnabled = podStateManager.isPodRunning && !podStateManager.isSuspended && rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
} else {
@ -485,7 +488,7 @@ class OmnipodFragment : DaggerFragment() {
}
private fun updateSetTimeButton() {
if (podStateManager.isPodRunning && (podStateManager.timeDeviatesMoreThan(Duration.standardMinutes(5)) || omnipodPumpPlugin.currentCommand == OmnipodCommandType.SET_TIME)) {
if (podStateManager.isPodRunning && (podStateManager.timeDeviatesMoreThan(Duration.standardMinutes(5)) || commandQueue.isCustomCommandInQueue(CommandHandleTimeChange::class.java))) {
omnipod_button_set_time.visibility = View.VISIBLE
omnipod_button_set_time.isEnabled = !podStateManager.isSuspended && rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
} else {
@ -504,8 +507,29 @@ class OmnipodFragment : DaggerFragment() {
private fun displayNotConfiguredDialog() {
context?.let {
OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning),
resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null)
UIRunnable(Runnable {
OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning),
resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null)
}).run()
}
}
private fun displayErrorDialog(title: String, message: String, withSound: Boolean) {
context?.let {
val i = Intent(it, ErrorHelperActivity::class.java)
i.putExtra("soundid", if (withSound) R.raw.boluserror else 0)
i.putExtra("status", message)
i.putExtra("title", title)
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
it.startActivity(i)
}
}
private fun displayOkDialog(title: String, message: String) {
context?.let {
UIRunnable(Runnable {
OKDialog.show(it, title, message, null)
}).run()
}
}
@ -568,4 +592,24 @@ class OmnipodFragment : DaggerFragment() {
return Duration.standardMinutes(sp.getInt(resourceHelper.gs(R.string.key_pump_unreachable_threshold_minutes), Constants.DEFAULT_PUMP_UNREACHABLE_THRESHOLD_MINUTES).toLong())
}
inner class DisplayResultDialogCallback(private val errorMessagePrefix: String, private val withSoundOnError: Boolean) : Callback() {
private var messageOnSuccess: String? = null
override fun run() {
if (result.success) {
val messageOnSuccess = this.messageOnSuccess
if (messageOnSuccess != null) {
displayOkDialog(resourceHelper.gs(R.string.omnipod_confirmation), messageOnSuccess)
}
} else {
displayErrorDialog(resourceHelper.gs(R.string.omnipod_warning), resourceHelper.gs(R.string.omnipod_two_strings_concatenated_by_colon, errorMessagePrefix, result.comment), withSoundOnError)
}
}
fun messageOnSuccess(message: String): DisplayResultDialogCallback {
messageOnSuccess = message
return this
}
}
}

View file

@ -250,7 +250,7 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
case SET_TEMPORARY_BASAL: {
TempBasalPair tempBasalPair = aapsOmnipodUtil.getGsonInstance().fromJson(historyEntry.getData(), TempBasalPair.class);
valueView.setText(resourceHelper.gs(R.string.omnipod_cmd_tbr_value, tempBasalPair.getInsulinRate(), tempBasalPair.getDurationMinutes()));
valueView.setText(resourceHelper.gs(R.string.omnipod_history_tbr_value, tempBasalPair.getInsulinRate(), tempBasalPair.getDurationMinutes()));
}
break;
@ -265,9 +265,9 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
case SET_BOLUS: {
if (historyEntry.getData().contains(";")) {
String[] splitVal = historyEntry.getData().split(";");
valueView.setText(resourceHelper.gs(R.string.omnipod_cmd_bolus_value_with_carbs, Double.valueOf(splitVal[0]), Double.valueOf(splitVal[1])));
valueView.setText(resourceHelper.gs(R.string.omnipod_history_bolus_value_with_carbs, Double.valueOf(splitVal[0]), Double.valueOf(splitVal[1])));
} else {
valueView.setText(resourceHelper.gs(R.string.omnipod_cmd_bolus_value, Double.valueOf(historyEntry.getData())));
valueView.setText(resourceHelper.gs(R.string.omnipod_history_bolus_value, Double.valueOf(historyEntry.getData())));
}
}
break;
@ -281,7 +281,7 @@ public class PodHistoryActivity extends NoSplashAppCompatActivity {
case CONFIGURE_ALERTS:
case CANCEL_BOLUS:
case DEACTIVATE_POD:
case RESET_POD_STATE:
case DISCARD_POD_STATE:
case ACKNOWLEDGE_ALERTS:
case SUSPEND_DELIVERY:
case RESUME_DELIVERY:

View file

@ -20,11 +20,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.definition.PodProg
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager
import info.nightscout.androidaps.plugins.pump.omnipod.event.EventOmnipodPumpValuesChanged
import info.nightscout.androidaps.plugins.pump.omnipod.manager.AapsOmnipodManager
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.defs.PodActionType
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.FullInitPodWizardModel
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.RemovePodWizardModel
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.model.ShortInitPodWizardModel
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.pages.InitPodRefreshAction
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
import info.nightscout.androidaps.utils.extensions.plusAssign
@ -93,15 +91,11 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
private fun initPodAction() {
val pagerSettings = WizardPagerSettings()
var refreshAction = InitPodRefreshAction(injector, PodActionType.INIT_POD)
pagerSettings.setWizardStepsWayType(WizardStepsWayType.CancelNext)
pagerSettings.setFinishStringResourceId(R.string.close)
pagerSettings.setFinishButtonBackground(R.drawable.finish_background)
pagerSettings.setNextButtonBackground(R.drawable.selectable_item_background)
pagerSettings.setBackStringResourceId(R.string.cancel)
pagerSettings.cancelAction = refreshAction
pagerSettings.finishAction = refreshAction
pagerSettings.pagerAdapterBehavior = FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
val wizardPagerContext = WizardPagerContext.getInstance()
@ -121,15 +115,12 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
private fun deactivatePodAction() {
val pagerSettings = WizardPagerSettings()
var refreshAction = InitPodRefreshAction(injector, PodActionType.DEACTIVATE_POD)
pagerSettings.setWizardStepsWayType(WizardStepsWayType.CancelNext)
pagerSettings.setFinishStringResourceId(R.string.close)
pagerSettings.setFinishButtonBackground(R.drawable.finish_background)
pagerSettings.setNextButtonBackground(R.drawable.selectable_item_background)
pagerSettings.setBackStringResourceId(R.string.cancel)
pagerSettings.cancelAction = refreshAction
pagerSettings.finishAction = refreshAction
pagerSettings.pagerAdapterBehavior = FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT
val wizardPagerContext = WizardPagerContext.getInstance();
@ -145,7 +136,7 @@ class PodManagementActivity : NoSplashAppCompatActivity() {
private fun discardPodAction() {
OKDialog.showConfirmation(this,
resourceHelper.gs(R.string.omnipod_cmd_discard_pod_desc), Thread {
resourceHelper.gs(R.string.omnipod_discard_pod_state_confirmation), Thread {
aapsOmnipodManager.discardPodState()
rxBus.send(EventOmnipodPumpValuesChanged())
})

View file

@ -1,93 +0,0 @@
package info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.pages;
import com.atech.android.library.wizardpager.defs.action.AbstractCancelAction;
import com.atech.android.library.wizardpager.defs.action.FinishActionInterface;
import org.json.JSONException;
import org.json.JSONObject;
import javax.inject.Inject;
import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface;
import info.nightscout.androidaps.interfaces.ProfileFunction;
import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.ui.wizard.defs.PodActionType;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.sharedPreferences.SP;
/**
* Created by andy on 12/11/2019
*/
public class InitPodRefreshAction extends AbstractCancelAction implements FinishActionInterface {
private final PodActionType actionType;
private final HasAndroidInjector injector;
@Inject PodStateManager podStateManager;
@Inject AAPSLogger aapsLogger;
@Inject SP sp;
@Inject NSUpload nsUpload;
@Inject DatabaseHelperInterface databaseHelper;
@Inject ProfileFunction profileFunction;
public InitPodRefreshAction(HasAndroidInjector injector, PodActionType actionType) {
this.injector = injector;
injector.androidInjector().inject(this);
this.actionType = actionType;
}
@Override
public void execute(String cancelReason) {
if (cancelReason != null && cancelReason.trim().length() > 0) {
this.cancelActionText = cancelReason;
}
}
@Override
public void execute() {
if (actionType == PodActionType.INIT_POD) {
if (podStateManager.isPodRunning()) {
uploadCareportalEvent(System.currentTimeMillis() - 2000, CareportalEvent.PUMPBATTERYCHANGE);
uploadCareportalEvent(System.currentTimeMillis() - 1000, CareportalEvent.INSULINCHANGE);
uploadCareportalEvent(System.currentTimeMillis(), CareportalEvent.SITECHANGE);
}
}
}
private void uploadCareportalEvent(long date, String event) {
if (databaseHelper.getCareportalEventFromTimestamp(date) != null)
return;
try {
JSONObject data = new JSONObject();
String enteredBy = sp.getString("careportal_enteredby", "");
if (enteredBy.isEmpty()) {
data.put("enteredBy", enteredBy);
}
data.put("created_at", DateUtil.toISOString(date));
data.put("mills", date);
data.put("eventType", event);
data.put("units", profileFunction.getUnits());
CareportalEvent careportalEvent = new CareportalEvent(injector);
careportalEvent.date = date;
careportalEvent.source = Source.USER;
careportalEvent.eventType = event;
careportalEvent.json = data.toString();
databaseHelper.createOrUpdate(careportalEvent);
nsUpload.uploadCareportalEntryToNS(data);
} catch (JSONException e) {
aapsLogger.error(LTag.PUMPCOMM, "Unhandled exception when uploading SiteChange event.", e);
}
}
@Override
public String getFinishActionText() {
return "Finish_OK";
}
}

View file

@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#72a8ff"
android:pathData="M22,5.72l-4.6,-3.86 -1.29,1.53 4.6,3.86L22,5.72zM7.88,3.39L6.6,1.86 2,5.71l1.29,1.53 4.59,-3.85zM12.5,8L11,8v6l4.75,2.85 0.75,-1.23 -4,-2.37L12.5,8zM12,4c-4.97,0 -9,4.03 -9,9s4.02,9 9,9c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,20c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z"/>
android:pathData="M22,5.72l-4.6,-3.86 -1.29,1.53 4.6,3.86L22,5.72zM7.88,3.39L6.6,1.86 2,5.71l1.29,1.53 4.59,-3.85zM12.5,8L11,8v6l4.75,2.85 0.75,-1.23 -4,-2.37L12.5,8zM12,4c-4.97,0 -9,4.03 -9,9s4.02,9 9,9c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,20c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z" />
</vector>

View file

@ -3,7 +3,7 @@
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18.71,11.606h-0.736c-0.198,-3.001 -2.579,-5.382 -5.58,-5.58V5.29c0,-0.218 -0.177,-0.394 -0.394,-0.394s-0.394,0.177 -0.394,0.394v0.736c-3.001,0.198 -5.382,2.579 -5.58,5.58H5.29c-0.218,0 -0.394,0.177 -0.394,0.394s0.177,0.394 0.394,0.394h0.736c0.198,3.001 2.579,5.382 5.58,5.58v0.736c0,0.217 0.177,0.394 0.394,0.394s0.394,-0.177 0.394,-0.394v-0.736c3.001,-0.198 5.382,-2.579 5.58,-5.58h0.736c0.217,0 0.394,-0.177 0.394,-0.394S18.927,11.606 18.71,11.606zM17.143,11.606h-1.944c-0.179,-1.478 -1.331,-2.643 -2.804,-2.841V6.85C14.939,7.044 16.953,9.06 17.143,11.606zM13.542,12.394h0.938c-0.171,1.079 -1.01,1.93 -2.085,2.115v-0.967c0,-0.217 -0.177,-0.394 -0.394,-0.394s-0.394,0.177 -0.394,0.394v0.975c-1.111,-0.156 -1.988,-1.017 -2.163,-2.122h1.016c0.218,0 0.394,-0.177 0.394,-0.394s-0.177,-0.394 -0.394,-0.394H9.442c0.171,-1.111 1.049,-1.978 2.164,-2.134v0.987c0,0.218 0.177,0.394 0.394,0.394s0.394,-0.177 0.394,-0.394v-0.98c1.079,0.185 1.92,1.041 2.086,2.126h-0.939c-0.217,0 -0.394,0.177 -0.394,0.394S13.324,12.394 13.542,12.394zM11.606,6.851v1.906C10.095,8.921 8.903,10.1 8.72,11.606H6.864C7.053,9.062 9.064,7.047 11.606,6.851zM6.866,12.394H8.72c0.183,1.505 1.374,2.684 2.885,2.849v1.884C9.071,16.931 7.065,14.928 6.866,12.394zM12.394,17.128v-1.893c1.473,-0.197 2.625,-1.362 2.804,-2.841h1.942C16.941,14.93 14.932,16.935 12.394,17.128z"
android:fillColor="#36FF00"/>
<path
android:pathData="M18.71,11.606h-0.736c-0.198,-3.001 -2.579,-5.382 -5.58,-5.58V5.29c0,-0.218 -0.177,-0.394 -0.394,-0.394s-0.394,0.177 -0.394,0.394v0.736c-3.001,0.198 -5.382,2.579 -5.58,5.58H5.29c-0.218,0 -0.394,0.177 -0.394,0.394s0.177,0.394 0.394,0.394h0.736c0.198,3.001 2.579,5.382 5.58,5.58v0.736c0,0.217 0.177,0.394 0.394,0.394s0.394,-0.177 0.394,-0.394v-0.736c3.001,-0.198 5.382,-2.579 5.58,-5.58h0.736c0.217,0 0.394,-0.177 0.394,-0.394S18.927,11.606 18.71,11.606zM17.143,11.606h-1.944c-0.179,-1.478 -1.331,-2.643 -2.804,-2.841V6.85C14.939,7.044 16.953,9.06 17.143,11.606zM13.542,12.394h0.938c-0.171,1.079 -1.01,1.93 -2.085,2.115v-0.967c0,-0.217 -0.177,-0.394 -0.394,-0.394s-0.394,0.177 -0.394,0.394v0.975c-1.111,-0.156 -1.988,-1.017 -2.163,-2.122h1.016c0.218,0 0.394,-0.177 0.394,-0.394s-0.177,-0.394 -0.394,-0.394H9.442c0.171,-1.111 1.049,-1.978 2.164,-2.134v0.987c0,0.218 0.177,0.394 0.394,0.394s0.394,-0.177 0.394,-0.394v-0.98c1.079,0.185 1.92,1.041 2.086,2.126h-0.939c-0.217,0 -0.394,0.177 -0.394,0.394S13.324,12.394 13.542,12.394zM11.606,6.851v1.906C10.095,8.921 8.903,10.1 8.72,11.606H6.864C7.053,9.062 9.064,7.047 11.606,6.851zM6.866,12.394H8.72c0.183,1.505 1.374,2.684 2.885,2.849v1.884C9.071,16.931 7.065,14.928 6.866,12.394zM12.394,17.128v-1.893c1.473,-0.197 2.625,-1.362 2.804,-2.841h1.942C16.941,14.93 14.932,16.935 12.394,17.128z"
android:fillColor="#36FF00" />
</vector>

View file

@ -3,19 +3,19 @@
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,17.813m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
android:fillColor="#E93057"/>
<path
android:pathData="M19.357,6.125c0.195,-0.196 0.195,-0.512 0,-0.708c-0.195,-0.195 -0.512,-0.195 -0.707,0l-2.364,2.364C14.916,7.314 13.477,7.062 12,7.062c-2.902,0 -5.674,0.925 -8.015,2.675c-0.222,0.166 -0.267,0.479 -0.102,0.7c0.166,0.222 0.479,0.266 0.7,0.102C6.751,8.919 9.315,8.063 12,8.063c1.198,0 2.369,0.177 3.493,0.512l-1.829,1.829c-0.547,-0.093 -1.1,-0.154 -1.663,-0.154c-2.212,0 -4.325,0.705 -6.111,2.039c-0.222,0.166 -0.267,0.479 -0.102,0.701c0.166,0.221 0.478,0.267 0.7,0.101C8.099,11.887 10.005,11.25 12,11.25c0.26,0 0.516,0.022 0.773,0.044l-2.215,2.215c-1.012,0.201 -1.989,0.596 -2.839,1.231c-0.222,0.165 -0.267,0.479 -0.102,0.7c0.166,0.22 0.479,0.268 0.7,0.101c0.192,-0.143 0.392,-0.271 0.597,-0.389l-2.618,2.618c-0.195,0.195 -0.195,0.512 0,0.707c0.098,0.098 0.226,0.146 0.354,0.146s0.256,-0.049 0.354,-0.146L19.357,6.125z"
android:fillColor="#E93057"/>
<path
android:pathData="M20.016,9.737c-0.562,-0.42 -1.15,-0.789 -1.757,-1.113L17.513,9.37c0.66,0.331 1.299,0.717 1.903,1.169c0.09,0.067 0.195,0.1 0.3,0.1c0.152,0 0.303,-0.069 0.4,-0.201C20.282,10.216 20.236,9.902 20.016,9.737z"
android:fillColor="#E93057"/>
<path
android:pathData="M15.867,11.016l-0.776,0.776c0.856,0.307 1.671,0.739 2.421,1.298c0.09,0.067 0.195,0.1 0.3,0.1c0.152,0 0.303,-0.069 0.4,-0.2c0.166,-0.222 0.12,-0.535 -0.101,-0.701C17.409,11.764 16.656,11.341 15.867,11.016z"
android:fillColor="#E93057"/>
<path
android:pathData="M13.394,13.489l-0.887,0.887c1.13,0.091 2.24,0.467 3.176,1.166c0.09,0.067 0.195,0.1 0.3,0.1c0.152,0 0.303,-0.069 0.4,-0.2c0.166,-0.222 0.12,-0.535 -0.101,-0.7C15.418,14.095 14.424,13.688 13.394,13.489z"
android:fillColor="#E93057"/>
<path
android:pathData="M12,17.813m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
android:fillColor="#E93057" />
<path
android:pathData="M19.357,6.125c0.195,-0.196 0.195,-0.512 0,-0.708c-0.195,-0.195 -0.512,-0.195 -0.707,0l-2.364,2.364C14.916,7.314 13.477,7.062 12,7.062c-2.902,0 -5.674,0.925 -8.015,2.675c-0.222,0.166 -0.267,0.479 -0.102,0.7c0.166,0.222 0.479,0.266 0.7,0.102C6.751,8.919 9.315,8.063 12,8.063c1.198,0 2.369,0.177 3.493,0.512l-1.829,1.829c-0.547,-0.093 -1.1,-0.154 -1.663,-0.154c-2.212,0 -4.325,0.705 -6.111,2.039c-0.222,0.166 -0.267,0.479 -0.102,0.701c0.166,0.221 0.478,0.267 0.7,0.101C8.099,11.887 10.005,11.25 12,11.25c0.26,0 0.516,0.022 0.773,0.044l-2.215,2.215c-1.012,0.201 -1.989,0.596 -2.839,1.231c-0.222,0.165 -0.267,0.479 -0.102,0.7c0.166,0.22 0.479,0.268 0.7,0.101c0.192,-0.143 0.392,-0.271 0.597,-0.389l-2.618,2.618c-0.195,0.195 -0.195,0.512 0,0.707c0.098,0.098 0.226,0.146 0.354,0.146s0.256,-0.049 0.354,-0.146L19.357,6.125z"
android:fillColor="#E93057" />
<path
android:pathData="M20.016,9.737c-0.562,-0.42 -1.15,-0.789 -1.757,-1.113L17.513,9.37c0.66,0.331 1.299,0.717 1.903,1.169c0.09,0.067 0.195,0.1 0.3,0.1c0.152,0 0.303,-0.069 0.4,-0.201C20.282,10.216 20.236,9.902 20.016,9.737z"
android:fillColor="#E93057" />
<path
android:pathData="M15.867,11.016l-0.776,0.776c0.856,0.307 1.671,0.739 2.421,1.298c0.09,0.067 0.195,0.1 0.3,0.1c0.152,0 0.303,-0.069 0.4,-0.2c0.166,-0.222 0.12,-0.535 -0.101,-0.701C17.409,11.764 16.656,11.341 15.867,11.016z"
android:fillColor="#E93057" />
<path
android:pathData="M13.394,13.489l-0.887,0.887c1.13,0.091 2.24,0.467 3.176,1.166c0.09,0.067 0.195,0.1 0.3,0.1c0.152,0 0.303,-0.069 0.4,-0.2c0.166,-0.222 0.12,-0.535 -0.101,-0.7C15.418,14.095 14.424,13.688 13.394,13.489z"
android:fillColor="#E93057" />
</vector>

View file

@ -3,10 +3,10 @@
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M16.578,18.026l0,-11.042l-3.698,0l0,11.042l-9.363,0l0,-1.01l8.354,0l0,-11.041l5.717,0l0,11.041l1.645,0l0,1.01z"
android:fillColor="#E93057"/>
<path
android:pathData="M2.852,13.946c-0.248,0 -0.498,-0.123 -0.74,-0.366c-0.49,-0.49 -0.492,-0.986 -0.004,-1.474l3.125,-3.125C5.106,8.737 5.048,8.435 5.048,8.136c0,-1.336 1.172,-2.508 2.508,-2.508c0.282,0 0.572,0.055 0.864,0.163c0.186,0.069 0.347,0.148 0.493,0.242L8.547,6.484L7.431,7.6l0.731,0.661l1.046,-1.116l0.374,-0.374c0.171,0.154 0.25,0.315 0.319,0.501c0.108,0.292 0.163,0.583 0.163,0.864c0,0.67 -0.261,1.3 -0.734,1.773c-0.473,0.474 -1.103,0.734 -1.773,0.735c-0.298,0 -0.6,-0.058 -0.898,-0.173l-3.072,3.113C3.346,13.824 3.099,13.946 2.852,13.946zM7.556,6.237c-0.507,0 -0.984,0.198 -1.342,0.556C5.855,7.152 5.657,7.629 5.657,8.136c0,0.153 0.024,0.313 0.076,0.5c0.046,0.168 0.114,0.326 0.2,0.47l0.022,0.037c0,0 -0.139,0.115 -0.168,0.146l-3.249,3.248c-0.26,0.26 -0.227,0.381 0.004,0.612c0.134,0.134 0.219,0.186 0.304,0.186c0.085,0 0.184,-0.058 0.308,-0.182l3.249,-3.249c0.03,-0.03 0.104,-0.12 0.104,-0.12l0.078,-0.026c0.146,0.087 0.304,0.155 0.471,0.2c0.186,0.052 0.344,0.076 0.499,0.076c1.009,0 1.896,-0.887 1.898,-1.898c0,-0.134 -0.018,-0.274 -0.054,-0.43L8.342,8.872C8.284,8.929 8.208,8.961 8.126,8.961c-0.081,0 -0.158,-0.032 -0.215,-0.089L6.82,7.78c-0.119,-0.119 -0.119,-0.313 0,-0.431l1.143,-1.142C7.886,6.235 7.807,6.241 7.729,6.241C7.67,6.241 7.556,6.237 7.556,6.237z"
android:fillColor="#E93057"/>
<path
android:pathData="M16.578,18.026l0,-11.042l-3.698,0l0,11.042l-9.363,0l0,-1.01l8.354,0l0,-11.041l5.717,0l0,11.041l1.645,0l0,1.01z"
android:fillColor="#E93057" />
<path
android:pathData="M2.852,13.946c-0.248,0 -0.498,-0.123 -0.74,-0.366c-0.49,-0.49 -0.492,-0.986 -0.004,-1.474l3.125,-3.125C5.106,8.737 5.048,8.435 5.048,8.136c0,-1.336 1.172,-2.508 2.508,-2.508c0.282,0 0.572,0.055 0.864,0.163c0.186,0.069 0.347,0.148 0.493,0.242L8.547,6.484L7.431,7.6l0.731,0.661l1.046,-1.116l0.374,-0.374c0.171,0.154 0.25,0.315 0.319,0.501c0.108,0.292 0.163,0.583 0.163,0.864c0,0.67 -0.261,1.3 -0.734,1.773c-0.473,0.474 -1.103,0.734 -1.773,0.735c-0.298,0 -0.6,-0.058 -0.898,-0.173l-3.072,3.113C3.346,13.824 3.099,13.946 2.852,13.946zM7.556,6.237c-0.507,0 -0.984,0.198 -1.342,0.556C5.855,7.152 5.657,7.629 5.657,8.136c0,0.153 0.024,0.313 0.076,0.5c0.046,0.168 0.114,0.326 0.2,0.47l0.022,0.037c0,0 -0.139,0.115 -0.168,0.146l-3.249,3.248c-0.26,0.26 -0.227,0.381 0.004,0.612c0.134,0.134 0.219,0.186 0.304,0.186c0.085,0 0.184,-0.058 0.308,-0.182l3.249,-3.249c0.03,-0.03 0.104,-0.12 0.104,-0.12l0.078,-0.026c0.146,0.087 0.304,0.155 0.471,0.2c0.186,0.052 0.344,0.076 0.499,0.076c1.009,0 1.896,-0.887 1.898,-1.898c0,-0.134 -0.018,-0.274 -0.054,-0.43L8.342,8.872C8.284,8.929 8.208,8.961 8.126,8.961c-0.081,0 -0.158,-0.032 -0.215,-0.089L6.82,7.78c-0.119,-0.119 -0.119,-0.313 0,-0.431l1.143,-1.142C7.886,6.235 7.807,6.241 7.729,6.241C7.67,6.241 7.556,6.237 7.556,6.237z"
android:fillColor="#E93057" />
</vector>

View file

@ -3,7 +3,7 @@
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M23.706,7.373c-0.149,-0.541 -0.728,-0.854 -1.294,-0.699L19.87,7.373c-0.325,-0.913 -1.301,-1.438 -2.255,-1.175l-3.008,0.826c-0.954,0.262 -1.525,1.212 -1.338,2.163l-2.542,0.698c-0.499,0.137 -0.799,0.593 -0.767,1.07c-1.696,0.439 -3.037,0.067 -4.101,-0.248c-1.047,-0.309 -1.951,-0.578 -2.713,0.152c-1.307,1.253 -0.369,2.87 0.384,4.17c0.501,0.863 1.019,1.757 0.766,2.3c-0.519,1.124 -2.729,1.128 -3.537,1.033c-0.203,-0.022 -0.392,0.122 -0.417,0.328c-0.024,0.206 0.123,0.391 0.329,0.414c0.086,0.01 1.376,0.152 2.554,-0.172c0.734,-0.202 1.424,-0.585 1.753,-1.292c0.416,-0.896 -0.173,-1.912 -0.797,-2.987c-0.844,-1.456 -1.336,-2.47 -0.515,-3.257c0.426,-0.409 0.972,-0.272 1.977,0.026c1.128,0.334 2.648,0.808 4.674,0.215c0.255,0.206 0.598,0.304 0.949,0.207l5.63,-1.547l2.016,7.338l0.127,-1.203l-1.718,-6.252l5.63,-1.547C23.517,8.479 23.855,7.914 23.706,7.373z"
android:fillColor="#67DFE8"/>
<path
android:pathData="M23.706,7.373c-0.149,-0.541 -0.728,-0.854 -1.294,-0.699L19.87,7.373c-0.325,-0.913 -1.301,-1.438 -2.255,-1.175l-3.008,0.826c-0.954,0.262 -1.525,1.212 -1.338,2.163l-2.542,0.698c-0.499,0.137 -0.799,0.593 -0.767,1.07c-1.696,0.439 -3.037,0.067 -4.101,-0.248c-1.047,-0.309 -1.951,-0.578 -2.713,0.152c-1.307,1.253 -0.369,2.87 0.384,4.17c0.501,0.863 1.019,1.757 0.766,2.3c-0.519,1.124 -2.729,1.128 -3.537,1.033c-0.203,-0.022 -0.392,0.122 -0.417,0.328c-0.024,0.206 0.123,0.391 0.329,0.414c0.086,0.01 1.376,0.152 2.554,-0.172c0.734,-0.202 1.424,-0.585 1.753,-1.292c0.416,-0.896 -0.173,-1.912 -0.797,-2.987c-0.844,-1.456 -1.336,-2.47 -0.515,-3.257c0.426,-0.409 0.972,-0.272 1.977,0.026c1.128,0.334 2.648,0.808 4.674,0.215c0.255,0.206 0.598,0.304 0.949,0.207l5.63,-1.547l2.016,7.338l0.127,-1.203l-1.718,-6.252l5.63,-1.547C23.517,8.479 23.855,7.914 23.706,7.373z"
android:fillColor="#67DFE8" />
</vector>

View file

@ -3,10 +3,10 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M16.495,12.092l-4.921,-4.92l-1.444,1.444l2.468,2.467l-9.765,0l0,2.042l9.765,0l-2.468,2.467l1.444,1.444l4.921,-4.92l-0.012,-0.012z"
android:fillColor="@color/white"/>
<path
android:pathData="M18.682,2.975H5.152c-1.272,0 -2.307,1.035 -2.307,2.307v3.801h2.126V5.282c0,-0.1 0.081,-0.181 0.181,-0.181h13.53c0.1,0 0.181,0.081 0.181,0.181v13.436c0,0.1 -0.081,0.181 -0.181,0.181H5.152c-0.1,0 -0.181,-0.081 -0.181,-0.181v-3.593H2.845v3.593c0,1.272 1.035,2.307 2.307,2.307h13.53c1.272,0 2.308,-1.034 2.308,-2.307V5.282C20.989,4.01 19.954,2.975 18.682,2.975z"
android:fillColor="@color/white"/>
<path
android:pathData="M16.495,12.092l-4.921,-4.92l-1.444,1.444l2.468,2.467l-9.765,0l0,2.042l9.765,0l-2.468,2.467l1.444,1.444l4.921,-4.92l-0.012,-0.012z"
android:fillColor="@color/white" />
<path
android:pathData="M18.682,2.975H5.152c-1.272,0 -2.307,1.035 -2.307,2.307v3.801h2.126V5.282c0,-0.1 0.081,-0.181 0.181,-0.181h13.53c0.1,0 0.181,0.081 0.181,0.181v13.436c0,0.1 -0.081,0.181 -0.181,0.181H5.152c-0.1,0 -0.181,-0.081 -0.181,-0.181v-3.593H2.845v3.593c0,1.272 1.035,2.307 2.307,2.307h13.53c1.272,0 2.308,-1.034 2.308,-2.307V5.282C20.989,4.01 19.954,2.975 18.682,2.975z"
android:fillColor="@color/white" />
</vector>

View file

@ -3,10 +3,10 @@
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12.069,20.423c-4.644,0 -8.422,-3.779 -8.422,-8.423s3.778,-8.422 8.422,-8.422S20.492,7.355 20.492,12S16.713,20.423 12.069,20.423zM12.069,4.943c-3.891,0 -7.057,3.166 -7.057,7.057c0,3.891 3.166,7.057 7.057,7.057c3.891,0 7.057,-3.166 7.057,-7.057C19.126,8.109 15.961,4.943 12.069,4.943z"
android:fillColor="#67DFE8"/>
<path
android:pathData="M9.945,16.362c-0.113,0 -0.227,-0.028 -0.33,-0.085c-0.217,-0.12 -0.353,-0.349 -0.353,-0.598V8.32c0,-0.249 0.135,-0.478 0.353,-0.598c0.218,-0.12 0.485,-0.112 0.694,0.021l5.827,3.679c0.198,0.125 0.318,0.343 0.318,0.577s-0.12,0.452 -0.318,0.577l-5.827,3.679C10.198,16.326 10.072,16.362 9.945,16.362zM10.627,9.559v4.881L14.493,12L10.627,9.559z"
android:fillColor="#67DFE8"/>
<path
android:pathData="M12.069,20.423c-4.644,0 -8.422,-3.779 -8.422,-8.423s3.778,-8.422 8.422,-8.422S20.492,7.355 20.492,12S16.713,20.423 12.069,20.423zM12.069,4.943c-3.891,0 -7.057,3.166 -7.057,7.057c0,3.891 3.166,7.057 7.057,7.057c3.891,0 7.057,-3.166 7.057,-7.057C19.126,8.109 15.961,4.943 12.069,4.943z"
android:fillColor="#67DFE8" />
<path
android:pathData="M9.945,16.362c-0.113,0 -0.227,-0.028 -0.33,-0.085c-0.217,-0.12 -0.353,-0.349 -0.353,-0.598V8.32c0,-0.249 0.135,-0.478 0.353,-0.598c0.218,-0.12 0.485,-0.112 0.694,0.021l5.827,3.679c0.198,0.125 0.318,0.343 0.318,0.577s-0.12,0.452 -0.318,0.577l-5.827,3.679C10.198,16.326 10.072,16.362 9.945,16.362zM10.627,9.559v4.881L14.493,12L10.627,9.559z"
android:fillColor="#67DFE8" />
</vector>

View file

@ -3,13 +3,13 @@
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M24,9.343l-5.781,-3.968l-1.328,6.688l2.102,-1.757c0.014,0.056 0.03,0.111 0.043,0.168c0.116,0.512 0.183,1.042 0.183,1.589c0,3.952 -3.204,7.156 -7.156,7.156s-7.156,-3.204 -7.156,-7.156s3.204,-7.156 7.156,-7.156c1.072,0 2.085,0.242 2.998,0.665c0.325,0.151 0.639,0.321 0.936,0.517l0.002,-0.002l-0.352,-1.784l1.876,-0.538c-1.567,-1.033 -3.442,-1.639 -5.46,-1.639c-5.488,0 -9.938,4.449 -9.938,9.938S6.574,22 12.063,22S22,17.551 22,12.063c0,-0.759 -0.093,-1.496 -0.254,-2.206c-0.04,-0.176 -0.085,-0.35 -0.134,-0.523L24,9.343L24,9.343z"
android:fillColor="#FF1313"/>
<path
android:pathData="M10.2429,8.7408l5.0162,5.0162l-1.5026,1.5026l-5.0162,-5.0162z"
android:fillColor="#FF1313"/>
<path
android:pathData="M8.7408,13.7571l5.0162,-5.0162l1.5026,1.5026l-5.0162,5.0162z"
android:fillColor="#FF1313"/>
<path
android:pathData="M24,9.343l-5.781,-3.968l-1.328,6.688l2.102,-1.757c0.014,0.056 0.03,0.111 0.043,0.168c0.116,0.512 0.183,1.042 0.183,1.589c0,3.952 -3.204,7.156 -7.156,7.156s-7.156,-3.204 -7.156,-7.156s3.204,-7.156 7.156,-7.156c1.072,0 2.085,0.242 2.998,0.665c0.325,0.151 0.639,0.321 0.936,0.517l0.002,-0.002l-0.352,-1.784l1.876,-0.538c-1.567,-1.033 -3.442,-1.639 -5.46,-1.639c-5.488,0 -9.938,4.449 -9.938,9.938S6.574,22 12.063,22S22,17.551 22,12.063c0,-0.759 -0.093,-1.496 -0.254,-2.206c-0.04,-0.176 -0.085,-0.35 -0.134,-0.523L24,9.343L24,9.343z"
android:fillColor="#FF1313" />
<path
android:pathData="M10.2429,8.7408l5.0162,5.0162l-1.5026,1.5026l-5.0162,-5.0162z"
android:fillColor="#FF1313" />
<path
android:pathData="M8.7408,13.7571l5.0162,-5.0162l1.5026,1.5026l-5.0162,5.0162z"
android:fillColor="#FF1313" />
</vector>

View file

@ -759,7 +759,7 @@
android:drawableTop="@drawable/ic_actions_refill"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/omnipod_refresh" />
android:text="@string/omnipod_button_refresh" />
<Button
android:id="@+id/omnipod_button_pod_mgmt"
@ -770,7 +770,7 @@
android:drawableTop="@drawable/ic_danarhistory"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/omnipod_pod_mgmt" />
android:text="@string/omnipod_button_pod_management" />
<Button
android:id="@+id/omnipod_button_acknowledge_active_alerts"
@ -781,7 +781,7 @@
android:drawableTop="@drawable/ic_cp_aaps_offline"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/omnipod_acknowledge_active_alerts_short" />
android:text="@string/omnipod_button_acknowledge_active_alerts" />
<Button
android:id="@+id/omnipod_button_rileylink_stats"
@ -792,7 +792,7 @@
android:drawableTop="@drawable/ic_danarstats"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/omnipod_rl_stats" />
android:text="@string/omnipod_button_riley_link_stats" />
<Button
android:id="@+id/omnipod_button_pulse_log"
@ -803,19 +803,7 @@
android:drawableTop="@drawable/ic_cp_bolus_correction"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/omnipod_read_pulse_log_short"
android:visibility="gone" />
<Button
android:id="@+id/omnipod_button_suspend_delivery"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_loop_disabled"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/omnipod_suspend_delivery_short"
android:text="@string/omnipod_button_read_pulse_log"
android:visibility="gone" />
<Button
@ -827,7 +815,7 @@
android:drawableTop="@drawable/ic_access_alarm"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/omnipod_set_time"
android:text="@string/omnipod_button_set_time"
android:visibility="gone" />
<Button
@ -839,7 +827,19 @@
android:drawableTop="@drawable/ic_local_activate"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/omnipod_resume_delivery"
android:text="@string/omnipod_button_resume_delivery"
android:visibility="gone" />
<Button
android:id="@+id/omnipod_button_suspend_delivery"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_loop_disabled"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:text="@string/omnipod_button_suspend_delivery"
android:visibility="gone" />
</LinearLayout>

View file

@ -30,8 +30,7 @@
android:layout_marginBottom="40dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
style="@style/WizardPagePodContent"
/>
style="@style/WizardPagePodContent" />
<LinearLayout
style="@style/ButtonBar"
@ -40,7 +39,8 @@
android:orientation="horizontal">
<ListView android:id="@+id/podInfoList"
<ListView
android:id="@+id/podInfoList"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"

View file

@ -25,7 +25,8 @@
android:paddingTop="12dp"
android:paddingBottom="12dp">
<TextView android:id="@android:id/text1"
<TextView
android:id="@android:id/text1"
style="?android:textAppearanceSmall"
android:textColor="@color/text_light"
android:textAllCaps="false"
@ -35,7 +36,8 @@
android:layout_height="wrap_content"
android:layout_marginEnd="16dp" />
<TextView android:id="@android:id/text2"
<TextView
android:id="@android:id/text2"
style="?android:textAppearanceMedium"
android:layout_width="0dp"
android:layout_height="wrap_content"

View file

@ -34,7 +34,7 @@
android:layout_weight="1"
android:background="@drawable/pillborder"
android:gravity="center_horizontal"
android:text="@string/omnipod_cmd_pod_history" />
android:text="@string/omnipod_history_title" />
</LinearLayout>

View file

@ -24,7 +24,7 @@
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:gravity="center"
android:text="@string/omnipod_pod_mgmt_title"
android:text="@string/omnipod_pod_management_title"
android:textAlignment="center"
android:textSize="12pt"
android:textStyle="bold" />
@ -55,7 +55,7 @@
android:gravity="center"
android:text="@string/omnipod_waiting_for_rileylink_connection"
android:textAlignment="center"
android:textSize="8pt"/>
android:textSize="8pt" />
</LinearLayout>
<info.nightscout.androidaps.utils.ui.SingleClickButton
@ -69,7 +69,7 @@
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_cp_pump_canula"
android:text="@string/omnipod_cmd_init_pod"
android:text="@string/omnipod_button_init_pod"
android:textAllCaps="false" />
<TextView
@ -90,7 +90,7 @@
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_actions_temptarget"
android:text="@string/omnipod_cmd_deactivate_pod"
android:text="@string/omnipod_button_deactivate_pod"
android:textAllCaps="false" />
<TextView
@ -111,7 +111,7 @@
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_cp_pump_canula"
android:text="@string/omnipod_cmd_discard_pod"
android:text="@string/omnipod_button_discard_pod"
android:textAllCaps="false" />
<TextView
@ -132,7 +132,7 @@
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_danarhistory"
android:text="@string/omnipod_cmd_pod_history"
android:text="@string/omnipod_button_pod_history"
android:textAllCaps="false" />
</LinearLayout>

View file

@ -4,35 +4,172 @@
<!-- Omnipod - Base -->
<string name="description_pump_omnipod">Интеграция на помпата Omnipod, изисква RileyLink устройство (с фърмуер минимум 2.0 ) .</string>
<!-- Omnipod Configuration -->
<string name="omnipod_config_bolus_beeps_enabled">Звук при болус активен</string>
<string name="omnipod_config_basal_beeps_enabled">Звук при базал активен</string>
<string name="omnipod_config_smb_beeps_enabled">Звук при SMB активен</string>
<string name="omnipod_config_tbr_beeps_enabled">Звук при временен базал активен</string>
<string name="omnipod_config_suspend_delivery_button_enabled">Бутон за спиране на инсулина активен</string>
<string name="omnipod_config_pulse_log_button_enabled">Разрешено е бутонът за Pulse Log </string>
<string name="omnipod_config_time_change_enabled">Разрешено е Лятно часово време</string>
<string name="omnipod_config_expiration_reminder_enabled">Напомняне за срок</string>
<string name="omnipod_config_expiration_reminder_hours_before_shutdown">Часове преди изключване</string>
<string name="omnipod_config_low_reservoir_alert_enabled">Малко инсулин в резервоар</string>
<string name="omnipod_config_low_reservoir_alert_units">Брой единици</string>
<!-- Omnipod - Fragment -->
<string name="omnipod_moments_ago">Преди малко</string>
<string name="omnipod_pod_mgmt">Настройки на под</string>
<string name="omnipod_pod_status">Статус на под</string>
<string name="omnipod_total_delivered_label">Общо доставени</string>
<string name="omnipod_total_delivered">%1$.2fЕ</string>
<string name="omnipod_reservoir_left">%1$.2f Е остават</string>
<string name="omnipod_reservoir_over50">Над 50 Е</string>
<string name="omnipod_pod_address">Адрес на под</string>
<string name="omnipod_pod_expiry">Капсулата изтича</string>
<string name="omnipod_warning">Внимание</string>
<string name="omnipod_pod_status_no_active_pod">Няма активен под</string>
<string name="omnipod_pod_status_waiting_for_pair_and_prime">Настройка в прогрес (изчакване на сдвояване и пълнене)</string>
<string name="omnipod_pod_status_waiting_for_cannula_insertion">Настройка в прогрес (въвеждане на канюла)</string>
<string name="omnipod_pod_status_running">Изпълнява</string>
<string name="omnipod_pod_status_suspended">Прекратено</string>
<string name="omnipod_pod_status_pod_fault">Грешка в под</string>
<string name="omnipod_pod_status_activation_time_exceeded">Времето за активация изтече</string>
<string name="omnipod_pod_status_inactive">Неактивен</string>
<string name="omnipod_pod_status_pod_fault_description">Грешка на под: %1$s %2$s</string>
<string name="omnipod_pod_active_alerts">Сигнали за активен под</string>
<string name="omnipod_acknowledge_active_alerts_short">Потвърди аларми</string>
<!-- Omnipod - Dialogs -->
<string name="omnipod_frequency">Omnipod (433.91 MHz)</string>
<!-- Omnipod - Error -->
<string name="omnipod_error_rileylink_address_invalid">Грешен RileyLink адрес.</string>
<string name="omnipod_error_operation_not_possible_no_configuration">Забранено действие.\n\n Първо трябва да конфигурурате Omnipod , преди да използвате тази операция,.</string>
<string name="omnipod_error_operation_not_possible_no_profile">Операцията не е възможна.\n\n Трябва да изчакате няколко минути, докато AAPS се опита да зададе профил за първи път.</string>
<string name="omnipod_error_illegal_init_action_type">Неправилен PodInitActionType: %1$s</string>
<string name="omnipod_error_pod_not_attached">Няма активен под</string>
<string name="omnipod_driver_error_setup_action_verification_failed">Грешка при проверка на командата</string>
<string name="omnipod_driver_error_unexpected_exception_type">Непредвидена грешка. Моля, докладвайте! (тип: %1$s).</string>
<string name="omnipod_driver_error_invalid_parameters">Неуспешна комуникация: получени грешни входни параметри</string>
<string name="omnipod_driver_error_communication_failed_timeout">Връзката е неуспешна: таймаут</string>
<string name="omnipod_driver_error_communication_failed_unexpected_exception">Комуникацията е неуспешна: възникнала е неочаквана грешка. Моля, докладвайте!</string>
<string name="omnipod_driver_error_crc_mismatch">Неуспешна комуникация: проверката на целостта на съобщението е неуспешна</string>
<string name="omnipod_driver_error_invalid_packet_type">Неуспешна комуникация: получени грешни входни параметри</string>
<string name="omnipod_driver_error_invalid_progress_state">Съобщението е неуспешно: Pod е в лошо състояние</string>
<string name="omnipod_driver_error_invalid_response">Неуспешна комуникация: получени грешни входни параметри</string>
<string name="omnipod_driver_error_invalid_message_sequence_number">Неуспешна комуникация: получи съобщение с невалиден номер на последователност от Pod</string>
<string name="omnipod_driver_error_invalid_message_address">Неуспешна комуникация: получи съобщение с невалиден номер на последователност от Pod</string>
<string name="omnipod_driver_error_message_decoding_failed">Неуспешна комуникация: получени грешни входни параметри</string>
<string name="omnipod_driver_error_nonce_resync_failed">Комуникацията е неуспешна: nonce ресинхронизирането е неуспешно</string>
<string name="omnipod_driver_error_nonce_out_of_sync">Комуникацията е неуспешна: nonce ресинхронизирането е неуспешно</string>
<string name="omnipod_driver_error_not_enough_data">Комуникацията е неуспешна: няма достатъчно данни, получени от Pod</string>
<string name="omnipod_driver_error_pod_fault">Грешка на Pod (%1$03d %2$s). Моля, деактивирайте вашия Pod и стартирайте нов</string>
<string name="omnipod_driver_error_pod_returned_error_response">Комуникацията е неуспешна: Pod върна отговор с грешка</string>
<!-- Omnipod - Pod Mgmt -->
<string name="omnipod_pod_mgmt_title">Управление на Pod</string>
<string name="omnipod_cmd_init_pod">Инициализация на Pod</string>
<string name="omnipod_cmd_deactivate_pod">Деактивирай под</string>
<string name="omnipod_cmd_discard_pod">Премахни под</string>
<string name="omnipod_cmd_pod_history">История на под</string>
<string name="omnipod_cmd_set_bolus">Стартирай болус</string>
<string name="omnipod_cmd_cancel_bolus">Отмяна на болус</string>
<string name="omnipod_cmd_set_tbr">Приложи временен базал</string>
<string name="omnipod_cmd_cancel_tbr_by_driver">Отказ на базал</string>
<string name="omnipod_cmd_cancel_tbr">Откажи временен базал</string>
<string name="omnipod_cmd_set_basal_schedule">Задаване на график за базал</string>
<string name="omnipod_cmd_get_pod_status">Получу статус на под</string>
<string name="omnipod_cmd_get_pod_info">Получи информация за Pod</string>
<string name="omnipod_cmd_set_time">Задаване на време</string>
<string name="omnipod_cmd_configure_alerts">Конфигуриране на аларми</string>
<string name="omnipod_cmd_acknowledge_alerts">Потвърждение на аларми</string>
<string name="omnipod_cmd_suspend_delivery">Спиране на доставката на инсулин</string>
<string name="omnipod_cmd_resume_delivery">Подновяване на доставката</string>
<string name="omnipod_cmd_unknown_entry">Непознат запис</string>
<string name="omnipod_cmd_bolus_value">%1$.2fЕ</string>
<string name="omnipod_cmd_bolus_value_with_carbs">%1$.2f U, CH=%2$.1f g</string>
<string name="omnipod_cmd_tbr_value">Скорост: %1$.2f U, Продължителност: %2$d мин</string>
<string name="omnipod_cmd_discard_pod_desc">Ако натиснете <b>OK</b>, състоянието на Pod ще бъде нулирано и няма да можете да общувате с него повече. Правете това, само ако вече не можете да се свързвате с него. Ако все още можете да общувате с Под, моля, използвайте опцията <b>Деактивирай Pod</b>.</string>
<string name="omnipod_cmd_pod_history_na">Историята на Pod не е достъпна в момента.</string>
<string name="omnipod_init_pod_wizard_step1_title">Напълни Pod</string>
<string name="omnipod_init_pod_wizard_step1_desc">\nНапълнете с достатъчно инсулин за 3 дни.\n\nИзчакайте два сигнала от Pod по време на процеса на зареждане. Те показват, че е вмъкнат минималният размер от 85U. Уверете се, че сте изпразнил напълно спринцовката, дори след като сте чули двата сигнала.\n\nСлед пълнене на Pod, моля натиснете <b>Следващ</b>.\n\n<b>Забележка:</b> не вадете капачката на капсулата на Podв този момент.</string>
<string name="omnipod_init_pod_wizard_step2_title">Пълнене</string>
<string name="omnipod_init_pod_wizard_step2_action_header">Опитвам се да се сдвоя с Pod.\n\nКогато всички елементи са проверени, можете да натиснете <b>Следващ</b>.\n\n<b>Забележка:</b> задръжте Pod много близо до RileyLink в този момент.</string>
<string name="omnipod_init_pod_wizard_step3_title">Прикрепете Pod</string>
<string name="omnipod_init_pod_wizard_step3_desc">\nПодгответе мястото за инфузия. Отстранете капачката на Pod и лепенката и прикрепете капсулата към мястото за инфузия.\n\nАко канюла стърчи, моля натиснете <b>Отказ</b> и изхвърлете вашия Pod.\n\nПрес <b>Следваща</b> да се вмъкне канюлата и да започне базалната доставка.</string>
<string name="omnipod_init_pod_wizard_step4_title">Вмъкване на канюла</string>
<string name="omnipod_init_pod_wizard_step4_action_header">Опитвам се да определя първоначалния базален график и да вмъкна канюлата.\n\nКогато всички елементи са проверени, можете да натиснете <b>Следващ</b>.</string>
<string name="omnipod_init_pod_wizard_pod_info_title">Информация за Pod</string>
<string name="omnipod_init_pod_wizard_pod_info_init_pod_description">\Podе активна.\n\nВашият базален график е програмиран и канюлата вмъкната.\n\nМоля, проверете дали канюлата е поставена правилно или заменете Pod, ако чувствате, че не е.</string>
<string name="omnipod_remove_pod_wizard_step1_title">Деактивирай Pod</string>
<string name="omnipod_remove_pod_wizard_step1_desc">\nНатиснете <b>Следващ</b> , за да деактивирате Pod.\n\n<b>Забележка:</b> Това ще спре всички доставки на инсулин и деактивира Pod.</string>
<string name="omnipod_remove_pod_wizard_step2_title">Деактивиране на Pod</string>
<string name="omnipod_remove_pod_wizard_step2_action_header">Деактивиране на Pod.\n\nКогато всички елементи са проверени, можете да натиснете <b>Следващ</b>.\n\n<b>Забележка:</b> Ако деактивирането непрекъснато се проваля, моля натиснете <b>Отказ</b> и използвайте опция <b>Нулирай Pod</b> , за да възстановите състоянието на Pod.</string>
<string name="omnipod_init_pod_wizard_pod_info_remove_pod_description">Pod изключен.\n\nмоля, извадете Pod от тялото си и го хвърли.</string>
<string name="omnipod_init_pod_pair_pod">Сдвояване на под</string>
<string name="omnipod_init_pod_prime_pod">Пълнене на под</string>
<string name="omnipod_init_pod_fill_cannula">Напълни канула</string>
<string name="omnipod_init_pod_set_basal_profile">Приложи базалният профил</string>
<string name="omnipod_deactivate_pod_cancel_delivery">Отмяна</string>
<string name="omnipod_deactivate_pod_deactivate_pod">Деактивирай под</string>
<!-- Omnipod - Base -->
<string name="omnipod_alert_finish_pairing_reminder">Край на напомняне за сдвояване</string>
<string name="omnipod_alert_finish_setup_reminder_reminder">Край на напомнянето за настройка</string>
<string name="omnipod_alert_expiration">Подът скоро ще изтече</string>
<string name="omnipod_alert_expiration_advisory">Подът скоро ще изтече</string>
<string name="omnipod_alert_shutdown_imminent">Спирането е неизбежно</string>
<string name="omnipod_alert_low_reservoir">Минимален инсулин в резервоара</string>
<string name="omnipod_alert_unknown_alert">Непозната аларма</string>
<string name="omnipod_error_set_basal_failed_delivery_might_be_suspended">Неуспешно задаване на базален профил. Доставката може да бъде спряна! Моля, ръчно опреснете състоянието на Pod от раздел Omnipod и възобновете доставката, ако е необходимо.</string>
<string name="omnipod_error_set_basal_might_have_failed_delivery_might_be_suspended">Неуспешно задаване на базален профил. Доставката може да бъде спряна! Моля, ръчно опреснете състоянието на Pod от раздел Omnipod и възобновете доставката, ако е необходимо.</string>
<string name="omnipod_error_set_basal_failed_delivery_suspended">Неуспешно задаване на базален профил. Доставката е спряна! Моля, ръчно подновяване на доставката от раздела Omnipod.</string>
<string name="omnipod_error_set_temp_basal_failed_old_tbr_might_be_cancelled">Задаването на временен базал е неуспешно. Ако преди това е изпълнявал временен базал, може да е бил отменен. Моля, ръчно опреснете статуса на Pod от раздела Omnipod.</string>
<string name="omnipod_error_set_temp_basal_failed_old_tbr_cancelled_new_might_have_failed">Задаването на временен базал е неуспешно. Ако преди това е изпълнявал временен базал, може да е бил отменен. Моля, ръчно опреснете статуса на Pod от раздела Omnipod.</string>
<string name="omnipod_error_set_time_failed_delivery_might_be_suspended">Неуспешно задаване на базален профил. Доставката може да бъде спряна! Моля, ръчно опреснете състоянието на Pod от раздел Omnipod и възобновете доставката, ако е необходимо.</string>
<string name="omnipod_error_set_time_failed_delivery_suspended">Неуспешно задаване на базален профил. Доставката е спряна! Моля, ръчно подновяване на доставката от раздела Omnipod.</string>
<string name="omnipod_bolus_failed_uncertain">Не може да се провери дали болус е успял. Моля, уверете се ръчно, че Вашата Pod се активира чрез слушане на кликвания. <b>Ако сте сигурни, че болус не е успял, вие трябва ръчно да изтриете болния запис от лечение, дори ако щракнете върху \'Отказ от болус\' сега!</b></string>
<string name="omnipod_bolus_failed_uncertain_smb">Не може да се провери дали SMB bolus (%1$.2f U) е успял. <b>Ако сте сигурни, че на Bolus не е успял, трябва ръчно да изтриете запис SMB от лечение.</b></string>
<string name="omnipod_rl_stats">Статистика на RL</string>
<string name="omnipod_read_pulse_log_short">Pulse лог</string>
<string name="omnipod_pod_lot">LOT</string>
<string name="omnipod_pod_tid">TID</string>
<string name="omnipod_pod_firmware_version">Firmware версия</string>
<string name="omnipod_errors">Грешки</string>
<string name="omnipod_cmd_basal_profile_not_set_is_same">Профилът е идентичен.</string>
<string name="omnipod_custom_action_reset_rileylink">Нулирай RileyLink конфигурацията</string>
<string name="omnipod_time_or_timezone_change">Време и/или промяна на часовата зона на помпата</string>
<string name="omnipod_composite_time">%1$s и %2$s</string>
<string name="omnipod_time_ago">преди %s</string>
<string name="omnipod_waiting_for_rileylink_connection">Изчакване за връзка...</string>
<string name="omnipod_bolus_did_not_succeed">Болус неуспешен</string>
<string name="omnipod_refresh">Обнови</string>
<string name="omnipod_resume_delivery">Подновяване на доставката</string>
<string name="omnipod_error_pod_suspended">Pod изключен</string>
<string name="omnipod_less_than_a_minute_ago">преди по-малко от минута</string>
<string name="omnipod_suspend_delivery_short">Спиране</string>
<string name="omnipod_cmd_pair_and_prime">Сдвояване и пълнене</string>
<string name="omnipod_cmd_fill_cannula_set_basal_profile">Запълнете канюлата и настройте базалния профил</string>
<string name="omnipod_cmd_get_pulse_log">Вземи лога</string>
<string name="omnipod_uncertain_failure">Неизвестна грешка</string>
<string name="omnipod_cancelled_old_tbr_failed_to_set_new">Спрян стар базал, но неуспешно задаване на нов</string>
<string name="omnipod_cmd_set_fake_suspended_tbr">Поставете фалшив временен базал, защото Pod е спряно</string>
<string name="omnipod_cmd_cancel_fake_suspended_tbr">Анулират фалшив временен базал, който е създаден, защото Pod е спряно</string>
<string name="omnipod_uncertain">неизвестно</string>
<string name="omnipod_expiration_alerts_updated">Конфигурация на тревога актуализирана в Pod</string>
<string name="omnipod_preference_category_rileylink">RileyLink</string>
<string name="omnipod_preference_category_other">Друго</string>
<string name="omnipod_preference_category_alerts">Известия</string>
<string name="omnipod_preference_category_confirmation_beeps">Звук за потвърждение</string>
<string name="omnipod_wizard_button_exit">Изход</string>
<string name="omnipod_wizard_button_previous">Предишен</string>
<string name="omnipod_wizard_button_next">Следващ</string>
<string name="omnipod_wizard_button_finish">Край</string>
<string name="omnipod_history_item_description">Описание</string>
<string name="omnipod_history_item_source">Източник</string>
<string name="omnipod_history_item_date">Дата</string>
<string name="omnipod_history_type">Тип:</string>
<plurals name="omnipod_minutes">
<item quantity="one">%1$d минути</item>
<item quantity="other">%1$d минути</item>
</plurals>
<plurals name="omnipod_hours">
<item quantity="one">%1$d часа</item>
<item quantity="other">%1$d часа</item>
</plurals>
</resources>

View file

@ -110,10 +110,27 @@
<string name="omnipod_alert_shutdown_imminent">Blíží se vypnutí</string>
<string name="omnipod_alert_low_reservoir">Nízký stav zásobníku</string>
<string name="omnipod_alert_unknown_alert">Neznámá výstraha</string>
<string name="omnipod_bolus_failed_uncertain_smb">Nelze ověřit, zda byl bolus SMB (%1$.2f U) úspěšně vydán. <b>Pokud jste si jisti, že bolus nebyl vydán, měli byste ručně odstranit položku SMB z Ošetření.</b></string>
<string name="omnipod_rl_stats">Statistika RL</string>
<string name="omnipod_read_pulse_log_short">Pulse log</string>
<string name="omnipod_pod_lot">LOT</string>
<string name="omnipod_pod_tid">TID</string>
<string name="omnipod_pod_firmware_version">Verze firmwaru</string>
<string name="omnipod_errors">Chyby</string>
<string name="omnipod_cmd_basal_profile_not_set_is_same">Bazální profil je stejný, takže nebude znovu nastaven.</string>
<string name="omnipod_custom_action_reset_rileylink">Resetovat konfiguraci RileyLinku</string>
<string name="omnipod_time_or_timezone_change">Změna času nebo časového pásma Podu</string>
<string name="omnipod_composite_time">%1$s a %2$s</string>
<string name="omnipod_time_ago">před %1$s</string>
<string name="omnipod_waiting_for_rileylink_connection">Čekání na připojení RileyLink...</string>
<string name="omnipod_bolus_did_not_succeed">Podání bolusu bylo neúspěšné</string>
<string name="omnipod_refresh">Obnovit</string>
<string name="omnipod_resume_delivery">Obnovit dodávání inzulínu</string>
<string name="omnipod_error_pod_suspended">Pod pozastavený</string>
<string name="omnipod_less_than_a_minute_ago">Před méně než minutou</string>
<string name="omnipod_suspend_delivery_short">Vypnutí</string>
<string name="omnipod_cmd_pair_and_prime">Spárovat a naplnit</string>
<string name="omnipod_cmd_fill_cannula_set_basal_profile">Naplnit kanylu a nastavit bazální profil</string>
<string name="omnipod_uncertain_failure">Neznámá chyba</string>
<string name="omnipod_cancelled_old_tbr_failed_to_set_new">Byl zrušen starý dočasný bazál, ale nový dočasný bazál se nepodařilo nastavit</string>
<string name="omnipod_cmd_set_fake_suspended_tbr">Nastavit falešný dočasný bazál, protože Pod je pozastaven</string>

View file

@ -15,7 +15,7 @@
<string name="omnipod_config_low_reservoir_alert_units">Anzahl der Einheiten</string>
<!-- Omnipod - Fragment -->
<string name="omnipod_moments_ago">gerade eben</string>
<string name="omnipod_pod_mgmt">Pod mgmt</string>
<string name="omnipod_button_pod_management">Pod mgmt</string>
<string name="omnipod_pod_status">Pod Status</string>
<string name="omnipod_total_delivered_label">Insgesamt abgegeben</string>
<string name="omnipod_total_delivered">%1$.2f IE</string>
@ -34,7 +34,7 @@
<string name="omnipod_pod_status_inactive">Inaktiv</string>
<string name="omnipod_pod_status_pod_fault_description">Pod-Fehler: %1$s %2$s</string>
<string name="omnipod_pod_active_alerts">Aktive Pod-Warnungen</string>
<string name="omnipod_acknowledge_active_alerts_short">Alarm bestätigen</string>
<string name="omnipod_button_acknowledge_active_alerts">Alarm bestätigen</string>
<!-- Omnipod - Dialogs -->
<string name="omnipod_frequency">Omnipod (433.91 MHz)</string>
<!-- Omnipod - Error -->
@ -43,29 +43,28 @@
<string name="omnipod_error_operation_not_possible_no_profile">Aktion ist nicht möglich.\n\n Du musst ein paar Minuten warten bis AAPS versucht, das Basalprofil zum ersten Mal zu setzen.</string>
<string name="omnipod_error_illegal_init_action_type">Illegal PodInitActionType: %1$s</string>
<string name="omnipod_error_pod_not_attached">Kein aktiver Pod</string>
<string name="omnipod_driver_error_setup_action_verification_failed">Kommandoprüfung fehlgeschlagen</string>
<string name="omnipod_driver_error_unexpected_exception_type">Es ist ein unerwarteter Fehler aufgetreten. Bitte melden! (Typ: %1$s).</string>
<string name="omnipod_driver_error_invalid_parameters">Kommunikation fehlgeschlagen: Ungültige Eingabeparameter empfangen</string>
<string name="omnipod_driver_error_communication_failed_timeout">Keine Verbindung: Zeitüberschreitung</string>
<string name="omnipod_driver_error_communication_failed_unexpected_exception">Keine Verbindung: Es ist ein unerwarteter Fehler aufgetreten. Bitte melden!</string>
<string name="omnipod_driver_error_crc_mismatch">Kommunikation fehlgeschlagen: Die Überprüfung der Nachrichtenintegrität ist fehlgeschlagen</string>
<string name="omnipod_driver_error_invalid_packet_type">Kommunikation fehlgeschlagen: Es wurde ein ungültiges Paket vom Pod empfangen</string>
<string name="omnipod_driver_error_invalid_progress_state">Kommunikation fehlgeschlagen: Der Pod befindet sich in einem falschen Status</string>
<string name="omnipod_driver_error_invalid_response">Kommunikation fehlgeschlagen: Es wurde eine ungültige Antwort vom Pod empfangen</string>
<string name="omnipod_driver_error_invalid_message_sequence_number">Kommunikation fehlgeschlagen: Ungültige Zeichenfolge vom Pod empfangen</string>
<string name="omnipod_driver_error_invalid_message_address">Kommunikation fehlgeschlagen: Ungültige Adresse vom Pod empfangen</string>
<string name="omnipod_driver_error_message_decoding_failed">Kommunikation fehlgeschlagen: Nachricht vom Pod konnte nicht decodiert werden</string>
<string name="omnipod_driver_error_nonce_resync_failed">Kommunikation fehlgeschlagen: Nonce resync fehlgeschlagen</string>
<string name="omnipod_driver_error_nonce_out_of_sync">Kommunikation fehlgeschlagen: Nonce nicht synchronisiert</string>
<string name="omnipod_driver_error_not_enough_data">Kommunikation fehlgeschlagen: Nicht genügend Daten vom Pod empfangen</string>
<string name="omnipod_driver_error_pod_fault">Ein Pod-Fehler (%1$03d %2$s) wurde festgestellt. Bitte deaktiviere den Pod und starte einen neuen</string>
<string name="omnipod_driver_error_pod_returned_error_response">Kommunikation fehlgeschlagen: Fehlerhafte Antwort vom Pod</string>
<string name="omnipod_error_setup_action_verification_failed">Kommandoprüfung fehlgeschlagen</string>
<string name="omnipod_error_invalid_parameters">Kommunikation fehlgeschlagen: Ungültige Eingabeparameter empfangen</string>
<string name="omnipod_error_communication_failed_timeout">Keine Verbindung: Zeitüberschreitung</string>
<string name="omnipod_error_communication_failed_unexpected_exception">Keine Verbindung: Es ist ein unerwarteter Fehler aufgetreten. Bitte melden!</string>
<string name="omnipod_error_crc_mismatch">Kommunikation fehlgeschlagen: Die Überprüfung der Nachrichtenintegrität ist fehlgeschlagen</string>
<string name="omnipod_error_invalid_packet_type">Kommunikation fehlgeschlagen: Es wurde ein ungültiges Paket vom Pod empfangen</string>
<string name="omnipod_error_invalid_progress_state">Kommunikation fehlgeschlagen: Der Pod befindet sich in einem falschen Status</string>
<string name="omnipod_error_invalid_response">Kommunikation fehlgeschlagen: Es wurde eine ungültige Antwort vom Pod empfangen</string>
<string name="omnipod_error_invalid_message_sequence_number">Kommunikation fehlgeschlagen: Ungültige Zeichenfolge vom Pod empfangen</string>
<string name="omnipod_error_invalid_message_address">Kommunikation fehlgeschlagen: Ungültige Adresse vom Pod empfangen</string>
<string name="omnipod_error_message_decoding_failed">Kommunikation fehlgeschlagen: Nachricht vom Pod konnte nicht decodiert werden</string>
<string name="omnipod_error_nonce_resync_failed">Kommunikation fehlgeschlagen: Nonce resync fehlgeschlagen</string>
<string name="omnipod_error_nonce_out_of_sync">Kommunikation fehlgeschlagen: Nonce nicht synchronisiert</string>
<string name="omnipod_error_not_enough_data">Kommunikation fehlgeschlagen: Nicht genügend Daten vom Pod empfangen</string>
<string name="omnipod_error_pod_fault">Ein Pod-Fehler (%1$03d %2$s) wurde festgestellt. Bitte deaktiviere den Pod und starte einen neuen</string>
<string name="omnipod_error_pod_returned_error_response">Kommunikation fehlgeschlagen: Fehlerhafte Antwort vom Pod</string>
<!-- Omnipod - Pod Mgmt -->
<string name="omnipod_pod_mgmt_title">Pod Management</string>
<string name="omnipod_cmd_init_pod">Init Pod</string>
<string name="omnipod_pod_management_title">Pod Management</string>
<string name="omnipod_button_init_pod">Init Pod</string>
<string name="omnipod_cmd_deactivate_pod">Pod deaktivieren</string>
<string name="omnipod_cmd_discard_pod">Pod ablegen</string>
<string name="omnipod_cmd_pod_history">Pod Historie</string>
<string name="omnipod_button_pod_history">Pod Historie</string>
<string name="omnipod_cmd_set_bolus">Mahlzeiten Bolus abgeben</string>
<string name="omnipod_cmd_cancel_bolus">Bolus abbrechen</string>
<string name="omnipod_cmd_set_tbr">Temp. Basalrate setzen</string>
@ -80,9 +79,9 @@
<string name="omnipod_cmd_suspend_delivery">Abgabe unterbrechen</string>
<string name="omnipod_cmd_resume_delivery">Abgabe fortsetzen</string>
<string name="omnipod_cmd_unknown_entry">Unbekannte Eingabe</string>
<string name="omnipod_cmd_bolus_value">%1$.2f IE</string>
<string name="omnipod_cmd_bolus_value_with_carbs">%1$.2f IE, CH=%2$.1f g</string>
<string name="omnipod_cmd_pod_history_na">Pod Historie derzeit nicht verfügbar.</string>
<string name="omnipod_history_bolus_value">%1$.2f IE</string>
<string name="omnipod_history_bolus_value_with_carbs">%1$.2f IE, CH=%2$.1f g</string>
<string name="omnipod_history_history_not_available">Pod Historie derzeit nicht verfügbar.</string>
<string name="omnipod_init_pod_wizard_step1_title">Befülle den Pod</string>
<string name="omnipod_init_pod_wizard_step2_title">Befüllen</string>
<string name="omnipod_init_pod_wizard_step3_title">Befestige den Pod</string>
@ -106,9 +105,9 @@
<string name="omnipod_alert_low_reservoir">Niedriger Reservoirstand</string>
<string name="omnipod_alert_unknown_alert">Unbekannter Alarm</string>
<string name="omnipod_errors">Fehler</string>
<string name="omnipod_cmd_basal_profile_not_set_is_same">Basalprofil, unverändert wird nicht erneut eingestellt.</string>
<string name="omnipod_refresh">Aktualisieren</string>
<string name="omnipod_suspend_delivery_short">Unterbrechungen</string>
<string name="omnipod_confirmation_basal_profile_not_set_is_same">Basalprofil, unverändert wird nicht erneut eingestellt.</string>
<string name="omnipod_button_refresh">Aktualisieren</string>
<string name="omnipod_button_suspend_delivery">Unterbrechungen</string>
<string name="omnipod_preference_category_rileylink">RileyLink</string>
<string name="omnipod_preference_category_other">Andere</string>
<string name="omnipod_wizard_button_exit">Schließen</string>

Some files were not shown because too many files have changed in this diff Show more