Merge branch 'dev' into smoothing

This commit is contained in:
Milos Kozak 2022-12-13 10:28:29 +01:00
commit b97fdead18
414 changed files with 4344 additions and 4117 deletions

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Удостоверяването неуспешно</string>
<string name="copytolocalprofile_invalid">Създаването на профила невъзможно. Профилът е невалиден.</string>
<string name="cta_dont_kill_my_app_info">Не убивай приложението?</string>
<string name="time_to_eat">Време за ядене!\nИзпълнете болус съветника и направете изчисления отново.</string>
<string name="fabric_upload_disabled">Качването на данни за проблеми е забранено!(Fabric)</string>
<string name="clear_filter">Премахни филтъра</string>
<string name="cannula">Канюла</string>

View file

@ -44,7 +44,6 @@
<string name="authorizationfailed">L\'autorització ha fallat</string>
<string name="copytolocalprofile_invalid">No s\'ha pogut crear el perfil local. Perfil no vàlid.</string>
<string name="cta_dont_kill_my_app_info">No matar la meva app?</string>
<string name="time_to_eat">Hora de menjar!\nExecuteu l\'assistent de bolus i torneu a fer els càlculs.</string>
<string name="fabric_upload_disabled">Enviament de logs d\'error desactivat!</string>
<string name="clear_filter">Netejar filtres</string>
<string name="cannula">Cànula</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Autorizace selhala</string>
<string name="copytolocalprofile_invalid">Nelze vytvořit profil. Profil je neplatný.</string>
<string name="cta_dont_kill_my_app_info">Nezabíjet mou aplikaci?</string>
<string name="time_to_eat">Čas k jídlu!\nSpusťte Bolusovou kalkulačku a proveďte výpočet znovu.</string>
<string name="fabric_upload_disabled">Nahrávání protokolů o pádech zakázáno!</string>
<string name="clear_filter">Vymazat filtr</string>
<string name="cannula">Kanyla</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Godkendelse mislykkedes</string>
<string name="copytolocalprofile_invalid">Kunne ikke oprette profil. Profilen er ugyldig.</string>
<string name="cta_dont_kill_my_app_info">Luk ikke min app?</string>
<string name="time_to_eat">Tid til at spise!\nKør Bolus guiden og lav beregning igen.</string>
<string name="fabric_upload_disabled">Upload af Crash logs deaktiveret!</string>
<string name="clear_filter">Nulstil filter</string>
<string name="cannula">Kanyle</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Autorisierung fehlgeschlagen</string>
<string name="copytolocalprofile_invalid">Profil kann nicht erstellt werden. Profil ist ungültig.</string>
<string name="cta_dont_kill_my_app_info">Don\'t kill my app?</string>
<string name="time_to_eat">Zeit zum Essen!\nStarte den Bolus-Rechner und gib die KH ein. </string>
<string name="fabric_upload_disabled">Hochladen von Crash-Protokollen deaktiviert!</string>
<string name="clear_filter">Filter löschen</string>
<string name="cannula">Kanüle</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Ha fallado la autorización</string>
<string name="copytolocalprofile_invalid">No se puede crear el perfil. El perfil es inválido.</string>
<string name="cta_dont_kill_my_app_info">¿No matar mi aplicación?</string>
<string name="time_to_eat">¡Hora de comer!\nEjecutar el asistente de bolo y calcular de nuevo.</string>
<string name="fabric_upload_disabled">¡Carga de registros de errores desactivada!</string>
<string name="clear_filter">Borrar filtro</string>
<string name="cannula">Cánula</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Echec de l\'authentification</string>
<string name="copytolocalprofile_invalid">Impossible de créer le profil. Le profil est invalide.</string>
<string name="cta_dont_kill_my_app_info">Garder l\'appli en arrière plan ?</string>
<string name="time_to_eat">Il est temps de manger !\nExécutez l\'assistant Bolus et refaites le calcul.</string>
<string name="fabric_upload_disabled">Téléchargement logs crashs désactivé!</string>
<string name="clear_filter">Effacer le filtre</string>
<string name="cannula">Canule</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Autorizzazione fallita</string>
<string name="copytolocalprofile_invalid">Impossibile creare il profilo. Il profilo non è valido.</string>
<string name="cta_dont_kill_my_app_info">Non terminare l\'app?</string>
<string name="time_to_eat">Tempo di mangiare!\nEsegui il calcolatore e fai di nuovi i calcoli.</string>
<string name="fabric_upload_disabled">Caricamento log dei crash disabilitato!</string>
<string name="clear_filter">Cancella filtro</string>
<string name="cannula">Cannula</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">ההרשאה נכשלה</string>
<string name="copytolocalprofile_invalid">לא ניתן ליצור פרופיל מקומי. הפרופיל אינו חוקי.</string>
<string name="cta_dont_kill_my_app_info">איך לא להשבית את האפליקציה שלי?</string>
<string name="time_to_eat">זמן לאכול!\nהפעילו את אשף הבולוסים וחשבו בולוס חדש.</string>
<string name="fabric_upload_disabled">העלאת רשומות קריסה מושבתת!</string>
<string name="clear_filter">נקה סינון</string>
<string name="cannula">צינורית</string>

View file

@ -43,7 +43,6 @@
<string name="chartmenu">차트 메뉴</string>
<string name="authorizationfailed">인증 실패</string>
<string name="cta_dont_kill_my_app_info">앱이 종료되지 않도록 합니다?</string>
<string name="time_to_eat">식사할 시간입니다! \nBolus wizard를 켜고 다시 계산하십시오.</string>
<string name="fabric_upload_disabled">충돌 로그 업로드가 작동하지 않습니다.</string>
<string name="clear_filter">필터 지우기</string>
<string name="cannula">캐뉼라</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Autorizacija nepavyko</string>
<string name="copytolocalprofile_invalid">Nepavyksta sukurti profilio. Profilis neteisingas.</string>
<string name="cta_dont_kill_my_app_info">Don\'t kill my app?</string>
<string name="time_to_eat">Laikas valgyti!\nĮjunkite Boluso patarėją ir atlikite skaičiavimą dar kartą.</string>
<string name="fabric_upload_disabled">Sutrikimų žurnalo įrašų įkėlimas išjungtas!</string>
<string name="clear_filter">Valyti filtrą</string>
<string name="cannula">Kaniulė</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Autorisatie mislukt</string>
<string name="copytolocalprofile_invalid">Kan profiel niet aanmaken. Profiel is ongeldig.</string>
<string name="cta_dont_kill_my_app_info">Don\'t kill my app?</string>
<string name="time_to_eat">Tijd om te eten!\nVoer de boluswizard opnieuw uit.</string>
<string name="fabric_upload_disabled">Upload van crashrapporten is uitgeschakeld!</string>
<string name="clear_filter">Verwijder filter</string>
<string name="cannula">Canule</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Autentisering feilet</string>
<string name="copytolocalprofile_invalid">Klarte ikke å opprette profil. Profilen er ikke gyldig.</string>
<string name="cta_dont_kill_my_app_info">Avslutte app?</string>
<string name="time_to_eat">Nå må du spise!\Bruk bolus veiviseren og beregn på nytt.</string>
<string name="fabric_upload_disabled">Opplast av krasj logger er deaktivert!</string>
<string name="clear_filter">Nullstill filtre</string>
<string name="cannula">Kanyle</string>

View file

@ -44,7 +44,6 @@
<string name="authorizationfailed">Autoryzacja nie powiodła się</string>
<string name="copytolocalprofile_invalid">Nie można utworzyć profilu. Profil jest nieprawidłowy.</string>
<string name="cta_dont_kill_my_app_info">Nie zabij mojej aplikacji?</string>
<string name="time_to_eat">Czas jeść!\nUruchom kreatora bolusa i zrób obliczenia ponownie.</string>
<string name="fabric_upload_disabled">Przesyłanie dzienników awarii jest wyłączone!</string>
<string name="clear_filter">Wyczyść filtr</string>
<string name="cannula">Kaniula</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Falha na autorização</string>
<string name="copytolocalprofile_invalid">Não foi possível criar o perfil. Perfil inválido.</string>
<string name="cta_dont_kill_my_app_info">Não encerre meu aplicativo?</string>
<string name="time_to_eat">Hora de comer!\nAbra o assistente de bolus e faça o cálculo novamente.</string>
<string name="fabric_upload_disabled">Envio de logs de erro desativado!</string>
<string name="clear_filter">Limpar filtro</string>
<string name="cannula">Cânula</string>

View file

@ -44,7 +44,6 @@
<string name="authorizationfailed">Falha na autorização</string>
<string name="copytolocalprofile_invalid">Não é possível criar o perfil. O perfil é inválido.</string>
<string name="cta_dont_kill_my_app_info">Não encerre minha app?</string>
<string name="time_to_eat">Hora de comer!\nExecutar assistente de Bólus e fazer cálculo novamente.</string>
<string name="fabric_upload_disabled">Envio de registos de erro desativado!</string>
<string name="clear_filter">Limpar filtros</string>
<string name="cannula">Cânula</string>

View file

@ -44,7 +44,6 @@
<string name="authorizationfailed">Autorizarea a eșuat</string>
<string name="copytolocalprofile_invalid">Nu se poate crea profilul. Profilul este invalid.</string>
<string name="cta_dont_kill_my_app_info">Nu-mi opri aplicația?</string>
<string name="time_to_eat">Timpul sa mănânci!\nRuleaza Calculatorul de Bolus pentru a face calculele din nou.</string>
<string name="fabric_upload_disabled">Încărcarea jurnalelor de erori este dezactivata!</string>
<string name="clear_filter">Șterge filtru</string>
<string name="cannula">Canula</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Ошибка авторизации</string>
<string name="copytolocalprofile_invalid">Не удается создать локальный профиль. Настройки профиля неправильны.</string>
<string name="cta_dont_kill_my_app_info">Не закрывать приложение?</string>
<string name="time_to_eat">Пора есть!\nЗапустите помощник болюса снова для подсчета.</string>
<string name="fabric_upload_disabled">Загрузка журналов сбоя на сервер отключена!</string>
<string name="clear_filter">Очистить фильтр</string>
<string name="cannula">Катетер помпы</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Autorizácia zlyhala</string>
<string name="copytolocalprofile_invalid">Nie je možné vytvoriť lokálny profil. Profil je neplatný.</string>
<string name="cta_dont_kill_my_app_info">Nepotláčať moju aplikáciu?</string>
<string name="time_to_eat">Čas na jedlo!\nSpustite Bolusovú kalkulačku a urobte výpočet znova.</string>
<string name="fabric_upload_disabled">Odosielanie protokolov o zlyhaní je zakázané!</string>
<string name="clear_filter">Vyčistiť filter</string>
<string name="cannula">Kanyla</string>

View file

@ -44,7 +44,6 @@
<string name="authorizationfailed">Behörighetskontroll misslyckades</string>
<string name="copytolocalprofile_invalid">Kan inte att skapa profilen. Profilen är felaktig.</string>
<string name="cta_dont_kill_my_app_info">Döda inte min app?</string>
<string name="time_to_eat">Dags att äta!\nKör bolusguiden igen för ny beräkning.</string>
<string name="fabric_upload_disabled">Uppladdning av kraschloggar inaktiverad!</string>
<string name="clear_filter">Rensa filter</string>
<string name="cannula">Kanyl</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">Yetkilendirme başarısız oldu</string>
<string name="copytolocalprofile_invalid">Profil oluşturulamıyor. Profil geçersiz.</string>
<string name="cta_dont_kill_my_app_info">Uygulamamı devre dışı bırakma?</string>
<string name="time_to_eat">Yemek zamanı!\nBolus sihirbazını çalıştırın ve yeniden hesaplama yapın.</string>
<string name="fabric_upload_disabled">Çökme günlükleri yükleme devre dışı bırakıldı!</string>
<string name="clear_filter">Filtreyi temizle</string>
<string name="cannula">Kanül</string>

View file

