diff --git a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt index d5b3dccb61..b4f2a655fd 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt @@ -99,7 +99,8 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() { activePlugin, defaultValueHelper, profileFunction, - repository + repository, + fabricPrivacy ) iobCobCalculator = IobCobCalculatorPlugin( diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt index 5dea75afd2..13079e418c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotuneIob.kt @@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory import java.util.* import javax.inject.Inject import javax.inject.Singleton +import kotlin.math.ceil import kotlin.math.roundToInt @Singleton @@ -181,7 +182,7 @@ class AutotuneIob @Inject constructor( // even if profile rate is not the same private fun toSplittedTimestampTB(tb: TemporaryBasal, tunedProfile: ATProfile) { var splittedTimestamp = tb.timestamp - val cutInMilliSec = T.mins(30).msecs() //30 min to compare with oref0 + val cutInMilliSec = T.mins(60).msecs() //30 min to compare with oref0, 60 min to improve accuracy var splittedDuration = tb.duration if (tb.isValid && tb.durationInMinutes > 0) { val endTimestamp = splittedTimestamp + splittedDuration @@ -248,21 +249,20 @@ class AutotuneIob @Inject constructor( fun convertToBoluses(eb: ExtendedBolus): MutableList { val result: MutableList = ArrayList() - val tempBolusSize = 0.05 - val tempBolusCount : Int = (eb.amount / tempBolusSize).roundToInt() - if(tempBolusCount > 0) { - val tempBolusSpacing = eb.duration / tempBolusCount - for (j in 0L until tempBolusCount) { - val calcDate = eb.timestamp + j * tempBolusSpacing - val bolusInterfaceIDs = InterfaceIDs().also { it.nightscoutId = eb.interfaceIDs.nightscoutId + "_eb_$j" } - val tempBolusPart = Bolus( - interfaceIDs_backing = bolusInterfaceIDs, - timestamp = calcDate, - amount = tempBolusSize, - type = Bolus.Type.NORMAL - ) - result.add(tempBolusPart) - } + val aboutFiveMinIntervals = ceil(eb.duration / 5.0).toInt() + val spacing = eb.duration / aboutFiveMinIntervals.toDouble() + for (j in 0L until aboutFiveMinIntervals) { + // find middle of the interval + val calcDate = (eb.timestamp + j * spacing * 60 * 1000 + 0.5 * spacing * 60 * 1000).toLong() + val tempBolusSize: Double = eb.amount / aboutFiveMinIntervals + val bolusInterfaceIDs = InterfaceIDs().also { it.nightscoutId = eb.interfaceIDs.nightscoutId + "_eb_$j" } + val tempBolusPart = Bolus( + interfaceIDs_backing = bolusInterfaceIDs, + timestamp = calcDate, + amount = tempBolusSize, + type = Bolus.Type.NORMAL + ) + result.add(tempBolusPart) } return result } @@ -277,22 +277,20 @@ class AutotuneIob @Inject constructor( } else { tbr.rate / 100.0 * basalRate - tunedRate }, 0.001) - val tempBolusSize = if (netBasalRate < 0 ) -0.05 else 0.05 - val netBasalAmount: Double = Round.roundTo(netBasalRate * realDuration / 60.0, 0.01) - val tempBolusCount : Int = (netBasalAmount / tempBolusSize).roundToInt() - if(tempBolusCount > 0) { - val tempBolusSpacing = realDuration * 60 * 1000 / tempBolusCount - for (j in 0L until tempBolusCount) { - val calcDate = tbr.timestamp + j * tempBolusSpacing - val bolusInterfaceIDs = InterfaceIDs().also { it.nightscoutId = tbr.interfaceIDs.nightscoutId + "_tbr_$j" } - val tempBolusPart = Bolus( - interfaceIDs_backing = bolusInterfaceIDs, - timestamp = calcDate, - amount = tempBolusSize, - type = Bolus.Type.NORMAL - ) - result.add(tempBolusPart) - } + val aboutFiveMinIntervals = ceil(realDuration / 5.0).toInt() + val tempBolusSpacing = realDuration / aboutFiveMinIntervals.toDouble() + for (j in 0L until aboutFiveMinIntervals) { + // find middle of the interval + val calcDate = (tbr.timestamp + j * tempBolusSpacing * 60 * 1000 + 0.5 * tempBolusSpacing * 60 * 1000).toLong() + val tempBolusSize = netBasalRate * tempBolusSpacing / 60.0 + val bolusInterfaceIDs = InterfaceIDs().also { it.nightscoutId = tbr.interfaceIDs.nightscoutId + "_tbr_$j" } + val tempBolusPart = Bolus( + interfaceIDs_backing = bolusInterfaceIDs, + timestamp = calcDate, + amount = tempBolusSize, + type = Bolus.Type.NORMAL + ) + result.add(tempBolusPart) } return result } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt index 139d3a8a93..825cba3df1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt @@ -29,6 +29,7 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP import java.util.* @@ -44,7 +45,8 @@ class OverviewData @Inject constructor( private val activePlugin: ActivePlugin, private val defaultValueHelper: DefaultValueHelper, private val profileFunction: ProfileFunction, - private val repository: AppRepository + private val repository: AppRepository, + private val fabricPrivacy: FabricPrivacy ) { var rangeToDisplay = 6 // for graph @@ -205,8 +207,8 @@ class OverviewData @Inject constructor( * IOB, COB */ - fun bolusIob(iobCobCalculator: IobCobCalculator): IobTotal = iobCobCalculator.calculateIobFromBolus().round() - fun basalIob(iobCobCalculator: IobCobCalculator): IobTotal = iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended().round() + fun bolusIob(iobCobCalculator: IobCobCalculator): IobTotal = iobCobCalculator.calculateIobFromBolus().round(fabricPrivacy) + fun basalIob(iobCobCalculator: IobCobCalculator): IobTotal = iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended().round(fabricPrivacy) fun cobInfo(iobCobCalculator: IobCobCalculator): CobInfo = iobCobCalculator.getCobInfo(true, "Overview COB") val lastCarbsTime: Long diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/xdripStatusline/StatusLinePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/xdripStatusline/StatusLinePlugin.kt index 104949730d..1c54ea4feb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -123,8 +123,8 @@ class StatusLinePlugin @Inject constructor( status += activeTemp.toStringShort() + " " } //IOB - val bolusIob = iobCobCalculator.calculateIobFromBolus().round() - val basalIob = iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended().round() + val bolusIob = iobCobCalculator.calculateIobFromBolus().round(fabricPrivacy) + val basalIob = iobCobCalculator.calculateIobFromTempBasalsIncludingConvertedExtended().round(fabricPrivacy) status += DecimalFormatter.to2Decimal(bolusIob.iob + basalIob.basaliob) + "U" if (sp.getBoolean(R.string.key_xdripstatus_detailediob, true)) { status += ("(" diff --git a/app/src/main/java/info/nightscout/androidaps/utils/ui/TimeListEdit.java b/app/src/main/java/info/nightscout/androidaps/utils/ui/TimeListEdit.java index 1d79a9205e..437bb3cbd2 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/ui/TimeListEdit.java +++ b/app/src/main/java/info/nightscout/androidaps/utils/ui/TimeListEdit.java @@ -182,7 +182,7 @@ public class TimeListEdit { numberPickers1[position].setTextWatcher(new TextWatcher() { @Override public void afterTextChanged(Editable s) { - Double value1 = SafeParse.stringToDouble(numberPickers1[position].getText()); + Double value1 = SafeParse.INSTANCE.stringToDouble(numberPickers1[position].getText()); Double value2 = value2(position); if (data2 != null && value1 > value2) { value2 = value1; @@ -209,7 +209,7 @@ public class TimeListEdit { @Override public void afterTextChanged(Editable s) { Double value1 = value1(position); - Double value2 = SafeParse.stringToDouble(numberPickers2[position].getText()); + Double value2 = SafeParse.INSTANCE.stringToDouble(numberPickers2[position].getText()); if (data2 != null && value2 < value1) { value1 = value2; numberPickers1[position].setValue(value1); diff --git a/app/src/main/res/values-af-rZA/strings.xml b/app/src/main/res/values-af-rZA/strings.xml index 421e2254c6..e7235fd739 100644 --- a/app/src/main/res/values-af-rZA/strings.xml +++ b/app/src/main/res/values-af-rZA/strings.xml @@ -457,9 +457,7 @@ Tweede koolhidrate inkrement Derde koolhidrate inkrement CGM - Gebruik slegs WiFi verbinding WiFi SSID - Slegs wanneer laai Verbindinginstellings Toegelate SSID\'s (kommapunt geskei) Laat verbindings toe terwyl swerf diff --git a/app/src/main/res/values-bg-rBG/strings.xml b/app/src/main/res/values-bg-rBG/strings.xml index 39a40f5ee2..4210714b25 100644 --- a/app/src/main/res/values-bg-rBG/strings.xml +++ b/app/src/main/res/values-bg-rBG/strings.xml @@ -591,9 +591,7 @@ Стойност на втория бърз бутон [гр] Стойност на третия бърз бутон [гр] CGM - Използвай само WiFi WiFi име - Само при зареждане на телефона Настройки за свързване Разрешени WiFi мрежи(разделени с запетая) Позволи връзка в роуминг diff --git a/app/src/main/res/values-cs-rCZ/exam.xml b/app/src/main/res/values-cs-rCZ/exam.xml index ba1f0cb394..674f46bec9 100644 --- a/app/src/main/res/values-cs-rCZ/exam.xml +++ b/app/src/main/res/values-cs-rCZ/exam.xml @@ -123,6 +123,7 @@ Výměna kanyly nebo změna profilu automaticky nastaví Autosense zpět na 100%. Některé pluginy mají konfigurovatelné časové rozmezí, které může nastavit uživatel. https://androidaps.readthedocs.io/en/latest/CROWDIN/cs/Configuration/Config-Builder.html#detekce-citlivosti + https://androidaps.readthedocs.io/cs/latest/Usage/Open-APS-features.html#autosens Chyby při zadávání sacharidů Co byste měli udělat, pokud jste zadali chybně sacharidy? Odstraňte nesprávný záznam v Ošetření a zadejte správnou novou hodnotu sacharidů. diff --git a/app/src/main/res/values-cs-rCZ/strings.xml b/app/src/main/res/values-cs-rCZ/strings.xml index 1630a7852a..bf56dddb8f 100644 --- a/app/src/main/res/values-cs-rCZ/strings.xml +++ b/app/src/main/res/values-cs-rCZ/strings.xml @@ -604,9 +604,11 @@ Druhý přídavek sacharidů Třetí přídavek sacharidů CGM - Používat pouze WiFi + Použít mobilní připojení + Použít WiFi připojení WiFi SSID - Pouze při nabíjení + Při nabíjení + Na baterii Nastavení připojení Povolené SSID (oddělené středníkem) Povolit připojení pro roamingu @@ -1037,4 +1039,6 @@ GlucoRx Aidex Aidex Přijímat hodnoty glykémie ze senzoru GlucoRx Aidex. + Zablokováno možností nabíjení + Zablokováno možností připojení diff --git a/app/src/main/res/values-da-rDK/strings.xml b/app/src/main/res/values-da-rDK/strings.xml index 37a54940e9..c906acf229 100644 --- a/app/src/main/res/values-da-rDK/strings.xml +++ b/app/src/main/res/values-da-rDK/strings.xml @@ -603,9 +603,7 @@ Anden kulhydratstigning Tredje kulhydratstigning CGM - Brug kun WiFi forbindelse WiFi SSID - Kun under opladning Indstillinger for forbindelse Tilladte SSID\'er (semikolon separeret) Tillad forbindelse i roaming diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index 0b4aad4f3a..80200d30ee 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -597,9 +597,7 @@ Zweite KH-Erhöhung Dritte KH-Erhöhung CGM - Benutze nur WLAN Verbindung WLAN SSID - Nur während des Ladens Verbindungs-Einstellungen Erlaubte SSIDs (durch Semikolon getrennt) Erlaube Verbindung bei Roaming diff --git a/app/src/main/res/values-el-rGR/strings.xml b/app/src/main/res/values-el-rGR/strings.xml index a1612db037..f7514986ed 100644 --- a/app/src/main/res/values-el-rGR/strings.xml +++ b/app/src/main/res/values-el-rGR/strings.xml @@ -459,9 +459,7 @@ Δεύτερη αύξηση υδατανθράκων Τρίτη αύξηση υδατανθράκων CGM - Χρησιμοποιήστε μόνο σύνδεση Wi-Fi WiFi SSID - Μόνο κατά τη φόρτιση Ρυθμίσεις σύνδεσης Επιτρέπονται SSID (διαχωρίζονται με ελληνικό ερωτηματικό) Επιτρέψτε τη σύνδεση περιαγωγής diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 3719c72aa2..edbe12fdeb 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -604,9 +604,11 @@ Segundo incremento de carbohidratos Tercer incremento de carbohidratos MCG - Usar sólo con WiFi + Usar conexión móvil + Usar conexión WiFi WiFi SSID - Sólo si está cargando + Durante la carga + Con batería Ajustes de conexión SSID\'s permitidos (separados por punto y coma) Permitir conexión en roaming @@ -1037,4 +1039,6 @@ GlucoRx Aidex Aidex Recibir los valores de glucosa de GlucoRx Aidex CGMS + Bloqueado por opciones de carga + Bloqueado por opciones de conectividad diff --git a/app/src/main/res/values-fr-rFR/exam.xml b/app/src/main/res/values-fr-rFR/exam.xml index 35675bf5b4..bab13d862d 100644 --- a/app/src/main/res/values-fr-rFR/exam.xml +++ b/app/src/main/res/values-fr-rFR/exam.xml @@ -123,6 +123,7 @@ Le changement de canule réinitialisera le ratio Autosens à 100%. Certaines des options du plugin ont des plages de temps configurables qui peuvent être définies par l\'utilisateur. https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html + https://androidaps.readthedocs.io/fr/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens Entrées de glucides erronées Que devez-vous faire si vous avez renseigné une valeur erronée de glucides ? Supprimez l\'entrée incorrecte dans les Traitements et entrez la nouvelle valeur correcte de glucides. diff --git a/app/src/main/res/values-fr-rFR/strings.xml b/app/src/main/res/values-fr-rFR/strings.xml index 9b5131b9d4..1925d15b97 100644 --- a/app/src/main/res/values-fr-rFR/strings.xml +++ b/app/src/main/res/values-fr-rFR/strings.xml @@ -605,9 +605,7 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Deuxième incrément de glucides Troisième incrément de glucides MGC - Utilisez uniquement connexion Wi-fi Wi-fi SSID - Uniquement si en charge Paramètres de connexion SSIDs autorisés (séparés par point-virgule) Autoriser connexion données itinérance @@ -682,6 +680,8 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Le traitement (insuline : %1$.2f, glucides : %2$d, à : %3$s) n\'a pas pu être ajouté aux traitements. Vérifiez et ajoutez SVP manuellement ce traitement. eCarbs : %1$d g (%2$d h), retard : %3$d m Pas de données d\'Autosens disponibles + Fichiers log + Divers Paramètres journal Réinitialiser les valeurs par défaut Dysfonctionnement NSClient. Faites une réinitialisation de NS et de NSClient. @@ -774,6 +774,11 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S % saisi invalide Moyenne Cible Gly + TIR Jour + TIR Nuit + Détail de 14 jours + SD: %1$s + HbA1c : Moniteur d\'activité Voulez-vous réinitialiser les stats d\'activité ? Statistiques @@ -999,6 +1004,10 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S %1$d sélectionnée(s) Trier Boîte de dialogue annulée + Très bas + Bas + Haut + Très haut En-dessous Dans la cible Au-dessus @@ -1008,6 +1017,11 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Configurer l’opacité État de la boucle Échelle du graph. + Profil 1 + Profil2 + Connexion + Supprimer tout + Réinitialiser le démarrage Code QR pour configurer un mot de passe à usage unique ouvrir les paramètres définir l\'alarme du minuteur de glucides diff --git a/app/src/main/res/values-ga-rIE/strings.xml b/app/src/main/res/values-ga-rIE/strings.xml index f098100eb4..908b6b148b 100644 --- a/app/src/main/res/values-ga-rIE/strings.xml +++ b/app/src/main/res/values-ga-rIE/strings.xml @@ -159,7 +159,6 @@ Ar Aghaidh Roimhe seo CGM - Úsáid WiFi nasc amháin WiFi SSID Socruithe Ginearálta Poctech diff --git a/app/src/main/res/values-it-rIT/strings.xml b/app/src/main/res/values-it-rIT/strings.xml index 39f0310df2..eb81d05f9f 100644 --- a/app/src/main/res/values-it-rIT/strings.xml +++ b/app/src/main/res/values-it-rIT/strings.xml @@ -603,9 +603,7 @@ Secondo incremento di CHO Terzo incremento di CHO CGM - Usa solo connessione WiFi WiFi SSID - Solo se in carica Impostazioni connessione SSID ammessi (separati da punto e virgola) Consenti connessione in roaming diff --git a/app/src/main/res/values-iw-rIL/strings.xml b/app/src/main/res/values-iw-rIL/strings.xml index 3989c6ff09..df974a2eec 100644 --- a/app/src/main/res/values-iw-rIL/strings.xml +++ b/app/src/main/res/values-iw-rIL/strings.xml @@ -603,9 +603,7 @@ תוספת פחמימות שניה תוספת פחמימות שלישית סנסור - השתמש בחיבור WiFi בלבד WiFi SSID - במצב טעינה בלבד הגדרות חיבור SSID מורשים (מופרדים בנקודה-פסיק) אפשר חיבור בנדידה @@ -678,6 +676,8 @@ לא ניתן להוסיף טיפול (אינסולין: %1$.2f, פחמ\': %2$d, בשעה: %3$s) לטיפולים. נא לבדוק ולהוסיף רשומה באופן ידני כנדרש. פחמימות ממושכות: %1$d גר\' (%2$d ש\'), עיכוב %3$d דק\' אין נתוני Autosens זמינים + קבצי יומן + שונות הגדרות יומן רישום אפס לברירת המחדל תקלה ב-NSClient. שקלו להפעיל את Nightscout ו-NSClient מחדש. diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 7d639884aa..0f14db4df7 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -586,9 +586,7 @@ 2차 탄수화물 증분 3차 탄수화물 증분 CGM - 와이파이 연결만 사용하기 와이파이 SSID - 충전중일때만 연결 설정 허가된 SSIDs(세미콜론으로 구분) 로밍에서 연결 허용 diff --git a/app/src/main/res/values-lt-rLT/strings.xml b/app/src/main/res/values-lt-rLT/strings.xml index cc5cd5d678..fb0d0f2b08 100644 --- a/app/src/main/res/values-lt-rLT/strings.xml +++ b/app/src/main/res/values-lt-rLT/strings.xml @@ -595,9 +595,7 @@ Antras angliavandenių kiekio žingsnis Trečias angliavandenių kiekio žingsnis NGJ - Naudoti tik WiFi WiFi pavadinimas - Tik įkraunant Ryšio nustatymai Leidžiami tinklai (atskirti kabliataškiais) Leisti sujungimą tarptinkliniu ryšiu diff --git a/app/src/main/res/values-nl-rNL/strings.xml b/app/src/main/res/values-nl-rNL/strings.xml index 5f07504605..dc28fa97db 100644 --- a/app/src/main/res/values-nl-rNL/strings.xml +++ b/app/src/main/res/values-nl-rNL/strings.xml @@ -604,9 +604,7 @@ Tweede koolhydraten increment Derde koolhydraten increment CGM - Gebuik enkel de WiFi verbinding WiFi SSID - Enkel tijdens opladen Verbindings instellingen Toegelaten SSIDs (gescheiden door puntkomma) Sta verbinding tijdens roaming toe diff --git a/app/src/main/res/values-no-rNO/exam.xml b/app/src/main/res/values-no-rNO/exam.xml index e65ff09029..087dc7d9be 100644 --- a/app/src/main/res/values-no-rNO/exam.xml +++ b/app/src/main/res/values-no-rNO/exam.xml @@ -123,6 +123,7 @@ Hvis du logger bytte av kanyle vil Autosens verdien tilbakestilles til 100%. Noen plugins har konfigurerbare tidsintervall som kan settes av brukeren. https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html + https://androidaps.readthedocs.io/en/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens Feil i KH angivelse Hva skal du gjøre hvis du har gjort en feilaktig registrering av karbohydrater? Fjern den feilaktige registreringen i Behandlinger og legg inn riktig verdi for karbohydrater. diff --git a/app/src/main/res/values-no-rNO/strings.xml b/app/src/main/res/values-no-rNO/strings.xml index 1e1059afc8..7e12b4f62e 100644 --- a/app/src/main/res/values-no-rNO/strings.xml +++ b/app/src/main/res/values-no-rNO/strings.xml @@ -604,9 +604,11 @@ Andre økning hurtigknapp for karbohydrater Tredje økning hurtigknapp for karbohydrater CGM - Bare kun WiFi tilkoblinger + Bruk mobildata + Bruk Wi-Fi-tilkobling WiFi nettverksnavn - Bare under lading + Under lading + På batteri Tilkoblingsinnstillinger Tillatte nettverksnavn SSID (separert med semikolon) Tillat tilkobling i roaming @@ -681,6 +683,8 @@ En behandling (insulin: %1$.2f, karbohydrater: %2$d, tid: %3$s) kunne ikke legges til Behandlinger. Vennligst kontroller og manuelt legg til en registrering der det er aktuelt. eKarbo: %1$d g (%2$d t), forsinkelse: %3$d m Ingen data tilgjengelig for autosens + Loggfiler + Annet Logginnstillinger Gjenopprett standardinnstillinger NSClient feil. Vurder omstart av NS og NSClient. @@ -773,6 +777,11 @@ Ugyldig % oppføring Gjennomsnitt TIR + Dag TIR + Natt TIR + Detaljert 14 dager + SD: %1$s + HbA1c: Overvåking av aktivitet Vil du tilbakestille aktivitets statistikk? Statistikk @@ -999,6 +1008,10 @@ %1$d valgt Sorter Dialog avbrutt + Veldig lavt + Lavt + Høyt + Veldig høyt Under I målområdet Over @@ -1026,4 +1039,6 @@ GlucoRx Aidex Aidex Motta BS verdier fra GlucoRx Aidex CGM. + Blokkert på grunn av ladealternativer + Blokkert på grunn av tilkoblingsalternativer diff --git a/app/src/main/res/values-pl-rPL/strings.xml b/app/src/main/res/values-pl-rPL/strings.xml index 504d21df25..06f2e32c76 100644 --- a/app/src/main/res/values-pl-rPL/strings.xml +++ b/app/src/main/res/values-pl-rPL/strings.xml @@ -595,9 +595,7 @@ Drugi stopień przyrostu węglow. Trzeci stopień przyrostu węglow. CGM - Używaj tylko połączenia WiFi WiFi SSID - Tylko gdy się ładuje Ustawienia połączenia Dozwolone SSID (rozdzielone średnikiem) Zezwalaj na połączenia w roamingu diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index ad3cd4ce00..cc897fcb4c 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -570,9 +570,7 @@ Segundo incremento hidratos Terceiro incremento hidratos CGM - Utilize apenas uma conexão WiFi WiFi SSID - Apenas quando estiver a carregar Definições de ligação SSIDs permitidos (separada por ponto e vírgula) Permitir ligação em roaming diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 2c6f3d9c56..0c41fd2511 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -595,9 +595,7 @@ Segundo incremento hidratos Terceiro incremento hidratos CGM - Utilize apenas uma conexão WiFi WiFi SSID - Apenas quando estiver a carregar Definições de ligação SSIDs permitidos (separada por ponto e vírgula) Permitir ligação em roaming diff --git a/app/src/main/res/values-ro-rRO/strings.xml b/app/src/main/res/values-ro-rRO/strings.xml index e4878a539e..c9501b704f 100644 --- a/app/src/main/res/values-ro-rRO/strings.xml +++ b/app/src/main/res/values-ro-rRO/strings.xml @@ -595,9 +595,7 @@ Al doilea increment de carbohidrați Al treilea increment de carbohidrați CGM - Folosește doar conexiune WiFi SSID WiFi - Doar când se încarcă Setări conexiune SSIDuri permise (separare prin punct și virgulă) Permite conexiuni în roaming diff --git a/app/src/main/res/values-ru-rRU/exam.xml b/app/src/main/res/values-ru-rRU/exam.xml index 0c8efbd035..d5edb09ce2 100644 --- a/app/src/main/res/values-ru-rRU/exam.xml +++ b/app/src/main/res/values-ru-rRU/exam.xml @@ -123,6 +123,7 @@ Внесение записи о замене катетера вернет коэффициент Autosens к 100%. У некоторых опций модуля есть настраиваемые диапазоны времени, которые может задать пользователь. https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html + https://androidaps.readthedocs.io/en/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens Ошибки записи углеводов Что нужно делать, если сделан неправильный ввод углеводов? Удалить неверную запись в Журнале терапии и заново ввести правильное значение углеводов. diff --git a/app/src/main/res/values-ru-rRU/strings.xml b/app/src/main/res/values-ru-rRU/strings.xml index 1e77d5b1f8..d41d36c2e4 100644 --- a/app/src/main/res/values-ru-rRU/strings.xml +++ b/app/src/main/res/values-ru-rRU/strings.xml @@ -440,6 +440,7 @@ Поиск незапланированного приема пищи Время пика действующего инс IOB время пика (в мин.) + Пик Свободный от пиков Oref Быстро действующий Oref Сверхбыстрый Oref @@ -603,9 +604,11 @@ Второй шаг увеличения углеводов Третий шаг увеличения углеводов Мониторинг ГК - Использовать только WiFi соединение + Использовать мобильное подключение + Использовать WiFi соединение WiFi SSID - Только при зарядке + Во время зарядки + От батареи Параметры подключения Разрешенные SSID (разделенные точкой с запятой) Разрешить подключение в роуминге @@ -680,6 +683,8 @@ Назначение (инсулин: %1$.2f, углеводы: %2$d, в: %3$s) не было добавлено. Пожалуйста, проверьте и при необходимости добавьте запись вручную. eCarbs: %1$d г. (%2$d h), задержка: %3$d m Данные autosens недоступны + Файлы журналов + Разное Настройки журнала Восстановить значения по умолчанию Некорректная работа NSClient. Возможно следует перезапустить NS и NSClient. @@ -772,6 +777,11 @@ Некорректный ввод % Средний Время в целевом диапазоне TIR + Время в целевом диапазоне днем + Время в целевом диапазоне ночью + Подробно 14 дней + СтандОткл: %1$s + HbA1c: Монитор активности Хотите сбросить статистику активности? Статистика @@ -966,9 +976,11 @@ Активный профиль не установлен! Неизвестный COB! Отсутствуют данные ГК или приложения недавно перезапущено? Нарушено ограничение по углеводам! + Кальк (IC:%1$.1f ISF: %2$.1f) Углеводов: %1$.2fгУ Акт Инс COB: %1$.0fг %2$.2fед ГК: %1$.2f + IOB: %1$.2fед Суперболюсный: %1$.2fед тренд 15\': %1$.2f Процент: %1$.2fU x %2$d%% = %3$.2f @@ -995,6 +1007,10 @@ %1$d выбрано Сортировать Диалог отменен + Очень низкий + Низкий + Высокий + Очень высокий Ниже целевых В целевом диапазоне Выше целевых @@ -1002,5 +1018,26 @@ Скрыть записи цикла Виджет androidAPS Настроить прозрачность + Статус цикла + Масштаб графика + Профиль 1 + Профиль 2 + Логин + Удалить всё + Перезапустить старт + QR код для введения временного пароля + открыть настройки + задать оповещение таймера углеводов + Все + Телефон + Часы + только на часах + только на телефоне + якорь перетягивания + Aidex GlucoRx + Aidex + Получить значения ГК от GlucoRx Aidex + Заблокировано опциями зарядки + Заблокировано настройками подключения diff --git a/app/src/main/res/values-sk-rSK/strings.xml b/app/src/main/res/values-sk-rSK/strings.xml index d9fea3abd0..b0e22b54b4 100644 --- a/app/src/main/res/values-sk-rSK/strings.xml +++ b/app/src/main/res/values-sk-rSK/strings.xml @@ -604,9 +604,11 @@ Druhý prídavok sacharidov Tretí prídavok sacharidov CGM - Používať iba WiFi + Použiť mobilné pripojenie + Použiť WiFi pripojenie WiFi SSID - Len pri nabíjaní + Počas nabíjania + Na batérii Nastavenie pripojenia Povolené SSID (oddelené bodkočiarkou) Povoliť pripojenie pri roamingu @@ -681,6 +683,8 @@ Ošetrenie (inzulín: %1$.2f, sacharidy: %2$d, čas: %3$s) nie je možné pridať. Skontrolujte a podľa potreby manuálne pridajte záznam. eCarbs: %1$d g (%2$d h), Oneskorenie: %3$d m Nedostupné dáta o glykémiách + Log súbory + Rôzne Nastavenie logovania Obnoviť predvolené Chyba NSClienta. Zvážte reštart NS a NSClienta. @@ -1035,4 +1039,6 @@ GlucoRx Aidex Aidex Prijímať hodnoty glykémie zo senzora GlucoRx Aidex. + Zablokované možnosti nabíjania + Zablokované možnosti pripojenia diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml index f59d25c23d..5a373efad3 100644 --- a/app/src/main/res/values-sv-rSE/strings.xml +++ b/app/src/main/res/values-sv-rSE/strings.xml @@ -600,9 +600,7 @@ Eversense-appen. Andra snabbknabben för kolhydrater Tredje snabbknabben för kolhydrater CGM - Använd endast WiFi WiFi nätverksnamn - Endast vid laddning Anslutningsinställningar Tillåtna nätverksnamn (separerade med semikolon) Tillåt NS-data vid roaming diff --git a/app/src/main/res/values-tr-rTR/exam.xml b/app/src/main/res/values-tr-rTR/exam.xml index 209deea3b6..979bfb5b2e 100644 --- a/app/src/main/res/values-tr-rTR/exam.xml +++ b/app/src/main/res/values-tr-rTR/exam.xml @@ -123,6 +123,7 @@ Bir kanül değişikliğinin kaydedilmesi, Otoduyarlılık oranını %100\'e sıfırlayacaktır. Eklenti seçeneklerinden bazıları, kullanıcı tarafından ayarlanabilen yapılandırılabilir zaman aralıklarına sahiptir. https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html + https://androidaps.readthedocs.io/tr/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens Karbonhidrat Giriş Hataları Yanlış bir karbonhidrat girişi yaptıysanız ne yapmalısınız? Tedavilerdeki yanlış girişi siler ve doğru karbonhidrat değerini girerim. diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index fd78a4f34a..356067e46b 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -475,7 +475,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Yerel uyarılar KŞ bilgisi alınmadığında uyar Pompa ulaşılamıyorsa uyar - Pompa ulaşılamaz eşiği [min] Karbonhidrat gerekliyse uyar Acil önemli Alarm BİLGİ @@ -605,9 +604,11 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d İkinci karbonhidrat artışı Üçüncü karbonhidrat artışı CGM - Sadece WiFi bağlantı kullanın + Mobil veri kullan + Wi-Fi bağlantısı kullan WiFi SSID - Sadece şarj olurken + Şarj olurken + Pilde Bağlantı Ayarları İzin verilen SSID (noktalı virgülle ayrılmış) Roaming bağlantıya izin ver @@ -682,6 +683,8 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Tedavilere (insülin: %1$.2f, karbonhidrat: %2$d, %3$s) şeklinde bir tedavi eklenemedi. Lütfen kontrol edin ve uygun şekilde elle bir kayıt ekleyin. yKarb: %1$d g (%2$d sa), gecikme: %3$d dk Otoduyarlılık verileri mevcut değil + Günlük dosyaları + Diğer Ayarlar Günlük ayarları Varsayılanlara sıfırla NSClient arızası. NS ve NSClient yeniden başlatmayı düşünün. @@ -774,6 +777,11 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Geçersiz % giriş Ortalama TIR + Gündüz TIR + Gece TIR + Ayrıntılı 14 gün + SD: %1$s + HbA1c: Aktivite monitörü Etkinlik istatistiklerini sıfırlamak istiyor musunuz? İstatistikler @@ -1000,6 +1008,10 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d %1$d seçildi Sırala İletişim kutusu iptal edildi + Çok düşük + Düşük + Yüksek + Çok yüksek Altında Aralık içinde Üstünde @@ -1027,4 +1039,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d GlucoRx Aidex Aidex GlucoRx Aidex CGMS\'den KŞ değerleri alır. + Şarj seçenekleri tarafından engellendi + Bağlantı seçenekleri tarafından engellendi diff --git a/app/src/main/res/values-zh-rCN/exam.xml b/app/src/main/res/values-zh-rCN/exam.xml index addb42c8b4..ae7b8c0ad4 100644 --- a/app/src/main/res/values-zh-rCN/exam.xml +++ b/app/src/main/res/values-zh-rCN/exam.xml @@ -123,6 +123,7 @@ 记录输注导管更换会将Autosens比率重置回100%。 一些插件选项具有可配置的时间范围,可由用户设置。 https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html + https://androidaps.readthedocs.io/en/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens 碳水化合物输入错误 如果您输入了不正确的碳水化合物,该怎么办? 删除治疗数据中的错误条目,并重新输入正确的碳水值。 diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 192f069438..0258e545fb 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -603,9 +603,7 @@ 第二碳水化合物增量 第三碳水化合物增量 CGM - 仅使用 WiFi 连接 WiFi SSID - 仅在充电时 连接设置 允许的 SSIDs (分号分隔) 允许在漫游中连接 @@ -772,6 +770,7 @@ 输入的百分比无效 平均 TIR + 糖化血红蛋白: 活动监视器 您想要重置所有的统计信息吗? 统计 @@ -967,9 +966,11 @@ 没有激活的个人配置文件! 未知的活性碳水!血糖读取缺失或最近重新启动了应用程序? 碳水违反约束条件! + 计算 (IC: %1$.1f, ISF: %2$.1f) 碳水: %1$.2fU 活性碳水: %1$.0f克 %2$.2fU 血糖: %1$.2fU + 活性胰岛素: %1$.2fU 超级大剂量:%1$.2fU 15分钟趋势:%1$.2fU 百分比:%1$.2fU x %2$d%% ≈ %3$.2fU @@ -996,6 +997,10 @@ 已选中 %1$d 排序 对话框已取消 + 非常低 + + + 非常高 底部 在范围内 上方 @@ -1003,6 +1008,12 @@ 隐藏闭环记录 AndroidAPS小部件 配置透明度 + 闭环状态 + 图形缩放 + 配置文件 1 + 配置文件 2 + 登录 + 删除全部 用于安装一次性随机验证码的二维码 打开设置 设置碳水计时器提醒 @@ -1016,4 +1027,6 @@ GlucoRx Aidex动泰 Aidex动泰 从GlucoRx Aidex动泰持续葡萄糖监测系统接收血糖值。 + 被充电选项阻止 + 被连接选项阻止 diff --git a/automation/src/main/res/values-zh-rCN/strings.xml b/automation/src/main/res/values-zh-rCN/strings.xml index 5ec6797b3a..5e02878c3d 100644 --- a/automation/src/main/res/values-zh-rCN/strings.xml +++ b/automation/src/main/res/values-zh-rCN/strings.xml @@ -120,4 +120,7 @@ 你确定要删除 %1$d 吗? 排序 系统自动化 + 运行自动化 + 添加规则 + 移除/排序 diff --git a/build.gradle b/build.gradle index 8a5dbef20b..144f4a1966 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { ext { kotlin_version = '1.6.21' core_version = '1.7.0' - rxjava_version = '3.1.4' + rxjava_version = '3.1.5' rxandroid_version = '3.0.0' rxkotlin_version = '3.0.1' room_version = '2.4.2' diff --git a/core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt b/core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt index 709b7d71c4..eb5f46428d 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt +++ b/core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt @@ -4,6 +4,7 @@ import android.content.Context import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.Round import org.json.JSONException import org.json.JSONObject @@ -50,15 +51,15 @@ class IobTotal(val time: Long) : DataPointWithLabelInterface { return this } - fun round(): IobTotal { - iob = Round.roundTo(iob, 0.001) - activity = Round.roundTo(activity, 0.0001) - bolussnooze = Round.roundTo(bolussnooze, 0.0001) - basaliob = Round.roundTo(basaliob, 0.001) - netbasalinsulin = Round.roundTo(netbasalinsulin, 0.001) - hightempinsulin = Round.roundTo(hightempinsulin, 0.001) - netInsulin = Round.roundTo(netInsulin, 0.001) - extendedBolusInsulin = Round.roundTo(extendedBolusInsulin, 0.001) + fun round(fabricPrivacy: FabricPrivacy? = null): IobTotal { + iob = Round.roundTo(iob, 0.001, fabricPrivacy) + activity = Round.roundTo(activity, 0.0001, fabricPrivacy) + bolussnooze = Round.roundTo(bolussnooze, 0.0001, fabricPrivacy) + basaliob = Round.roundTo(basaliob, 0.001, fabricPrivacy) + netbasalinsulin = Round.roundTo(netbasalinsulin, 0.001, fabricPrivacy) + hightempinsulin = Round.roundTo(hightempinsulin, 0.001, fabricPrivacy) + netInsulin = Round.roundTo(netInsulin, 0.001, fabricPrivacy) + extendedBolusInsulin = Round.roundTo(extendedBolusInsulin, 0.001, fabricPrivacy) return this } diff --git a/core/src/main/java/info/nightscout/androidaps/di/CoreFragmentsModule.kt b/core/src/main/java/info/nightscout/androidaps/di/CoreFragmentsModule.kt index 1b9229e4e3..e30a92c223 100644 --- a/core/src/main/java/info/nightscout/androidaps/di/CoreFragmentsModule.kt +++ b/core/src/main/java/info/nightscout/androidaps/di/CoreFragmentsModule.kt @@ -10,6 +10,7 @@ import info.nightscout.androidaps.dialogs.ErrorDialog import info.nightscout.androidaps.dialogs.NtpProgressDialog import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.plugins.general.maintenance.activities.PrefImportListActivity +import info.nightscout.androidaps.utils.ui.SingleClickButton @Module @Suppress("unused") @@ -25,4 +26,6 @@ abstract class CoreFragmentsModule { @ContributesAndroidInjector abstract fun contributesNtpProgressDialog(): NtpProgressDialog @ContributesAndroidInjector abstract fun contributesProfileViewerDialog(): ProfileViewerDialog + @ContributesAndroidInjector abstract fun contributesSingleClickButton(): SingleClickButton + } diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java index eee40443e2..c96e99b89b 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java @@ -273,6 +273,13 @@ public class DateTimeUtil { } + public static long getATDWithAddedMinutes(Long atd, int minutesDiff) { + GregorianCalendar oldestEntryTime = DateTimeUtil.toGregorianCalendar(atd); + oldestEntryTime.add(Calendar.MINUTE, minutesDiff); + + return toATechDate(oldestEntryTime); + } + public static long getATDWithAddedMinutes(GregorianCalendar oldestEntryTime, int minutesDiff) { oldestEntryTime.add(Calendar.MINUTE, minutesDiff); diff --git a/core/src/main/java/info/nightscout/androidaps/utils/Round.kt b/core/src/main/java/info/nightscout/androidaps/utils/Round.kt index c25b1181c0..3f854d4979 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/Round.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/Round.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.utils +import android.os.Bundle import java.math.BigDecimal import kotlin.math.abs import kotlin.math.ceil import kotlin.math.floor -import kotlin.math.round import kotlin.math.roundToLong /** @@ -12,22 +12,26 @@ import kotlin.math.roundToLong */ object Round { - @JvmStatic - fun roundTo(x: Double, step: Double): Double = + fun roundTo(x: Double, step: Double, fabricPrivacy: FabricPrivacy? = null): Double = try { if (x == 0.0) 0.0 else BigDecimal.valueOf((x / step).roundToLong()).multiply(BigDecimal.valueOf(step)).toDouble() + } catch (e: Exception) { + fabricPrivacy?.logCustom("Error_roundTo", Bundle().apply { + putDouble("x", x) + putDouble("step", step) + putString("stacktrace", e.stackTraceToString()) + }) + 0.0 + } - @JvmStatic fun floorTo(x: Double, step: Double): Double = if (x != 0.0) floor(x / step) * step else 0.0 - @JvmStatic fun ceilTo(x: Double, step: Double): Double = if (x != 0.0) ceil(x / step) * step else 0.0 - @JvmStatic fun isSame(d1: Double, d2: Double): Boolean = abs(d1 - d2) <= 0.000001 } \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt b/core/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt index ef336c2a52..185b97f89f 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt @@ -2,25 +2,32 @@ package info.nightscout.androidaps.utils.ui import android.content.Context import android.util.AttributeSet +import dagger.android.HasAndroidInjector import info.nightscout.androidaps.core.R -import info.nightscout.shared.logging.StacktraceLoggerWrapper -import org.slf4j.Logger +import info.nightscout.shared.logging.AAPSLogger +import info.nightscout.shared.logging.LTag +import javax.inject.Inject -class SingleClickButton @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.style.Widget_MaterialComponents_Button) : com.google.android.material.button.MaterialButton(context, attrs, defStyleAttr) { +class SingleClickButton @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.style.Widget_MaterialComponents_Button) : + com.google.android.material.button.MaterialButton(context, attrs, defStyleAttr) { + + init { + (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) + } + + @Inject lateinit var aapsLogger: AAPSLogger override fun performClick(): Boolean = guardClick { super.performClick() } override fun callOnClick(): Boolean = guardClick { super.callOnClick() } private fun guardClick(block: () -> Boolean): Boolean { isEnabled = false - postDelayed({ isEnabled = true; log.debug("Button enabled") }, BUTTON_REFRACTION_PERIOD) + postDelayed({ isEnabled = true; aapsLogger.debug(LTag.UI, "Button enabled") }, BUTTON_REFRACTION_PERIOD) return block() } - @Suppress("DEPRECATION") - private val log: Logger = StacktraceLoggerWrapper.getLogger(SingleClickButton::class.java) - companion object { + const val BUTTON_REFRACTION_PERIOD = 3000L } } \ No newline at end of file diff --git a/core/src/main/res/values-ru-rRU/strings.xml b/core/src/main/res/values-ru-rRU/strings.xml index 20f5a3db8f..af6b5dadc6 100644 --- a/core/src/main/res/values-ru-rRU/strings.xml +++ b/core/src/main/res/values-ru-rRU/strings.xml @@ -42,6 +42,7 @@ Углеводы Неверный профиль !!! ПРОФИЛЬ НЕ ЗАДАН + дата единицы DIA (время действия инсулина) @@ -438,7 +439,21 @@ Удалить элементы Сортировать элементы Удалить выбранные элементы + файл + пользователь + Автонастройка + Помощь в возможной корректировке профиля (ISF, IC, базал) + АвтТюн + Настройки Autotune + Профили Автонастройки + При активации происходит обновление автонастройки и смена профиля на основе правила автоматизации + Классифицировать UAM как базал + Включите, если только вы точно ввели все съеденные углеводы. С этой опцией внезапные подъемы, зафиксированные Autotune, будут использованы для рекомендаций изменения базальной скорости. + Настройка кривой инсулина + Количество дней обработки данных Autotune по умолчанию (до 30) + Ошибка ввода данных, попробуйте запустить снова autotune или уменьшить количество дней + Неверный профиль %1$d день %1$d дня diff --git a/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index fe56e12d89..5594689077 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -232,8 +232,8 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin { int percentRate = Double.valueOf(absoluteRate / getBaseBasalRate() * 100).intValue(); // Any basal less than 0.10u/h will be dumped once per hour, not every 4 minutes. So if it's less than .10u/h, set a zero temp. if (absoluteRate < 0.10d) percentRate = 0; - if (percentRate < 100) percentRate = (int) Round.ceilTo((double) percentRate, 10d); - else percentRate = (int) Round.floorTo((double) percentRate, 10d); + if (percentRate < 100) percentRate = (int) Round.INSTANCE.ceilTo((double) percentRate, 10d); + else percentRate = (int) Round.INSTANCE.floorTo((double) percentRate, 10d); if (percentRate > 500) // Special high temp 500/15min percentRate = 500; aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Calculated percent rate: " + percentRate); @@ -353,7 +353,8 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin { insulin = constraintChecker.applyExtendedBolusConstraints(new Constraint<>(insulin)).value(); // needs to be rounded int durationInHalfHours = Math.max(durationInMinutes / 30, 1); - insulin = Round.roundTo(insulin, getPumpDescription().getExtendedBolusStep()); + insulin = Round.INSTANCE.roundTo(insulin, getPumpDescription().getExtendedBolusStep(), + null); PumpEnactResult result = new PumpEnactResult(getInjector()); if (danaPump.isExtendedInProgress() && Math.abs(danaPump.getExtendedBolusAmount() - insulin) < pumpDescription.getExtendedBolusStep()) { diff --git a/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index a290c4e520..f2dbf782a6 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -267,7 +267,8 @@ public abstract class AbstractDanaRPlugin extends PumpPluginBase implements Pump insulin = constraintChecker.applyExtendedBolusConstraints(new Constraint<>(insulin)).value(); // needs to be rounded int durationInHalfHours = Math.max(durationInMinutes / 30, 1); - insulin = Round.roundTo(insulin, getPumpDescription().getExtendedBolusStep()); + insulin = Round.INSTANCE.roundTo(insulin, getPumpDescription().getExtendedBolusStep(), + null); PumpEnactResult result = new PumpEnactResult(getInjector()); if (danaPump.isExtendedInProgress() && Math.abs(danaPump.getExtendedBolusAmount() - insulin) < getPumpDescription().getExtendedBolusStep()) { diff --git a/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index 90fd97ed88..9640c86b00 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -217,8 +217,8 @@ public class DanaRPlugin extends AbstractDanaRPlugin { int percentRate = Double.valueOf(absoluteRate / getBaseBasalRate() * 100).intValue(); // Any basal less than 0.10u/h will be dumped once per hour, not every 4 minutes. So if it's less than .10u/h, set a zero temp. if (absoluteRate < 0.10d) percentRate = 0; - if (percentRate < 100) percentRate = (int) Round.ceilTo((double) percentRate, 10d); - else percentRate = (int) Round.floorTo((double) percentRate, 10d); + if (percentRate < 100) percentRate = (int) Round.INSTANCE.ceilTo((double) percentRate, 10d); + else percentRate = (int) Round.INSTANCE.floorTo((double) percentRate, 10d); if (percentRate > getPumpDescription().getMaxTempPercent()) { percentRate = getPumpDescription().getMaxTempPercent(); } @@ -288,7 +288,8 @@ public class DanaRPlugin extends AbstractDanaRPlugin { double extendedRateToSet = absoluteRate - getBaseBasalRate(); extendedRateToSet = constraintChecker.applyBasalConstraints(new Constraint<>(extendedRateToSet), profile).value(); // needs to be rounded to 0.1 - extendedRateToSet = Round.roundTo(extendedRateToSet, pumpDescription.getExtendedBolusStep() * 2); // *2 because of half hours + extendedRateToSet = Round.INSTANCE.roundTo(extendedRateToSet, + pumpDescription.getExtendedBolusStep() * 2, null); // *2 because of half hours // What is current rate of extended bolusing in u/h? aapsLogger.debug(LTag.PUMP, "setTempBasalAbsolute: Extended bolus in progress: " + (danaPump.isExtendedInProgress()) + " rate: " + danaPump.getExtendedBolusAbsoluteRate() + "U/h duration remaining: " + danaPump.getExtendedBolusRemainingMinutes() + "min"); diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/app_layer/history/history_events/HistoryEvent.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/app_layer/history/history_events/HistoryEvent.java index 864fb9e3c0..1ac0d12f7f 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/app_layer/history/history_events/HistoryEvent.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/app_layer/history/history_events/HistoryEvent.java @@ -8,7 +8,7 @@ import org.slf4j.Logger; public class HistoryEvent implements Comparable { @SuppressWarnings("deprecation") - private static final Logger log = StacktraceLoggerWrapper.getLogger(HistoryEvent.class); + private static final Logger log = StacktraceLoggerWrapper.Companion.getLogger(HistoryEvent.class); private int eventYear; private int eventMonth; diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt index 39ab042651..7a70667d51 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt @@ -140,6 +140,8 @@ abstract class MedtronicHistoryEntry : MedtronicHistoryEntryInterface { val bodyLength: Int get() = sizes[2] + abstract fun toEntryString(): String + override fun toString(): String { val sb = StringBuilder() // if (DT == null) { @@ -156,6 +158,7 @@ abstract class MedtronicHistoryEntry : MedtronicHistoryEntryInterface { sb.append("(") sb.append(headLength + dateTimeLength + bodyLength) sb.append(")") + val hasData = hasData() if (hasData) { sb.append(", data=$decodedDataAsString") diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt index 26e9cea75a..82beed1655 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt @@ -60,4 +60,9 @@ class CGMSHistoryEntry : MedtronicHistoryEntry() { fun setDateTime(timeStamp: LocalDateTime, getIndex: Int) { atechDateTime = (DateTimeUtil.toATechDate(timeStamp.plusMinutes(getIndex * 5))) } + + override fun toEntryString(): String { + // TODO fixme if needed + return toString() + } } \ No newline at end of file diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt index c16bf5c362..2c7481fd73 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt @@ -84,6 +84,45 @@ class PumpHistoryEntry : MedtronicHistoryEntry() { return atechDateTime < this.atechDateTime } + override fun toEntryString(): String { + val sb = StringBuilder() + // if (DT == null) { + // Log.e("", "DT is null. RawData=" + ByteUtil.getHex(rawData)) + // } + sb.append("PumpHistoryEntry [type=" + StringUtil.getStringInLength(entryType.name, 20)) + sb.append(" " + if (DT == null) "null" else StringUtil.getStringInLength(DT, 19)) + + val hasData = (decodedData.size > 0) + if (hasData) { + if (hasDecodedDataEntry("Object")) { + val oo = getDecodedDataEntry("Object") + sb.append(", $oo") + } else { + sb.append(", data=$decodedDataAsString") + } + } else { + if (head.isNotEmpty()) { + sb.append(", head=") + sb.append(ByteUtil.shortHexString(head)) + } + if (datetime.size != 0) { + sb.append(", datetime=") + sb.append(ByteUtil.shortHexString(datetime)) + } + if (body.size != 0) { + sb.append(", body=") + sb.append(ByteUtil.shortHexString(body)) + } + sb.append(", rawData=") + sb.append(ByteUtil.shortHexString(rawData)) + sb.append("]") + } + + // sb.append(" Ext: "); + return sb.toString() + + } + class Comparator : java.util.Comparator { override fun compare(o1: PumpHistoryEntry, o2: PumpHistoryEntry): Int { diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index 2f9b264971..752d7e187b 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -357,7 +357,7 @@ class MedtronicHistoryData @Inject constructor( aapsLogger.debug(LTag.PUMP, String.format(Locale.ENGLISH, "ProcessHistoryData: TBRs Processed [count=%d, items=%s]", tbrs.size, gson.toJson(tbrs))) if (tbrs.isNotEmpty()) { try { - processTBREntries(tbrs) + processTBREntries(tbrs, rewindRecords) } catch (ex: Exception) { aapsLogger.error(LTag.PUMP, "ProcessHistoryData: Error processing TBR entries: " + ex.message, ex) throw ex @@ -582,7 +582,7 @@ class MedtronicHistoryData @Inject constructor( } } - private fun processTBREntries(entryList: MutableList) { + private fun processTBREntries(entryList: MutableList, rewindList: MutableList) { entryList.reverse() val tbr = entryList[0].getDecodedDataEntry("Object") as TempBasalPair // var readOldItem = false @@ -606,7 +606,7 @@ class MedtronicHistoryData @Inject constructor( val tbrRecords = pumpSyncStorage.getTBRs() - val processList: MutableList = createTBRProcessList(entryList) + val processList: MutableList = createTBRProcessList(entryList, rewindList) if (processList.isNotEmpty()) { for (tempBasalProcessDTO in processList) { @@ -729,7 +729,8 @@ class MedtronicHistoryData @Inject constructor( } // collection } - fun createTBRProcessList(entryList: MutableList) : MutableList { + + fun createTBRProcessList(entryList: MutableList, rewindList: MutableList) : MutableList { aapsLogger.debug(LTag.PUMP, "${ProcessHistoryRecord.TBR.description} List (before filter): ${gson.toJson(entryList)}") @@ -795,6 +796,23 @@ class MedtronicHistoryData @Inject constructor( } } + // see if rewind items, need to fix any of current tempBasalProcessDTO items (bug 1724) + if (rewindList.isNotEmpty()) { + for (rewindEntry in rewindList) { + for (tempBasalProcessDTO in processList) { + if (tempBasalProcessDTO.itemTwo==null) { + val endTime: Long = DateTimeUtil.getATDWithAddedMinutes(tempBasalProcessDTO.itemOne.atechDateTime, tempBasalProcessDTO.itemOneTbr!!.durationMinutes) + + if ((rewindEntry.atechDateTime > tempBasalProcessDTO.itemOne.atechDateTime) && + (rewindEntry.atechDateTime < endTime)) { + tempBasalProcessDTO.itemTwo = rewindEntry + continue + } + } + } + } + } + return processList } @@ -1174,7 +1192,7 @@ class MedtronicHistoryData @Inject constructor( return getFilteredItems(newHistory, entryTypes) } - private fun getFilteredItems(entryType: PumpHistoryEntryType): MutableList { + fun getFilteredItems(entryType: PumpHistoryEntryType): MutableList { return getFilteredItems(newHistory, setOf(entryType)) } @@ -1188,7 +1206,7 @@ class MedtronicHistoryData @Inject constructor( } } - private fun getFilteredItems(inList: MutableList?, entryType: PumpHistoryEntryType): MutableList { + fun getFilteredItems(inList: MutableList?, entryType: PumpHistoryEntryType): MutableList { return getFilteredItems(inList, setOf(entryType)) } diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt index b784699bfa..29645b477b 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt @@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto import info.nightscout.shared.logging.AAPSLogger import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, var aapsLogger: AAPSLogger, @@ -13,7 +14,11 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, field = value if (objectType == ObjectType.TemporaryBasal) { if (value!=null) { - itemTwoTbr = value.getDecodedDataEntry("Object") as TempBasalPair + if (value.entryType == PumpHistoryEntryType.TempBasalCombined) { + itemTwoTbr = value.getDecodedDataEntry("Object") as TempBasalPair + } else { + itemTwoRewind = value + } } else { itemTwoTbr = null } @@ -22,6 +27,7 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, var itemOneTbr: TempBasalPair? = null var itemTwoTbr: TempBasalPair? = null + var itemTwoRewind: PumpHistoryEntry? = null val atechDateTime: Long get() = itemOne.atechDateTime @@ -41,6 +47,9 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, //aapsLogger.error("Couldn't find TempBasalPair in entry: $itemOne") return 0 } + } else if (itemTwoRewind!=null) { + val secondsDiff = DateTimeUtil.getATechDateDiferenceAsSeconds(itemOne.atechDateTime, DateTimeUtil.getATDWithAddedSeconds(itemTwo!!.atechDateTime, -2)) + return secondsDiff } else { //aapsLogger.debug(LTag.PUMP, "Found 2 items for duration: itemOne=$itemOne, itemTwo=$itemTwo") val secondsDiff = DateTimeUtil.getATechDateDiferenceAsSeconds(itemOne.atechDateTime, itemTwo!!.atechDateTime) diff --git a/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt b/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt index 3d78d1b4f6..fd598dcb63 100644 --- a/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt +++ b/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt @@ -1,10 +1,26 @@ package info.nightscout.androidaps +import dagger.android.AndroidInjector +import dagger.android.HasAndroidInjector +import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.plugins.bus.RxBus +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil +import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage +import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType +import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.shared.logging.AAPSLoggerTest import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.rx.TestAapsSchedulers +import info.nightscout.shared.sharedPreferences.SP import org.junit.Before import org.junit.Rule +import org.mockito.Answers +import org.mockito.Mock import org.mockito.Mockito import org.mockito.junit.MockitoJUnit import org.mockito.junit.MockitoRule @@ -14,6 +30,28 @@ open class TestBase { val aapsLogger = AAPSLoggerTest() val aapsSchedulers: AapsSchedulers = TestAapsSchedulers() + var rxBus: RxBus = RxBus(TestAapsSchedulers(), aapsLogger) + var byteUtil = ByteUtil() + var rileyLinkUtil = RileyLinkUtil() + + @Mock lateinit var pumpSync: PumpSync + @Mock lateinit var pumpSyncStorage: PumpSyncStorage + @Mock(answer = Answers.RETURNS_DEEP_STUBS) lateinit var activePlugin: ActivePlugin + @Mock lateinit var sp: SP + @Mock lateinit var rh: ResourceHelper + + lateinit var medtronicUtil : MedtronicUtil + lateinit var decoder : MedtronicPumpHistoryDecoder + + + val packetInjector = HasAndroidInjector { + AndroidInjector { + + } + } + + + // Add a JUnit rule that will setup the @Mock annotated vars and log. // Another possibility would be to add `MockitoAnnotations.initMocks(this) to the setup method. @@ -34,6 +72,52 @@ open class TestBase { return uninitialized() } + fun preProcessListTBR(inputList: MutableList) { + + var tbrs: MutableList = mutableListOf() + + for (pumpHistoryEntry in inputList) { + if (pumpHistoryEntry.entryType === PumpHistoryEntryType.TempBasalRate || + pumpHistoryEntry.entryType === PumpHistoryEntryType.TempBasalDuration) { + tbrs.add(pumpHistoryEntry) + } + } + + inputList.removeAll(tbrs) + + inputList.addAll(preProcessTBRs(tbrs)) + + sort(inputList) + + //return inputList + + } + + + private fun preProcessTBRs(TBRs_Input: MutableList): MutableList { + val tbrs: MutableList = mutableListOf() + val map: MutableMap = HashMap() + for (pumpHistoryEntry in TBRs_Input) { + if (map.containsKey(pumpHistoryEntry.DT)) { + decoder.decodeTempBasal(map[pumpHistoryEntry.DT]!!, pumpHistoryEntry) + pumpHistoryEntry.setEntryType(medtronicUtil.medtronicPumpModel, PumpHistoryEntryType.TempBasalCombined) + tbrs.add(pumpHistoryEntry) + map.remove(pumpHistoryEntry.DT) + } else { + map[pumpHistoryEntry.DT] = pumpHistoryEntry + } + } + return tbrs + } + + private fun sort(list: MutableList) { + // if (list != null && !list.isEmpty()) { + // Collections.sort(list, PumpHistoryEntry.Comparator()) + // } + list.sortWith(PumpHistoryEntry.Comparator()) + } + + @Suppress("Unchecked_Cast") fun uninitialized(): T = null as T } \ No newline at end of file diff --git a/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.java b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.java deleted file mode 100644 index e02c4bab20..0000000000 --- a/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.java +++ /dev/null @@ -1,113 +0,0 @@ -package info.nightscout.androidaps.plugins.pump.medtronic.comm; - -//import uk.org.lidalia.slf4jtest.TestLogger; -//import uk.org.lidalia.slf4jtest.TestLoggerFactory; - -/** - * Created by andy on 3/10/19. - */ -public class MedtronicHistoryDataUTest { -/* - //TestLogger LOGGER = TestLoggerFactory.getTestLogger(MedtronicHistoryDataUTest.class); - - byte[] historyPageData = ByteUtil - .createByteArrayFromString("16 00 12 EC 14 47 13 33 00 14 F2 14 47 13 00 16 01 14 F2 14 47 13 33 00 1C C9 15 47 13 00 16 00 1C C9 15 47 13 33 4E 31 D3 15 47 13 00 16 01 31 D3 15 47 13 33 00 1A F1 15 47 13 00 16 00 1A F1 15 47 13 33 50 1D F1 15 47 13 00 16 01 1D F1 15 47 13 33 50 11 D8 16 47 13 00 16 01 11 D8 16 47 13 33 50 31 FB 16 47 13 00 16 01 31 FB 16 47 13 33 50 12 E3 17 47 13 00 16 01 12 E3 17 47 13 33 00 1E FB 17 47 13 00 16 00 1E FB 17 47 13 33 D8 21 FB 17 47 13 00 16 01 21 FB 17 47 13 07 00 00 05 CC 27 93 6D 27 93 05 0C 00 E8 00 00 00 00 05 CC 05 CC 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 E8 00 00 00 33 00 36 C4 00 48 13 00 16 00 36 C4 00 48 13 33 D8 29 C9 00 48 13 00 16 01 29 C9 00 48 13 33 00 12 E7 00 48 13 00 16 00 12 E7 00 48 13 33 BC 19 C9 01 48 13 00 16 01 19 C9 01 48 13 33 00 26 CE 01 48 13 00 16 00 26 CE 01 48 13 33 44 29 CE 01 48 13 00 16 01 29 CE 01 48 13 33 00 13 D3 01 48 13 00 16 00 13 D3 01 48 13 33 64 31 F1 01 48 13 00 16 01 31 F1 01 48 13 33 00 0B F7 01 48 13 00 16 00 0B F7 01 48 13 33 00 12 D8 02 48 13 00 16 01 12 D8 02 48 13 33 00 10 F1 02 48 13 00 16 00 10 F1 02 48 13 33 00 30 C4 03 48 13 00 16 01 30 C4 03 48 13 33 00 04 CA 03 48 13 00 16 00 04 CA 03 48 13 33 00 2F D3 03 48 13 00 16 01 2F D3 03 48 13 33 00 30 D8 03 48 13 00 16 00 30 D8 03 48 13 33 00 13 E7 03 48 13 00 16 01 13 E7 03 48 13 33 00 2E FB 03 48 13 00 16 00 2E FB 03 48 13 19 00 00 C1 04 08 13 07 00 00 04 0C 28 93 6D 28 93 05 0C 00 E8 00 00 00 00 04 0C 04 0C 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 E8 00 00 00 06 3E 03 7A 19 DC 48 49 13 0C 3E 0C E6 08 09 13 07 00 00 01 E4 29 93 6D 29 93 05 0C 00 E8 00 00 00 00 01 E4 01 E4 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 E8 00 00 00 1A 00 13 D2 0D 0A 13 1A 01 28 D2 0D 0A 13 21 00 2A D8 0D 0A 13 03 00 00 00 0E 2D D9 2D 0A 13 33 98 26 DE 0D 4A 13 00 16 01 26 DE 0D 4A 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 70"); - - MedtronicPumpHistoryDecoder decoder = new MedtronicPumpHistoryDecoder(); - - - // Logger LOGGER = StacktraceLoggerWrapper.getLogger(MedtronicHistoryDataUTest.class); - - //@Before - public void setup() { - - System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "trace"); - - // final TestAppender appender = new TestAppender(); - // final Logger logger = Logger.getRootLogger(); - // logger.addAppender(appender); - // try { - // Logger.getLogger(MyTest.class).info("Test"); - // } finally { - // logger.removeAppender(appender); - // } - - - } - - - @Before - public void prepareMocks() throws Exception { - - System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "trace"); - - when(SP.getString(R.string.key_danars_address, "")).thenReturn(""); - - //danaRPlugin = DanaRPlugin.getPlugin(); - } - - - //@Test - public void testTBR() throws Exception { - - RawHistoryPage historyPage = new RawHistoryPage(); - historyPage.appendData(historyPageData); - - List pumpHistoryEntries = decoder.processPageAndCreateRecords(historyPage); - - System.out.println("PumpHistoryEntries: " + pumpHistoryEntries.size()); - - Log.d("Test", "Log.d"); - //LOGGER.debug("Logger.debug"); - - for (PumpHistoryEntry pumpHistoryEntry : pumpHistoryEntries) { - Log.d("MedtronicHistoryDataUTest", pumpHistoryEntry.toString()); - } - - } - - - public void testRussel() throws Exception { - byte[] historyPageData = ByteUtil - .createByteArrayFromString("06 15 04 F6 00 40 60 01 05 06 36 04 FE 00 40 60 01 05 06 2F 18 1A 00 40 20 C1 05 06 2F 0C 45 00 40 20 C1 05 06 2F 0C 56 00 40 20 C1 05 06 2F 0C 78 00 40 20 C1 05 06 2F 0C AD 00 40 20 C1 05 06 15 04 BA 00 40 40 A1 05 0C 15 0E 40 00 01 05 64 00 0D 44 00 01 05 17 00 14 44 00 01 05 18 00 00 44 00 01 05 21 00 07 44 00 01 05 21 00 0C 4E 00 01 05 07 00 00 00 00 01 85 6D 01 85 06 08 00 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 2B 00 00 00 03 00 00 00 15 00 67 35 02 05 03 00 03 00 03 1C 67 15 02 05 07 00 00 00 40 02 85 6D 02 85 06 08 00 2B 00 00 00 00 00 40 00 40 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 2B 00 00 00 2C 78 39 5F 17 03 05 07 00 00 02 6C 03 85 6D 03 85 06 08 00 2B 00 00 00 00 02 6C 02 6C 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 2B 00 00 00 26 01 33 44 01 04 05 27 03 74 41 01 B2 07 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29 74"); - - RawHistoryPage historyPage = new RawHistoryPage(); - historyPage.appendData(historyPageData); - - List pumpHistoryEntries = decoder.processPageAndCreateRecords(historyPage); - - System.out.println("PumpHistoryEntries: " + pumpHistoryEntries.size()); - - Log.d("Test", "Log.d"); - //LOGGER.debug("Logger.debug"); - - for (PumpHistoryEntry pumpHistoryEntry : pumpHistoryEntries) { - Log.d("MedtronicHistoryDataUTest", pumpHistoryEntry.toString()); - } - - } - - - // @Test - public void testJRoth_2111() throws Exception { - - byte[] historyPageData = ByteUtil - .createByteArrayFromString("01 03 03 00 8E 85 52 48 13 33 00 AB 89 12 48 13 00 16 00 AB 89 12 48 13 33 34 AD 89 12 48 13 00 16 01 AD 89 12 48 13 01 01 01 00 B8 8A 52 48 13 01 08 08 00 9F 8C 52 48 13 33 00 91 8F 12 48 13 00 16 00 91 8F 12 48 13 33 00 92 8F 12 48 13 00 16 03 92 8F 12 48 13 33 00 BA A7 12 48 13 00 16 04 BA A7 12 48 13 01 19 19 00 AF B0 52 48 13 33 00 8C 8A 13 48 13 00 16 04 8C 8A 13 48 13 33 00 9D A8 13 48 13 00 16 04 9D A8 13 48 13 33 00 AA 85 14 48 13 00 16 04 AA 85 14 48 13 33 00 8D A1 14 48 13 00 16 04 8D A1 14 48 13 33 10 89 BA 14 48 13 00 16 01 89 BA 14 48 13 33 00 AD 88 15 48 13 00 16 00 AD 88 15 48 13 33 00 AF 88 15 48 13 00 16 01 AF 88 15 48 13 01 1D 1D 00 95 8D 55 48 13 33 00 95 92 15 48 13 00 16 04 95 92 15 48 13 33 1E B7 9C 15 48 13 00 16 01 B7 9C 15 48 13 33 00 AA A6 15 48 13 00 16 00 AA A6 15 48 13 33 00 AC A6 15 48 13 00 16 04 AC A6 15 48 13 01 02 02 00 B7 A6 55 48 13 01 01 01 00 A6 AC 55 48 13 33 00 B3 8D 16 48 13 00 16 04 B3 8D 16 48 13 33 00 B7 97 16 48 13 00 16 04 B7 97 16 48 13 33 18 A7 B2 16 48 13 00 16 01 A7 B2 16 48 13 33 00 8B B8 16 48 13 00 16 00 8B B8 16 48 13 33 00 8D B8 16 48 13 00 16 03 8D B8 16 48 13 33 18 AE 85 17 48 13 00 16 01 AE 85 17 48 13 33 00 92 8A 17 48 13 00 16 00 92 8A 17 48 13 33 00 94 8A 17 48 13 00 16 01 94 8A 17 48 13 01 02 02 00 9F 8A 57 48 13 33 06 AC 8F 17 48 13 00 16 01 AC 8F 17 48 13 01 02 02 00 B8 8F 57 48 13 33 00 98 94 17 48 13 00 16 00 98 94 17 48 13 33 0C 9A 94 17 48 13 00 16 01 9A 94 17 48 13 01 02 02 00 A5 94 57 48 13 33 00 9C 99 17 48 13 00 16 00 9C 99 17 48 13 33 00 9E 99 17 48 13 00 16 01 9E 99 17 48 13 01 02 02 00 A9 99 57 48 13 01 02 02 00 84 9F 57 48 13 01 02 02 00 A7 A6 57 48 13 33 00 A4 AB 17 48 13 00 16 00 A4 AB 17 48 13 01 02 02 00 B0 AB 57 48 13 33 00 A7 B0 17 48 13 00 16 02 A7 B0 17 48 13 01 01 01 00 B2 B0 57 48 13 33 00 AD BA 17 48 13 00 16 04 AD BA 17 48 13 07 00 00 05 3A A8 13 6D A8 13 05 0C 00 E8 00 00 00 00 05 3A 00 F6 12 04 44 52 00 00 04 44 52 00 00 00 00 00 00 04 44 64 35 00 00 00 35 0C 00 E8 00 00 00 06 0A 1D 66 80 81 60 09 13 0C 0A 8D 82 00 09 13 1A 00 9A 82 00 09 13 1A 01 AF 82 00 09 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 28"); - - RawHistoryPage historyPage = new RawHistoryPage(); - historyPage.appendData(historyPageData); - - List pumpHistoryEntries = decoder.processPageAndCreateRecords(historyPage); - - System.out.println("PumpHistoryEntries: " + pumpHistoryEntries.size()); - - Log.d("Test", "Log.d"); - //LOGGER.debug("Logger.debug"); - - for (PumpHistoryEntry pumpHistoryEntry : pumpHistoryEntries) { - Log.d("MedtronicHistoryDataUTest", pumpHistoryEntry.toString()); - } - } - -*/ -} diff --git a/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt new file mode 100644 index 0000000000..adb0844ef0 --- /dev/null +++ b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt @@ -0,0 +1,186 @@ +package info.nightscout.androidaps.plugins.pump.medtronic.comm + +import android.util.Log +import info.nightscout.androidaps.TestBase +import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil +import org.mockito.Mock +import info.nightscout.androidaps.plugins.bus.RxBus +import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.logging.AAPSLogger +import info.nightscout.shared.logging.AAPSLoggerTest +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil +import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus +import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder +import kotlin.Throws +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry +import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType +import info.nightscout.androidaps.plugins.pump.medtronic.data.MedtronicHistoryData +import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.TempBasalProcessDTO +import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType +import info.nightscout.androidaps.utils.rx.TestAapsSchedulers +import info.nightscout.androidaps.utils.serialisation.SealedClassHelper.gson +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.ArgumentMatchers +import org.mockito.Mockito +import org.mockito.MockitoAnnotations +import java.lang.Exception + +//import uk.org.lidalia.slf4jtest.TestLogger; +//import uk.org.lidalia.slf4jtest.TestLoggerFactory; +/** + * Created by andy on 3/10/19. + */ +class MedtronicHistoryDataUTest : TestBase() { + + //TestLogger LOGGER = TestLoggerFactory.getTestLogger(MedtronicHistoryDataUTest.class); + // var historyPageData = ByteUtil + // .createByteArrayFromString( + // "16 00 12 EC 14 47 13 33 00 14 F2 14 47 13 00 16 01 14 F2 14 47 13 33 00 1C C9 15 47 13 00 16 00 1C C9 15 47 13 33 4E 31 D3 15 47 13 00 16 01 31 D3 15 47 13 33 00 1A F1 15 47 13 00 16 00 1A F1 15 47 13 33 50 1D F1 15 47 13 00 16 01 1D F1 15 47 13 33 50 11 D8 16 47 13 00 16 01 11 D8 16 47 13 33 50 31 FB 16 47 13 00 16 01 31 FB 16 47 13 33 50 12 E3 17 47 13 00 16 01 12 E3 17 47 13 33 00 1E FB 17 47 13 00 16 00 1E FB 17 47 13 33 D8 21 FB 17 47 13 00 16 01 21 FB 17 47 13 07 00 00 05 CC 27 93 6D 27 93 05 0C 00 E8 00 00 00 00 05 CC 05 CC 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 E8 00 00 00 33 00 36 C4 00 48 13 00 16 00 36 C4 00 48 13 33 D8 29 C9 00 48 13 00 16 01 29 C9 00 48 13 33 00 12 E7 00 48 13 00 16 00 12 E7 00 48 13 33 BC 19 C9 01 48 13 00 16 01 19 C9 01 48 13 33 00 26 CE 01 48 13 00 16 00 26 CE 01 48 13 33 44 29 CE 01 48 13 00 16 01 29 CE 01 48 13 33 00 13 D3 01 48 13 00 16 00 13 D3 01 48 13 33 64 31 F1 01 48 13 00 16 01 31 F1 01 48 13 33 00 0B F7 01 48 13 00 16 00 0B F7 01 48 13 33 00 12 D8 02 48 13 00 16 01 12 D8 02 48 13 33 00 10 F1 02 48 13 00 16 00 10 F1 02 48 13 33 00 30 C4 03 48 13 00 16 01 30 C4 03 48 13 33 00 04 CA 03 48 13 00 16 00 04 CA 03 48 13 33 00 2F D3 03 48 13 00 16 01 2F D3 03 48 13 33 00 30 D8 03 48 13 00 16 00 30 D8 03 48 13 33 00 13 E7 03 48 13 00 16 01 13 E7 03 48 13 33 00 2E FB 03 48 13 00 16 00 2E FB 03 48 13 19 00 00 C1 04 08 13 07 00 00 04 0C 28 93 6D 28 93 05 0C 00 E8 00 00 00 00 04 0C 04 0C 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 E8 00 00 00 06 3E 03 7A 19 DC 48 49 13 0C 3E 0C E6 08 09 13 07 00 00 01 E4 29 93 6D 29 93 05 0C 00 E8 00 00 00 00 01 E4 01 E4 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 E8 00 00 00 1A 00 13 D2 0D 0A 13 1A 01 28 D2 0D 0A 13 21 00 2A D8 0D 0A 13 03 00 00 00 0E 2D D9 2D 0A 13 33 98 26 DE 0D 4A 13 00 16 01 26 DE 0D 4A 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 70" + // ) + + + + + //lateinit var rxBus: RxBus + lateinit var medtronicHistoryData: MedtronicHistoryData + lateinit var medtronicPumpStatus : MedtronicPumpStatus + + + @Before + fun setup() { + MockitoAnnotations.initMocks(this) + + rxBus = RxBus(TestAapsSchedulers(), aapsLogger) + + medtronicPumpStatus = MedtronicPumpStatus( + rh, sp, rxBus, + rileyLinkUtil + ) + + medtronicUtil = MedtronicUtil( + aapsLogger, rxBus, rileyLinkUtil, + medtronicPumpStatus + ) + + decoder = MedtronicPumpHistoryDecoder( + aapsLogger, + medtronicUtil, byteUtil + ) + + medtronicHistoryData = MedtronicHistoryData(packetInjector, aapsLogger, sp, rh, rxBus, activePlugin, + medtronicUtil, decoder, + medtronicPumpStatus, + pumpSync, + pumpSyncStorage) + + + System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "trace") + + } + + + //@Test + @Throws(Exception::class) fun testTBR() { + var historyPageData = ByteUtil + .createByteArrayFromString( + "16 00 12 EC 14 47 13 33 00 14 F2 14 47 13 00 16 01 14 F2 14 47 13 33 00 1C C9 15 47 13 00 16 00 1C C9 15 47 13 33 4E 31 D3 15 47 13 00 16 01 31 D3 15 47 13 33 00 1A F1 15 47 13 00 16 00 1A F1 15 47 13 33 50 1D F1 15 47 13 00 16 01 1D F1 15 47 13 33 50 11 D8 16 47 13 00 16 01 11 D8 16 47 13 33 50 31 FB 16 47 13 00 16 01 31 FB 16 47 13 33 50 12 E3 17 47 13 00 16 01 12 E3 17 47 13 33 00 1E FB 17 47 13 00 16 00 1E FB 17 47 13 33 D8 21 FB 17 47 13 00 16 01 21 FB 17 47 13 07 00 00 05 CC 27 93 6D 27 93 05 0C 00 E8 00 00 00 00 05 CC 05 CC 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 E8 00 00 00 33 00 36 C4 00 48 13 00 16 00 36 C4 00 48 13 33 D8 29 C9 00 48 13 00 16 01 29 C9 00 48 13 33 00 12 E7 00 48 13 00 16 00 12 E7 00 48 13 33 BC 19 C9 01 48 13 00 16 01 19 C9 01 48 13 33 00 26 CE 01 48 13 00 16 00 26 CE 01 48 13 33 44 29 CE 01 48 13 00 16 01 29 CE 01 48 13 33 00 13 D3 01 48 13 00 16 00 13 D3 01 48 13 33 64 31 F1 01 48 13 00 16 01 31 F1 01 48 13 33 00 0B F7 01 48 13 00 16 00 0B F7 01 48 13 33 00 12 D8 02 48 13 00 16 01 12 D8 02 48 13 33 00 10 F1 02 48 13 00 16 00 10 F1 02 48 13 33 00 30 C4 03 48 13 00 16 01 30 C4 03 48 13 33 00 04 CA 03 48 13 00 16 00 04 CA 03 48 13 33 00 2F D3 03 48 13 00 16 01 2F D3 03 48 13 33 00 30 D8 03 48 13 00 16 00 30 D8 03 48 13 33 00 13 E7 03 48 13 00 16 01 13 E7 03 48 13 33 00 2E FB 03 48 13 00 16 00 2E FB 03 48 13 19 00 00 C1 04 08 13 07 00 00 04 0C 28 93 6D 28 93 05 0C 00 E8 00 00 00 00 04 0C 04 0C 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 E8 00 00 00 06 3E 03 7A 19 DC 48 49 13 0C 3E 0C E6 08 09 13 07 00 00 01 E4 29 93 6D 29 93 05 0C 00 E8 00 00 00 00 01 E4 01 E4 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 00 E8 00 00 00 1A 00 13 D2 0D 0A 13 1A 01 28 D2 0D 0A 13 21 00 2A D8 0D 0A 13 03 00 00 00 0E 2D D9 2D 0A 13 33 98 26 DE 0D 4A 13 00 16 01 26 DE 0D 4A 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5D 70" + ) + + val historyPage = RawHistoryPage(aapsLogger) + historyPage.appendData(historyPageData) + val pumpHistoryEntries: List = decoder.processPageAndCreateRecords(historyPage) + println("PumpHistoryEntries: " + pumpHistoryEntries.size) + Log.d("Test", "Log.d") + //LOGGER.debug("Logger.debug"); + for (pumpHistoryEntry in pumpHistoryEntries) { + Log.d("MedtronicHistoryDataUTest", pumpHistoryEntry.toString()) + } + } + + @Throws(Exception::class) fun testRussel() { + val historyPageData = ByteUtil + .createByteArrayFromString( + "06 15 04 F6 00 40 60 01 05 06 36 04 FE 00 40 60 01 05 06 2F 18 1A 00 40 20 C1 05 06 2F 0C 45 00 40 20 C1 05 06 2F 0C 56 00 40 20 C1 05 06 2F 0C 78 00 40 20 C1 05 06 2F 0C AD 00 40 20 C1 05 06 15 04 BA 00 40 40 A1 05 0C 15 0E 40 00 01 05 64 00 0D 44 00 01 05 17 00 14 44 00 01 05 18 00 00 44 00 01 05 21 00 07 44 00 01 05 21 00 0C 4E 00 01 05 07 00 00 00 00 01 85 6D 01 85 06 08 00 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 2B 00 00 00 03 00 00 00 15 00 67 35 02 05 03 00 03 00 03 1C 67 15 02 05 07 00 00 00 40 02 85 6D 02 85 06 08 00 2B 00 00 00 00 00 40 00 40 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 2B 00 00 00 2C 78 39 5F 17 03 05 07 00 00 02 6C 03 85 6D 03 85 06 08 00 2B 00 00 00 00 02 6C 02 6C 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 2B 00 00 00 26 01 33 44 01 04 05 27 03 74 41 01 B2 07 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29 74" + ) + val historyPage = RawHistoryPage(aapsLogger) + historyPage.appendData(historyPageData) + val pumpHistoryEntries: List = decoder.processPageAndCreateRecords(historyPage) + println("PumpHistoryEntries: " + pumpHistoryEntries.size) + Log.d("Test", "Log.d") + //LOGGER.debug("Logger.debug"); + for (pumpHistoryEntry in pumpHistoryEntries) { + Log.d("MedtronicHistoryDataUTest", pumpHistoryEntry.toString()) + } + } + + // @Test + @Throws(Exception::class) fun testJRoth_2111() { + val historyPageData = ByteUtil + .createByteArrayFromString( + "01 03 03 00 8E 85 52 48 13 33 00 AB 89 12 48 13 00 16 00 AB 89 12 48 13 33 34 AD 89 12 48 13 00 16 01 AD 89 12 48 13 01 01 01 00 B8 8A 52 48 13 01 08 08 00 9F 8C 52 48 13 33 00 91 8F 12 48 13 00 16 00 91 8F 12 48 13 33 00 92 8F 12 48 13 00 16 03 92 8F 12 48 13 33 00 BA A7 12 48 13 00 16 04 BA A7 12 48 13 01 19 19 00 AF B0 52 48 13 33 00 8C 8A 13 48 13 00 16 04 8C 8A 13 48 13 33 00 9D A8 13 48 13 00 16 04 9D A8 13 48 13 33 00 AA 85 14 48 13 00 16 04 AA 85 14 48 13 33 00 8D A1 14 48 13 00 16 04 8D A1 14 48 13 33 10 89 BA 14 48 13 00 16 01 89 BA 14 48 13 33 00 AD 88 15 48 13 00 16 00 AD 88 15 48 13 33 00 AF 88 15 48 13 00 16 01 AF 88 15 48 13 01 1D 1D 00 95 8D 55 48 13 33 00 95 92 15 48 13 00 16 04 95 92 15 48 13 33 1E B7 9C 15 48 13 00 16 01 B7 9C 15 48 13 33 00 AA A6 15 48 13 00 16 00 AA A6 15 48 13 33 00 AC A6 15 48 13 00 16 04 AC A6 15 48 13 01 02 02 00 B7 A6 55 48 13 01 01 01 00 A6 AC 55 48 13 33 00 B3 8D 16 48 13 00 16 04 B3 8D 16 48 13 33 00 B7 97 16 48 13 00 16 04 B7 97 16 48 13 33 18 A7 B2 16 48 13 00 16 01 A7 B2 16 48 13 33 00 8B B8 16 48 13 00 16 00 8B B8 16 48 13 33 00 8D B8 16 48 13 00 16 03 8D B8 16 48 13 33 18 AE 85 17 48 13 00 16 01 AE 85 17 48 13 33 00 92 8A 17 48 13 00 16 00 92 8A 17 48 13 33 00 94 8A 17 48 13 00 16 01 94 8A 17 48 13 01 02 02 00 9F 8A 57 48 13 33 06 AC 8F 17 48 13 00 16 01 AC 8F 17 48 13 01 02 02 00 B8 8F 57 48 13 33 00 98 94 17 48 13 00 16 00 98 94 17 48 13 33 0C 9A 94 17 48 13 00 16 01 9A 94 17 48 13 01 02 02 00 A5 94 57 48 13 33 00 9C 99 17 48 13 00 16 00 9C 99 17 48 13 33 00 9E 99 17 48 13 00 16 01 9E 99 17 48 13 01 02 02 00 A9 99 57 48 13 01 02 02 00 84 9F 57 48 13 01 02 02 00 A7 A6 57 48 13 33 00 A4 AB 17 48 13 00 16 00 A4 AB 17 48 13 01 02 02 00 B0 AB 57 48 13 33 00 A7 B0 17 48 13 00 16 02 A7 B0 17 48 13 01 01 01 00 B2 B0 57 48 13 33 00 AD BA 17 48 13 00 16 04 AD BA 17 48 13 07 00 00 05 3A A8 13 6D A8 13 05 0C 00 E8 00 00 00 00 05 3A 00 F6 12 04 44 52 00 00 04 44 52 00 00 00 00 00 00 04 44 64 35 00 00 00 35 0C 00 E8 00 00 00 06 0A 1D 66 80 81 60 09 13 0C 0A 8D 82 00 09 13 1A 00 9A 82 00 09 13 1A 01 AF 82 00 09 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 28" + ) + val historyPage = RawHistoryPage(aapsLogger) + historyPage.appendData(historyPageData) + val pumpHistoryEntries: List = decoder.processPageAndCreateRecords(historyPage) + println("PumpHistoryEntries: " + pumpHistoryEntries.size) + Log.d("Test", "Log.d") + //LOGGER.debug("Logger.debug"); + for (pumpHistoryEntry in pumpHistoryEntries) { + Log.d("MedtronicHistoryDataUTest", pumpHistoryEntry.toString()) + } + } + + @Test @Throws(Exception::class) fun test_1724() { + val historyPageData = ByteUtil + .createByteArrayFromString( + "33 20 53 78 15 51 16 00 16 01 53 78 15 51 16 33 00 6F 40 16 51 16 00 16 00 6F 40 16 51 16 7B 16 6F 40 16 11 16 2C 1E 00 33 30 71 40 16 51 16 00 16 01 71 40 16 51 16 33 00 6E 45 16 51 16 00 16 00 6E 45 16 51 16 7B 16 6E 45 16 11 16 2C 1E 00 33 3A 70 45 16 51 16 00 16 01 70 45 16 51 16 33 00 71 5E 16 51 16 00 16 00 71 5E 16 51 16 7B 16 71 5E 16 11 16 2C 1E 00 33 40 73 5E 16 51 16 00 16 01 73 5E 16 51 16 33 00 74 6D 16 51 16 00 16 00 74 6D 16 51 16 7B 16 74 6D 16 11 16 2C 1E 00 33 14 76 6D 16 51 16 00 16 01 76 6D 16 51 16 33 00 77 72 16 51 16 00 16 00 77 72 16 51 16 7B 16 77 72 16 11 16 2C 1E 00 7B 17 40 40 17 11 16 2E 1E 00 33 28 51 41 17 51 16 00 16 01 51 41 17 51 16 33 00 56 46 17 51 16 00 16 00 56 46 17 51 16 7B 17 56 46 17 11 16 2E 1E 00 33 34 59 46 17 51 16 00 16 01 59 46 17 51 16 33 00 70 4A 17 51 16 00 16 00 70 4A 17 51 16 7B 17 70 4A 17 11 16 2E 1E 00 33 58 72 4A 17 51 16 00 16 01 72 4A 17 51 16 33 00 6E 59 17 51 16 00 16 00 6E 59 17 51 16 7B 17 6E 59 17 11 16 2E 1E 00 33 18 70 59 17 51 16 00 16 01 70 59 17 51 16 33 00 70 5E 17 51 16 00 16 00 70 5E 17 51 16 7B 17 70 5E 17 11 16 2E 1E 00 33 0C 72 5E 17 51 16 00 16 01 72 5E 17 51 16 33 00 72 63 17 51 16 00 16 00 72 63 17 51 16 7B 17 72 63 17 11 16 2E 1E 00 33 1C 70 72 17 51 16 00 16 01 70 72 17 51 16 33 00 51 78 17 51 16 00 16 00 51 78 17 51 16 7B 17 52 78 17 11 16 2E 1E 00 33 12 54 78 17 51 16 00 16 01 54 78 17 51 16 07 00 00 04 4E 51 96 00 00 00 6E 51 96 05 00 00 00 00 00 00 00 04 4E 03 A2 54 00 AC 10 00 00 00 00 00 00 00 00 00 AC 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 33 00 46 46 00 52 16 00 16 00 46 46 00 52 16 7B 00 47 46 00 12 16 00 1E 00 33 20 47 64 00 52 16 00 16 01 47 64 00 52 16 33 00 6D 77 00 52 16 00 16 00 6D 77 00 52 16 7B 00 6D 77 00 12 16 00 1E 00 33 12 70 77 00 52 16 00 16 01 70 77 00 52 16 33 00 58 78 00 52 16 00 16 00 58 78 00 52 16 7B 00 59 78 00 12 16 00 1E 00 33 00 5C 78 00 52 16 00 16 02 5C 78 00 52 16 21 00 66 79 00 12 16 03 00 00 00 9C 74 42 21 12 16 03 00 03 00 03 6E 4D 01 12 16 33 00 79 4E 01 52 16 00 16 00 79 4E 01 52 16 7B 01 79 4E 01 12 16 02 1E 00 33 2A 6B 4F 01 52 16 00 16 01 6B 4F 01 52 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E D1" + //"33 20 53 78 15 51 16 00 16 01 53 78 15 51 16 33 00 6F 40 16 51 16 00 16 00 6F 40 16 51 16 7B 16 6F 40 16 11 16 2C 1E 00 33 30 71 40 16 51 16 00 16 01 71 40 16 51 16 33 00 6E 45 + // 16 51 16 00 16 00 6E 45 16 51 16 7B 16 6E 45 16 11 16 2C 1E 00 33 3A 70 45 16 51 16 00 16 01 70 45 16 51 16 33 00 71 5E 16 51 16 00 16 00 71 5E 16 51 16 7B 16 71 5E 16 11 16 2C 1E 00 33 40 73 5E 16 51 16 00 16 01 73 5E 16 51 16 33 00 74 6D 16 51 16 00 16 00 74 6D 16 51 16 7B 16 74 6D 16 11 16 2C 1E 00 33 14 76 6D 16 51 16 00 16 01 76 6D 16 51 16 33 00 77 72 16 51 16 00 16 00 77 72 16 51 16 7B 16 77 72 16 11 16 2C 1E 00 7B 17 40 40 17 11 16 2E 1E 00 33 28 51 41 17 51 16 00 16 01 51 41 17 51 16 33 00 56 46 17 51 16 00 16 00 56 46 17 51 16 7B 17 56 46 17 11 16 2E 1E 00 33 34 59 46 17 51 16 00 16 01 59 46 17 51 16 33 00 70 4A 17 51 16 00 16 00 70 4A 17 51 16 7B 17 70 4A 17 11 16 2E 1E 00 33 58 72 4A 17 51 16 00 16 01 72 4A 17 51 16 33 00 6E 59 17 51 16 00 16 00 6E 59 17 51 16 7B 17 6E 59 17 11 16 2E 1E 00 33 18 70 59 17 51 16 00 16 01 70 59 17 51 16 33 00 70 5E 17 51 16 00 16 00 70 5E 17 51 16 7B 17 70 5E 17 11 16 2E 1E 00 33 0C 72 5E 17 51 16 00 16 01 72 5E 17 51 16 33 00 72 63 17 51 16 00 16 00 72 63 17 51 16 7B 17 72 63 17 11 16 2E 1E 00 33 1C 70 72 17 51 16 00 16 01 70 72 17 51 16 33 00 51 78 17 51 16 00 16 00 51 78 17 51 16 7B 17 52 78 17 11 16 2E 1E 00 33 12 54 78 17 51 16 00 16 01 54 78 17 51 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4D 6D" + ) + + medtronicUtil.medtronicPumpModel =MedtronicDeviceType.Medtronic_723_Revel + medtronicUtil.isModelSet = true + + val historyPage = RawHistoryPage(aapsLogger) + historyPage.appendData(historyPageData) + val pumpHistoryEntries: MutableList = decoder.processPageAndCreateRecords(historyPage) + println("PumpHistoryEntries: " + pumpHistoryEntries.size) + + val rewindRecords: MutableList = medtronicHistoryData.getFilteredItems(pumpHistoryEntries, PumpHistoryEntryType.Rewind) + + preProcessListTBR(pumpHistoryEntries) + + println("PumpHistoryEntries: after: " + pumpHistoryEntries.size) + + Log.d("Test", "Log.d") + //LOGGER.debug("Logger.debug"); + for (pumpHistoryEntry in pumpHistoryEntries) { + println(pumpHistoryEntry.toEntryString()) + } + + println("PumpHistoryEntries: after: " + pumpHistoryEntries.size) + + val tbrs: MutableList = medtronicHistoryData.getFilteredItems(pumpHistoryEntries, PumpHistoryEntryType.TempBasalCombined) + + tbrs.reverse() + + println("PumpHistoryEntries: getFilteredItems: " + tbrs.size) + + println("PumpHistoryEntries: getRewindItems: $rewindRecords.size : " + gson.toJson(rewindRecords) ) + + val processList: MutableList = medtronicHistoryData.createTBRProcessList(tbrs, rewindRecords) + + println("PumpHistoryEntries: processList: " + processList.size) + + for (tempBasalProcessDTO in processList) { + println(tempBasalProcessDTO.toTreatmentString()) + } + + } +} \ No newline at end of file diff --git a/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt index 14d3a7e1b2..9b0a05ebf9 100644 --- a/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt +++ b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump -import dagger.android.HasAndroidInjector +//import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil @@ -10,13 +9,11 @@ import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistory import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.rx.TestAapsSchedulers -import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before +import org.junit.Ignore import org.junit.Test -import org.mockito.Answers import org.mockito.Mock /** @@ -25,16 +22,17 @@ import org.mockito.Mock @Suppress("SpellCheckingInspection") class MedtronicPumpHistoryDecoderUTest : TestBase() { - @Mock lateinit var injector: HasAndroidInjector - @Mock lateinit var rh: ResourceHelper - @Mock(answer = Answers.RETURNS_DEEP_STUBS) lateinit var activePlugin: ActivePlugin - @Mock lateinit var rileyLinkUtil: RileyLinkUtil - @Mock lateinit var sp: SP + //@Mock lateinit var injector: HasAndroidInjector + //@Mock lateinit var rh: ResourceHelper +// @Mock(answer = Answers.RETURNS_DEEP_STUBS) lateinit var activePlugin: ActivePlugin + //@Mock lateinit var rileyLinkUtil: RileyLinkUtil + //@Mock lateinit var sp: SP private var medtronicPumpStatus: MedtronicPumpStatus? = null - private var medtronicUtil: MedtronicUtil? = null - private var decoder: MedtronicPumpHistoryDecoder? = null + //private var medtronicUtil: MedtronicUtil? = null + //private var decoder: MedtronicPumpHistoryDecoder? = null var rxBusWrapper = RxBus(TestAapsSchedulers(), aapsLogger) + @Before fun setup() { medtronicPumpStatus = MedtronicPumpStatus(rh, sp, rxBusWrapper, rileyLinkUtil) diff --git a/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt index 757620e104..a985f6d615 100644 --- a/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt +++ b/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data +import java.lang.reflect.Type +import com.google.gson.reflect.TypeToken import com.google.gson.Gson import com.google.gson.internal.LinkedTreeMap -import com.google.gson.reflect.TypeToken -import dagger.android.AndroidInjector -import dagger.android.HasAndroidInjector +// import dagger.android.AndroidInjector +// import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder @@ -16,39 +16,55 @@ import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpH import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.TempBasalPair import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import org.junit.Before +import org.junit.Ignore + import org.junit.Test import org.mockito.Mock -import java.lang.reflect.Type -@Suppress("UNCHECKED_CAST") class MedtronicHistoryDataUTest : TestBase() { +@Suppress("UNCHECKED_CAST") +class MedtronicHistoryDataUTest : TestBase() { - @Mock lateinit var activePlugin: ActivePlugin - @Mock lateinit var medtronicUtil: MedtronicUtil - @Mock lateinit var medtronicPumpHistoryDecoder: MedtronicPumpHistoryDecoder + //@Mock lateinit var activePlugin: ActivePlugin + //@Mock lateinit var medtronicUtil: MedtronicUtil + //@Mock lateinit var medtronicPumpHistoryDecoder: MedtronicPumpHistoryDecoder @Mock lateinit var medtronicPumpStatus: MedtronicPumpStatus - @Mock lateinit var pumpSync: PumpSync - @Mock lateinit var pumpSyncStorage: PumpSyncStorage - @Mock lateinit var sp: SP - @Mock lateinit var rh: ResourceHelper - @Mock lateinit var rxBus: RxBus + // @Mock lateinit var pumpSync: PumpSync + // @Mock lateinit var pumpSyncStorage: PumpSyncStorage - private val packetInjector = HasAndroidInjector { - AndroidInjector { + //@Mock lateinit var rxBus: RxBus - } + // val packetInjector = HasAndroidInjector { + // AndroidInjector { + // + // } + // } + + @Before + fun setUp() { + medtronicUtil = MedtronicUtil( + aapsLogger, rxBus, rileyLinkUtil, + medtronicPumpStatus + ) + + decoder = MedtronicPumpHistoryDecoder( + aapsLogger, + medtronicUtil, byteUtil + ) } + + @Test fun createTBRProcessList() { - val unitToTest = MedtronicHistoryData( - packetInjector, aapsLogger, sp, rh, rxBus, activePlugin, - medtronicUtil, medtronicPumpHistoryDecoder, - medtronicPumpStatus, - pumpSync, - pumpSyncStorage - ) + var unitToTest = MedtronicHistoryData(packetInjector, aapsLogger, sp, rh, rxBus, activePlugin, + medtronicUtil, decoder, + medtronicPumpStatus, + pumpSync, + pumpSyncStorage) val gson = Gson() @@ -58,26 +74,26 @@ import java.lang.reflect.Type val yourClassList: MutableList = gson.fromJson(fileText, listType) for (pumpHistoryEntry in yourClassList) { - val stringObject = pumpHistoryEntry.decodedData["Object"] as LinkedTreeMap + val stringObject = pumpHistoryEntry.decodedData["Object"] as LinkedTreeMap - val rate: Double = stringObject["insulinRate"] as Double - val durationMinutes: Double = stringObject["durationMinutes"] as Double - val durationMinutesInt: Int = durationMinutes.toInt() + val rate : Double = stringObject.get("insulinRate") as Double + val durationMinutes: Double = stringObject.get("durationMinutes") as Double + val durationMinutesInt : Int = durationMinutes.toInt() - val tmbPair = TempBasalPair(rate, false, durationMinutesInt) + var tmbPair = TempBasalPair(rate, false, durationMinutesInt) pumpHistoryEntry.decodedData.remove("Object") pumpHistoryEntry.addDecodedData("Object", tmbPair) } - println("TBR Pre-Process List: " + gson.toJson(yourClassList)) + System.out.println("TBR Pre-Process List: " + gson.toJson(yourClassList)) - val createTBRProcessList = unitToTest.createTBRProcessList(yourClassList) + val createTBRProcessList = unitToTest.createTBRProcessList(yourClassList, mutableListOf()) - println("TBR Process List: " + createTBRProcessList.size) + System.out.println("TBR Process List: " + createTBRProcessList.size) for (tempBasalProcessDTO in createTBRProcessList) { - println(tempBasalProcessDTO.toTreatmentString()) + System.out.println(tempBasalProcessDTO.toTreatmentString()) } } @@ -85,13 +101,11 @@ import java.lang.reflect.Type @Test fun createTBRProcessList_SpecialCase() { - val unitToTest = MedtronicHistoryData( - packetInjector, aapsLogger, sp, rh, rxBus, activePlugin, - medtronicUtil, medtronicPumpHistoryDecoder, - medtronicPumpStatus, - pumpSync, - pumpSyncStorage - ) + var unitToTest = MedtronicHistoryData(packetInjector, aapsLogger, sp, rh, rxBus, activePlugin, + medtronicUtil, decoder, + medtronicPumpStatus, + pumpSync, + pumpSyncStorage) val gson = Gson() @@ -101,26 +115,26 @@ import java.lang.reflect.Type val yourClassList: MutableList = gson.fromJson(fileText, listType) for (pumpHistoryEntry in yourClassList) { - val stringObject = pumpHistoryEntry.decodedData["Object"] as LinkedTreeMap + val stringObject = pumpHistoryEntry.decodedData["Object"] as LinkedTreeMap - val rate: Double = stringObject["insulinRate"] as Double - val durationMinutes: Double = stringObject["durationMinutes"] as Double - val durationMinutesInt: Int = durationMinutes.toInt() + val rate : Double = stringObject.get("insulinRate") as Double + val durationMinutes: Double = stringObject.get("durationMinutes") as Double + val durationMinutesInt : Int = durationMinutes.toInt() - val tmbPair = TempBasalPair(rate, false, durationMinutesInt) + var tmbPair = TempBasalPair(rate, false, durationMinutesInt) pumpHistoryEntry.decodedData.remove("Object") pumpHistoryEntry.addDecodedData("Object", tmbPair) } - println("TBR Pre-Process List (Special): " + gson.toJson(yourClassList)) + System.out.println("TBR Pre-Process List (Special): " + gson.toJson(yourClassList)) - val createTBRProcessList = unitToTest.createTBRProcessList(yourClassList) + val createTBRProcessList = unitToTest.createTBRProcessList(yourClassList, mutableListOf()) - println("TBR Process List (Special): " + createTBRProcessList.size) + System.out.println("TBR Process List (Special): " + createTBRProcessList.size) for (tempBasalProcessDTO in createTBRProcessList) { - println(tempBasalProcessDTO.toTreatmentString()) + System.out.println(tempBasalProcessDTO.toTreatmentString()) } } diff --git a/medtronic/src/test/resources/tbr_1724.json b/medtronic/src/test/resources/tbr_1724.json new file mode 100644 index 0000000000..79c6bc320c --- /dev/null +++ b/medtronic/src/test/resources/tbr_1724.json @@ -0,0 +1 @@ +33 20 53 78 15 51 16 00 16 01 53 78 15 51 16 33 00 6F 40 16 51 16 00 16 00 6F 40 16 51 16 7B 16 6F 40 16 11 16 2C 1E 00 33 30 71 40 16 51 16 00 16 01 71 40 16 51 16 33 00 6E 45 16 51 16 00 16 00 6E 45 16 51 16 7B 16 6E 45 16 11 16 2C 1E 00 33 3A 70 45 16 51 16 00 16 01 70 45 16 51 16 33 00 71 5E 16 51 16 00 16 00 71 5E 16 51 16 7B 16 71 5E 16 11 16 2C 1E 00 33 40 73 5E 16 51 16 00 16 01 73 5E 16 51 16 33 00 74 6D 16 51 16 00 16 00 74 6D 16 51 16 7B 16 74 6D 16 11 16 2C 1E 00 33 14 76 6D 16 51 16 00 16 01 76 6D 16 51 16 33 00 77 72 16 51 16 00 16 00 77 72 16 51 16 7B 16 77 72 16 11 16 2C 1E 00 7B 17 40 40 17 11 16 2E 1E 00 33 28 51 41 17 51 16 00 16 01 51 41 17 51 16 33 00 56 46 17 51 16 00 16 00 56 46 17 51 16 7B 17 56 46 17 11 16 2E 1E 00 33 34 59 46 17 51 16 00 16 01 59 46 17 51 16 33 00 70 4A 17 51 16 00 16 00 70 4A 17 51 16 7B 17 70 4A 17 11 16 2E 1E 00 33 58 72 4A 17 51 16 00 16 01 72 4A 17 51 16 33 00 6E 59 17 51 16 00 16 00 6E 59 17 51 16 7B 17 6E 59 17 11 16 2E 1E 00 33 18 70 59 17 51 16 00 16 01 70 59 17 51 16 33 00 70 5E 17 51 16 00 16 00 70 5E 17 51 16 7B 17 70 5E 17 11 16 2E 1E 00 33 0C 72 5E 17 51 16 00 16 01 72 5E 17 51 16 33 00 72 63 17 51 16 00 16 00 72 63 17 51 16 7B 17 72 63 17 11 16 2E 1E 00 33 1C 70 72 17 51 16 00 16 01 70 72 17 51 16 33 00 51 78 17 51 16 00 16 00 51 78 17 51 16 7B 17 52 78 17 11 16 2E 1E 00 33 12 54 78 17 51 16 00 16 01 54 78 17 51 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4D 6D \ No newline at end of file diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index 4483eab747..402d836bb3 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -705,7 +705,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements Pump, Riley } if (tbrCurrent != null && !enforceNew) { - if (Round.isSame(tbrCurrent.getRate(), absoluteRate)) { + if (Round.INSTANCE.isSame(tbrCurrent.getRate(), absoluteRate)) { aapsLogger.info(LTag.PUMP, "setTempBasalAbsolute - No enforceNew and same rate. Exiting."); return new PumpEnactResult(getInjector()).success(true).enacted(false); } diff --git a/openhumans/src/main/res/values-fr-rFR/strings.xml b/openhumans/src/main/res/values-fr-rFR/strings.xml index a2945acfc4..b200c1e685 100644 --- a/openhumans/src/main/res/values-fr-rFR/strings.xml +++ b/openhumans/src/main/res/values-fr-rFR/strings.xml @@ -45,4 +45,13 @@ Champs de texte libre Je comprends et je suis d\'accord. Téléchargement vers Open Humans + Touche finale + Vous n\'êtes qu\'à une étape du téléchargement de vos données vers Open Humans. Voulez-vous continuer? + Annuler + Procéder + Finalisation... + Cela peut prendre quelques secondes. + Nous avons terminé ! + Désormais, votre téléphone téléversera les données en arrière-plan de temps en temps. + Fermer diff --git a/openhumans/src/main/res/values-zh-rCN/strings.xml b/openhumans/src/main/res/values-zh-rCN/strings.xml index 18a0cfd7e9..ad03708d8d 100644 --- a/openhumans/src/main/res/values-zh-rCN/strings.xml +++ b/openhumans/src/main/res/values-zh-rCN/strings.xml @@ -16,4 +16,36 @@ 你已经从开源人类项目中退出 如果不是故意的,请单击此处再次登录。 现在上传 + 下一个 + 欢迎使用 Open Humans + 要设置数据上传,请单击“下一步” + 同意 + 使用条款 + 请仔细阅读以下信息并接受使用条款以继续 + 上传数据 + 血糖值 + 大剂量 + 扩展大剂量(方波) + 碳水化合物 + 切换配置文件 + 每日总剂量 + 临时基础率 + 临时目标 + 设置 + 应用程序版本 + 设备型号 + 屏幕尺寸 + 算法调试数据 + 数据未上传 + 密码 + Nightscout URL(NS网址) + Nightscout API密钥 + 空闲文本字段 + 我理解并同意 + 登陆到Open Humans + 取消 + 继续 + 正在完成... + 成功完成! + 关闭 diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java index 5ca477f8e2..1837bfce2e 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java @@ -200,7 +200,7 @@ public abstract class RileyLinkCommunicationManager { double[] scanFrequencies = rileyLinkServiceData.rileyLinkTargetFrequency.getScanFrequencies(); if (scanFrequencies.length == 1) { - return Round.isSame(scanFrequencies[0], frequency); + return Round.INSTANCE.isSame(scanFrequencies[0], frequency); } else { return (scanFrequencies[0] <= frequency && scanFrequencies[scanFrequencies.length - 1] >= frequency); } diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java index 3d25089463..703cd1c211 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.java @@ -103,7 +103,8 @@ public class InitializePumpManagerTask extends ServiceTask { } } else { - if (!Round.isSame(lastGoodFrequency, RileyLinkTargetFrequency.Omnipod.getScanFrequencies()[0])) { + if (!Round.INSTANCE.isSame(lastGoodFrequency, + RileyLinkTargetFrequency.Omnipod.getScanFrequencies()[0])) { lastGoodFrequency = RileyLinkTargetFrequency.Omnipod.getScanFrequencies()[0]; lastGoodFrequency = Math.round(lastGoodFrequency * 1000d) / 1000d; diff --git a/shared/src/main/java/info/nightscout/shared/SafeParse.kt b/shared/src/main/java/info/nightscout/shared/SafeParse.kt index 1c415b858b..badcc231d6 100644 --- a/shared/src/main/java/info/nightscout/shared/SafeParse.kt +++ b/shared/src/main/java/info/nightscout/shared/SafeParse.kt @@ -1,12 +1,9 @@ package info.nightscout.shared -import java.lang.Exception - object SafeParse { - // TODO return logging with dagger // private static Logger log = StacktraceLoggerWrapper.getLogger(SafeParse.class); - @JvmStatic fun stringToDouble(inputString: String?): Double { + fun stringToDouble(inputString: String?): Double { var input = inputString ?: return 0.0 var result = 0.0 input = input.replace(",", ".") @@ -20,7 +17,7 @@ object SafeParse { return result } - @JvmStatic fun stringToFloat(inputString: String?): Float { + fun stringToFloat(inputString: String?): Float { var input = inputString ?: return 0f var result = 0f input = input.replace(",", ".") @@ -34,7 +31,7 @@ object SafeParse { return result } - @JvmStatic fun stringToInt(inputString: String?): Int { + fun stringToInt(inputString: String?): Int { var input = inputString ?: return 0 var result = 0 input = input.replace(",", ".") diff --git a/shared/src/main/java/info/nightscout/shared/logging/StacktraceLoggerWrapper.kt b/shared/src/main/java/info/nightscout/shared/logging/StacktraceLoggerWrapper.kt index fb65329df6..2301a3f008 100644 --- a/shared/src/main/java/info/nightscout/shared/logging/StacktraceLoggerWrapper.kt +++ b/shared/src/main/java/info/nightscout/shared/logging/StacktraceLoggerWrapper.kt @@ -32,7 +32,7 @@ class StacktraceLoggerWrapper(private val delegate: Logger) : Logger by delegate // all other methods will be implemented by delegate companion object { - @JvmStatic + @Deprecated("please inject AAPSLogger") fun getLogger(clazz: Class<*>) = StacktraceLoggerWrapper(LoggerFactory.getLogger(clazz)) } diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BaseWatchFace.kt b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BaseWatchFace.kt index a25d320dd4..07fbc4d63d 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/BaseWatchFace.kt +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/BaseWatchFace.kt @@ -13,11 +13,11 @@ import android.os.Vibrator import android.support.wearable.watchface.WatchFaceStyle import android.view.LayoutInflater import android.view.View +import android.view.ViewGroup import android.view.WindowInsets import android.view.WindowManager import android.widget.ImageView import android.widget.LinearLayout -import android.widget.RelativeLayout import android.widget.TextView import androidx.annotation.LayoutRes import androidx.core.content.ContextCompat @@ -100,14 +100,14 @@ abstract class BaseWatchFace : WatchFace() { var mDay: TextView? = null var mDayName: TextView? = null var mMonth: TextView? = null - var isAAPSv2: TextView? = null + var isAAPSv2: View? = null var mHighLight: TextView? = null var mLowLight: TextView? = null var mGlucoseDial: ImageView? = null var mDeltaGauge: ImageView? = null var mHourHand: ImageView? = null var mMinuteHand: ImageView? = null - var mRelativeLayout: RelativeLayout? = null + var mRelativeLayout: ViewGroup? = null var mLinearLayout: LinearLayout? = null var mLinearLayout2: LinearLayout? = null var mDate: LinearLayout? = null @@ -594,4 +594,4 @@ abstract class BaseWatchFace : WatchFace() { val BOLD_TYPEFACE: Typeface = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD) const val SCREEN_SIZE_SMALL = 280 } -} \ No newline at end of file +} diff --git a/wear/src/main/res/layout-notround/activity_bigchart.xml b/wear/src/main/res/layout-notround/activity_bigchart.xml index d610c6f38b..8c3a136e6a 100644 --- a/wear/src/main/res/layout-notround/activity_bigchart.xml +++ b/wear/src/main/res/layout-notround/activity_bigchart.xml @@ -1,108 +1,111 @@ - + android:gravity="center_horizontal" + android:orientation="vertical" + android:textAlignment="center" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - - - - - - - - - - - - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="-5dp" + android:gravity="center_horizontal" + android:orientation="horizontal" + android:paddingTop="5dp" + android:textAlignment="center"> - - + android:layout_gravity="bottom" + android:layout_marginEnd="5dp" + android:gravity="center_horizontal|bottom" + android:text="---" + android:textColor="@color/white" + android:textSize="30sp" + tools:ignore="HardcodedText" /> - + - - + - + + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-notround/activity_bigchart_small.xml b/wear/src/main/res/layout-notround/activity_bigchart_small.xml index 3a271e9ea0..9462a35612 100644 --- a/wear/src/main/res/layout-notround/activity_bigchart_small.xml +++ b/wear/src/main/res/layout-notround/activity_bigchart_small.xml @@ -1,111 +1,114 @@ - + android:gravity="center_horizontal" + android:orientation="vertical" + android:textAlignment="center" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - - - - - - - - - - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="-5dp" + android:gravity="center_horizontal" + android:orientation="horizontal" + android:paddingTop="5dp" + android:textAlignment="center"> + + + android:gravity="center_horizontal" + android:text="---" + android:textColor="@color/white" + android:textSize="34sp" + tools:ignore="HardcodedText" /> - - - - - - - - + android:layout_gravity="center_vertical|center_horizontal|center" + android:layout_marginStart="5dp" + android:gravity="center_horizontal|bottom" + android:text="---" + android:textColor="@color/white" + android:textSize="24sp" + tools:ignore="HardcodedText" /> - + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-notround/activity_cockpit.xml b/wear/src/main/res/layout-notround/activity_cockpit.xml index 75290deb00..750cb2a80e 100644 --- a/wear/src/main/res/layout-notround/activity_cockpit.xml +++ b/wear/src/main/res/layout-notround/activity_cockpit.xml @@ -1,9 +1,13 @@ + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/airplane_cockpit_outside_clouds" + tools:context=".watchfaces.CockpitWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - - - + android:layout_weight="0.095" /> + android:layout_weight="0.2575" + android:orientation="horizontal"> + + + android:layout_weight="0.06" + android:baselineAligned="false" + android:orientation="vertical"> + + + android:id="@+id/highLight" + android:layout_width="fill_parent" + android:layout_height="0px" + android:layout_gravity="center" + android:layout_weight="1" + android:background="@drawable/airplane_led_grey_unlit" + android:gravity="center" + android:text="@string/first_char_high" + android:textAlignment="center" + android:textColor="@color/primary_text_dark" + android:textSize="8sp" + android:textStyle="bold" + tools:ignore="SmallSp" /> - - - - - - - - - - - - - + + android:id="@+id/lowLight" + android:layout_width="fill_parent" + android:layout_height="0px" + android:layout_gravity="center" + android:layout_weight="1" + android:background="@drawable/airplane_led_grey_unlit" + android:gravity="center" + android:text="@string/first_char_low" + android:textAlignment="center" + android:textColor="@color/primary_text_dark" + android:textSize="8sp" + android:textStyle="bold" + tools:ignore="SmallSp" /> + + + + + android:layout_weight="0.0775" + android:orientation="vertical"> @@ -120,369 +111,335 @@ android:layout_width="match_parent" android:layout_height="0px" android:layout_weight="0.57" - android:orientation="vertical"> + android:orientation="horizontal"> + + + android:layout_weight="0.275" + android:orientation="vertical"> + + + android:layout_width="match_parent" + android:layout_height="0px" + android:layout_weight="0.5" + android:orientation="vertical" + android:weightSum="1"> + + + + + android:weightSum="1"> - + android:layout_weight="0.35" + tools:ignore="NestedWeights" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:layout_gravity="center" + android:layout_weight="0.65" + android:gravity="center" + android:text="--'" + android:textAlignment="center" + android:textColor="@color/primary_text_dark" + android:textSize="14sp" + android:textStyle="bold" + tools:ignore="HardcodedText" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-notround/activity_digitalstyle.xml b/wear/src/main/res/layout-notround/activity_digitalstyle.xml index 87352b783a..d07e0bc616 100644 --- a/wear/src/main/res/layout-notround/activity_digitalstyle.xml +++ b/wear/src/main/res/layout-notround/activity_digitalstyle.xml @@ -1,12 +1,12 @@ - + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> + android:orientation="horizontal" + tools:ignore="HardcodedText" /> @@ -34,10 +36,11 @@ android:orientation="vertical" android:weightSum="100"> - + android:layout_weight="13.95" + tools:ignore="NestedWeights" /> - @@ -69,7 +72,8 @@ android:gravity="bottom|center_horizontal" android:text="@string/activity_carb" android:textColor="@color/light_grey" - android:textSize="10sp" /> + android:textSize="10sp" + tools:ignore="SmallSp, NestedWeights" /> + - - @@ -105,7 +110,7 @@ android:orientation="horizontal" android:weightSum="13"> - @@ -120,6 +125,7 @@ + android:weightSum="10" + tools:ignore="NestedWeights"> - @@ -146,7 +153,8 @@ android:textAlignment="center" android:textColor="@color/white" android:textSize="16sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:ignore="HardcodedText" /> + android:textSize="10sp" + tools:ignore="HardcodedText,SmallSp" /> - + @@ -186,21 +196,23 @@ android:gravity="top|center_horizontal" android:letterSpacing="-0.05" android:lines="1" - android:text="00,0" + android:text="@string/svg_00_0" android:textColor="@color/white" android:textSize="20sp" android:textStyle="bold" /> + + - - @@ -213,7 +225,7 @@ android:orientation="horizontal" android:weightSum="13"> - @@ -235,7 +247,8 @@ android:gravity="bottom|center_horizontal" android:text="@string/activity_IOB" android:textColor="@color/light_grey" - android:textSize="10sp" /> + android:textSize="10sp" + tools:ignore="SmallSp, NestedWeights" /> + - - + @@ -278,12 +293,14 @@ + android:orientation="vertical" + tools:ignore="NestedWeights"> - @@ -311,11 +328,11 @@ android:layout_height="match_parent" android:layout_weight="5" android:fontFamily="@font/roboto_condensed_regular" - android:text="DDD" android:textAllCaps="true" android:textColor="@color/white" android:textFontWeight="400" - android:textSize="18sp" /> + android:textSize="18sp" + tools:text="DDD" /> + android:visibility="gone" + tools:text="ww" /> - + @@ -354,10 +372,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="@font/roboto_condensed_regular" + android:paddingStart="0dp" android:paddingEnd="4dp" - android:text="DD" android:textColor="@color/light_grey" - android:textSize="18sp" /> + android:textSize="18sp" + tools:text="DD" /> + + android:textSize="18sp" + tools:text="MMM" /> + + + @@ -383,7 +406,8 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="4" - android:gravity="left|center_vertical" + android:baselineAligned="false" + android:gravity="start|center_vertical" android:orientation="horizontal"> + android:textStyle="bold" + tools:text="HH" /> + @@ -416,29 +441,33 @@ android:id="@+id/minute" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="left" - android:layout_marginLeft="6sp" + android:layout_gravity="start" + android:layout_marginStart="6sp" android:layout_marginBottom="-8sp" android:fontFamily="@font/roboto_condensed_bold" - android:text="MI" android:textColor="@color/light_grey" android:textSize="26sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:text="MI" /> - + + android:textStyle="bold" + tools:ignore="SmallSp" + tools:text="AM" /> + + + @@ -449,7 +478,7 @@ android:layout_marginRight="7dp" android:layout_weight="1" android:baselineAligned="false" - android:gravity="left|top" + android:gravity="start|top" android:orientation="vertical" android:weightSum="10"> @@ -472,7 +501,8 @@ android:text="+/-" android:textColor="@color/light_grey" android:textSize="10sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:ignore="HardcodedText, SmallSp, NestedWeights" /> + android:textStyle="bold" + tools:ignore="SmallSp" /> + android:textStyle="bold" + tools:ignore="HardcodedText,SmallSp" /> + android:visibility="gone" + tools:ignore="HardcodedText,SmallSp" /> + android:textStyle="bold" + tools:ignore="SmallSp" /> + android:visibility="gone" + tools:ignore="SmallSp" + tools:text="bgi" /> + @@ -547,26 +583,28 @@ android:layout_height="0dp" android:layout_gravity="bottom" android:layout_weight="1" - android:gravity="center_horizontal|top" /> + android:gravity="center_horizontal|top" + tools:ignore="NestedWeights" /> - + + + - diff --git a/wear/src/main/res/layout-notround/activity_home.xml b/wear/src/main/res/layout-notround/activity_home.xml index dd700fcf5c..b20301ae4a 100644 --- a/wear/src/main/res/layout-notround/activity_home.xml +++ b/wear/src/main/res/layout-notround/activity_home.xml @@ -1,156 +1,158 @@ - + android:gravity="center_horizontal" + android:orientation="vertical" + android:textAlignment="center" + android:weightSum="1" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - + + + android:baselineAligned="false" + android:gravity="center_horizontal" + android:orientation="vertical" + android:textAlignment="center" + android:weightSum="1"> + + - - - - - - - - + android:gravity="center_horizontal|bottom" + android:text="@string/delta_na" + android:textColor="@color/white" + android:textSize="10sp" + android:textStyle="bold" + tools:ignore="SmallSp" /> - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-notround/activity_home_2.xml b/wear/src/main/res/layout-notround/activity_home_2.xml index 60ae6c3cf6..faaaca080e 100644 --- a/wear/src/main/res/layout-notround/activity_home_2.xml +++ b/wear/src/main/res/layout-notround/activity_home_2.xml @@ -1,372 +1,351 @@ - + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> + android:id="@+id/primary_layout" + android:layout_width="fill_parent" + android:layout_height="0px" + android:layout_gravity="center_horizontal" + android:layout_weight="0.27" + android:gravity="center_horizontal" + android:orientation="horizontal" + android:textAlignment="center"> + + + + + android:orientation="vertical"> - - + android:gravity="center_horizontal|bottom" + android:text="--" + android:textAlignment="center" + android:textColor="@color/white" + android:textSize="22sp" + android:textStyle="bold" + tools:ignore="HardcodedText" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:text="--'" + android:textColor="@color/white" + android:textSize="14sp" + android:textStyle="bold" + tools:ignore="HardcodedText" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-notround/activity_home_large.xml b/wear/src/main/res/layout-notround/activity_home_large.xml index a3ffe072f3..9595976def 100644 --- a/wear/src/main/res/layout-notround/activity_home_large.xml +++ b/wear/src/main/res/layout-notround/activity_home_large.xml @@ -1,138 +1,136 @@ - + android:orientation="vertical" + android:textAlignment="center" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:layout_width="147dp" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:orientation="horizontal" + android:paddingTop="15dp" + android:textAlignment="center" + android:weightSum="1"> + + + android:weightSum="1"> + + + + + + - + + + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-notround/activity_nochart.xml b/wear/src/main/res/layout-notround/activity_nochart.xml index 41f44e4404..6f4da2c1b5 100644 --- a/wear/src/main/res/layout-notround/activity_nochart.xml +++ b/wear/src/main/res/layout-notround/activity_nochart.xml @@ -1,100 +1,103 @@ - + android:gravity="center_horizontal" + android:orientation="vertical" + android:textAlignment="center" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - - - - - - - - - - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="-5dp" + android:gravity="center_horizontal" + android:orientation="horizontal" + android:paddingTop="5dp" + android:textAlignment="center"> - - + android:layout_gravity="bottom" + android:layout_marginEnd="5dp" + android:gravity="center_horizontal|bottom" + android:text="---" + android:textColor="@color/white" + android:textSize="40sp" + tools:ignore="HardcodedText" /> - + - - + - + + + + + + + + + + + diff --git a/wear/src/main/res/layout-notround/activity_nochart_small.xml b/wear/src/main/res/layout-notround/activity_nochart_small.xml index c8f82fad03..a02a672216 100644 --- a/wear/src/main/res/layout-notround/activity_nochart_small.xml +++ b/wear/src/main/res/layout-notround/activity_nochart_small.xml @@ -1,116 +1,112 @@ - + android:gravity="center_vertical|center_horizontal" + android:orientation="vertical" + android:textAlignment="center" + tools:context=".watchfaces.NoChartWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - + + - - - - - - - - - - + android:text="---" + android:textColor="@color/white" + android:textSize="45sp" + tools:ignore="HardcodedText" /> - - - - - - - - - + android:layout_height="match_parent" + android:layout_gravity="center_horizontal" + android:layout_marginStart="5dp" + android:gravity="center_vertical|center_horizontal|center" + android:text=" ---" + android:textColor="@color/white" + android:textSize="26sp" + tools:ignore="HardcodedText" /> - \ No newline at end of file + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-notround/activity_steampunk.xml b/wear/src/main/res/layout-notround/activity_steampunk.xml index e56d515d1b..fc414e9c39 100644 --- a/wear/src/main/res/layout-notround/activity_steampunk.xml +++ b/wear/src/main/res/layout-notround/activity_steampunk.xml @@ -5,7 +5,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".watchfaces.SteampunkWatchface" - tools:deviceIds="wear_square"> + tools:deviceIds="wear_round" + tools:ignore="MissingDefaultResource"> @@ -57,13 +59,11 @@ android:orientation="vertical" android:weightSum="1"> - + tools:ignore="NestedWeights" /> @@ -108,7 +108,7 @@ @@ -130,7 +130,7 @@ @@ -170,11 +170,11 @@ android:orientation="horizontal" android:weightSum="1"> - + tools:ignore="NestedWeights" /> - - + android:layout_weight="0.03" /> @@ -207,26 +206,26 @@ android:orientation="vertical" android:weightSum="1"> - + android:layout_weight="0.15" /> - + tools:ignore="NestedWeights" /> + android:textSize="12sp" + android:textStyle="bold" + tools:ignore="HardcodedText" /> @@ -268,9 +269,10 @@ android:text="--%" android:textAlignment="center" android:textColor="@color/black_86p" - android:textSize="10sp" + android:textSize="12sp" android:textStyle="bold" - android:visibility="gone" /> + android:visibility="gone" + tools:ignore="HardcodedText" /> + android:textSize="12sp" + android:textStyle="bold" + tools:ignore="HardcodedText" /> @@ -300,28 +303,28 @@ android:gravity="center" android:paddingStart="10dp" android:paddingTop="8dp" + android:paddingEnd="0dp" android:rotation="24" android:text="-'" android:textAlignment="center" android:textColor="@color/black_86p" - android:textSize="10sp" - android:textStyle="bold" /> + android:textSize="12sp" + android:textStyle="bold" + tools:ignore="HardcodedText" /> - + android:layout_weight="0.32" /> - + android:layout_weight="0.64" /> @@ -330,8 +333,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/steampunk_cover_plate" - android:orientation="vertical"> - + android:orientation="vertical" /> - + android:visibility="gone" /> diff --git a/wear/src/main/res/layout-round/activity_bigchart.xml b/wear/src/main/res/layout-round/activity_bigchart.xml index d610c6f38b..58c7a609a7 100644 --- a/wear/src/main/res/layout-round/activity_bigchart.xml +++ b/wear/src/main/res/layout-round/activity_bigchart.xml @@ -1,108 +1,107 @@ - + android:orientation="vertical" + android:textAlignment="center" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - - - - - - - - - - - - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="-2dp" + android:gravity="center_horizontal" + android:orientation="horizontal" + android:paddingTop="5dp" + android:textAlignment="center"> - - + android:layout_gravity="bottom" + android:layout_marginEnd="5dp" + android:gravity="center_horizontal|bottom" + android:text="---" + android:textColor="@color/white" + android:textSize="30sp" + tools:ignore="HardcodedText" /> - + - - + - + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-round/activity_bigchart_small.xml b/wear/src/main/res/layout-round/activity_bigchart_small.xml index 3a271e9ea0..c705f913dd 100644 --- a/wear/src/main/res/layout-round/activity_bigchart_small.xml +++ b/wear/src/main/res/layout-round/activity_bigchart_small.xml @@ -1,111 +1,113 @@ - + android:orientation="vertical" + android:textAlignment="center" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - - - - - - - - - - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="-5dp" + android:gravity="center_horizontal" + android:orientation="horizontal" + android:paddingTop="5dp" + android:textAlignment="center"> + + + android:gravity="center_horizontal" + android:text="---" + android:textColor="@color/white" + android:textSize="34sp" + tools:ignore="HardcodedText" /> - - - - - - - - + android:layout_gravity="center_vertical|center_horizontal|center" + android:layout_marginStart="5dp" + android:gravity="center_horizontal|bottom" + android:text="---" + android:textColor="@color/white" + android:textSize="24sp" + tools:ignore="HardcodedText" /> - + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-round/activity_cockpit.xml b/wear/src/main/res/layout-round/activity_cockpit.xml index 8486b4d211..4f967c714f 100644 --- a/wear/src/main/res/layout-round/activity_cockpit.xml +++ b/wear/src/main/res/layout-round/activity_cockpit.xml @@ -1,9 +1,13 @@ + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/airplane_cockpit_outside_clouds" + tools:context=".watchfaces.CockpitWatchface" + tools:deviceIds="wear_round" + tools:ignore="MissingDefaultResource"> - - - + android:layout_weight="0.095" /> + android:layout_weight="0.2575" + android:orientation="horizontal"> + + + android:layout_weight="0.06" + android:baselineAligned="false" + android:orientation="vertical"> + + + android:id="@+id/highLight" + android:layout_width="fill_parent" + android:layout_height="0px" + android:layout_gravity="center" + android:layout_weight="1" + android:background="@drawable/airplane_led_grey_unlit" + android:gravity="center" + android:text="@string/first_char_high" + android:textAlignment="center" + android:textColor="@color/primary_text_dark" + android:textSize="8sp" + android:textStyle="bold" + tools:ignore="SmallSp" /> - - - - - - - - - - - - - + + android:id="@+id/lowLight" + android:layout_width="fill_parent" + android:layout_height="0px" + android:layout_gravity="center" + android:layout_weight="1" + android:background="@drawable/airplane_led_grey_unlit" + android:gravity="center" + android:text="@string/first_char_low" + android:textAlignment="center" + android:textColor="@color/primary_text_dark" + android:textSize="8sp" + android:textStyle="bold" + tools:ignore="SmallSp" /> + + + + + android:layout_weight="0.0775" + android:orientation="vertical"> @@ -120,369 +111,334 @@ android:layout_width="match_parent" android:layout_height="0px" android:layout_weight="0.57" - android:orientation="vertical"> + android:orientation="horizontal"> + + + android:layout_weight="0.275" + android:orientation="vertical"> + + + android:layout_width="match_parent" + android:layout_height="0px" + android:layout_weight="0.5" + android:orientation="vertical" + android:weightSum="1"> + + + + + android:weightSum="1"> - + android:layout_weight="0.35" + tools:ignore="NestedWeights" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:layout_gravity="center" + android:layout_weight="0.65" + android:gravity="center" + android:text="--'" + android:textAlignment="center" + android:textColor="@color/primary_text_dark" + android:textSize="14sp" + android:textStyle="bold" + tools:ignore="HardcodedText" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-round/activity_digitalstyle.xml b/wear/src/main/res/layout-round/activity_digitalstyle.xml index bc21b8d326..feeedc2455 100644 --- a/wear/src/main/res/layout-round/activity_digitalstyle.xml +++ b/wear/src/main/res/layout-round/activity_digitalstyle.xml @@ -1,12 +1,12 @@ - + tools:deviceIds="wear_round" + tools:ignore="MissingDefaultResource"> + android:orientation="horizontal" + tools:ignore="HardcodedText" /> @@ -34,7 +36,7 @@ android:orientation="vertical" android:weightSum="100"> - @@ -47,7 +49,7 @@ android:orientation="horizontal" android:weightSum="13"> - @@ -69,7 +71,8 @@ android:gravity="bottom|center_horizontal" android:text="@string/activity_carb" android:textColor="@color/light_grey" - android:textSize="10sp" /> + android:textSize="10sp" + tools:ignore="SmallSp" /> + - - @@ -105,7 +109,7 @@ android:orientation="horizontal" android:weightSum="13"> - @@ -130,7 +134,7 @@ android:orientation="horizontal" android:weightSum="10"> - @@ -147,7 +151,8 @@ android:textAlignment="center" android:textColor="@color/white" android:textSize="16sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:ignore="HardcodedText" /> + android:textSize="10sp" + tools:ignore="HardcodedText,SmallSp" /> - + @@ -187,21 +194,23 @@ android:gravity="top|center_horizontal" android:letterSpacing="-0.05" android:lines="1" - android:text="00,0" + android:text="@string/svg_00_0" android:textColor="@color/white" android:textSize="20sp" android:textStyle="bold" /> + + - - @@ -214,7 +223,7 @@ android:orientation="horizontal" android:weightSum="13"> - @@ -236,7 +245,8 @@ android:gravity="bottom|center_horizontal" android:text="@string/activity_IOB" android:textColor="@color/light_grey" - android:textSize="10sp" /> + android:textSize="10sp" + tools:ignore="SmallSp" /> + - - + @@ -279,12 +291,13 @@ - @@ -312,11 +325,11 @@ android:layout_height="match_parent" android:layout_weight="5" android:fontFamily="@font/roboto_condensed_regular" - android:text="DDD" android:textAllCaps="true" android:textColor="@color/white" android:textFontWeight="400" - android:textSize="18sp" /> + android:textSize="18sp" + tools:text="DDD" /> + android:visibility="gone" + tools:text="ww" /> - + @@ -355,10 +369,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="@font/roboto_condensed_regular" + android:paddingStart="0dp" android:paddingEnd="4dp" - android:text="DD" android:textColor="@color/light_grey" - android:textSize="18sp" /> + android:textSize="18sp" + tools:text="DD" /> + + android:textSize="18sp" + tools:text="MMM" /> + + + @@ -384,29 +403,32 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="4" - android:gravity="left|center_vertical" + android:baselineAligned="false" + android:gravity="start|center_vertical" android:orientation="horizontal"> + + android:textStyle="bold" + tools:text="HH" /> + @@ -416,29 +438,33 @@ android:id="@+id/minute" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="left" - android:layout_marginLeft="6sp" + android:layout_gravity="start" + android:layout_marginStart="6sp" android:layout_marginBottom="-8sp" android:fontFamily="@font/roboto_condensed_bold" - android:text="MI" android:textColor="@color/light_grey" android:textSize="26sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:text="MI" /> + android:textStyle="bold" + tools:ignore="SmallSp" + tools:text="AM" /> + + + @@ -449,7 +475,7 @@ android:layout_marginRight="7dp" android:layout_weight="1" android:baselineAligned="false" - android:gravity="left|top" + android:gravity="start|top" android:orientation="vertical" android:weightSum="10"> @@ -472,7 +498,8 @@ android:text="+/-" android:textColor="@color/light_grey" android:textSize="10sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:ignore="HardcodedText,SmallSp" /> + android:textStyle="bold" + tools:ignore="SmallSp" /> + android:textStyle="bold" + tools:ignore="HardcodedText,SmallSp" /> + android:visibility="gone" + tools:ignore="HardcodedText,SmallSp" /> + android:textStyle="bold" + tools:ignore="SmallSp" /> + android:visibility="gone" + tools:ignore="SmallSp" + tools:text="bgi" /> + @@ -552,22 +585,22 @@ - + + - diff --git a/wear/src/main/res/layout-round/activity_home.xml b/wear/src/main/res/layout-round/activity_home.xml index 008ed7d129..e886eada50 100644 --- a/wear/src/main/res/layout-round/activity_home.xml +++ b/wear/src/main/res/layout-round/activity_home.xml @@ -1,155 +1,164 @@ - + android:orientation="vertical" + android:textAlignment="center" + android:weightSum="1" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_round" + tools:ignore="MissingDefaultResource"> - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:layout_gravity="center_horizontal|bottom" + android:layout_marginBottom="-2dp" + android:gravity="bottom|end" + android:paddingStart="0dp" + android:paddingTop="-2dp" + android:paddingEnd="5dp" + android:text="---" + android:textColor="@color/white" + android:textSize="41sp" + tools:ignore="HardcodedText" /> - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-round/activity_home_2.xml b/wear/src/main/res/layout-round/activity_home_2.xml index 64e6a411f0..2a16cfb66a 100644 --- a/wear/src/main/res/layout-round/activity_home_2.xml +++ b/wear/src/main/res/layout-round/activity_home_2.xml @@ -1,385 +1,367 @@ - + tools:deviceIds="wear_round" + tools:ignore="MissingDefaultResource"> + + + android:id="@+id/primary_layout" + android:layout_width="fill_parent" + android:layout_height="0px" + android:layout_gravity="center_horizontal" + android:layout_weight="0.27" + android:gravity="center_horizontal" + android:orientation="horizontal" + android:textAlignment="center"> + + + + - - + android:baselineAligned="false" + android:gravity="center_vertical" + android:orientation="vertical" + android:paddingStart="0dp" + android:paddingEnd="4dp"> - - + android:gravity="center_horizontal|bottom" + android:text="--" + android:textAlignment="center" + android:textColor="@color/white" + android:textSize="22sp" + android:textStyle="bold" + tools:ignore="HardcodedText" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:text="--'" + android:textColor="@color/white" + android:textSize="14sp" + android:textStyle="bold" + tools:ignore="HardcodedText" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-round/activity_home_large.xml b/wear/src/main/res/layout-round/activity_home_large.xml index 40f26dc17c..35bb86cdf1 100644 --- a/wear/src/main/res/layout-round/activity_home_large.xml +++ b/wear/src/main/res/layout-round/activity_home_large.xml @@ -1,138 +1,138 @@ - + android:orientation="vertical" + android:textAlignment="center" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_round" + tools:ignore="MissingDefaultResource"> - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + android:weightSum="1"> + + + + + + - + + + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-round/activity_nochart.xml b/wear/src/main/res/layout-round/activity_nochart.xml index 41f44e4404..0ae2e794e0 100644 --- a/wear/src/main/res/layout-round/activity_nochart.xml +++ b/wear/src/main/res/layout-round/activity_nochart.xml @@ -1,100 +1,101 @@ - + android:gravity="center_vertical|center_horizontal" + android:orientation="vertical" + android:textAlignment="center" + tools:context=".watchfaces.NoChartWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - - - - - - - - - - + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="-15dp" + android:gravity="center_horizontal" + android:orientation="horizontal" + android:textAlignment="center"> - - + android:layout_gravity="bottom" + android:layout_marginEnd="5dp" + android:gravity="center_horizontal|bottom" + android:text="---" + android:textColor="@color/white" + android:textSize="40sp" + tools:ignore="HardcodedText" /> - + - - + - + + + + + + + + + + diff --git a/wear/src/main/res/layout-round/activity_nochart_small.xml b/wear/src/main/res/layout-round/activity_nochart_small.xml index c8f82fad03..070d9baf38 100644 --- a/wear/src/main/res/layout-round/activity_nochart_small.xml +++ b/wear/src/main/res/layout-round/activity_nochart_small.xml @@ -1,116 +1,114 @@ - + android:gravity="center_vertical|center_horizontal" + android:orientation="vertical" + tools:context=".watchfaces.AapsWatchface" + tools:deviceIds="wear_square" + tools:ignore="MissingDefaultResource"> - + + - - - - - - - - - - + android:text="---" + android:textColor="@color/white" + android:textSize="42sp" + tools:ignore="HardcodedText" /> - - - - - - - - - + android:layout_height="match_parent" + android:layout_gravity="center_horizontal" + android:layout_marginStart="5dp" + android:layout_marginBottom="-15dp" + android:gravity="center_vertical|center_horizontal|center" + android:text=" ---" + android:textColor="@color/white" + android:textSize="22sp" + tools:ignore="HardcodedText" /> - \ No newline at end of file + + + + + + + + + + + + + diff --git a/wear/src/main/res/layout-round/activity_steampunk.xml b/wear/src/main/res/layout-round/activity_steampunk.xml index 78f9c52383..fc414e9c39 100644 --- a/wear/src/main/res/layout-round/activity_steampunk.xml +++ b/wear/src/main/res/layout-round/activity_steampunk.xml @@ -5,7 +5,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".watchfaces.SteampunkWatchface" - tools:deviceIds="wear_round"> + tools:deviceIds="wear_round" + tools:ignore="MissingDefaultResource"> @@ -57,13 +59,11 @@ android:orientation="vertical" android:weightSum="1"> - + tools:ignore="NestedWeights" /> - + tools:ignore="NestedWeights" /> - - + android:layout_weight="0.03" /> @@ -207,26 +206,26 @@ android:orientation="vertical" android:weightSum="1"> - + android:layout_weight="0.15" /> - + tools:ignore="NestedWeights" /> + android:textStyle="bold" + tools:ignore="HardcodedText" /> @@ -270,7 +271,8 @@ android:textColor="@color/black_86p" android:textSize="12sp" android:textStyle="bold" - android:visibility="gone" /> + android:visibility="gone" + tools:ignore="HardcodedText" /> + android:textStyle="bold" + tools:ignore="HardcodedText" /> @@ -300,28 +303,28 @@ android:gravity="center" android:paddingStart="10dp" android:paddingTop="8dp" + android:paddingEnd="0dp" android:rotation="24" android:text="-'" android:textAlignment="center" android:textColor="@color/black_86p" android:textSize="12sp" - android:textStyle="bold" /> + android:textStyle="bold" + tools:ignore="HardcodedText" /> - + android:layout_weight="0.32" /> - + android:layout_weight="0.64" /> @@ -330,8 +333,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/steampunk_cover_plate" - android:orientation="vertical"> - + android:orientation="vertical" /> - + android:visibility="gone" /> diff --git a/wear/src/main/res/layout-v26/list_item.xml b/wear/src/main/res/layout-v26/list_item.xml index 7e5efb671f..2616da7efb 100644 --- a/wear/src/main/res/layout-v26/list_item.xml +++ b/wear/src/main/res/layout-v26/list_item.xml @@ -12,9 +12,9 @@ android:layout_width="35dp" android:layout_height="35dp" android:layout_alignParentStart="true" - android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginStart="10dp" + android:importantForAccessibility="no" android:src="@drawable/circle" /> + android:textStyle="bold" + tools:text="action item" /> diff --git a/wear/src/main/res/layout/action_confirm_ok.xml b/wear/src/main/res/layout/action_confirm_ok.xml index fd0d4c89b9..097dc75adb 100644 --- a/wear/src/main/res/layout/action_confirm_ok.xml +++ b/wear/src/main/res/layout/action_confirm_ok.xml @@ -1,26 +1,22 @@ - + - + android:layout_margin="10sp" + android:background="@drawable/circle" + android:backgroundTint="@color/white" + android:contentDescription="@string/action_confirm" + android:padding="25sp" + android:src="@drawable/ic_confirm" + app:tint="@color/white" /> - - - - + diff --git a/wear/src/main/res/layout/action_confirm_text.xml b/wear/src/main/res/layout/action_confirm_text.xml index 031d98d1e2..9fde2356c6 100644 --- a/wear/src/main/res/layout/action_confirm_text.xml +++ b/wear/src/main/res/layout/action_confirm_text.xml @@ -1,5 +1,6 @@ @@ -11,18 +12,21 @@ + android:layout_height="match_parent" + android:focusable="true" + android:focusableInTouchMode="true"> + + android:textColor="@color/white" + tools:text="message" /> + - \ No newline at end of file + + diff --git a/wear/src/main/res/layout/action_editplusminus_item.xml b/wear/src/main/res/layout/action_editplusminus_item.xml index be5b622dbe..c3cbe263ba 100644 --- a/wear/src/main/res/layout/action_editplusminus_item.xml +++ b/wear/src/main/res/layout/action_editplusminus_item.xml @@ -1,66 +1,68 @@ - + + + + android:orientation="vertical"> - + android:cursorVisible="false" + android:gravity="center_horizontal" + android:inputType="numberDecimal" + android:minWidth="50dp" + android:padding="10dp" + android:textColor="@color/white" + android:textSize="45sp" + tools:text="112" /> - - - - - - - + android:gravity="center" + android:labelFor="@+id/amountfield" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="@color/white" + android:textSize="25sp" + tools:ignore="LabelFor" + tools:text="label" /> - + + + + diff --git a/wear/src/main/res/layout/action_editplusminus_item_quicklefty.xml b/wear/src/main/res/layout/action_editplusminus_item_quicklefty.xml index 980677522c..bf3418ca2c 100644 --- a/wear/src/main/res/layout/action_editplusminus_item_quicklefty.xml +++ b/wear/src/main/res/layout/action_editplusminus_item_quicklefty.xml @@ -1,69 +1,68 @@ - + + + + android:gravity="center" + android:orientation="vertical"> + + + + - - - - - - - - - - + android:backgroundTint="@color/white" + android:contentDescription="@string/decrement" + android:src="@drawable/ic_action_minus" + android:tint="@color/white" /> - + diff --git a/wear/src/main/res/layout/action_editplusminus_item_quickrighty.xml b/wear/src/main/res/layout/action_editplusminus_item_quickrighty.xml index a1b2107768..78c5d7e817 100644 --- a/wear/src/main/res/layout/action_editplusminus_item_quickrighty.xml +++ b/wear/src/main/res/layout/action_editplusminus_item_quickrighty.xml @@ -1,69 +1,68 @@ - + + android:gravity="center" + android:orientation="vertical"> - + android:cursorVisible="false" + android:gravity="center_horizontal" + android:inputType="numberDecimal" + android:minWidth="100dp" + android:paddingTop="10dp" + android:textColor="@color/white" + android:textSize="45sp" + tools:text="112" /> - - - - - - - + + android:backgroundTint="@color/white" + android:contentDescription="@string/decrement" + android:src="@drawable/ic_action_minus" + android:tint="@color/white" /> - + + + diff --git a/wear/src/main/res/layout/action_editplusminus_item_viktoria.xml b/wear/src/main/res/layout/action_editplusminus_item_viktoria.xml index 357fa7c4f2..0b396d8b7f 100644 --- a/wear/src/main/res/layout/action_editplusminus_item_viktoria.xml +++ b/wear/src/main/res/layout/action_editplusminus_item_viktoria.xml @@ -1,71 +1,67 @@ - + android:orientation="horizontal"> + + - + + + android:layout_gravity="center_vertical|center_horizontal" + android:background="@android:color/transparent" + android:cursorVisible="false" + android:gravity="center_vertical|center_horizontal" + android:inputType="numberDecimal" + android:minWidth="50dp" + android:padding="10dp" + android:textColor="@color/white" + android:textSize="45sp" + tools:text="112" /> - + - - - - - - - - - - + + + + diff --git a/wear/src/main/res/layout/actions_list_activity.xml b/wear/src/main/res/layout/actions_list_activity.xml index 45037c8337..4acdee7c25 100644 --- a/wear/src/main/res/layout/actions_list_activity.xml +++ b/wear/src/main/res/layout/actions_list_activity.xml @@ -1,9 +1,9 @@ - + android:textSize="18sp" + tools:text="Title" /> + + android:visibility="gone" + tools:text="Title" /> diff --git a/wear/src/main/res/layout/activity_circle.xml b/wear/src/main/res/layout/activity_circle.xml index 9837a8a2aa..57a9c6325a 100644 --- a/wear/src/main/res/layout/activity_circle.xml +++ b/wear/src/main/res/layout/activity_circle.xml @@ -1,53 +1,46 @@ - - + - - - + + + tools:text="999" /> - + - + - - - + diff --git a/wear/src/main/res/layout/grid_layout.xml b/wear/src/main/res/layout/grid_layout.xml index 26f1e92a6a..51091b08c4 100644 --- a/wear/src/main/res/layout/grid_layout.xml +++ b/wear/src/main/res/layout/grid_layout.xml @@ -1,16 +1,17 @@ + android:layout_height="match_parent"> + android:visibility="gone" + tools:text="Title" /> + android:textSize="18sp" + tools:text="Title" /> + app:dotFadeOutDelay="100000" /> diff --git a/wear/src/main/res/layout/list_item.xml b/wear/src/main/res/layout/list_item.xml index c5fd3b2433..2c5fbb2653 100644 --- a/wear/src/main/res/layout/list_item.xml +++ b/wear/src/main/res/layout/list_item.xml @@ -11,10 +11,9 @@ android:id="@+id/menuItemIcon" android:layout_width="35dp" android:layout_height="35dp" - android:layout_alignParentStart="true" - android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:layout_marginStart="10dp" + android:importantForAccessibility="no" android:src="@drawable/circle" /> + android:textStyle="bold" + tools:text="action item" /> diff --git a/wear/src/main/res/values-es-rES/strings.xml b/wear/src/main/res/values-es-rES/strings.xml index bbd8afaa5b..680c610a92 100644 --- a/wear/src/main/res/values-es-rES/strings.xml +++ b/wear/src/main/res/values-es-rES/strings.xml @@ -168,4 +168,20 @@ No hay configuración disponible Controles Wear desactivados No hay datos disponibles + incremento + decremento + A + B + media + --U + --g + -.--U/h + Subido: ---% + S: sin estado + -- minutos atrás + --- mg/dl + Sin estado del lazo + 000g + 00,0 + 0,00U diff --git a/wear/src/main/res/values-ru-rRU/strings.xml b/wear/src/main/res/values-ru-rRU/strings.xml index cf45f1a812..56bd0c5746 100644 --- a/wear/src/main/res/values-ru-rRU/strings.xml +++ b/wear/src/main/res/values-ru-rRU/strings.xml @@ -2,6 +2,15 @@ AAPS AAPS + AAPS + AAPS (Большой) + AAPS (Крупный график) + AAPS (Без графика) + AAPS (круглый) + AAPS(v2) + AAPS (кабина пилота) + AAPS (Стимпанк) + AAPS (ЦифровойСтиль) AAPS (Действия) AAPS(ВремЦель) AAPS(Мастер) @@ -55,11 +64,13 @@ Действия при нажатии кнопки расширений Юникод в репликации Версия: + Еще настройки циферблатов Смотрите конфигурацию циферблата. ВремЦ Калькулятор Кальк Терапия + Терап Болюс Углеводы растянутые углеводы eCarbs @@ -70,18 +81,38 @@ Не показывать По умолчанию Menu + XL + Длительность + Запрошена временная цель + Запрошен мастер настройки + Запрошена терапия + Запрошен Болюс + Расчет запрошен + Заполнение запрошено + Углеводы запрошены + Запрос на смену профиля + Цель + Низкое значение + Высокое значение + Углеводы растянутые углеводы eCarbs + Процент + Начало [min] + Продолжительность [h] + Инсулин Предустановка 1 Предустановка 2 Предустановка 3 Произвольное количество ПОДТВЕРДИТЬ сдвиг по времени + Болюс Подается болюс нажмите для отмены ОТМЕНИТЬ БОЛЮС Помпа Замкнутый цикл + Смена профиля TDD/общая суточная доза Углеводы IOB @@ -128,4 +159,13 @@ Во время зарядки Режим: всегда вкл Режим: всегда вкл при зарядке + Прием пищи + Гипо + Нагрузка + Вручную + Отмена + Отсутствует + Нет доступной конфигурации + Функция управления Wear выключена + Нет данных diff --git a/wear/src/main/res/values-zh-rCN/strings.xml b/wear/src/main/res/values-zh-rCN/strings.xml index a7b0cdfd1f..0dd214aefa 100644 --- a/wear/src/main/res/values-zh-rCN/strings.xml +++ b/wear/src/main/res/values-zh-rCN/strings.xml @@ -2,6 +2,15 @@ AAPS AAPS + AAPS + AAPS(大) + AAPS(大图) + AAPS(无图) + AAPS(圆形) + AAPS(v2) + AAPS(驾驶) + AAPS(机械) + AAPS(数字风格) AAPS(操作) AAPS(临时目标) AAPS(快速向导) @@ -55,6 +64,7 @@ 折叠Tap操作 折叠中的代码 版本 + 更多手表表盘设置 请查看手表表盘配置。 临时目标 计算器 @@ -80,6 +90,7 @@ 计算请求 Fill 充盈请求 碳水化合物请求 + 请求配置文件切换 目标 @@ -101,6 +112,7 @@ 取消大剂量 胰岛素泵 闭环 + 切换配置文件 日总量 碳水化合物 活性胰岛素 diff --git a/wear/src/main/res/values/strings.xml b/wear/src/main/res/values/strings.xml index 1869913e37..d5331aa883 100644 --- a/wear/src/main/res/values/strings.xml +++ b/wear/src/main/res/values/strings.xml @@ -222,5 +222,21 @@ dark input_design complication_tap_action + increment + decrement + H + L + avg + --U + --g + -.--U/h + Uploader: ---% + S: no status + -- Minutes ago + --- mg/dl + No Loop Status + 000g + 00,0 + 0,00U