@ -46,7 +46,6 @@
<string name="authorizationfailed">授权失败</string>
<string name="copytolocalprofile_invalid">无法创建配置文件。配置文件无效。</string>
<string name="cta_dont_kill_my_app_info">不要杀死我的应用程序?</string>
<string name="time_to_eat">吃饭时间到了!\n请运行大剂量向导然后进行计算。</string>
<string name="fabric_upload_disabled">已禁用崩溃日志上传!</string>
<string name="clear_filter">清除筛选</string>
<string name="cannula">输注导管</string>

View file

@ -1,7 +1,48 @@
package info.nightscout.interfaces.nsclient
import info.nightscout.database.entities.Bolus
import info.nightscout.database.entities.BolusCalculatorResult
import info.nightscout.database.entities.Carbs
import info.nightscout.database.entities.DeviceStatus
import info.nightscout.database.entities.EffectiveProfileSwitch
import info.nightscout.database.entities.ExtendedBolus
import info.nightscout.database.entities.Food
import info.nightscout.database.entities.GlucoseValue
import info.nightscout.database.entities.OfflineEvent
import info.nightscout.database.entities.ProfileSwitch
import info.nightscout.database.entities.TemporaryBasal
import info.nightscout.database.entities.TemporaryTarget
import info.nightscout.database.entities.TherapyEvent
import info.nightscout.database.transactions.TransactionGlucoseValue
interface StoreDataForDb {
val glucoseValues: MutableList<TransactionGlucoseValue>
val boluses: MutableList<Bolus>
val carbs: MutableList<Carbs>
val temporaryTargets: MutableList<TemporaryTarget>
val effectiveProfileSwitches: MutableList<EffectiveProfileSwitch>
val bolusCalculatorResults: MutableList<BolusCalculatorResult>
val therapyEvents: MutableList<TherapyEvent>
val extendedBoluses: MutableList<ExtendedBolus>
val temporaryBasals: MutableList<TemporaryBasal>
val profileSwitches: MutableList<ProfileSwitch>
val offlineEvents: MutableList<OfflineEvent>
val nsIdGlucoseValues: MutableList<GlucoseValue>
val nsIdBoluses: MutableList<Bolus>
val nsIdCarbs: MutableList<Carbs>
val nsIdFoods: MutableList<Food>
val nsIdTemporaryTargets: MutableList<TemporaryTarget>
val nsIdEffectiveProfileSwitches: MutableList<EffectiveProfileSwitch>
val nsIdBolusCalculatorResults: MutableList<BolusCalculatorResult>
val nsIdTherapyEvents: MutableList<TherapyEvent>
val nsIdExtendedBoluses: MutableList<ExtendedBolus>
val nsIdTemporaryBasals: MutableList<TemporaryBasal>
val nsIdProfileSwitches: MutableList<ProfileSwitch>
val nsIdOfflineEvents: MutableList<OfflineEvent>
val nsIdDeviceStatuses: MutableList<DeviceStatus>
fun storeTreatmentsToDb()
fun storeGlucoseValuesToDb()
fun scheduleNsIdUpdate()
}

View file

@ -17,19 +17,21 @@ import org.json.JSONObject
interface DataSyncSelector {
data class PairTemporaryTarget(val value: TemporaryTarget, val updateRecordId: Long)
data class PairGlucoseValue(val value: GlucoseValue, val updateRecordId: Long)
data class PairTherapyEvent(val value: TherapyEvent, val updateRecordId: Long)
data class PairFood(val value: Food, val updateRecordId: Long)
data class PairBolus(val value: Bolus, val updateRecordId: Long)
data class PairCarbs(val value: Carbs, val updateRecordId: Long)
data class PairBolusCalculatorResult(val value: BolusCalculatorResult, val updateRecordId: Long)
data class PairTemporaryBasal(val value: TemporaryBasal, val updateRecordId: Long)
data class PairExtendedBolus(val value: ExtendedBolus, val updateRecordId: Long)
data class PairProfileSwitch(val value: ProfileSwitch, val updateRecordId: Long)
data class PairEffectiveProfileSwitch(val value: EffectiveProfileSwitch, val updateRecordId: Long)
data class PairOfflineEvent(val value: OfflineEvent, val updateRecordId: Long)
data class PairProfileStore(val value: JSONObject, val timestampSync: Long)
interface DataPair
data class PairTemporaryTarget(val value: TemporaryTarget, val updateRecordId: Long): DataPair
data class PairGlucoseValue(val value: GlucoseValue, val updateRecordId: Long): DataPair
data class PairTherapyEvent(val value: TherapyEvent, val updateRecordId: Long): DataPair
data class PairFood(val value: Food, val updateRecordId: Long): DataPair
data class PairBolus(val value: Bolus, val updateRecordId: Long): DataPair
data class PairCarbs(val value: Carbs, val updateRecordId: Long): DataPair
data class PairBolusCalculatorResult(val value: BolusCalculatorResult, val updateRecordId: Long): DataPair
data class PairTemporaryBasal(val value: TemporaryBasal, val updateRecordId: Long): DataPair
data class PairExtendedBolus(val value: ExtendedBolus, val updateRecordId: Long): DataPair
data class PairProfileSwitch(val value: ProfileSwitch, val updateRecordId: Long): DataPair
data class PairEffectiveProfileSwitch(val value: EffectiveProfileSwitch, val updateRecordId: Long): DataPair
data class PairOfflineEvent(val value: OfflineEvent, val updateRecordId: Long): DataPair
data class PairProfileStore(val value: JSONObject, val timestampSync: Long): DataPair
data class PairDeviceStatus(val value: DeviceStatus, val unused: Long?): DataPair
fun queueSize(): Long
@ -38,81 +40,42 @@ interface DataSyncSelector {
fun resetToNextFullSync()
fun confirmLastBolusIdIfGreater(lastSynced: Long)
fun changedBoluses(): List<Bolus>
// Until NS v3
fun processChangedBolusesCompat()
fun confirmLastCarbsIdIfGreater(lastSynced: Long)
fun changedCarbs(): List<Carbs>
// Until NS v3
fun processChangedCarbsCompat()
fun confirmLastBolusCalculatorResultsIdIfGreater(lastSynced: Long)
fun changedBolusCalculatorResults(): List<BolusCalculatorResult>
// Until NS v3
fun processChangedBolusCalculatorResultsCompat()
fun confirmLastTempTargetsIdIfGreater(lastSynced: Long)
fun changedTempTargets(): List<TemporaryTarget>
// Until NS v3
fun processChangedTempTargetsCompat()
fun confirmLastGlucoseValueIdIfGreater(lastSynced: Long)
fun changedGlucoseValues(): List<GlucoseValue>
// Until NS v3
fun processChangedGlucoseValuesCompat()
fun confirmLastTherapyEventIdIfGreater(lastSynced: Long)
fun changedTherapyEvents(): List<TherapyEvent>
// Until NS v3
fun processChangedTherapyEventsCompat()
fun confirmLastFoodIdIfGreater(lastSynced: Long)
fun changedFoods(): List<Food>
// Until NS v3
fun processChangedFoodsCompat()
fun confirmLastDeviceStatusIdIfGreater(lastSynced: Long)
fun changedDeviceStatuses(): List<DeviceStatus>
// Until NS v3
fun processChangedDeviceStatusesCompat()
fun confirmLastTemporaryBasalIdIfGreater(lastSynced: Long)
fun changedTemporaryBasals(): List<TemporaryBasal>
// Until NS v3
fun processChangedTemporaryBasalsCompat()
fun confirmLastExtendedBolusIdIfGreater(lastSynced: Long)
fun changedExtendedBoluses(): List<ExtendedBolus>
// Until NS v3
fun processChangedExtendedBolusesCompat()
fun confirmLastProfileSwitchIdIfGreater(lastSynced: Long)
fun changedProfileSwitch(): List<ProfileSwitch>
// Until NS v3
fun processChangedProfileSwitchesCompat()
fun confirmLastEffectiveProfileSwitchIdIfGreater(lastSynced: Long)
fun changedEffectiveProfileSwitch(): List<EffectiveProfileSwitch>
// Until NS v3
fun processChangedEffectiveProfileSwitchesCompat()
fun confirmLastOfflineEventIdIfGreater(lastSynced: Long)
fun changedOfflineEvents(): List<OfflineEvent>
// Until NS v3
fun processChangedOfflineEventsCompat()
fun confirmLastProfileStore(lastSynced: Long)

View file

@ -2,7 +2,6 @@ package info.nightscout.interfaces.sync
import android.text.Spanned
import info.nightscout.interfaces.nsclient.NSAlarm
import org.json.JSONObject
interface NsClient : Sync {
enum class Version {
@ -11,7 +10,6 @@ interface NsClient : Sync {
val version: Version
val address: String
val nsClientService: NSClientService?
fun pause(newState: Boolean)
fun resend(reason: String)
@ -24,9 +22,6 @@ interface NsClient : Sync {
fun resetToFullSync()
interface NSClientService {
fun dbAdd(collection: String, data: JSONObject, originalObject: Any, progress: String)
fun dbUpdate(collection: String, _id: String?, data: JSONObject?, originalObject: Any, progress: String)
}
fun dbAdd(collection: String, dataPair: DataSyncSelector.DataPair, progress: String)
fun dbUpdate(collection: String, dataPair: DataSyncSelector.DataPair, progress: String)
}

View file

@ -3,12 +3,16 @@ package info.nightscout.sdk
import android.content.Context
import info.nightscout.sdk.exceptions.DateHeaderOutOfToleranceException
import info.nightscout.sdk.exceptions.InvalidAccessTokenException
import info.nightscout.sdk.exceptions.InvalidFormatNightscoutException
import info.nightscout.sdk.exceptions.TodoNightscoutException
import info.nightscout.sdk.exceptions.UnknownResponseNightscoutException
import info.nightscout.sdk.interfaces.NSAndroidClient
import info.nightscout.sdk.localmodel.Status
import info.nightscout.sdk.localmodel.entry.NSSgvV3
import info.nightscout.sdk.localmodel.treatment.CreateUpdateResponse
import info.nightscout.sdk.localmodel.treatment.NSTreatment
import info.nightscout.sdk.mapper.toLocal
import info.nightscout.sdk.mapper.toRemoteTreatment
import info.nightscout.sdk.mapper.toSgv
import info.nightscout.sdk.mapper.toTreatment
import info.nightscout.sdk.networking.NetworkStackBuilder
@ -58,6 +62,8 @@ class NSAndroidClientImpl(
accessToken = accessToken,
logging = logging
)
override var lastStatus: Status? = null
private set
/*
* TODO: how should our result look like?
@ -81,7 +87,7 @@ class NSAndroidClientImpl(
}
override suspend fun getStatus(): Status = callWrapper(dispatcher) {
api.statusSimple().result!!.toLocal()
api.statusSimple().result!!.toLocal().also { lastStatus = it }
}
// TODO: return something better than a String
@ -152,6 +158,38 @@ class NSAndroidClientImpl(
}
}
override suspend fun createTreatment(nsTreatment: NSTreatment): CreateUpdateResponse = callWrapper(dispatcher) {
val remoteTreatment = nsTreatment.toRemoteTreatment() ?: throw InvalidFormatNightscoutException()
val response = api.createTreatment(remoteTreatment)
if (response.isSuccessful) {
return@callWrapper CreateUpdateResponse(
identifier = response.body()?.result?.identifier ?: throw UnknownResponseNightscoutException(),
isDeduplication = response.body()?.result?.isDeduplication ?: false,
deduplicatedIdentifier = response.body()?.result?.deduplicatedIdentifier,
lastModified = response.body()?.result?.lastModified
)
} else {
throw TodoNightscoutException() // TODO: react to response errors (offline, ...)
}
}
override suspend fun updateTreatment(nsTreatment: NSTreatment): CreateUpdateResponse = callWrapper(dispatcher) {
val remoteTreatment = nsTreatment.toRemoteTreatment() ?: throw InvalidFormatNightscoutException()
val response = api.updateTreatment(remoteTreatment)
if (response.isSuccessful) {
return@callWrapper CreateUpdateResponse(
identifier = response.body()?.result?.identifier ?: throw UnknownResponseNightscoutException(),
isDeduplication = response.body()?.result?.isDeduplication ?: false,
deduplicatedIdentifier = response.body()?.result?.deduplicatedIdentifier,
lastModified = response.body()?.result?.lastModified
)
} else {
throw TodoNightscoutException() // TODO: react to response errors (offline, ...)
}
}
private suspend fun <T> callWrapper(dispatcher: CoroutineDispatcher, block: suspend () -> T): T =
withContext(dispatcher) {
retry(

View file

@ -0,0 +1,3 @@
package info.nightscout.sdk.exceptions
class InvalidFormatNightscoutException : NightscoutException()

View file

@ -0,0 +1,3 @@
package info.nightscout.sdk.exceptions
class UnknownResponseNightscoutException : NightscoutException()

View file

@ -2,12 +2,14 @@ package info.nightscout.sdk.interfaces
import info.nightscout.sdk.localmodel.Status
import info.nightscout.sdk.localmodel.entry.NSSgvV3
import info.nightscout.sdk.localmodel.treatment.CreateUpdateResponse
import info.nightscout.sdk.localmodel.treatment.NSTreatment
import info.nightscout.sdk.remotemodel.LastModified
import info.nightscout.sdk.remotemodel.RemoteDeviceStatus
interface NSAndroidClient {
val lastStatus: Status?
suspend fun getVersion(): String
suspend fun getStatus(): Status
suspend fun getEntries(): String
@ -18,4 +20,6 @@ interface NSAndroidClient {
suspend fun getSgvsNewerThan(from: Long, limit: Long): List<NSSgvV3>
suspend fun getTreatmentsModifiedSince(from: Long, limit: Long): List<NSTreatment>
suspend fun getDeviceStatusModifiedSince(from: Long): List<RemoteDeviceStatus>
suspend fun createTreatment(nsTreatment: NSTreatment): CreateUpdateResponse
suspend fun updateTreatment(nsTreatment: NSTreatment): CreateUpdateResponse
}

View file

@ -7,4 +7,7 @@ data class ApiPermissions(
val profile: ApiPermission,
val settings: ApiPermission,
val treatments: ApiPermission
)
) {
fun isFull() = deviceStatus.full && entries.full && food.full && profile.full && settings.full && treatments.full
fun isRead() = deviceStatus.read && entries.read && food.read && profile.read && settings.read && treatments.read
}

View file

@ -0,0 +1,8 @@
package info.nightscout.sdk.localmodel.treatment
class CreateUpdateResponse(
val identifier: String?,
val isDeduplication: Boolean? = false,
val deduplicatedIdentifier: String? = null,
val lastModified: Long? = null
)

View file

@ -4,14 +4,14 @@ import info.nightscout.sdk.localmodel.entry.NsUnits
data class NSBolus(
override val date: Long,
override val device: String?,
override val identifier: String,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val device: String?= null,
override val identifier: String?,
override val units: NsUnits?= null,
override val srvModified: Long? = null,
override val srvCreated: Long? = null,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,
override val subject: String? = null,
override var isReadOnly: Boolean = false,
override val isValid: Boolean,
override val eventType: EventType,
override val notes: String?,

View file

@ -6,10 +6,10 @@ import org.json.JSONObject
data class NSBolusWizard(
override val date: Long,
override val device: String?,
override val identifier: String,
override val identifier: String?,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val srvModified: Long?,
override val srvCreated: Long?,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,

View file

@ -5,10 +5,10 @@ import info.nightscout.sdk.localmodel.entry.NsUnits
data class NSCarbs(
override val date: Long,
override val device: String?,
override val identifier: String,
override val identifier: String?,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val srvModified: Long?,
override val srvCreated: Long?,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,

View file

@ -6,10 +6,10 @@ import org.json.JSONObject
data class NSEffectiveProfileSwitch(
override val date: Long,
override val device: String?,
override val identifier: String,
override val identifier: String?,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val srvModified: Long?,
override val srvCreated: Long?,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,

View file

@ -5,10 +5,10 @@ import info.nightscout.sdk.localmodel.entry.NsUnits
data class NSExtendedBolus(
override val date: Long,
override val device: String?,
override val identifier: String,
override val identifier: String?,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val srvModified: Long?,
override val srvCreated: Long?,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,
@ -21,5 +21,5 @@ data class NSExtendedBolus(
override val pumpSerial: String?,
val duration: Long,
val enteredinsulin: Double,
val isEmulatingTempbasal: Boolean
val isEmulatingTempBasal: Boolean?
) : NSTreatment

View file

@ -5,10 +5,10 @@ import info.nightscout.sdk.localmodel.entry.NsUnits
data class NSOfflineEvent(
override val date: Long,
override val device: String?,
override val identifier: String,
override val identifier: String?,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val srvModified: Long?,
override val srvCreated: Long?,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,

View file

@ -6,10 +6,10 @@ import org.json.JSONObject
data class NSProfileSwitch(
override val date: Long,
override val device: String?,
override val identifier: String,
override val identifier: String?,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val srvModified: Long?,
override val srvCreated: Long?,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,

View file

@ -6,10 +6,10 @@ import org.json.JSONObject
data class NSTemporaryBasal(
override val date: Long,
override val device: String?,
override val identifier: String,
override val identifier: String?,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val srvModified: Long?,
override val srvCreated: Long?,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,
@ -21,9 +21,11 @@ data class NSTemporaryBasal(
override val pumpType: String?,
override val pumpSerial: String?,
val duration: Long,
val rate: Double,
val rate: Double, // when sending to NS always convertedToAbsolute(timestamp, profile)
val isAbsolute: Boolean,
val type: Type
val type: Type,
val percent: Double? = null, // when sending to NS (rate - 100)
val absolute: Double? = null // when sending to NS (rate)
) : NSTreatment {
enum class Type {

View file

@ -5,10 +5,10 @@ import info.nightscout.sdk.localmodel.entry.NsUnits
data class NSTemporaryTarget(
override val date: Long,
override val device: String?,
override val identifier: String,
override val identifier: String?,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val srvModified: Long?,
override val srvCreated: Long?,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,

View file

@ -6,10 +6,10 @@ import info.nightscout.sdk.localmodel.entry.NsUnits
data class NSTherapyEvent(
override val date: Long,
override val device: String?,
override val identifier: String,
override val identifier: String?,
override val units: NsUnits?,
override val srvModified: Long,
override val srvCreated: Long,
override val srvModified: Long?,
override val srvCreated: Long?,
override val utcOffset: Long,
override val subject: String?,
override var isReadOnly: Boolean,

View file

@ -5,11 +5,11 @@ import info.nightscout.sdk.localmodel.entry.NsUnits
interface NSTreatment {
val date: Long
val device: String?
val identifier: String
val identifier: String?
val units: NsUnits?
val eventType: EventType
val srvModified: Long
val srvCreated: Long
val srvModified: Long?
val srvCreated: Long?
val utcOffset: Long
val subject: String?
var isReadOnly: Boolean

View file

@ -117,7 +117,7 @@ internal fun RemoteTreatment.toTreatment(): NSTreatment? {
pumpSerial = extendedEmulated.pumpSerial,
enteredinsulin = extendedEmulated.enteredinsulin ?: 0.0,
duration = extendedEmulated.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(extendedEmulated.duration ?: 0L),
isEmulatingTempbasal = extendedEmulated.isEmulatingTempBasal
isEmulatingTempBasal = extendedEmulated.isEmulatingTempBasal
)
}
@ -329,10 +329,270 @@ internal fun RemoteTreatment.toTreatment(): NSTreatment? {
pumpSerial = this.pumpSerial,
enteredinsulin = this.enteredinsulin,
duration = this.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(this.duration ?: 0L),
isEmulatingTempbasal = this.isEmulatingTempBasal
isEmulatingTempBasal = this.isEmulatingTempBasal
)
}
}
return null
}
internal fun NSTreatment.toRemoteTreatment(): RemoteTreatment? =
when (this) {
is NSBolus -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
insulin = insulin,
type = type.name
)
is NSCarbs -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
carbs = carbs,
duration = duration
)
is NSTemporaryTarget -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
srvModified = srvModified,
srvCreated = srvCreated,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
duration = TimeUnit.MILLISECONDS.toMinutes(duration),
durationInMilliseconds = duration,
targetBottom = targetBottom,
targetTop = targetTop,
reason = reason.text
)
/*
// Convert back emulated TBR -> EB
eventType == EventType.TEMPORARY_BASAL && extendedEmulated != null ->
return RemoteTreatment(
date = treatmentTimestamp,
device = device,
identifier = identifier,
units = NsUnits.fromString(extendedEmulated.units),
srvModified = srvModified,
srvCreated = srvCreated,
utcOffset = utcOffset ?: 0,
subject = subject,
isReadOnly = extendedEmulated.isReadOnly ?: false,
isValid = extendedEmulated.isValid ?: true,
eventType = extendedEmulated.eventType,
notes = extendedEmulated.notes,
pumpId = extendedEmulated.pumpId,
endId = extendedEmulated.endId,
pumpType = extendedEmulated.pumpType,
pumpSerial = extendedEmulated.pumpSerial,
enteredinsulin = extendedEmulated.enteredinsulin ?: 0.0,
duration = extendedEmulated.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(extendedEmulated.duration ?: 0L),
isEmulatingTempbasal = extendedEmulated.isEmulatingTempBasal
)
}
*/
is NSTemporaryBasal -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
srvModified = srvModified,
srvCreated = srvCreated,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
duration = TimeUnit.MILLISECONDS.toMinutes(duration),
durationInMilliseconds = duration,
absolute = absolute,
percent = percent,
rate = absolute,
type = type.name
)
is NSEffectiveProfileSwitch -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
srvModified = srvModified,
srvCreated = srvCreated,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
profileJson = profileJson.toString(),
originalProfileName = originalProfileName,
originalCustomizedName = originalCustomizedName,
originalTimeshift = originalTimeshift,
originalPercentage = originalPercentage,
originalDuration = originalDuration,
originalEnd = originalEnd
)
is NSProfileSwitch -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
srvModified = srvModified,
srvCreated = srvCreated,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
profileJson = profileJson.toString(), // must be de-customized
profile = profileName,
originalProfileName = originalProfileName,
originalDuration = originalDuration,
duration = duration,
timeshift = timeShift,
percentage = percentage,
)
is NSBolusWizard -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
srvModified = srvModified,
srvCreated = srvCreated,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
bolusCalculatorResult = bolusCalculatorResult,
glucose = glucose
)
is NSTherapyEvent -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
srvModified = srvModified,
srvCreated = srvCreated,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
duration = TimeUnit.MILLISECONDS.toMinutes(duration),
durationInMilliseconds = duration,
glucose = glucose,
enteredBy = enteredBy,
glucoseType = glucoseType?.text
)
is NSOfflineEvent -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
srvModified = srvModified,
srvCreated = srvCreated,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
duration = TimeUnit.MILLISECONDS.toMinutes(duration),
durationInMilliseconds = duration,
reason = reason.name
)
is NSExtendedBolus -> RemoteTreatment(
date = date,
device = device,
identifier = identifier,
units = units?.value,
srvModified = srvModified,
srvCreated = srvCreated,
utcOffset = utcOffset,
subject = subject,
isReadOnly = isReadOnly,
isValid = isValid,
eventType = eventType,
notes = notes,
pumpId = pumpId,
endId = endId,
pumpType = pumpType,
pumpSerial = pumpSerial,
enteredinsulin = enteredinsulin,
duration = TimeUnit.MILLISECONDS.toMinutes(duration),
durationInMilliseconds = duration,
isEmulatingTempBasal = isEmulatingTempBasal
)
else -> null
}

View file

@ -4,11 +4,18 @@ import com.google.gson.JsonElement
import info.nightscout.sdk.remotemodel.LastModified
import info.nightscout.sdk.remotemodel.RemoteDeviceStatus
import info.nightscout.sdk.remotemodel.NSResponse
import info.nightscout.sdk.remotemodel.RemoteCreateUpdateResponse
import info.nightscout.sdk.remotemodel.RemoteEntry
import info.nightscout.sdk.remotemodel.RemoteStatusResponse
import info.nightscout.sdk.remotemodel.RemoteTreatment
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query
@ -48,4 +55,11 @@ internal interface NightscoutRemoteService {
@GET("v3/devicestatus/history/{from}")
suspend fun getDeviceStatusModifiedSince(@Path("from") from: Long): Response<NSResponse<List<RemoteDeviceStatus>>>
@POST("v3/treatments")
fun createTreatment(@Body remoteTreatment: RemoteTreatment): Response<NSResponse<RemoteCreateUpdateResponse>>
@PUT("v3/treatments")
fun updateTreatment(@Body remoteTreatment: RemoteTreatment): Response<NSResponse<RemoteCreateUpdateResponse>>
}

View file

@ -17,6 +17,13 @@ internal data class RemoteStorage(
@SerializedName("version") val version: String
)
internal data class RemoteCreateUpdateResponse(
@SerializedName("identifier") val identifier: String?,
@SerializedName("isDeduplication") val isDeduplication: Boolean?,
@SerializedName("deduplicatedIdentifier") val deduplicatedIdentifier: String?,
@SerializedName("lastModified") val lastModified: Long?
)
internal data class RemoteApiPermissions(
@SerializedName("devicestatus") val deviceStatus: RemoteApiPermission,
@SerializedName("entries") val entries: RemoteApiPermission,

View file

@ -17,73 +17,72 @@ import org.json.JSONObject
*
* */
internal data class RemoteTreatment(
@SerializedName("identifier") val identifier: String, // string Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted.
@SerializedName("date") val date: Long?, // integer($int64) or string required timestamp when the record or event occurred, you can choose from three input formats Unix epoch in milliseconds (1525383610088), Unix epoch in seconds (1525383610), ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00')
@SerializedName("mills") val mills: Long?, // integer($int64) or string required timestamp when the record or event occurred, you can choose from three input formats Unix
@SerializedName("timestamp") val timestamp: Long?, // integer($int64) or string required timestamp when the record or event occurred, you can choose from three input formats Unix epoch in milliseconds (1525383610088), Unix epoch in seconds (1525383610), ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00')
@SerializedName("created_at") val created_at: String, // integer($int64) or string timestamp on previous version of api, in my examples, a lot of treatments don't have date, only created_at, some of them with string others with long...
@SerializedName("utcOffset") val utcOffset: Long?, // integer Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming
// document) or it is automatically parsed from the date field.
@SerializedName("identifier") val identifier: String?, // string Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted.
@SerializedName("date") val date: Long? = null, // integer($int64) or string required timestamp when the record or event occurred, you can choose from three input formats Unix epoch in milliseconds (1525383610088), Unix epoch in seconds (1525383610), ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00')
@SerializedName("mills") val mills: Long? = null, // integer($int64) or string required timestamp when the record or event occurred, you can choose from three input formats Unix
@SerializedName("timestamp") val timestamp: Long? = null, // integer($int64) or string required timestamp when the record or event occurred, you can choose from three input formats Unix epoch in milliseconds (1525383610088), Unix epoch in seconds (1525383610), ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00')
@SerializedName("created_at") val created_at: String? = null, // integer($int64) or string timestamp on previous version of api, in my examples, a lot of treatments don't have date, only created_at, some of them with string others with long...
@SerializedName("utcOffset") val utcOffset: Long? = null, // integer Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming document) or it is automatically parsed from the date field.
// @SerializedName("app") val app : String, // TODO required ? Application or system in which the record was entered by human or device for the first time.
@SerializedName("device") val device: String?, // string The device from which the data originated (including serial number of the device, if it is relevant and safe).
@SerializedName("srvCreated") val srvCreated: Long, // integer($int64) example: 1525383610088 The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3.
@SerializedName("subject") val subject: String?, // string Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed token or JWT.
@SerializedName("srvModified") val srvModified: Long, // integer($int64) example: 1525383610088 The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted).
@SerializedName("modifiedBy") val modifiedBy: String?, // string Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server.
@SerializedName("isValid") val isValid: Boolean?, // boolean A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value)
@SerializedName("isReadOnly") val isReadOnly: Boolean?, // boolean A flag set by client that locks the document from any changes. Every document marked with isReadOnly=true is forever immutable and cannot even be deleted.
@SerializedName("device") val device: String? = null, // string The device from which the data originated (including serial number of the device, if it is relevant and safe).
@SerializedName("srvCreated") val srvCreated: Long? = null, // integer($int64) example: 1525383610088 The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3.
@SerializedName("subject") val subject: String? = null, // string Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed token or JWT.
@SerializedName("srvModified") val srvModified: Long? = null, // integer($int64) example: 1525383610088 The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted).
@SerializedName("modifiedBy") val modifiedBy: String? = null, // string Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server.
@SerializedName("isValid") val isValid: Boolean? = null, // boolean A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value)
@SerializedName("isReadOnly") val isReadOnly: Boolean? = null, // boolean A flag set by client that locks the document from any changes. Every document marked with isReadOnly=true is forever immutable and cannot even be deleted.
@SerializedName("eventType") val eventType: EventType, // string "BG Check", "Snack Bolus", "Meal Bolus", "Correction Bolus", "Carb Correction", "Combo Bolus", "Announcement", "Note", "Question", "Exercise", "Site Change", "Sensor Start", "Sensor Change", "Pump Battery Change", "Insulin Change", "Temp Basal", "Profile Switch", "D.A.D. Alert", "Temporary Target", "OpenAPS Offline", "Bolus Wizard"
@SerializedName("glucose") val glucose: Double?, // double Current glucose
@SerializedName("glucoseType") val glucoseType: String?, // string example: "Sensor", "Finger", "Manual"
@SerializedName("units") val units: String?, // string The units for the glucose value, mg/dl or mmol/l. It is strongly recommended to fill in this field.
@SerializedName("carbs") val carbs: Double?, // number... Amount of carbs given.
@SerializedName("protein") val protein: Int?, // number... Amount of protein given.
@SerializedName("fat") val fat: Int?, // number... Amount of fat given.
@SerializedName("insulin") val insulin: Double?, // number... Amount of insulin, if any.
@SerializedName("duration") val duration: Long?, // number... Duration in minutes.
@SerializedName("durationInMilliseconds") val durationInMilliseconds: Long?, // number... Duration in milliseconds.
@SerializedName("preBolus") val preBolus: Int?, // number... How many minutes the bolus was given before the meal started.
@SerializedName("splitNow") val splitNow: Int?, // number... Immediate part of combo bolus (in percent).
@SerializedName("splitExt") val splitExt: Int?, // number... Extended part of combo bolus (in percent).
@SerializedName("percent") val percent: Double?, // number... Eventual basal change in percent.
@SerializedName("absolute") val absolute: Double?, // number... Eventual basal change in absolute value (insulin units per hour).
@SerializedName("targetTop") val targetTop: Double?, // number... Top limit of temporary target.
@SerializedName("targetBottom") val targetBottom: Double?, // number... Bottom limit of temporary target.
@SerializedName("profile") val profile: String?, // string Name of the profile to which the pump has been switched.
@SerializedName("reason") val reason: String?, // string For example the reason why the profile has been switched or why the temporary target has been set.
@SerializedName("notes") val notes: String?, // string Description/notes of treatment.
@SerializedName("enteredBy") val enteredBy: String?, // string Who entered the treatment.
@SerializedName("glucose") val glucose: Double? = null, // double Current glucose
@SerializedName("glucoseType") val glucoseType: String? = null, // string example: "Sensor", "Finger", "Manual"
@SerializedName("units") val units: String? = null, // string The units for the glucose value, mg/dl or mmol/l. It is strongly recommended to fill in this field.
@SerializedName("carbs") val carbs: Double? = null, // number... Amount of carbs given.
@SerializedName("protein") val protein: Int? = null, // number... Amount of protein given.
@SerializedName("fat") val fat: Int? = null, // number... Amount of fat given.
@SerializedName("insulin") val insulin: Double? = null, // number... Amount of insulin, if any.
@SerializedName("duration") val duration: Long? = null, // number... Duration in minutes.
@SerializedName("durationInMilliseconds") val durationInMilliseconds: Long? = null, // number... Duration in milliseconds.
@SerializedName("preBolus") val preBolus: Int? = null, // number... How many minutes the bolus was given before the meal started.
@SerializedName("splitNow") val splitNow: Int? = null, // number... Immediate part of combo bolus (in percent).
@SerializedName("splitExt") val splitExt: Int? = null, // number... Extended part of combo bolus (in percent).
@SerializedName("percent") val percent: Double? = null, // number... Eventual basal change in percent.
@SerializedName("absolute") val absolute: Double? = null, // number... Eventual basal change in absolute value (insulin units per hour).
@SerializedName("targetTop") val targetTop: Double? = null, // number... Top limit of temporary target.
@SerializedName("targetBottom") val targetBottom: Double? = null, // number... Bottom limit of temporary target.
@SerializedName("profile") val profile: String? = null, // string Name of the profile to which the pump has been switched.
@SerializedName("reason") val reason: String? = null, // string For example the reason why the profile has been switched or why the temporary target has been set.
@SerializedName("notes") val notes: String? = null, // string Description/notes of treatment.
@SerializedName("enteredBy") val enteredBy: String? = null, // string Who entered the treatment.
@SerializedName("endId") val endId: Long?, // long id of record which ended this
@SerializedName("pumpId") val pumpId: Long?, // long or "Meal Bolus", "Correction Bolus", "Combo Bolus" ex 4102 not sure if long or int
@SerializedName("pumpType") val pumpType: String?, // string "Meal Bolus", "Correction Bolus", "Combo Bolus" ex "ACCU_CHEK_INSIGHT_BLUETOOTH",
@SerializedName("pumpSerial") val pumpSerial: String?, // string "Meal Bolus", "Correction Bolus", "Combo Bolus" "33013206",
@SerializedName("endId") val endId: Long? = null, // long id of record which ended this
@SerializedName("pumpId") val pumpId: Long? = null, // long or "Meal Bolus", "Correction Bolus", "Combo Bolus" ex 4102 not sure if long or int
@SerializedName("pumpType") val pumpType: String? = null, // string "Meal Bolus", "Correction Bolus", "Combo Bolus" ex "ACCU_CHEK_INSIGHT_BLUETOOTH",
@SerializedName("pumpSerial") val pumpSerial: String? = null, // string "Meal Bolus", "Correction Bolus", "Combo Bolus" "33013206",
// other fields found in examples but not in documentation
@SerializedName("profileJson") val profileJson: String?, // string "Profile Switch" ex json toString "{\"units\":\"mg\\/dl\",\"dia\":5,\"timezone\":\"Africa\\/Cairo\",
@SerializedName("profileJson") val profileJson: String? = null, // string "Profile Switch" ex json toString "{\"units\":\"mg\\/dl\",\"dia\":5,\"timezone\":\"Africa\\/Cairo\",
// \"sens\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":60},{\"time\":\"07:00\",\"timeAsSeconds\":25200,\"value\":60},{\"time\":\"08:00\",\"timeAsSeconds\":28800,\"value\":61.33333333333333},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":65.33333333333333},{\"time\":\"10:00\",\"timeAsSeconds\":36000,\"value\":69.33333333333333},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":73.33333333333333},{\"time\":\"13:00\",\"timeAsSeconds\":46800,\"value\":72},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":68},{\"time\":\"15:00\",\"timeAsSeconds\":54000,\"value\":65.33333333333333},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":65.33333333333333}],\"carbratio\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":5.7333333333333325},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":7.333333333333333},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":6.666666666666666}],\"basal\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":0.5249999999999999},{\"time\":\"01:00\",\"timeAsSeconds\":3600,\"value\":0.585},{\"time\":\"02:00\",\"timeAsSeconds\":7200,\"value\":0.6375},{\"time\":\"03:00\",\"timeAsSeconds\":10800,\"value\":0.5625},{\"time\":\"04:00\",\"timeAsSeconds\":14400,\"value\":0.4575},{\"time\":\"05:00\",\"timeAsSeconds\":18000,\"value\":0.5175},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":0.48},{\"time\":\"07:00\",\"timeAsSeconds\":25200,\"value\":0.51},{\"time\":\"08:00\",\"timeAsSeconds\":28800,\"value\":0.48750000000000004},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":0.48},{\"time\":\"10:00\",\"timeAsSeconds\":36000,\"value\":0.48750000000000004},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":0.5025000000000001},{\"time\":\"12:00\",\"timeAsSeconds\":43200,\"value\":0.5549999999999999},{\"time\":\"13:00\",\"timeAsSeconds\":46800,\"value\":0.5700000000000001},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":0.5700000000000001},{\"time\":\"15:00\",\"timeAsSeconds\":54000,\"value\":0.5775},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":0.51},{\"time\":\"17:00\",\"timeAsSeconds\":61200,\"value\":0.54},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":0.48750000000000004},{\"time\":\"19:00\",\"timeAsSeconds\":68400,\"value\":0.5249999999999999},{\"time\":\"20:00\",\"timeAsSeconds\":72000,\"value\":0.46499999999999997},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":0.46499999999999997},{\"time\":\"22:00\",\"timeAsSeconds\":79200,\"value\":0.43499999999999994},{\"time\":\"23:00\",\"timeAsSeconds\":82800,\"value\":0.41250000000000003}],\"target_low\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":100},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":90},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":100},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":90},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":100},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":90},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":100}],\"target_high\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":100},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":90},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":100},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":90},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":100},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":90},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":100}]}",
@SerializedName("originalProfileName") val originalProfileName: String?, // string "Effective Profile Switch"
@SerializedName("originalCustomizedName") val originalCustomizedName: String?, // string "Effective Profile Switch"
@SerializedName("originalTimeshift") val originalTimeshift: Long?, // long "Effective Profile Switch"
@SerializedName("originalPercentage") val originalPercentage: Int?, // int "Effective Profile Switch"
@SerializedName("originalDuration") val originalDuration: Long?, // long "Effective Profile Switch"
@SerializedName("originalEnd") val originalEnd: Long?, // long "Effective Profile Switch"
@SerializedName("originalProfileName") val originalProfileName: String? = null, // string "Effective Profile Switch"
@SerializedName("originalCustomizedName") val originalCustomizedName: String? = null, // string "Effective Profile Switch"
@SerializedName("originalTimeshift") val originalTimeshift: Long? = null, // long "Effective Profile Switch"
@SerializedName("originalPercentage") val originalPercentage: Int? = null, // int "Effective Profile Switch"
@SerializedName("originalDuration") val originalDuration: Long? = null, // long "Effective Profile Switch"
@SerializedName("originalEnd") val originalEnd: Long? = null, // long "Effective Profile Switch"
@SerializedName("bolusCalculatorResult") val bolusCalculatorResult: String?, // string "Bolus Wizard" json toString ex "bolusCalculatorResult": "{\"basalIOB\":-0.247,\"bolusIOB\":-1.837,\"carbs\":45.0,\"carbsInsulin\":9.0,\"cob\":0.0,\"cobInsulin\":0.0,\"dateCreated\":1626202788810,\"glucoseDifference\":44.0,\"glucoseInsulin\":0.8979591836734694,\"glucoseTrend\":5.5,\"glucoseValue\":134.0,\"ic\":5.0,\"id\":331,\"interfaceIDs_backing\":{\"nightscoutId\":\"60ede2a4c574da0004a3869d\"},\"isValid\":true,\"isf\":49.0,\"note\":\"\",\"otherCorrection\":0.0,\"percentageCorrection\":90,\"profileName\":\"Tuned 13/01 90%Lyum\",\"superbolusInsulin\":0.0,\"targetBGHigh\":90.0,\"targetBGLow\":90.0,\"timestamp\":1626202783325,\"totalInsulin\":7.34,\"trendInsulin\":0.336734693877551,\"utcOffset\":7200000,\"version\":1,\"wasBasalIOBUsed\":true,\"wasBolusIOBUsed\":true,\"wasCOBUsed\":true,\"wasGlucoseUsed\":true,\"wasSuperbolusUsed\":false,\"wasTempTargetUsed\":false,\"wasTrendUsed\":true,\"wereCarbsUsed\":false}",
@SerializedName("type") val type: String?, // string "Meal Bolus", "Correction Bolus", "Combo Bolus", "Temp Basal" type of bolus "NORMAL", "SMB", "FAKE_EXTENDED"
@SerializedName("isSMB") val isSMB: Boolean, // boolean "Meal Bolus", "Correction Bolus", "Combo Bolus"
@SerializedName("enteredinsulin") val enteredinsulin: Double?, // number... "Combo Bolus" insulin is missing only enteredinsulin field found
@SerializedName("relative") val relative: Double?, // number... "Combo Bolus", "extendedEmulated" (not in doc see below)
@SerializedName("isEmulatingTempBasal") val isEmulatingTempBasal: Boolean, // boolean "Combo Bolus", "extendedEmulated" (not in doc see below)
@SerializedName("isAnnouncement") val isAnnouncement: Boolean, // boolean "Announcement"
@SerializedName("rate") val rate: Double?, // Double "Temp Basal" absolute rate (could be calculated with percent and profile information...)
@SerializedName("extendedEmulated") val extendedEmulated: RemoteTreatment?, // Gson of emulated EB
@SerializedName("timeshift") val timeshift: Long, // integer "Profile Switch"
@SerializedName("percentage") val percentage: Int?, // integer "Profile Switch"
@SerializedName("bolusCalculatorResult") val bolusCalculatorResult: String? = null, // string "Bolus Wizard" json toString ex "bolusCalculatorResult": "{\"basalIOB\":-0.247,\"bolusIOB\":-1.837,\"carbs\":45.0,\"carbsInsulin\":9.0,\"cob\":0.0,\"cobInsulin\":0.0,\"dateCreated\":1626202788810,\"glucoseDifference\":44.0,\"glucoseInsulin\":0.8979591836734694,\"glucoseTrend\":5.5,\"glucoseValue\":134.0,\"ic\":5.0,\"id\":331,\"interfaceIDs_backing\":{\"nightscoutId\":\"60ede2a4c574da0004a3869d\"},\"isValid\":true,\"isf\":49.0,\"note\":\"\",\"otherCorrection\":0.0,\"percentageCorrection\":90,\"profileName\":\"Tuned 13/01 90%Lyum\",\"superbolusInsulin\":0.0,\"targetBGHigh\":90.0,\"targetBGLow\":90.0,\"timestamp\":1626202783325,\"totalInsulin\":7.34,\"trendInsulin\":0.336734693877551,\"utcOffset\":7200000,\"version\":1,\"wasBasalIOBUsed\":true,\"wasBolusIOBUsed\":true,\"wasCOBUsed\":true,\"wasGlucoseUsed\":true,\"wasSuperbolusUsed\":false,\"wasTempTargetUsed\":false,\"wasTrendUsed\":true,\"wereCarbsUsed\":false}",
@SerializedName("type") val type: String? = null, // string "Meal Bolus", "Correction Bolus", "Combo Bolus", "Temp Basal" type of bolus "NORMAL", "SMB", "FAKE_EXTENDED"
@SerializedName("isSMB") val isSMB: Boolean? = null, // boolean "Meal Bolus", "Correction Bolus", "Combo Bolus"
@SerializedName("enteredinsulin") val enteredinsulin: Double? = null, // number... "Combo Bolus" insulin is missing only enteredinsulin field found
@SerializedName("relative") val relative: Double? = null, // number... "Combo Bolus", "extendedEmulated" (not in doc see below)
@SerializedName("isEmulatingTempBasal") val isEmulatingTempBasal: Boolean? = null, // boolean "Combo Bolus", "extendedEmulated" (not in doc see below)
@SerializedName("isAnnouncement") val isAnnouncement: Boolean? = null, // boolean "Announcement"
@SerializedName("rate") val rate: Double? = null, // Double "Temp Basal" absolute rate (could be calculated with percent and profile information...)
@SerializedName("extendedEmulated") val extendedEmulated: RemoteTreatment? = null, // Gson of emulated EB
@SerializedName("timeshift") val timeshift: Long? = null, // integer "Profile Switch"
@SerializedName("percentage") val percentage: Int? = null // integer "Profile Switch"
) {
fun timestamp(): Long {
return date ?: mills ?: timestamp ?: fromISODateString(created_at)
return date ?: mills ?: timestamp ?: created_at?. let { fromISODateString(created_at) } ?: 0L
}
private fun fromISODateString(isoDateString: String): Long =

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.utils.extensions
package info.nightscout.core.ui.extensions
import android.widget.RadioGroup
import androidx.appcompat.widget.AppCompatRadioButton

View file

@ -113,6 +113,7 @@
<string name="closedloop">Geslote lus</string>
<string name="openloop">Oop lus</string>
<string name="dia">DIA</string>
<string name="virtualpump_uploadstatus_title">Oplaaistatus aan NS</string>
<!-- Protection-->
<string name="wrongpassword">Verkeerde wagwoord</string>
<!-- Profile-->

View file

@ -138,6 +138,7 @@
<string name="dia">DIA</string>
<string name="ic_short">И / Въгл</string>
<string name="isf_short">Чувств</string>
<string name="virtualpump_uploadstatus_title">Качва статуса в NS</string>
<!-- Protection-->
<string name="wrongpassword">Грешна парола</string>
<string name="passwords_dont_match">Паролите не съвпадат</string>

View file

@ -137,6 +137,9 @@
<string name="dia">DIA (Durada de l\'Acció de la Insulina)</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Enviar estat a NS</string>
<string name="suspendloop_label">Llaç desactivat/aturat</string>
<string name="iob_label">Insulina \"a bord\" (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Contrasenya incorrecta</string>
<string name="passwords_dont_match">Les contrasenyes no coincideixen</string>

View file

@ -164,6 +164,9 @@
<string name="isf_short">ISF</string>
<string name="canceling_tbr_failed">Rušení dočasného bazálu selhalo</string>
<string name="canceling_eb_failed">Zastavení prodlouženého bolusu selhalo</string>
<string name="virtualpump_uploadstatus_title">Nahrávat status do NS</string>
<string name="suspendloop_label">Zakázaná/pozastavená smyčka</string>
<string name="iob_label">Aktivní inzulín (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Chybné heslo</string>
<string name="wrongpin">Nesprávný PIN</string>

View file

@ -155,6 +155,9 @@
<string name="dia">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Upload status til NS</string>
<string name="suspendloop_label">Deaktiveret/Suspendéret Loop</string>
<string name="iob_label">Insulin om bord (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Forkert kodeord</string>
<string name="wrongpin">Forkert pinkode</string>

View file

@ -101,6 +101,7 @@
<string name="loading">Lade…</string>
<string name="notes_label">Notizen</string>
<string name="remove_button">Löschen</string>
<string name="add_new">Neu hinzufügen</string>
<string name="addnew_above">Neu oben hinzufügen</string>
<string name="wrong_pump_data">Daten kommen von einer anderen Pumpe. Wechsle den Pumpentreiber.</string>
<string name="bg_label">BZ</string>
@ -155,6 +156,9 @@
<string name="dia">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Status zu Nightscout hochladen</string>
<string name="suspendloop_label">Deaktiviere/Pausiere den Loop</string>
<string name="iob_label">Aktives Insulin (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Falsches Passwort</string>
<string name="wrongpin">Falsche PIN</string>
@ -316,6 +320,7 @@
<string name="uel_export_settings">EINSTELLUNGEN EXPORTIEREN</string>
<string name="uel_import_settings">EINSTELLUNGEN IMPORTIEREN</string>
<string name="uel_reset_databases">DATENBANK ZURÜCKSETZEN</string>
<string name="uel_cleanup_databases">DATENBANKEN BEREINIGEN</string>
<string name="uel_export_databases">DATENBANK EXPORTIEREN</string>
<string name="uel_import_databases">DATENBANK IMPORTIEREN</string>
<string name="uel_otp_export">OTP EXPORT</string>

View file

@ -116,6 +116,7 @@
<string name="closedloop">Κλειστό Κύκλωμα</string>
<string name="openloop">Ανοιχτό Κύκλωμα</string>
<string name="lowglucosesuspend">Αναστολή Χαμηλής Γλυκόζης</string>
<string name="virtualpump_uploadstatus_title">Φόρτωση κατάστασης στο NS</string>
<!-- Protection-->
<string name="wrongpassword">Λάθος κωδικός</string>
<!-- Profile-->

View file

@ -164,6 +164,9 @@
<string name="isf_short">ISF</string>
<string name="canceling_tbr_failed">Error cancelando la basal temporal</string>
<string name="canceling_eb_failed">Error cancelando el bolo extendido</string>
<string name="virtualpump_uploadstatus_title">Subir estado a Nightscout</string>
<string name="suspendloop_label">Desactiva/suspende el lazo</string>
<string name="iob_label">Insulina a bordo (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Contraseña incorrecta</string>
<string name="wrongpin">Pin erróneo</string>

View file

@ -14,6 +14,7 @@
<string name="pump_base_basal_rate">%1$.2f U/h</string>
<string name="pump_not_initialized_profile_not_set">Pompe non initialisée, profil non défini !</string>
<string name="failed_update_basal_profile">La mise à jour du profil basal a échouée</string>
<string name="bolus_delivered_successfully">Bolus de %1$.2f U délivré avec succès</string>
<string name="no_valid_basal_rate">Aucun débit basal valide lu depuis la pompe</string>
<string name="limiting_iob">Limiter lIA %1$.1f U en raison de la %2$s</string>
<string name="loop_disabled">BOUCLE DÉSACTIVÉE PAR RESTRICTIONS</string>
@ -161,6 +162,11 @@
<string name="dia">DAI</string>
<string name="ic_short">G/I</string>
<string name="isf_short">SI</string>
<string name="canceling_tbr_failed">Echec de l\'annulation du basal temporaire</string>
<string name="canceling_eb_failed">Échec de l\'annulation du Bolus étendu</string>
<string name="virtualpump_uploadstatus_title">Remontée des informations vers NS</string>
<string name="suspendloop_label">Boucle désactivée/suspendue</string>
<string name="iob_label">Insuline Active (IA)</string>
<!-- Protection-->
<string name="wrongpassword">Mot de passe incorrect</string>
<string name="wrongpin">Code PIN incorrect</string>
@ -243,6 +249,7 @@
<!-- CarbsReq-->
<string name="carbsreq">%1$dg de glucides requis dans %2$d min.</string>
<!-- TDDStatsActivity-->
<string name="cumulative_tdd">DTQ cumulée</string>
<string name="expweight">DTQ avec Pondération Exponentielle</string>
<string name="basalrate">Basal</string>
<string name="bolus">Bolus</string>

View file

@ -108,6 +108,7 @@
<string name="dia">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Prijenos statusa u NS</string>
<!-- Protection-->
<string name="wrongpassword">Pogrešna lozinka</string>
<string name="wrongpin">Pogrešan PIN</string>

View file

@ -156,6 +156,9 @@
<string name="dia">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Carica stato in NS</string>
<string name="suspendloop_label">Loop disabilitato/sospeso</string>
<string name="iob_label">Insulina attiva (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Password errata</string>
<string name="wrongpin">PIN errato</string>

View file

@ -156,6 +156,9 @@
<string name="dia">משך פעילות אינסולין</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">טוען מצב ל-Nightscout</string>
<string name="suspendloop_label">השבתת \\ השהיית לולאה</string>
<string name="iob_label">אינסולין פעיל בגוף (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">סיסמה שגויה</string>
<string name="wrongpin">קוד PIN שגוי</string>

View file

@ -136,6 +136,9 @@
<string name="dia">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">NS에 상태 업로드하기</string>
<string name="suspendloop_label">중지 또는 일시중지된 loop</string>
<string name="iob_label">활성 인슐린 (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">잘못된 비밀번호</string>
<string name="passwords_dont_match">비밀번호가 일치하지 않습니다.</string>

View file

@ -141,6 +141,9 @@
<string name="dia">IVT</string>
<string name="ic_short">IA</string>
<string name="isf_short">JIF</string>
<string name="virtualpump_uploadstatus_title">Perduoti būsenos duomenis į NS</string>
<string name="suspendloop_label">Ciklas išjungtas/sustabdytas</string>
<string name="iob_label">Aktyvus insulinas organizme (AIO)</string>
<!-- Protection-->
<string name="wrongpassword">Neteisingas slaptažodis</string>
<string name="passwords_dont_match">Slaptažodžiai nesutampa</string>

View file

@ -158,6 +158,9 @@
<string name="dia">DIA</string>
<string name="ic_short">KH-ratio</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Upload status naar NS</string>
<string name="suspendloop_label">Uitgeschakelde/onderbroken loop</string>
<string name="iob_label">Insuline aan boord (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Verkeerd wachtwoord</string>
<string name="wrongpin">Onjuiste PIN-code</string>

View file

@ -164,6 +164,9 @@
<string name="isf_short">ISF</string>
<string name="canceling_tbr_failed">Kansellering av Temp Basal feilet</string>
<string name="canceling_eb_failed">Kansellering av forlenget bolus feilet</string>
<string name="virtualpump_uploadstatus_title">Last opp status til Nightscout</string>
<string name="suspendloop_label">Deaktiver/pause loop</string>
<string name="iob_label">Aktivt insulin (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Feil passord</string>
<string name="wrongpin">Feil PIN-kode</string>

View file

@ -141,6 +141,9 @@
<string name="dia">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Przesyłaj status do NS</string>
<string name="suspendloop_label">Wyłączona/zawieszona pętla</string>
<string name="iob_label">Aktywna insulina (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Złe hasło</string>
<string name="passwords_dont_match">Hasła się nie zgadzają</string>

View file

@ -6,13 +6,26 @@
<string name="application_protection">Proteção Aplicação</string>
<string name="bolus_protection">Proteção Bólus</string>
<string name="settings_password">Definições de senha</string>
<string name="settings_pin">Configurações do PIN</string>
<string name="application_password">Senha da aplicação</string>
<string name="application_pin">PIN do Aplicativo</string>
<string name="bolus_password">Senha do bólus</string>
<string name="bolus_pin">Bolus PIN</string>
<string name="protection_timeout_title">PIN e senha de segurança</string>
<string name="protection_timeout_summary">Tempo até que a senha ou PIN sejam inseridos</string>
<string name="biometric">Biometria</string>
<string name="custom_password">Senha personalizada</string>
<string name="custom_pin">PIN personalizado</string>
<string name="noprotection">Sem proteção</string>
<string name="unsecure_fallback_biometric">Retorno Inseguro</string>
<string name="unsecure_fallback_descriotion_biometric">Para ser eficaz, a proteção biométrica precisa de uma senha mestra definida para a substituição.\n\nPor favor defina uma senha mestra!</string>
<string name="password_set">Senha foi definida!</string>
<string name="pin_set">PIN definido!</string>
<string name="password_not_set">Senha não foi definida</string>
<string name="pin_not_set">PIN não definido</string>
<string name="password_not_changed">Senha não foi alterada</string>
<string name="pin_not_changed">PIN não alterado</string>
<string name="pin_cleared">PIN apagado!</string>
<string name="password_hint">Insira a senha aqui</string>
<string name="pin_hint">Insira o PIN aqui</string>
</resources>

View file

@ -14,6 +14,7 @@
<string name="pump_base_basal_rate">%1$.2f U/h</string>
<string name="pump_not_initialized_profile_not_set">Bomba não inicializada, perfil não definido!</string>
<string name="failed_update_basal_profile">Falha ao atualizar o perfil basal</string>
<string name="bolus_delivered_successfully">Bolus %1$.2f U aplicado com sucesso</string>
<string name="no_valid_basal_rate">Nenhum valor de basal temporaria valido foi lido da bomba</string>
<string name="limiting_iob">A limitar IOB para %1$.1f U porque %2$s</string>
<string name="loop_disabled">LOOP DESATIVADO POR RESTRIÇÕES</string>
@ -46,6 +47,7 @@
<string name="success">Sucesso</string>
<string name="advancedsettings_title">Configurações Avançadas</string>
<string name="extendedbolusdeliveryerror">Erro na entrega Bólus Estendido</string>
<string name="aps_mode_title">Modo APS</string>
<string name="extended_bolus">Bólus estendido</string>
<string name="paused">Pausado</string>
<string name="tdd_total">DDT Total</string>
@ -60,6 +62,8 @@
<string name="please_wait">Por favor aguarde…</string>
<string name="stop">Parar</string>
<string name="carbs">Carbos</string>
<string name="invalid_profile">Perfil inválido!</string>
<string name="no_profile_set">SEM PERFIL DEFINIDO</string>
<string name="active"><![CDATA[<Active>]]></string>
<string name="date">Data</string>
<string name="units_label">Unidades</string>
@ -149,6 +153,7 @@
<string name="treatments_wizard_basaliob_label">IOB Basal</string>
<string name="invalid">INVÁLIDO</string>
<string name="login">Login</string>
<string name="prime_fill">Purgar/Preencher</string>
<string name="overview_insulin_label">Insulina</string>
<string name="stoptemptarget">Parar Alvo Temp</string>
<string name="closedloop">Loop Fechado</string>
@ -157,6 +162,11 @@
<string name="dia">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">FSI</string>
<string name="canceling_tbr_failed">Cancelamento do basal temporário falhou</string>
<string name="canceling_eb_failed">Falhou o cancelamento do bolus extendido</string>
<string name="virtualpump_uploadstatus_title">Enviar estado para NS</string>
<string name="suspendloop_label">Loop Desativado/Suspenso</string>
<string name="iob_label">Insulina ativa (IA)</string>
<!-- Protection-->
<string name="wrongpassword">Senha incorreta</string>
<string name="wrongpin">PIN incorreto</string>
@ -172,6 +182,7 @@
<!-- ProfileFunction-->
<string name="startprofile">Iniciar perfil %1$d%% para %2$d min</string>
<!-- APSResult-->
<string name="cancel_temp">Cancelar basal temporário</string>
<string name="let_temp_basal_run">Deixa o basal temporário em andamento</string>
<string name="rate">Rácio</string>
<string name="duration">Duração</string>
@ -193,9 +204,12 @@
<string name="careportal_note_message">Observação: %1$s</string>
<string name="careportal_question_message">Questão : %1$s</string>
<string name="careportal_exercise_message">Exercício : %1$s</string>
<string name="careportal_pump_site_change">Alteração do local do cateter</string>
<string name="cgm_sensor_insert">Colocação do Sensor CGM</string>
<string name="careportal_cgmsensorstart">Início do Sensor CGM</string>
<string name="careportal_cgm_sensor_stop">Parar Sensor CGM</string>
<string name="careportal_dad_alert">Alerta D.A.D</string>
<string name="careportal_insulin_cartridge_change">Troca de Reservatório de Insulina</string>
<string name="careportal_profileswitch">Troca de Perfil</string>
<string name="careportal_snackbolus">Bólus Lanche</string>
<string name="careportal_mealbolus">Bólus Refeição</string>
@ -205,6 +219,8 @@
<string name="careportal_tempbasalend">Fim do Basal Temp</string>
<string name="careportal_carbscorrection">Correção Carboidratos</string>
<string name="careportal_openapsoffline">OpenAPS Offline</string>
<string name="pump_battery_change">Troca de Bateria da Bomba</string>
<string name="temporary_target">Alvo Temporário</string>
<string name="careportal_temporarytargetvalue">Valor do Alvo Temporário</string>
<string name="careportal_temporarytargetcancel">Cancelar alvo temporário</string>
<string name="boluswizard">Assistente de Bólus</string>
@ -233,6 +249,7 @@
<!-- CarbsReq-->
<string name="carbsreq">%1$d g de carboidratos necessários em %2$d minutos</string>
<!-- TDDStatsActivity-->
<string name="cumulative_tdd">Dose diária acumulada (TDD)</string>
<string name="expweight">Dose diária exponencialmente ponderada</string>
<string name="basalrate">Basal</string>
<string name="bolus">Bólus</string>
@ -402,7 +419,7 @@
<string name="autotune_warning">Aviso :</string>
<string name="autotune_select_profile">Selecione o perfil para ajustar</string>
<string name="autotune_ic_warning">O perfil selecionado tem %1$d valores de IC. Autotune vai usar %2$.2f g/U</string>
<string name="autotune_isf_warning">O perfil selecionado tem %1$d valores de ISF. Autotune vai usar %2$.1f g/U</string>
<string name="autotune_isf_warning">O perfil selecionado tem %1$d valores de ISF. Autotune usará %2$.1f %3$s/U</string>
<string name="autotune_error">Erro nos dados de entrada, tente executar novamente autotune ou reduza o número de dias</string>
<string name="autotune_warning_during_run">Cálculos do Autotune iniciados, por favor aguarde</string>
<string name="autotune_warning_after_run">Verifique os resultados cuidadosamente antes de usá-los!</string>
@ -431,9 +448,13 @@
<string name="urgent_alarm">Alarme Urgente</string>
<string name="info">INFO</string>
<!-- BolusWizard -->
<string name="bolus_advisor">Assistente de bolus</string>
<string name="bolus_advisor_message">Sua glicemia está alta. Em vez de comer agora, é recomendado esperar por uma glicemia melhor. Quer fazer um bolus de correção agora e ser lembrado de quando for hora de comer? Neste caso, nenhum carboidrato será registrado e você deverá usar o assistente novamente quando lembrarmos você.</string>
<string name="cobvsiob">CA vs IA</string>
<string name="slowabsorptiondetected"><![CDATA[<font color=\'%1$s\'>!!!!! Absorção lenta de hidratos detectada: %2$d%% do tempo. Verifique o seu cálculo. COB pode estar sobreestimado, assim mais insulina pode ser dada !!!</font>]]></string>
<string name="partialboluswizard">Entregue esta parte do resultado do assistente de bólus [%]</string>
<string name="bolus_constraint_applied_warn">Restrição de bólus aplicada: %1$.2f U para %2$.2f U</string>
<string name="bolus_recorded_only">Bolus será apenas registrado (não administrado pela bomba)</string>
<string name="advisoralarm">Disparar alarme quando for a hora de comer</string>
<string name="no_action_selected">Nenhuma acção seleccionada, nada irá acontecer</string>
<string name="wizard_no_actual_bg">Nenhuma glicemia recente para base de cálculo!</string>
@ -453,9 +474,15 @@
<string name="wizard_explain_tt_to">%1$s para %2$s</string>
<string name="wizard_pump_not_available">Nenhuma bomba disponível!</string>
<!-- Preferences-->
<string name="child">Criança</string>
<string name="teenage">Adolescente</string>
<string name="adult">Adulto</string>
<string name="resistant_adult">Adulto resistente à insulina</string>
<string name="pregnant">Grávida</string>
<string name="patient_age_summary">Selecione o tipo de paciente para configurar os limites de segurança</string>
<string name="max_bolus_title">Máximo bolus permitido [U]</string>
<string name="max_carbs_title">Máximo de carbs permitidos [g]</string>
<string name="patient_type">Tipo de paciente</string>
<!-- Protection-->
<string name="unlock_settings">Definições de desbloqueio</string>
<!-- Pumps -->

View file

@ -139,6 +139,9 @@
<string name="dia">DIA</string>
<string name="ic_short">IHC</string>
<string name="isf_short">FSI</string>
<string name="virtualpump_uploadstatus_title">Enviar estado para NS</string>
<string name="suspendloop_label">Loop Desactivado/Suspenso</string>
<string name="iob_label">Insulina ativa (IA )</string>
<!-- Protection-->
<string name="wrongpassword">Palavra-passe incorreta</string>
<string name="passwords_dont_match">Palavras-passe não correspondem</string>

View file

@ -140,6 +140,9 @@
<string name="dia">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Trimitere status către NS</string>
<string name="suspendloop_label">Buclă dezactivată/suspendată</string>
<string name="iob_label">Insulină activă (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Parola greșită</string>
<string name="passwords_dont_match">Parolele nu corespund</string>

View file

@ -162,6 +162,11 @@
<string name="dia">Время действия инсулина DIA</string>
<string name="ic_short">IC углкоэф ГУ/инс</string>
<string name="isf_short">ISF (чувствительность к инсулину)</string>
<string name="canceling_tbr_failed">Отмена врем базала не состоялась</string>
<string name="canceling_eb_failed">Сбой отмены пролонгированного болюса</string>
<string name="virtualpump_uploadstatus_title">статус передачи данных в NS</string>
<string name="suspendloop_label">Отключенный/приостановленный цикл</string>
<string name="iob_label">Активный инсулин (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Неверный пароль</string>
<string name="wrongpin">Неверный PIN-код</string>
@ -423,7 +428,6 @@
<string name="autotune_param">Парам</string>
<string name="autotune_percent">%</string>
<string name="autotune_missing">Отсутствует</string>
<string name="autotune_profile_name">Профиль авто тюн</string>
<string name="autotune_run">Выполнить Autotune</string>
<string name="autotune_check_input_profile_button">Проверьте профиль ввода</string>
<string name="autotune_compare_profile">Сравнить профили</string>

View file

@ -162,6 +162,9 @@
<string name="dia">DIA</string>
<string name="ic_short">I:C</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Nahrať stav do NS</string>
<string name="suspendloop_label">Deaktivovaný/pozastavený uzavretý okruh</string>
<string name="iob_label">Aktívny inzulín (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Nesprávne heslo</string>
<string name="wrongpin">Nesprávny PIN</string>

View file

@ -153,6 +153,9 @@
<string name="dia">Duration</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">Ladda upp status till Nightscout</string>
<string name="suspendloop_label">Inaktiverad/pausad loop</string>
<string name="iob_label">Aktivt Insulin (IOB)</string>
<!-- Protection-->
<string name="wrongpassword">Fel lösenord</string>
<string name="passwords_dont_match">Lösenorden stämmer inte överens</string>

View file

@ -160,6 +160,9 @@
<string name="dia">İES</string>
<string name="ic_short">IC Karbonhidrat İnsülin Oranı</string>
<string name="isf_short">IDF İnsülin Duyarlılık Faktörü</string>
<string name="virtualpump_uploadstatus_title">Nightscout\'a durum aktar</string>
<string name="suspendloop_label">Döngüyü Devre Dışı bırakma/Askıya alma</string>
<string name="iob_label">Aktif İnsülin (AİNS)</string>
<!-- Protection-->
<string name="wrongpassword">Hatalı parola</string>
<string name="wrongpin">Yanlış PIN</string>

View file

@ -154,6 +154,9 @@
<string name="dia">DIA</string>
<string name="ic_short">IC</string>
<string name="isf_short">ISF</string>
<string name="virtualpump_uploadstatus_title">将状态上传到 NS</string>
<string name="suspendloop_label">禁用/暂停闭环</string>
<string name="iob_label">活性胰岛素(IOB)</string>
<!-- Protection-->
<string name="wrongpassword">密码错误</string>
<string name="wrongpin">PIN 码错误</string>
@ -480,7 +483,7 @@
<!-- Constraints-->
<string name="limitingbasalratio">最大基础率被限定为 %1$.2f U/h 由于 %2$s</string>
<string name="pumplimit">泵限制</string>
<string name="limitingpercentrate">由于 %2$s, 将最大百分比限制为 %1$d%</string>
<string name="limitingpercentrate">由于 %2$s, 将最大百分比限制为 %1$d%%</string>
<string name="itmustbepositivevalue">它必须是正数</string>
<string name="limitingbolus">由于 %2$s, 将大剂量限制为 %1$.1f U</string>
<!-- Locale -->

View file

@ -1,4 +1,4 @@
package info.nightscout.core.extensions
package info.nightscout.core.utils.extensions
import androidx.annotation.StringRes
import info.nightscout.shared.interfaces.ResourceHelper

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.BolusCalculatorResult
class UpdateNsIdBolusCalculatorResultTransaction(val bolusCalculatorResult: BolusCalculatorResult) : Transaction<Unit>() {
class UpdateNsIdBolusCalculatorResultTransaction(private val bolusCalculatorResults: List<BolusCalculatorResult>) : Transaction<UpdateNsIdBolusCalculatorResultTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (bolusCalculatorResult in bolusCalculatorResults) {
val current = database.bolusCalculatorResultDao.findById(bolusCalculatorResult.id)
if (current != null && current.interfaceIDs.nightscoutId != bolusCalculatorResult.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = bolusCalculatorResult.interfaceIDs.nightscoutId
database.bolusCalculatorResultDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<BolusCalculatorResult>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.Bolus
class UpdateNsIdBolusTransaction(val bolus: Bolus) : Transaction<Unit>() {
class UpdateNsIdBolusTransaction(private val boluses: List<Bolus>) : Transaction<UpdateNsIdBolusTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (bolus in boluses) {
val current = database.bolusDao.findById(bolus.id)
if (current != null && current.interfaceIDs.nightscoutId != bolus.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = bolus.interfaceIDs.nightscoutId
database.bolusDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<Bolus>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.Carbs
class UpdateNsIdCarbsTransaction(val carbs: Carbs) : Transaction<Unit>() {
class UpdateNsIdCarbsTransaction(private val carbs: List<Carbs>) : Transaction<UpdateNsIdCarbsTransaction.TransactionResult>() {
override fun run() {
val current = database.carbsDao.findById(carbs.id)
if (current != null && current.interfaceIDs.nightscoutId != carbs.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = carbs.interfaceIDs.nightscoutId
val result = TransactionResult()
override fun run(): TransactionResult {
for (carb in carbs) {
val current = database.carbsDao.findById(carb.id)
if (current != null && current.interfaceIDs.nightscoutId != carb.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = carb.interfaceIDs.nightscoutId
database.carbsDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<Carbs>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.DeviceStatus
class UpdateNsIdDeviceStatusTransaction(val deviceStatus: DeviceStatus) : Transaction<Unit>() {
class UpdateNsIdDeviceStatusTransaction(private val deviceStatuses: List<DeviceStatus>) : Transaction<UpdateNsIdDeviceStatusTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (deviceStatus in deviceStatuses) {
val current = database.deviceStatusDao.findById(deviceStatus.id)
if (current != null && current.interfaceIDs.nightscoutId != deviceStatus.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = deviceStatus.interfaceIDs.nightscoutId
database.deviceStatusDao.update(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<DeviceStatus>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.EffectiveProfileSwitch
class UpdateNsIdEffectiveProfileSwitchTransaction(val effectiveProfileSwitch: EffectiveProfileSwitch) : Transaction<Unit>() {
class UpdateNsIdEffectiveProfileSwitchTransaction(private val effectiveProfileSwitches: List<EffectiveProfileSwitch>) : Transaction<UpdateNsIdEffectiveProfileSwitchTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (effectiveProfileSwitch in effectiveProfileSwitches) {
val current = database.effectiveProfileSwitchDao.findById(effectiveProfileSwitch.id)
if (current != null && current.interfaceIDs.nightscoutId != effectiveProfileSwitch.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = effectiveProfileSwitch.interfaceIDs.nightscoutId
database.effectiveProfileSwitchDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<EffectiveProfileSwitch>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.ExtendedBolus
class UpdateNsIdExtendedBolusTransaction(val bolus: ExtendedBolus) : Transaction<Unit>() {
class UpdateNsIdExtendedBolusTransaction(val boluses: List<ExtendedBolus>) : Transaction<UpdateNsIdExtendedBolusTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (bolus in boluses) {
val current = database.extendedBolusDao.findById(bolus.id)
if (current != null && current.interfaceIDs.nightscoutId != bolus.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = bolus.interfaceIDs.nightscoutId
database.extendedBolusDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<ExtendedBolus>()
}
}

View file

@ -2,13 +2,24 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.Food
class UpdateNsIdFoodTransaction(val food: Food) : Transaction<Unit>() {
class UpdateNsIdFoodTransaction(private val foods: List<Food>) : Transaction<UpdateNsIdFoodTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (food in foods) {
val current = database.foodDao.findById(food.id)
if (current != null && current.interfaceIDs.nightscoutId != food.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = food.interfaceIDs.nightscoutId
database.foodDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<Food>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.GlucoseValue
class UpdateNsIdGlucoseValueTransaction(val glucoseValue: GlucoseValue) : Transaction<Unit>() {
class UpdateNsIdGlucoseValueTransaction(private val glucoseValues: List<GlucoseValue>) : Transaction<UpdateNsIdGlucoseValueTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (glucoseValue in glucoseValues) {
val current = database.glucoseValueDao.findById(glucoseValue.id)
if (current != null && current.interfaceIDs.nightscoutId != glucoseValue.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = glucoseValue.interfaceIDs.nightscoutId
database.glucoseValueDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<GlucoseValue>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.OfflineEvent
class UpdateNsIdOfflineEventTransaction(val offlineEvent: OfflineEvent) : Transaction<Unit>() {
class UpdateNsIdOfflineEventTransaction(private val offlineEvents: List<OfflineEvent>) : Transaction<UpdateNsIdOfflineEventTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (offlineEvent in offlineEvents) {
val current = database.offlineEventDao.findById(offlineEvent.id)
if (current != null && current.interfaceIDs.nightscoutId != offlineEvent.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = offlineEvent.interfaceIDs.nightscoutId
database.offlineEventDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<OfflineEvent>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.ProfileSwitch
class UpdateNsIdProfileSwitchTransaction(val profileSwitch: ProfileSwitch) : Transaction<Unit>() {
class UpdateNsIdProfileSwitchTransaction(val profileSwitches: List<ProfileSwitch>) : Transaction<UpdateNsIdProfileSwitchTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (profileSwitch in profileSwitches) {
val current = database.profileSwitchDao.findById(profileSwitch.id)
if (current != null && current.interfaceIDs.nightscoutId != profileSwitch.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = profileSwitch.interfaceIDs.nightscoutId
database.profileSwitchDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<ProfileSwitch>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.TemporaryBasal
class UpdateNsIdTemporaryBasalTransaction(val temporaryBasal: TemporaryBasal) : Transaction<Unit>() {
class UpdateNsIdTemporaryBasalTransaction(private val temporaryBasals: List<TemporaryBasal>) : Transaction<UpdateNsIdTemporaryBasalTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (temporaryBasal in temporaryBasals) {
val current = database.temporaryBasalDao.findById(temporaryBasal.id)
if (current != null && current.interfaceIDs.nightscoutId != temporaryBasal.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = temporaryBasal.interfaceIDs.nightscoutId
database.temporaryBasalDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<TemporaryBasal>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.TemporaryTarget
class UpdateNsIdTemporaryTargetTransaction(val temporaryTarget: TemporaryTarget) : Transaction<Unit>() {
class UpdateNsIdTemporaryTargetTransaction(private val temporaryTargets: List<TemporaryTarget>) : Transaction<UpdateNsIdTemporaryTargetTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (temporaryTarget in temporaryTargets) {
val current = database.temporaryTargetDao.findById(temporaryTarget.id)
if (current != null && current.interfaceIDs.nightscoutId != temporaryTarget.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = temporaryTarget.interfaceIDs.nightscoutId
database.temporaryTargetDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<TemporaryTarget>()
}
}

View file

@ -2,13 +2,23 @@ package info.nightscout.database.impl.transactions
import info.nightscout.database.entities.TherapyEvent
class UpdateNsIdTherapyEventTransaction(val therapyEvent: TherapyEvent) : Transaction<Unit>() {
class UpdateNsIdTherapyEventTransaction(val therapyEvents: List<TherapyEvent>) : Transaction<UpdateNsIdTherapyEventTransaction.TransactionResult>() {
override fun run() {
val result = TransactionResult()
override fun run(): TransactionResult {
for (therapyEvent in therapyEvents) {
val current = database.therapyEventDao.findById(therapyEvent.id)
if (current != null && current.interfaceIDs.nightscoutId != therapyEvent.interfaceIDs.nightscoutId) {
current.interfaceIDs.nightscoutId = therapyEvent.interfaceIDs.nightscoutId
database.therapyEventDao.updateExistingEntry(current)
result.updatedNsId.add(current)
}
}
return result
}
class TransactionResult {
val updatedNsId = mutableListOf<TherapyEvent>()
}
}

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ не е инсталиран</string>
<string name="calibration_sent">Калибрацията е изпратена към xDrip+</string>
<string name="bg_label">КЗ</string>
<string name="time_to_eat">Време е за ядене</string>
<string name="time_to_bolus">Време е за болус!\nВключи болус съветника и направи изчисление отново.</string>
<string name="executing_right_now">Командата се изпълнява в момента</string>
<string name="basal_value_below_minimum">Базалните стойности са под минимума. Не е зададен профил!</string>
<string name="permission">Разрешение</string>

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ no instal·lat</string>
<string name="calibration_sent">Calibració enviada a xDrip+</string>
<string name="bg_label">Glucèmia</string>
<string name="time_to_eat">Hora de menjar</string>
<string name="time_to_bolus">Hora daplicar bolus!\nExecuteu l\'assistent de bolus i torneu a fer els càlculs.</string>
<string name="executing_right_now">Ordre executant-se ara mateix</string>
<string name="basal_value_below_minimum">Valor de basal per sota del mínim. Perfil no definit!</string>
<string name="permission">Permís</string>

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ není nainstalován</string>
<string name="calibration_sent">Kalibrace odeslána do xDripu+</string>
<string name="bg_label">Gly</string>
<string name="time_to_eat">Čas k jídlu</string>
<string name="time_to_bolus">Čas na bolus!\nSpusťte Bolusovou kalkulačku a proveďte výpočet znovu.</string>
<string name="executing_right_now">Příkaz je právě prováděn</string>
<string name="basal_value_below_minimum">Hodnota bazálu pod povoleným minimem. Nenastaveno!</string>
<string name="permission">Povolení</string>

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ ikke installeret</string>
<string name="calibration_sent">Kalibrering sendt til xDrip+</string>
<string name="bg_label">BG</string>
<string name="time_to_eat">Tid til at spise</string>
<string name="time_to_bolus">Tid til bolus!\nKør Bolus-guiden og lav beregningen igen.</string>
<string name="executing_right_now">Kommando udføres lige nu</string>
<string name="basal_value_below_minimum">Basal værdi under minimum. Profil ikke angivet!</string>
<string name="permission">Tilladelse</string>

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ nicht installiert</string>
<string name="calibration_sent">Kalibrierung an xDrip+ gesendet+</string>
<string name="bg_label">BZ</string>
<string name="time_to_eat">Zeit zum Essen</string>
<string name="time_to_bolus">Zeit für den nächsten Bolus!\nFühre den Bolus-Assistenten aus, um die Berechnung erneut durchzuführen.</string>
<string name="executing_right_now">Befehl wird zurzeit ausgeführt</string>
<string name="basal_value_below_minimum">Wert der Basalrate unter Minimum. Profil nicht gesetzt!</string>
<string name="permission">Berechtigung</string>

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ no se encuentra instalado</string>
<string name="calibration_sent">Calibración enviada a xDrip+</string>
<string name="bg_label">BG</string>
<string name="time_to_eat">Hora de comer</string>
<string name="time_to_bolus">¡Hora de comer!\nEjecutar el asistente de bolo y calcular de nuevo.</string>
<string name="executing_right_now">Orden se esta efectuando en este momento</string>
<string name="basal_value_below_minimum">Valor basal por debajo del mínimo. Perfil no establecido.</string>
<string name="permission">Permiso</string>

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ n\'est pas installé</string>
<string name="calibration_sent">Étalonnage envoyé à xDrip+</string>
<string name="bg_label">Gly</string>
<string name="time_to_eat">Il est temps de manger</string>
<string name="time_to_bolus">Il est temps de faire le bolus !\nExécutez l\'Assistant et faites de nouveau le calcul.</string>
<string name="executing_right_now">Commande exécutée à l\'instant</string>
<string name="basal_value_below_minimum">Le débit Basal est inférieur au minimum autorisé. Profil non accepté !</string>
<string name="permission">Autorisation</string>

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ nije instaliran</string>
<string name="calibration_sent">Kalibracija poslana na xDrip+</string>
<string name="bg_label">GUK</string>
<string name="time_to_eat">Vrijeme za jelo</string>
<string name="time_to_bolus">Vrijeme je za bolus!\nPokrenite čarobnjak za bolus i ponovite izračun.</string>
<string name="executing_right_now">Naredba se izvršava upravo sada</string>
<string name="basal_value_below_minimum">Bazalna vrijednost ispod minimuma. Profil nije postavljen!</string>
<string name="permission">Dozvola</string>

View file

@ -2,7 +2,6 @@
<resources>
<string name="xdrip_not_installed">xDrip+ nincs telepítve</string>
<string name="bg_label">VC</string>
<string name="time_to_eat">Ideje enni</string>
<!-- Stats -->
<string name="low" comment="3.1-3.9">Alacsony</string>
<string name="high" comment="10.0-13.9">Magas</string>

View file

@ -3,7 +3,6 @@
<string name="xdrip_not_installed">xDrip+ non installato</string>
<string name="calibration_sent">Calibrazione inviata a xDrip+</string>
<string name="bg_label">BG</string>
<string name="time_to_bolus">Tempo di fare un bolo!\nEsegui il calcolatore e fai di nuovi i calcoli.</string>
<string name="executing_right_now">Il comando sarà eseguito ora</string>
<string name="basal_value_below_minimum">Valore basale inferiore al minimo. Profilo non impostato!</string>
<string name="permission">Autorizzazione</string>

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ אינו מותקן</string>
<string name="calibration_sent">כיול נשלח ל-xDrip+</string>
<string name="bg_label">BG</string>
<string name="time_to_eat">זמן לאכול</string>
<string name="time_to_bolus">זמן להזריק בולוס!\nהשתמשו במחשבון וחשבו מחדש.</string>
<string name="executing_right_now">הפקודה מבוצעת כעת</string>
<string name="basal_value_below_minimum">ערך הבסיס מתחת למינימום. פרופיל אינו מוגדר!</string>
<string name="permission">הרשאה</string>

View file

@ -3,7 +3,6 @@
<string name="xdrip_not_installed">xDrip+가 설치되지 않았습니다</string>
<string name="calibration_sent">보정이 xDrip으로 전송되었습니다+</string>
<string name="bg_label">혈당</string>
<string name="time_to_eat">식사할 시간</string>
<string name="executing_right_now">명령을 지금 실행합니다.</string>
<string name="basal_value_below_minimum">Basal값이 최소값 이하입니다. 프로파일이 설정되지 않습니다!</string>
<string name="permission">권한</string>

View file

@ -3,8 +3,6 @@
<string name="xdrip_not_installed">xDrip+ neįdiegta</string>
<string name="calibration_sent">Kalibracija nusiųsta į xDrip+</string>
<string name="bg_label">KG</string>
<string name="time_to_eat">Laikas valgyti</string>
<string name="time_to_bolus">Laikas bolusui!\nĮjunkite Skaičiuotuvą ir pakartokite skaičiavimus.</string>
<string name="executing_right_now">Komanda vykdoma</string>
<string name="basal_value_below_minimum">Valandinės bazės vertė mažesnė už minimalią. Profilis nenustatytas!</string>
<string name="permission">Leidimas</string>

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