Merge pull request #3056 from nightscout/prepare3.2.0.2

3.2.0.2
This commit is contained in:
Milos Kozak 2023-11-12 12:45:15 +01:00 committed by GitHub
commit c31617fd2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
212 changed files with 1476 additions and 1115 deletions

8
.gitignore vendored
View file

@ -3,6 +3,7 @@
/local.properties
.DS_Store
*/jacoco.exec
*/output-metadata.json
/build
/captures
*.apk
@ -19,6 +20,9 @@ app/.classpath
app/.settings/org.eclipse.buildship.core.prefs
wear/.classpath
wear/.settings/org.eclipse.buildship.core.prefs
app/nsclient/*
app/nsclient2/*
app/aapsclient/*
app/aapsclient2/*
app/pumpcontrol/*
wear/aapsclient/*
wear/aapsclient2/*
wear/pumpcontrol/*

View file

@ -190,7 +190,7 @@ class UiInteractionImpl @Inject constructor(
rxBus.send(EventNewNotification(Notification(id, System.currentTimeMillis(), text, level, validTo)))
}
override fun addNotificationWithAction(injector: HasAndroidInjector, nsAlarm: NSAlarm) {
override fun addNotificationWithAction(nsAlarm: NSAlarm) {
rxBus.send(EventNewNotification(NotificationWithAction(injector, nsAlarm)))
}

View file

@ -32,7 +32,7 @@ open class DataReceiver : DaggerBroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
super.onReceive(context, intent)
val bundle = intent.extras ?: return
aapsLogger.debug(LTag.DATABASE, "onReceive ${intent.action} ${BundleLogger.log(bundle)}")
aapsLogger.debug(LTag.CORE, "onReceive ${intent.action} ${BundleLogger.log(bundle)}")
when (intent.action) {
Intents.ACTION_NEW_BG_ESTIMATE ->

View file

@ -17,8 +17,8 @@
<string name="nav_about">Apie</string>
<string name="smscommunicator_missingphonestatepermission">Trūksta telefono būsenos leidimo</string>
<string name="ns_alarm_options">Aliarmų nustatymai</string>
<string name="ns_alarms">Sukurti pranešimus iš NS aliarmų</string>
<string name="ns_announcements">Sukurkite pranešimus iš NS perspėjimų</string>
<string name="ns_alarms">Kurti pranešimus iš NS aliarmų</string>
<string name="ns_announcements">Kurti pranešimus iš NS perspėjimų</string>
<string name="ns_alarm_stale_data_value_label">Seni duomenys, riba [min]</string>
<string name="ns_alarm_urgent_stale_data_value_label">Kritiškai seni duomenys, riba [min]</string>
<string name="sensitivity_warning">Įjungę Autosens funkciją nepamirškite įvedinėti visus valgomus angliavandenius. To nedarant, angliavandenių sukeliami glikemijos svyravimai bus klaidingai identifikuojami kaip jautrumo pasikeitimai!</string>
@ -48,7 +48,7 @@
<string name="clear_filter">Valyti filtrą</string>
<string name="cannula">Kaniulė</string>
<string name="email_address">El. pašto adresas</string>
<string name="remove_bg_readings">Pašalinti KG duomenis</string>
<string name="remove_bg_readings">Pašalinti glikemijos duomenis</string>
<string name="identification_not_set">Kūrėjo režime tapatybė nenustatyta</string>
<string name="a11y_dialog">dialogas</string>
<!-- WEAR OS-->

View file

@ -8,7 +8,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.1.2")
classpath("com.android.tools.build:gradle:8.1.3")
classpath("com.google.gms:google-services:4.4.0")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9")

View file

@ -1,6 +1,6 @@
object KtsBuildVersions {
const val gradle = "8.1.2"
const val gradle = "8.1.3"
const val kotlin = "1.9.0"
}

View file

@ -2,7 +2,7 @@ import org.gradle.api.JavaVersion
object Versions {
const val appVersion = "3.2.0.1"
const val appVersion = "3.2.0.2"
const val versionCode = 1500
const val ndkVersion = "21.1.6352462"
@ -15,4 +15,4 @@ object Versions {
val javaVersion = JavaVersion.VERSION_11
const val jacoco = "0.8.11"
}
}

View file

@ -13,7 +13,7 @@ interface PrefFileListProvider {
fun newExportFile(): File
fun newExportCsvFile(): File
fun newCwfFile(filename: String, withDate: Boolean = true): File
fun listPreferenceFiles(loadMetadata: Boolean = false): MutableList<PrefsFile>
fun listPreferenceFiles(): MutableList<PrefsFile>
fun listCustomWatchfaceFiles(): MutableList<CwfFile>
fun checkMetadata(metadata: Map<PrefsMetadataKey, PrefMetadata>): Map<PrefsMetadataKey, PrefMetadata>
fun formatExportedAgo(utcTime: String): String

View file

@ -10,7 +10,6 @@ data class PrefsFile(
val name: String,
val file: File,
val baseDir: File,
val dirKind: PrefsImportDir,
// metadata here is used only for list display
val metadata: @RawValue Map<PrefsMetadataKey, PrefMetadata>

View file

@ -1,6 +0,0 @@
package app.aaps.core.interfaces.maintenance
enum class PrefsImportDir {
ROOT_DIR,
AAPS_DIR
}

View file

@ -139,6 +139,8 @@ open class Notification {
const val PUMP_TIMEZONE_UPDATE_FAILED = 85
const val BLUETOOTH_NOT_SUPPORTED = 86
const val PUMP_WARNING = 87
const val PUMP_SYNC_ERROR = 88
const val SMB_FALLBACK = 89
const val USER_MESSAGE = 1000

View file

@ -2,7 +2,6 @@ package app.aaps.core.interfaces.nsclient
import android.text.Spanned
import app.aaps.core.interfaces.aps.APSResult
import dagger.android.HasAndroidInjector
import org.json.JSONObject
interface ProcessedDeviceStatusData {
@ -61,7 +60,7 @@ interface ProcessedDeviceStatusData {
val extendedOpenApsStatus: Spanned
val openApsStatus: Spanned
val openApsTimestamp: Long
fun getAPSResult(injector: HasAndroidInjector): APSResult
fun getAPSResult(): APSResult
val uploaderStatus: String
val uploaderStatusSpanned: Spanned
val extendedUploaderStatus: Spanned

View file

@ -9,7 +9,7 @@ class PumpDescription() {
var pumpType = PumpType.GENERIC_AAPS
var isBolusCapable = false
var bolusStep = 0.0
var isExtendedBolusCapable = false
var isExtendedBolusCapable = true
var extendedBolusStep = 0.0
var extendedBolusDurationStep = 0.0
var extendedBolusMaxDuration = 0.0

View file

@ -7,4 +7,7 @@ class EventNetworkChange(
var ssid: String = "",
var roaming: Boolean = false,
var metered: Boolean = false
) : Event()
) : Event() {
val isAnyConnection : Boolean
get() = mobileConnected || wifiConnected
}

View file

@ -268,6 +268,9 @@ enum class JsonKeys(val key: String) {
DYNPREF("dynPref"),
DYNPREFCOLOR("dynPrefColor"),
PREFKEY("prefKey"),
INVALIDTOPOFFSET("invalidTopOffset"),
INVALIDLEFTOFFSET("invalidLeftOffset"),
INVALIDROTATIONOFFSET("invalidRotationOffset"),
DEFAULT("default")
}

View file

@ -5,7 +5,6 @@ import androidx.annotation.RawRes
import androidx.annotation.StringRes
import androidx.fragment.app.FragmentManager
import app.aaps.core.interfaces.nsclient.NSAlarm
import dagger.android.HasAndroidInjector
/**
* Interface to use activities located in different modules
@ -73,7 +72,7 @@ interface UiInteraction {
fun addNotificationValidFor(id: Int, text: String, level: Int, validMinutes: Int)
fun addNotificationWithSound(id: Int, text: String, level: Int, @RawRes soundId: Int?)
fun addNotificationValidTo(id: Int, date: Long, text: String, level: Int, validTo: Long)
fun addNotificationWithAction(injector: HasAndroidInjector, nsAlarm: NSAlarm)
fun addNotificationWithAction(nsAlarm: NSAlarm)
fun addNotificationWithAction(id: Int, text: String, level: Int, buttonText: Int, action: Runnable, @RawRes soundId: Int? = null, date: Long = System.currentTimeMillis())
fun showToastAndNotification(ctx: Context?, string: String?, @RawRes soundID: Int)

View file

@ -1,64 +1,86 @@
package app.aaps.core.interfaces.utils
import android.util.LongSparseArray
import java.util.Calendar
import androidx.annotation.VisibleForTesting
import java.time.Instant
import java.time.LocalDateTime
import java.time.LocalTime
import java.time.ZoneId
object MidnightTime {
@VisibleForTesting
val times = LongSparseArray<Long>()
private var hits: Long = 0
private var misses: Long = 0
private const val THRESHOLD = 100000
fun calc(): Long {
val c = Calendar.getInstance()
c[Calendar.HOUR_OF_DAY] = 0
c[Calendar.MINUTE] = 0
c[Calendar.SECOND] = 0
c[Calendar.MILLISECOND] = 0
return c.timeInMillis
}
/**
* Epoch time of last midnight
*
* @return epoch millis
*/
fun calc(): Long =
LocalDateTime.now().atZone(ZoneId.systemDefault())
.with(LocalTime.of(0, 0, 0, 0))
.toInstant().toEpochMilli()
fun calcPlusMinutes(minutes: Int): Long {
val h = minutes / 60
/**
* Today's time with 'minutes' from midnight
*
* @param minutes minutes to add
* @return epoch millis of today with hh:mm:00
*/
fun calcMidnightPlusMinutes(minutes: Int): Long {
val h = (minutes / 60) % 24
val m = minutes % 60
val c = Calendar.getInstance()
c[Calendar.HOUR_OF_DAY] = h
c[Calendar.MINUTE] = m
c[Calendar.SECOND] = 0
c[Calendar.MILLISECOND] = 0
return c.timeInMillis
return LocalDateTime.now().atZone(ZoneId.systemDefault())
.with(LocalTime.of(h, m, 0, 0))
.toInstant().toEpochMilli()
}
/**
* Epoch time of last midnight before 'time'
*
* @param time time of the day
* @return epoch millis
*/
fun calc(time: Long): Long {
var m: Long?
synchronized(times) {
m = times[time]
if (m != null) {
++hits
return m!!
}
val c = Calendar.getInstance()
c.timeInMillis = time
c[Calendar.HOUR_OF_DAY] = 0
c[Calendar.MINUTE] = 0
c[Calendar.SECOND] = 0
c[Calendar.MILLISECOND] = 0
m = c.timeInMillis
times.append(time, m)
++misses
val m = times[time] ?: Instant.ofEpochMilli(time).atZone(ZoneId.systemDefault())
.with(LocalTime.of(0, 0, 0, 0))
.toInstant().toEpochMilli()
if (times.size() > THRESHOLD) resetCache()
return m
}
return m!!
}
/**
* Epoch time of last midnight 'days' back
*
* @param daysBack how many days back
* @return epoch millis of midnight
*/
fun calcDaysBack(daysBack: Long): Long =
LocalDateTime.now().atZone(ZoneId.systemDefault())
.with(LocalTime.of(0, 0, 0, 0))
.minusDays(daysBack)
.toInstant().toEpochMilli()
/**
* Epoch time of last midnight 'days' back from time
*
* @param time start time
* @param daysBack how many days back
* @return epoch millis of midnight
*/
fun calcDaysBack(time: Long, daysBack: Long): Long =
Instant.ofEpochMilli(time).atZone(ZoneId.systemDefault())
.with(LocalTime.of(0, 0, 0, 0))
.minusDays(daysBack)
.toInstant().toEpochMilli()
@VisibleForTesting
fun resetCache() {
hits = 0
misses = 0
times.clear()
}
fun log(): String =
"Hits: " + hits + " misses: " + misses + " stored: " + times.size()
}

View file

@ -1,7 +1,6 @@
package app.aaps.core.interfaces.utils
import app.aaps.core.interfaces.aps.AutosensDataStore
import app.aaps.core.interfaces.iob.InMemoryGlucoseValue
import app.aaps.database.entities.GlucoseValue
/**
@ -10,22 +9,6 @@ import app.aaps.database.entities.GlucoseValue
*/
interface TrendCalculator {
/**
* Provide or calculate trend
*
* @param glucoseValue BG
* @return TrendArrow
*/
fun getTrendArrow(glucoseValue: GlucoseValue?): GlucoseValue.TrendArrow
/**
* Provide or calculate trend
*
* @param glucoseValue BG
* @return TrendArrow
*/
fun getTrendArrow(glucoseValue: InMemoryGlucoseValue?): GlucoseValue.TrendArrow
/**
* Provide or calculate trend from newest bucketed data
*
@ -34,14 +17,6 @@ interface TrendCalculator {
*/
fun getTrendArrow(autosensDataStore: AutosensDataStore): GlucoseValue.TrendArrow?
/**
* Provide or calculate trend
*
* @param glucoseValue BG
* @return string description of TrendArrow
*/
fun getTrendDescription(glucoseValue: GlucoseValue?): String
/**
* Provide or calculate trend from newest bucketed data
*

View file

@ -57,6 +57,8 @@
<string name="pref_show_bgi">Mostra BGI</string>
<string name="pref_show_direction_arrow">Mostra frecce direzionali</string>
<string name="pref_show_ago">Mostra Indietro</string>
<string name="pref_show_week_number">Mostra numeri della settimana</string>
<string name="pref_show_date">Mostra la data</string>
<string name="default_custom_watchface_comment">Watchface predefinita, puoi fare click sul tasto ESPORTA WATCHFACE per generare un template</string>
<string name="wear_default_watchface">Watchface predefinita</string>
<string name="cwf_comment_background">Immagine sfondo</string>
@ -83,6 +85,7 @@
<string name="cwf_comment_timePeriod">AM o PM</string>
<string name="cwf_comment_day_name">Nome del giorno della settimana</string>
<string name="cwf_comment_day">Giorno (DD)</string>
<string name="cwf_comment_week_number">Numero settimana (ww)</string>
<string name="cwf_comment_month">Nome del mese (breve)</string>
<string name="cwf_comment_loop">Stato loop e indietro</string>
<string name="cwf_comment_direction">Freccia direzionale</string>

View file

@ -42,6 +42,7 @@
<string name="metadata_wear_import_filename">파일 이름: %1$s</string>
<string name="metadata_label_plugin_version">플러그인 버전: %1$s</string>
<string name="metadata_label_watchface_name_version">이름: %1$s (%2$s)</string>
<string name="metadata_label_watchface_infos">정보: %1$s</string>
<string name="pref_show_iob">IOB 표시</string>
<string name="pref_show_detailed_iob">IOB 자세히 표시하기</string>
<string name="pref_show_cob">COB 표시</string>
@ -56,6 +57,8 @@
<string name="pref_show_bgi">BGI 표시하기</string>
<string name="pref_show_direction_arrow">화살표 표시하기</string>
<string name="pref_show_ago">이전 표시하기</string>
<string name="pref_show_week_number">몇 번째 주인지 표시</string>
<string name="pref_show_date">날짜 표시</string>
<string name="default_custom_watchface_comment">기본 시계, 워치페이스 내보내기 버튼을 클릭하여 템플릿을 생성할 수 있습니다.</string>
<string name="wear_default_watchface">기본 워치페이스</string>
<string name="cwf_comment_background">배경화면 이미지</string>
@ -82,6 +85,7 @@
<string name="cwf_comment_timePeriod">오전 또는 오후</string>
<string name="cwf_comment_day_name">요일</string>
<string name="cwf_comment_day">일 (DD)</string>
<string name="cwf_comment_week_number">주 번호 (ww)</string>
<string name="cwf_comment_month">월명 (짧게)</string>
<string name="cwf_comment_loop">루프 상태 및 이전</string>
<string name="cwf_comment_direction">방향 화살표</string>

View file

@ -53,7 +53,7 @@
<string name="pref_show_rig_battery">Rodyti įrenginio bateriją</string>
<string name="pref_show_basal_rate">Rodyti valandinę bazę</string>
<string name="pref_show_loop_status">Rodyti Ciklo statusą</string>
<string name="pref_show_bg">Rodyti KG</string>
<string name="pref_show_bg">Rodyti glikemiją</string>
<string name="pref_show_bgi">Rodyti GĮ</string>
<string name="pref_show_direction_arrow">Rodyti krypties rodyklę</string>
<string name="pref_show_ago">Laikas nuo pask. vertės</string>
@ -76,7 +76,7 @@
<string name="cwf_comment_uploader_battery">Telefono baterija (%)</string>
<string name="cwf_comment_rig_battery">Baterija (%)</string>
<string name="cwf_comment_basalRate">Bazė</string>
<string name="cwf_comment_bgi">KGI vertė</string>
<string name="cwf_comment_bgi">BGI vertė</string>
<string name="cwf_comment_time">Laikas (val:min arba val:min:sek)</string>
<string name="cwf_comment_hour">Val.</string>
<string name="cwf_comment_minute">Min.</string>

View file

@ -59,8 +59,8 @@
<string name="pref_show_ago">Vis tid siden</string>
<string name="pref_show_week_number">Vis ukenummer</string>
<string name="pref_show_date">Vis dato</string>
<string name="default_custom_watchface_comment">Standard klokkebakgrunn, du kan klikke på EKSPORTER KLOKKEBAKGRUNN for å lage en mal</string>
<string name="wear_default_watchface">Standard klokkebakgrunn</string>
<string name="default_custom_watchface_comment">Standard urskive, du kan klikke på EKSPORTER MAL for å lage en mal</string>
<string name="wear_default_watchface">Standard urskive</string>
<string name="cwf_comment_background">Bakgrunnsbilde</string>
<string name="cwf_comment_chart">Grafer (BS, basal, prediksjonslinjer...)</string>
<string name="cwf_comment_cover_chart">Bilde foran grafer og bak tekstfelter</string>

View file

@ -58,6 +58,7 @@
<string name="pref_show_direction_arrow">Отображать стрелку тренда</string>
<string name="pref_show_ago">Отображать историю</string>
<string name="pref_show_week_number">Показывать номер недели</string>
<string name="pref_show_date">Показать дату</string>
<string name="default_custom_watchface_comment">Циферблат по умолчанию, вы можете нажать на EXPORT WATCHFACE чтобы создать шаблон</string>
<string name="wear_default_watchface">Циферблат по умолчанию</string>
<string name="cwf_comment_background">Фоновое изображение</string>

View file

@ -58,6 +58,7 @@
<string name="pref_show_direction_arrow">Zobraziť trendovú šípku</string>
<string name="pref_show_ago">Zobraziť aktualizované pred</string>
<string name="pref_show_week_number">Zobraziť číslo týždňa</string>
<string name="pref_show_date">Zobraziť dátum</string>
<string name="default_custom_watchface_comment">Predvolený ciferník. Môžete kliknúť na tlačítko EXPORTOVAŤ CIFERNÍK pre vygenerovanie šablóny</string>
<string name="wear_default_watchface">Predvolený ciferník</string>
<string name="cwf_comment_background">Obrázok pozadia</string>

View file

@ -58,6 +58,7 @@
<string name="pref_show_direction_arrow">Ok yönünü Göster</string>
<string name="pref_show_ago">Önce Göster</string>
<string name="pref_show_week_number">Hafta sayısını göster</string>
<string name="pref_show_date">Tarihi Göster</string>
<string name="default_custom_watchface_comment">Varsayılan saat arayüzü; bir şablon oluşturmak için SAAT ARAYÜZÜNÜ DIŞA AKTAR butonuna tıklayabilirsiniz</string>
<string name="wear_default_watchface">Varsayılan saat arayüzü</string>
<string name="cwf_comment_background">Arka plan görüntüsü</string>

View file

@ -1,22 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="64"
android:viewportHeight="64">
android:viewportHeight="64"
android:width="64dp"
android:height="64dp">
<path
android:fillColor="?attr/colorControlNormal"
android:pathData="M26.974,28.633c2.447,-4.486 5.781,-8.918 9.638,-13.317l3.594,4.239c-1.265,2.24 -2.645,4.425 -4.439,6.402l-8.793,2.676ZM46.37,28.633l-7.664,-2.644l3.351,-4.189l4.313,6.833ZM35.349,41.533c-0,3.178 -2.597,5.758 -5.797,5.758c-3.199,-0 -5.796,-2.58 -5.796,-5.758c-0,-0.951 0.232,-1.848 0.643,-2.638c-0.118,-1.207 0.853,-4.15 2.623,-6.373c0.178,-0.224 0.353,-0.432 0.522,-0.624c0.604,-1.645 4.255,-2.912 8.664,-2.912c2.719,-0 5.149,0.482 6.755,1.237c0.042,0.019 0.084,0.039 0.126,0.061c0.715,0.352 1.254,0.761 1.565,1.206c0.115,0.118 0.23,0.242 0.345,0.374c2.301,2.631 3.834,5.883 3.857,7.058c0.402,0.784 0.629,1.671 0.629,2.611c0,3.178 -2.597,5.758 -5.796,5.758c-3.199,-0 -5.797,-2.58 -5.797,-5.758l0,-7.108c-0.186,-0.106 -0.322,-0.221 -0.397,-0.347l-3.196,-0c0,-0 1.087,-0 1.087,-0l-0,7.455l-0.037,-0ZM45.369,36.021c-0.051,-0.056 -0.098,-0.063 -0.147,-0.042c0.049,0.014 0.098,0.028 0.147,0.042ZM43.689,45.909c-2.432,-0 -4.406,-1.961 -4.406,-4.376c0,-2.415 1.974,-4.376 4.406,-4.376c2.431,0 4.405,1.961 4.405,4.376c0,2.415 -1.974,4.376 -4.405,4.376ZM29.552,45.909c-2.431,-0 -4.405,-1.961 -4.405,-4.376c-0,-2.415 1.974,-4.376 4.405,-4.376c2.432,0 4.406,1.961 4.406,4.376c-0,2.415 -1.974,4.376 -4.406,4.376ZM43.689,43.618c-1.157,-0 -2.096,-0.935 -2.096,-2.085c-0,-1.151 0.939,-2.085 2.096,-2.085c1.157,0 2.096,0.934 2.096,2.085c-0,1.15 -0.939,2.085 -2.096,2.085ZM29.552,43.618c-1.156,-0 -2.096,-0.935 -2.096,-2.085c0,-1.151 0.94,-2.085 2.096,-2.085c1.157,0 2.096,0.934 2.096,2.085c0,1.15 -0.939,2.085 -2.096,2.085ZM43.284,53.001c-1.541,0.761 -4.041,1.256 -6.862,1.256c-4.229,0 -7.739,-1.114 -8.37,-2.568c-0.582,-0.608 -1.036,-1.296 -1.404,-1.99l2.356,0.052c0.027,-0.017 0.054,-0.034 0.081,-0.052l3.199,0l4.304,-3.361l4.303,3.361l2.868,0c0.006,0.004 0.012,0.008 0.018,0.012l2.699,0.015c-0.688,1.644 -1.835,2.709 -3.171,3.325l-0.021,-0.05Z" />
android:pathData="M48.9 43.7c0.9 -0.2 3.8 4 5.8 8s-1.1 9.1 -5.8 9.2c-3.9 0.1 -8 -5.1 -5.5 -9.8C44.7 48.6 47.4 44 48.9 43.7zM47.6 50c-1.2 -0.4 -3.5 2.2 -2.9 4.7c0.6 2.3 2.9 4.8 3.5 4.6c1.4 -0.5 -1.4 -3.8 -1.5 -5.2C46.5 52.3 48.3 50.3 47.6 50z"
android:fillColor="?attr/colorControlNormal" />
<path
android:pathData="M36.472,7.728c-2.167,-1.778 -20.58,21.776 -18.727,34.474c1.511,10.356 8.067,18.397 18.727,18.626c10.775,0.231 17.757,-7.836 18.727,-18.626c1.144,-12.715 -16.12,-36.225 -18.727,-34.474Z"
android:strokeWidth="3.09"
android:strokeColor="?attr/colorControlNormal" />
android:pathData="M46.9 22.5c0 1.7 -0.2 3.9 -0.3 4.6c-0.3 2 -0.8 3.9 -1.4 5.8c-0.8 2.5 -1.8 4.8 -3.1 7.1c-0.8 1.4 -1.6 2.8 -2.4 4.1c-0.9 1.4 -1.9 2.8 -3 4.2c-1 1.3 -2 2.5 -3.1 3.8c-0.4 0.4 -0.7 0.8 -1.1 1.2c-0.7 0.8 -1.3 1.4 -2.1 2.1c-1.7 1.6 -4.3 1.5 -5.8 -0.2c-1.1 -1.1 -2.2 -2.3 -3.3 -3.5c-1.3 -1.5 -2.5 -3 -3.7 -4.6c-1.7 -2.3 -3.3 -4.8 -4.7 -7.4c-1 -1.8 -1.8 -3.8 -2.5 -5.7c-0.9 -2.7 -1.7 -5.4 -1.9 -8.2c0 -0.3 -0.1 -1.7 -0.1 -3.2c0 -1.6 0.2 -2.8 0.2 -3.3c0.3 -1.8 0.9 -3.5 1.7 -5.2c0.6 -1.4 1.5 -2.6 2.4 -3.8c0.9 -1.1 2 -2.1 3.1 -3c1.3 -1 2.6 -1.8 4.1 -2.4c1.6 -0.7 3.3 -1.2 5 -1.4c0.3 0 1.4 -0.2 2.8 -0.2c1.8 0 3.5 0.3 4.3 0.4c1.8 0.4 3.5 1.1 5.1 2c2.3 1.3 4.2 2.9 5.8 5c1.1 1.5 2.1 3.1 2.7 4.8c0.5 1.2 0.8 2.5 1.1 3.8C46.7 19.6 46.9 21 46.9 22.5zM27.8 6.2c-0.8 0 -1.5 0.1 -2.2 0.2c-1.6 0.2 -3 0.6 -4.5 1.3c-2.4 1.1 -4.5 2.7 -6.1 4.8c-1.2 1.5 -2 3.1 -2.6 4.8c-0.3 1 -0.6 1.9 -0.7 2.9c-0.1 0.8 -0.2 1.7 -0.2 2.5c0 1 0.1 1.9 0.2 2.9c0.1 0.9 0.2 1.9 0.5 2.8c0.6 2.6 1.5 5.2 2.6 7.6c1 2.1 2.1 4.2 3.4 6.1c1.3 2 2.7 3.9 4.2 5.7c1.4 1.7 2.8 3.3 4.3 4.8c0.6 0.6 1.3 0.6 1.9 0c1.5 -1.5 3.7 -4 4.7 -5.3c1 -1.2 1.9 -2.4 2.7 -3.6c1.1 -1.6 2.1 -3.2 3.1 -4.9c1 -1.9 2 -3.9 2.7 -5.9c0.7 -1.8 1.2 -3.7 1.5 -5.6c0.3 -1.4 0.4 -2.8 0.5 -4.3c0 -0.8 -0.1 -1.7 -0.2 -2.5c-0.2 -1.6 -0.6 -3.1 -1.3 -4.5c-0.9 -2 -2.2 -3.8 -3.9 -5.4c-1.2 -1.1 -2.6 -2 -4.1 -2.8C32.3 6.8 30.1 6.3 27.8 6.2z"
android:fillColor="?attr/colorControlNormal" />
<path
android:fillColor="?attr/colorBackgroundFloating"
android:pathData="M26,42a1.113,1.107 0,1 0,7 0a1.113,1.107 0,1 0,-7 0z" />
android:pathData="M26.2 26c0 1.2 0 2.4 0 3.6c0 0.6 0.2 0.9 0.8 0.8c0.4 0 0.9 0 1.3 0c0.7 0 0.8 -0.1 0.8 -0.8c0 -2.3 -0.1 -4.7 0 -7c0.1 -2.1 1 -3.7 2.8 -4.8c1.9 -1.1 3.9 -1.1 5.8 -0.2c1.6 0.8 2.6 2.1 3 3.9c0.4 1.5 0 3 -0.3 4.5c-0.4 1.8 -1.3 3.4 -2.5 4.9c-1.8 2.2 -4 3.6 -6.7 4.4c-1.6 0.4 -3.1 0.6 -4.7 0.5c-2.5 -0.2 -4.7 -1.1 -6.7 -2.5c-1.6 -1.1 -2.8 -2.5 -3.7 -4.2c-0.7 -1.2 -1.2 -2.6 -1.4 -4c-0.1 -0.8 -0.3 -1.5 -0.2 -2.3c0.1 -2.7 1.9 -5.2 4.7 -5.6c1.6 -0.3 3.1 -0.1 4.5 0.8c1.3 0.8 2.1 2 2.5 3.5c0.1 0.5 0.2 1 0.2 1.5C26.2 24 26.2 25 26.2 26zM35 17.7c-2.8 0 -5.1 2.2 -5.1 5c0 2.9 2.3 5.2 5.1 5.2c2.9 0 5.1 -2.2 5.1 -5C40.1 19.9 37.8 17.7 35 17.7zM25.4 22.7c0 -2.8 -2.3 -5 -4.9 -5c-3.1 -0.1 -5.3 2.3 -5.3 5c0 2.9 2.2 5.1 5.1 5.1C23 27.8 25.3 25.7 25.4 22.7z"
android:fillColor="?attr/colorControlNormal" />
<path
android:fillColor="?attr/colorBackgroundFloating"
android:pathData="M40,42a1.113,1.107 0,1 0,7 0a1.113,1.107 0,1 0,-7 0z" />
android:pathData="M38.5 14.8c-0.5 -0.1 -0.9 -0.2 -1.3 -0.3c-2.8 -0.6 -5.4 -0.1 -7.7 1.6c-0.6 0.5 -1.2 1 -1.6 1.7c-0.2 0.4 -0.4 0.2 -0.5 0c-0.3 -0.4 -0.6 -0.8 -1 -1.1c-1.4 -1.3 -2.9 -2 -4.8 -2.3c-1.4 -0.2 -2.8 -0.1 -4.2 0.3c-0.2 0.1 -0.3 0.1 -0.5 0.2c0 0 -0.1 0 -0.2 0C19.6 11 23.5 9 28.2 9.2C32.5 9.3 36 11.3 38.5 14.8z"
android:fillColor="?attr/colorControlNormal" />
<path
android:fillColor="?attr/colorControlNormal"
android:pathData="M15.033,3.173c0.86,-0.187 3.831,4.041 5.767,7.976c1.97,4.005 -1.144,9.071 -5.767,9.169c-3.916,0.084 -8.031,-5.067 -5.515,-9.774c1.298,-2.429 4.076,-7.057 5.515,-7.371ZM13.751,9.511c-1.167,-0.437 -3.511,2.215 -2.886,4.685c0.582,2.301 2.948,4.824 3.5,4.626c1.44,-0.517 -1.41,-3.828 -1.541,-5.219c-0.174,-1.834 1.591,-3.843 0.927,-4.092Z" />
</vector>
android:pathData="M27.6 49.6c-0.9 -1 -1.8 -2 -2.7 -3c-0.4 -0.4 -0.7 -0.9 -1.1 -1.3c-0.1 -0.2 -0.1 -0.2 0 -0.4c1.1 -1.6 2.2 -3.2 3.2 -4.9c0.2 -0.4 0.4 -0.7 0.6 -1.1c0.1 -0.2 0.2 -0.2 0.4 -0.3c2.6 -0.1 5 -0.7 7.2 -2c0.8 -0.4 1.6 -0.9 2.3 -1.5C35.2 40.6 31.7 45.2 27.6 49.6z"
android:fillColor="?attr/colorControlNormal" />
<path
android:pathData="M17.6 35.2c1 0.7 2 1.4 3.2 1.9c1.2 0.6 2.4 1 3.7 1.2c0.3 0.1 0.3 0.2 0.2 0.4c-0.7 1.1 -1.3 2.2 -2.1 3.2c-0.2 0.3 -0.4 0.5 -0.6 0.8C20.3 40.3 18.8 37.8 17.6 35.2z"
android:fillColor="?attr/colorControlNormal" />
<path
android:pathData="M35 20.6c1.2 -0.2 2.3 1 2.2 2.2c0 1 -1 2.2 -2.2 2.2c-1.1 0 -2.2 -1.1 -2.2 -2.3C32.8 21.6 33.9 20.4 35 20.6z"
android:fillColor="?attr/colorControlNormal" />
<path
android:pathData="M22.5 22.7c0.1 1.2 -1.1 2.3 -2.2 2.3c-1.2 0 -2.2 -1 -2.2 -2.3c0 -1 0.9 -2.2 2.4 -2.1C21.4 20.6 22.6 21.6 22.5 22.7z"
android:fillColor="?attr/colorControlNormal" />
</vector>

View file

@ -25,24 +25,40 @@ class MidnightTimeTest {
assertThat(midnight).isAtMost(now)
val c = Calendar.getInstance()
c.timeInMillis = MidnightTime.calc(now)
assertThat(c[Calendar.HOUR_OF_DAY].toLong()).isEqualTo(0L)
assertThat(c[Calendar.MINUTE].toLong()).isEqualTo(0L)
assertThat(c[Calendar.SECOND].toLong()).isEqualTo(0L)
assertThat(c[Calendar.MILLISECOND].toLong()).isEqualTo(0L)
assertThat(c[Calendar.HOUR_OF_DAY]).isEqualTo(0)
assertThat(c[Calendar.MINUTE]).isEqualTo(0)
assertThat(c[Calendar.SECOND]).isEqualTo(0)
assertThat(c[Calendar.MILLISECOND]).isEqualTo(0)
// Assure we get the same time from cache
assertThat(midnight).isEqualTo(MidnightTime.calc(now))
}
@Test fun calcMidnightPlusMinutesTest() {
val c = Calendar.getInstance()
c.timeInMillis = MidnightTime.calcMidnightPlusMinutes(121)
assertThat(c[Calendar.HOUR_OF_DAY]).isEqualTo(2)
assertThat(c[Calendar.MINUTE]).isEqualTo(1)
assertThat(c[Calendar.SECOND]).isEqualTo(0)
assertThat(c[Calendar.MILLISECOND]).isEqualTo(0)
}
@Test fun calcDaysBackTest() {
// We get real midnight
val now = System.currentTimeMillis()
val c = Calendar.getInstance()
c.timeInMillis = MidnightTime.calc(now)
c.add(Calendar.DAY_OF_MONTH, -5)
assertThat(c[Calendar.HOUR_OF_DAY]).isEqualTo(0)
assertThat(c[Calendar.MINUTE]).isEqualTo(0)
assertThat(c[Calendar.SECOND]).isEqualTo(0)
assertThat(c[Calendar.MILLISECOND]).isEqualTo(0)
assertThat(MidnightTime.calcDaysBack(5)).isEqualTo(c.timeInMillis)
}
@Test fun resetCache() {
val now = System.currentTimeMillis()
MidnightTime.calc(now)
MidnightTime.resetCache()
assertThat(MidnightTime.times.size().toLong()).isEqualTo(0L)
}
@Test fun log() {
val now = System.currentTimeMillis()
MidnightTime.calc(now)
assertThat(MidnightTime.log()).startsWith("Hits:")
}
}

View file

@ -7,7 +7,7 @@ import app.aaps.core.nssdk.exceptions.InvalidAccessTokenException
import app.aaps.core.nssdk.exceptions.InvalidFormatNightscoutException
import app.aaps.core.nssdk.exceptions.InvalidParameterNightscoutException
import app.aaps.core.nssdk.exceptions.UnknownResponseNightscoutException
import app.aaps.core.nssdk.exceptions.UnsuccessfullNightscoutException
import app.aaps.core.nssdk.exceptions.UnsuccessfulNightscoutException
import app.aaps.core.nssdk.interfaces.NSAndroidClient
import app.aaps.core.nssdk.localmodel.Status
import app.aaps.core.nssdk.localmodel.devicestatus.NSDeviceStatus
@ -108,11 +108,11 @@ class NSAndroidClientImpl(
val response = api.lastModified()
if (response.isSuccessful) {
return@callWrapper response.body()?.result ?: throw UnsuccessfullNightscoutException()
return@callWrapper response.body()?.result ?: throw UnsuccessfulNightscoutException("Unsuccessful")
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
override suspend fun getSgvs(): NSAndroidClient.ReadResponse<List<NSSgvV3>> = callWrapper(dispatcher) {
@ -127,7 +127,7 @@ class NSAndroidClientImpl(
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
override suspend fun getSgvsModifiedSince(from: Long, limit: Int): NSAndroidClient.ReadResponse<List<NSSgvV3>> = callWrapper(dispatcher) {
@ -144,7 +144,7 @@ class NSAndroidClientImpl(
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
override suspend fun getSgvsNewerThan(from: Long, limit: Int): NSAndroidClient.ReadResponse<List<NSSgvV3>> = callWrapper(dispatcher) {
@ -159,7 +159,7 @@ class NSAndroidClientImpl(
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
override suspend fun createSgv(nsSgvV3: NSSgvV3): CreateUpdateResponse = callWrapper(dispatcher) {
@ -197,7 +197,7 @@ class NSAndroidClientImpl(
errorResponse = errorResponse ?: response.message()
)
} else
throw UnsuccessfullNightscoutException(errorResponse ?: response.message())
throw UnsuccessfulNightscoutException(errorResponse ?: response.message())
}
override suspend fun updateSvg(nsSgvV3: NSSgvV3): CreateUpdateResponse = callWrapper(dispatcher) {
@ -206,19 +206,11 @@ class NSAndroidClientImpl(
nsSgvV3.utcOffset = null
nsSgvV3.date = null
val remoteEntry = nsSgvV3.toRemoteEntry()
val identifier = remoteEntry.identifier ?: throw InvalidFormatNightscoutException()
val identifier = remoteEntry.identifier ?: throw InvalidFormatNightscoutException("Invalid format")
val response =
if (nsSgvV3.isValid) api.updateEntry(remoteEntry, identifier)
else api.deleteEntry(identifier)
if (response.isSuccessful) {
return@callWrapper CreateUpdateResponse(
response = response.code(),
identifier = null,
isDeduplication = false,
deduplicatedIdentifier = null,
lastModified = null
)
} else if (response.code() == 404) { // not found
if (response.isSuccessful || response.code() == 404) { // OK or not found
return@callWrapper CreateUpdateResponse(
response = response.code(),
identifier = null,
@ -233,7 +225,7 @@ class NSAndroidClientImpl(
errorResponse = response.errorBody()?.string() ?: response.message()
)
} else
throw UnsuccessfullNightscoutException(response.errorBody()?.string() ?: response.message())
throw UnsuccessfulNightscoutException(response.errorBody()?.string() ?: response.message())
}
override suspend fun getTreatmentsNewerThan(createdAt: String, limit: Int): NSAndroidClient.ReadResponse<List<NSTreatment>> = callWrapper(dispatcher) {
@ -248,7 +240,7 @@ class NSAndroidClientImpl(
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
override suspend fun getTreatmentsModifiedSince(from: Long, limit: Int): NSAndroidClient.ReadResponse<List<NSTreatment>> = callWrapper(dispatcher) {
@ -264,7 +256,7 @@ class NSAndroidClientImpl(
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
override suspend fun getDeviceStatusModifiedSince(from: Long): List<NSDeviceStatus> = callWrapper(dispatcher) {
@ -275,7 +267,7 @@ class NSAndroidClientImpl(
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
override suspend fun createDeviceStatus(nsDeviceStatus: NSDeviceStatus): CreateUpdateResponse = callWrapper(dispatcher) {
@ -291,7 +283,7 @@ class NSAndroidClientImpl(
deduplicatedIdentifier = response.body()?.deduplicatedIdentifier,
lastModified = response.body()?.lastModified
)
} else throw UnknownResponseNightscoutException()
} else throw UnknownResponseNightscoutException("Unsuccessful")
} else return@callWrapper CreateUpdateResponse(
response = response.code(),
identifier = null,
@ -301,7 +293,7 @@ class NSAndroidClientImpl(
override suspend fun createTreatment(nsTreatment: NSTreatment): CreateUpdateResponse = callWrapper(dispatcher) {
val remoteTreatment = nsTreatment.toRemoteTreatment() ?: throw InvalidFormatNightscoutException()
val remoteTreatment = nsTreatment.toRemoteTreatment() ?: throw InvalidFormatNightscoutException("Invalid format")
remoteTreatment.app = "AAPS"
val response = api.createTreatment(remoteTreatment)
val errorResponse = response.errorBody()?.string()
@ -333,7 +325,7 @@ class NSAndroidClientImpl(
errorResponse = errorResponse ?: response.message()
)
} else
throw UnsuccessfullNightscoutException(errorResponse ?: response.message())
throw UnsuccessfulNightscoutException(errorResponse ?: response.message())
}
override suspend fun updateTreatment(nsTreatment: NSTreatment): CreateUpdateResponse = callWrapper(dispatcher) {
@ -341,20 +333,12 @@ class NSAndroidClientImpl(
// following cannot be updated
nsTreatment.utcOffset = null
nsTreatment.date = null
val remoteTreatment = nsTreatment.toRemoteTreatment() ?: throw InvalidFormatNightscoutException()
val identifier = remoteTreatment.identifier ?: throw InvalidFormatNightscoutException()
val remoteTreatment = nsTreatment.toRemoteTreatment() ?: throw InvalidFormatNightscoutException("Invalid format")
val identifier = remoteTreatment.identifier ?: throw InvalidFormatNightscoutException("Invalid format")
val response =
if (nsTreatment.isValid) api.updateTreatment(remoteTreatment, identifier)
else api.deleteTreatment(identifier)
if (response.isSuccessful) {
return@callWrapper CreateUpdateResponse(
response = response.code(),
identifier = null,
isDeduplication = false,
deduplicatedIdentifier = null,
lastModified = null
)
} else if (response.code() == 404) { // not found
if (response.isSuccessful || response.code() == 404) { // OK or not found
return@callWrapper CreateUpdateResponse(
response = response.code(),
identifier = null,
@ -369,7 +353,7 @@ class NSAndroidClientImpl(
errorResponse = response.errorBody()?.string() ?: response.message()
)
} else
throw UnsuccessfullNightscoutException(response.errorBody()?.string() ?: response.message())
throw UnsuccessfulNightscoutException(response.errorBody()?.string() ?: response.message())
}
override suspend fun getFoods(limit: Int): NSAndroidClient.ReadResponse<List<NSFood>> = callWrapper(dispatcher) {
@ -384,7 +368,7 @@ class NSAndroidClientImpl(
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
/*
@ -414,7 +398,7 @@ class NSAndroidClientImpl(
deduplicatedIdentifier = response.body()?.deduplicatedIdentifier,
lastModified = response.body()?.lastModified
)
} else throw UnsuccessfullNightscoutException()
} else throw UnsuccessfulNightscoutException("Unsuccessful")
} else if (response.code() in 400..499) {
return@callWrapper CreateUpdateResponse(
response = response.code(),
@ -422,25 +406,17 @@ class NSAndroidClientImpl(
errorResponse = response.errorBody()?.string() ?: response.message()
)
} else
throw UnsuccessfullNightscoutException(response.errorBody()?.string() ?: response.message())
throw UnsuccessfulNightscoutException(response.errorBody()?.string() ?: response.message())
}
override suspend fun updateFood(nsFood: NSFood): CreateUpdateResponse = callWrapper(dispatcher) {
val remoteFood = nsFood.toRemoteFood()
val identifier = nsFood.identifier ?: throw InvalidFormatNightscoutException()
val identifier = nsFood.identifier ?: throw InvalidFormatNightscoutException("Invalid format")
val response =
if (nsFood.isValid) api.updateFood(remoteFood, identifier)
else api.deleteFood(identifier)
if (response.isSuccessful) {
return@callWrapper CreateUpdateResponse(
response = response.code(),
identifier = null,
isDeduplication = false,
deduplicatedIdentifier = null,
lastModified = null
)
} else if (response.code() == 404) { // not found
if (response.isSuccessful || response.code() == 404) { // OK or not found
return@callWrapper CreateUpdateResponse(
response = response.code(),
identifier = null,
@ -455,7 +431,7 @@ class NSAndroidClientImpl(
errorResponse = response.errorBody()?.string() ?: response.message()
)
} else
throw UnsuccessfullNightscoutException(response.errorBody()?.string() ?: response.message())
throw UnsuccessfulNightscoutException(response.errorBody()?.string() ?: response.message())
}
override suspend fun createProfileStore(remoteProfileStore: JSONObject): CreateUpdateResponse = callWrapper(dispatcher) {
@ -470,7 +446,7 @@ class NSAndroidClientImpl(
deduplicatedIdentifier = response.body()?.deduplicatedIdentifier,
lastModified = response.body()?.lastModified
)
} else throw UnsuccessfullNightscoutException()
} else throw UnsuccessfulNightscoutException("Unsuccessful")
} else if (response.code() in 400..499) {
return@callWrapper CreateUpdateResponse(
response = response.code(),
@ -478,7 +454,7 @@ class NSAndroidClientImpl(
errorResponse = response.errorBody()?.string() ?: response.message()
)
} else
throw UnsuccessfullNightscoutException(response.errorBody()?.string() ?: response.message())
throw UnsuccessfulNightscoutException(response.errorBody()?.string() ?: response.message())
}
override suspend fun getLastProfileStore(): NSAndroidClient.ReadResponse<List<JSONObject>> = callWrapper(dispatcher) {
@ -491,7 +467,7 @@ class NSAndroidClientImpl(
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
override suspend fun getProfileModifiedSince(from: Long): NSAndroidClient.ReadResponse<List<JSONObject>> = callWrapper(dispatcher) {
@ -504,7 +480,7 @@ class NSAndroidClientImpl(
} else if (response.code() in 400..499)
throw InvalidParameterNightscoutException(response.errorBody()?.string() ?: response.message())
else
throw UnsuccessfullNightscoutException()
throw UnsuccessfulNightscoutException("Unsuccessful")
}
private suspend fun <T> callWrapper(dispatcher: CoroutineDispatcher, block: suspend () -> T): T =

View file

@ -6,4 +6,4 @@ package app.aaps.core.nssdk.exceptions
* In practice this will happen if the server time and the phone time are off.
*
*/
class DateHeaderOutOfToleranceException : NightscoutException()
class DateHeaderOutOfToleranceException(message: String) : NightscoutException(message)

View file

@ -1,3 +1,3 @@
package app.aaps.core.nssdk.exceptions
class InvalidAccessTokenException : NightscoutException()
class InvalidAccessTokenException(message: String) : NightscoutException(message)

View file

@ -1,9 +1,4 @@
package app.aaps.core.nssdk.exceptions
@Suppress("unused")
class InvalidFormatNightscoutException : NightscoutException {
constructor() : super()
constructor(message: String) : super(message)
constructor(message: String, cause: Throwable) : super(message, cause)
constructor(cause: Throwable?) : super(cause)
}
class InvalidFormatNightscoutException(message: String) : NightscoutException(message)

View file

@ -1,9 +1,4 @@
package app.aaps.core.nssdk.exceptions
@Suppress("unused")
class InvalidParameterNightscoutException : NightscoutException {
constructor() : super()
constructor(message: String) : super(message)
constructor(message: String, cause: Throwable) : super(message, cause)
constructor(cause: Throwable?) : super(cause)
}
class InvalidParameterNightscoutException(message: String) : NightscoutException(message)

View file

@ -2,9 +2,4 @@ package app.aaps.core.nssdk.exceptions
import java.io.IOException
abstract class NightscoutException : IOException {
constructor() : super()
constructor(message: String) : super(message)
constructor(message: String, cause: Throwable) : super(message, cause)
constructor(cause: Throwable?) : super(cause)
}
abstract class NightscoutException(message: String, cause: Throwable? = null) : IOException(message, cause)

View file

@ -1,3 +1,3 @@
package app.aaps.core.nssdk.exceptions
class UnknownResponseNightscoutException : NightscoutException()
class UnknownResponseNightscoutException(override val message: String) : NightscoutException(message)

View file

@ -0,0 +1,3 @@
package app.aaps.core.nssdk.exceptions
class UnsuccessfulNightscoutException(message: String) : NightscoutException(message)

View file

@ -1,8 +0,0 @@
package app.aaps.core.nssdk.exceptions
class UnsuccessfullNightscoutException : NightscoutException {
constructor() : super()
constructor(message: String) : super(message)
constructor(message: String, cause: Throwable) : super(message, cause)
constructor(cause: Throwable?) : super(cause)
}

View file

@ -49,7 +49,7 @@ internal class NSAuthInterceptor(private val refreshToken: String, private val r
return when {
authResponseResponse == null -> initialResponse
authResponseResponse.code() in listOf(401, 403) -> throw InvalidAccessTokenException()
authResponseResponse.code() in listOf(401, 403) -> throw InvalidAccessTokenException("Invalid access token")
authResponseResponse.code() != 200 -> initialResponse
else -> {
authResponseResponse.body()?.token?.let { jwtToken = it }
@ -62,7 +62,7 @@ internal class NSAuthInterceptor(private val refreshToken: String, private val r
private fun testCanRefresh(initialResponse: Response) {
// Todo: use proper reason code once it is supplied by remote
if (initialResponse.body?.string()?.contains(MESSAGE_DATE_HEADER_OUT_OF_TOLERANCE) == true) {
throw DateHeaderOutOfToleranceException()
throw DateHeaderOutOfToleranceException("Data header out of tolerance")
}
}
}

View file

@ -56,7 +56,7 @@ internal interface NightscoutRemoteService {
@DELETE("v3/entries/{identifier}")
suspend fun deleteEntry(@Path("identifier") identifier: String): Response<NSResponse<RemoteCreateUpdateResponse>>
@GET("v3/treatments?sort=date")
@GET("v3/treatments?sort=created_at")
suspend fun getTreatmentsNewerThan(@Query(value = "created_at\$gt", encoded = true) createdAt: String, @Query("limit") limit: Int): Response<NSResponse<List<RemoteTreatment>>>
@GET("v3/treatments/history/{from}")

View file

@ -51,6 +51,7 @@
<string name="extended_bolus">Bolo esteso</string>
<string name="paused">In pausa</string>
<string name="tdd_total">TDD totale</string>
<string name="tdd_old_data">Dati vecchi</string>
<string name="goingtodeliver">Sto per erogare %1$.2f U</string>
<string name="waitingforpump">In attesa del micro</string>
<string name="androidaps_start">AAPS avviato</string>
@ -120,7 +121,7 @@
<string name="notconfigured">Non configurato</string>
<string name="loopsuspended">Loop sospeso</string>
<string name="trend_arrow">Freccia trend</string>
<string name="a11y_autosens_label">Asuto sens</string>
<string name="a11y_autosens_label">Auto sens</string>
<string name="required">ric</string>
<string name="a11y_arrow_double_down">discesa rapida</string>
<string name="a11y_arrow_single_down">discesa</string>
@ -155,7 +156,7 @@
<string name="login">Login</string>
<string name="prime_fill">Carica/Riempi</string>
<string name="overview_insulin_label">Insulina</string>
<string name="stoptemptarget">Stoppa temp-target</string>
<string name="stoptemptarget">Stoppa target temporaneo</string>
<string name="closedloop">Loop chiuso</string>
<string name="openloop">Loop aperto</string>
<string name="lowglucosesuspend">Sospensione a glicemia bassa (LGS)</string>
@ -167,6 +168,8 @@
<string name="virtualpump_uploadstatus_title">Carica stato micro su NS o Tidepool</string>
<string name="suspendloop_label">Loop disabilitato/sospeso</string>
<string name="iob_label">Insulina attiva (IOB)</string>
<string name="loopstatus_targets">TARGET:</string>
<string name="loopstatus_OAPS_result">RISULTATO OAPS:</string>
<!-- Protection-->
<string name="wrongpassword">Password errata</string>
<string name="wrongpin">PIN errato</string>
@ -222,7 +225,7 @@
<string name="pump_battery_change">Cambio batteria micro</string>
<string name="temporary_target">Target temporaneo</string>
<string name="careportal_temporarytargetvalue">Valore target temporaneo</string>
<string name="careportal_temporarytargetcancel">Cancellazione temp-target</string>
<string name="careportal_temporarytargetcancel">Cancellazione target temporaneo</string>
<string name="boluswizard">Calcolatore</string>
<string name="glucosetype_finger">Dito</string>
<string name="glucosetype_sensor">Sensore</string>
@ -404,9 +407,9 @@
<string name="autotune_shortname">AT</string>
<string name="autotune_settings">Impostazioni Autotune</string>
<string name="autotune_auto_title">Automazione cambio profilo</string>
<string name="autotune_auto_summary">Se abilitato, Autotune si aggiornerà automaticamente e passerà al profilo di input dopo il calcolo da una regola di automazione.</string>
<string name="autotune_auto_summary">Se abilitato, dopo il calcolo di una regola di automazione Autotune verrà eseguito e il profilo generato verrà automaticamente attivato.</string>
<string name="autotune_categorize_uam_as_basal_title">Classifica UAM come basale</string>
<string name="autotune_categorize_uam_as_basal_summary">Abilita solo se hai inserito in modo affidabile tutti i carboidrati assunti, con questa opzione aumenti improvvisi individuati da Autotune verranno usati per consigliare modifiche alla velocità basale.</string>
<string name="autotune_categorize_uam_as_basal_summary">Abilita solo se hai inserito in modo affidabile tutti i carboidrati assunti, con questa opzione gli aumenti improvvisi individuati da Autotune verranno usati per consigliare modifiche alla velocità basale.</string>
<string name="autotune_tune_insulin_curve_title">Regola la curva dell\'insulina</string>
<string name="autotune_tune_insulin_curve_summary">Abilita solo se usi free-peak. Questa opzione regolerà la durata di picco e DIA</string>
<string name="autotune_default_tune_days_title">Numero di giorni di dati</string>
@ -453,15 +456,17 @@
<string name="info">INFO</string>
<!-- BolusWizard -->
<string name="bolus_advisor">Consiglio bolo</string>
<string name="bolus_advisor_message">Hai una glicemia alta. Invece di mangiare ora, si consiglia di attendere una glicemia migliore. Vuoi fare adesso un bolo di correzione ed essere ricordato quando è il momento di mangiare? In questo caso non verranno registrati carboidrati e dovrai usare di nuovo il calcolatore quando ti verrà mostrato il promemoria.</string>
<string name="bolus_advisor_message">Hai una glicemia alta. Invece di mangiare ora, si consiglia di attendere una glicemia migliore. Vuoi fare adesso un bolo di correzione ed ricevere un promemoria quando è il momento di mangiare? In questo caso non verranno registrati carboidrati e dovrai usare di nuovo il calcolatore quando ti verrà mostrato il promemoria.</string>
<string name="cobvsiob">COB vs IOB</string>
<string name="slowabsorptiondetected"><![CDATA[<font color=\'%1$s\'>!!!!! Rilevato assorbimento lento dei carboidrati: %2$d%% del tempo. Ricontrolla il tuo calcolo. COB potrebbero essere sovrastimati e potrebbe essere somministrata più insulina !!!!!</font>]]></string>
<string name="slowabsorptiondetected"><![CDATA[<font color=\'%1$s\'>!!!!! Rilevato assorbimento lento dei carboidrati: %2$d%% del tempo. Ricontrolla il tuo calcolo. I COB potrebbero essere sovrastimati e potrebbe essere somministrata più insulina !!!!!</font>]]></string>
<string name="partialboluswizard">Eroga parte del risultato del calcolatore [%]</string>
<string name="partialboluswizard_reset_time">Soglia tempo glicemia \"vecchia\" [min]</string>
<string name="bolus_constraint_applied_warn">Vincolo bolo applicato: %1$.2f U a %2$.2f U</string>
<string name="bolus_recorded_only">Il bolo sarà solo registrato (non erogato dal micro)</string>
<string name="advisoralarm">Esegui allarme quando è tempo di mangiare</string>
<string name="no_action_selected">Nessuna azione selezionata, non succederà nulla</string>
<string name="carb_equal_zero_no_action">CHO = 0. Nessuna azione intrapresa!</string>
<string name="wizard_no_insulin_required">Insulina non necessaria!</string>
<string name="wizard_no_actual_bg">Nessun recente valore BG su cui basare il calcolo!</string>
<string name="wizard_no_active_profile">Nessun profilo attivo!</string>
<string name="wizard_no_cob">Valore COB sconosciuto! Lettura BG mancante o recente riavvio dell\'app?</string>
@ -555,7 +560,7 @@
<string name="ble_not_supported_or_not_paired">Bluetooth Low Energy non supportato o dispositivo non associato.</string>
<string name="ble_not_enabled">Bluetooth non abilitato.</string>
<string name="location_not_found_title">La localizzazione non è abilitata</string>
<string name="location_not_found_message">Affinché la ricerca bluetooth funzioni sui dispositivi più recenti, la localizzazione deve essere abilitata, ma può essere disabilitata dopo l\'associazione. AAPS non tiene traccia della tua posizione.</string>
<string name="location_not_found_message">Affinché la ricerca bluetooth funzioni sui dispositivi più recenti la localizzazione deve essere abilitata, ma può essere disabilitata dopo l\'associazione. AAPS non tiene traccia della tua posizione.</string>
<!-- Preferences -->
<string name="nav_plugin_preferences">Preferenze plugin</string>
<!-- SmsCommunicator -->
@ -581,6 +586,7 @@
<string name="cleanup_db_confirm_sync">Vuoi pulire il database?\nIl processo rimuoverà i cambiamenti tracciati e i dati dello storico più vecchi di 3 mesi.\nFarlo velocizzerà considerevolmente la sincronizzazione completa.</string>
<string name="cleared_entries">Elementi cancellati</string>
<!-- Weekday-->
<string name="weekday_sunday_short">Dom</string>
<string name="weekday_saturday_short">Sab</string>
<string name="weekday_friday_short">Ven</string>
<string name="weekday_thursday_short">Gio</string>
@ -589,11 +595,13 @@
<string name="weekday_monday_short">Lun</string>
<!-- WeekdayPicker -->
<string name="monday_short">L</string>
<string name="tuesday_short">M</string>
<string name="wednesday_short">M</string>
<string name="tuesday_short">Ma</string>
<string name="wednesday_short">Me</string>
<string name="thursday_short">G</string>
<string name="friday_short">V</string>
<string name="saturday_short">S</string>
<string name="sunday_short">D</string>
<!-- DecimalFormatterImpl -->
<string name="format_insulin_units1">%1$.1f U</string>
<string name="format_insulin_units">%1$.2f U</string>
</resources>

View file

@ -51,6 +51,7 @@
<string name="extended_bolus">확장 Bolus</string>
<string name="paused">일시중지</string>
<string name="tdd_total">TDD Total</string>
<string name="tdd_old_data">오래된 데이터</string>
<string name="goingtodeliver">%1$.2f U을 주입합니다.</string>
<string name="waitingforpump">펌프를 기다리는 중</string>
<string name="androidaps_start">AAPS 시작</string>
@ -167,6 +168,8 @@
<string name="virtualpump_uploadstatus_title">NS에 펌프상태 업로드하기</string>
<string name="suspendloop_label">중지 또는 일시중지된 loop</string>
<string name="iob_label">활성 인슐린 (IOB)</string>
<string name="loopstatus_targets">목표:</string>
<string name="loopstatus_OAPS_result">OAPS 결과:</string>
<!-- Protection-->
<string name="wrongpassword">잘못된 비밀번호</string>
<string name="wrongpin">잘못된 PIN</string>
@ -462,6 +465,8 @@
<string name="bolus_recorded_only">Bolus는 이 경우(펌프를 통해 공급되지 않음) 에만 기록됩니다</string>
<string name="advisoralarm">식사 시간이 되면 알람을 울리기</string>
<string name="no_action_selected">선택한 실행이 없습니다. 아무런 실행이 되지 않습니다.</string>
<string name="carb_equal_zero_no_action">탄수화물= 0. 아무런 조치도 취하지 않았습니다!</string>
<string name="wizard_no_insulin_required">인슐린이 필요하지 않습니다!</string>
<string name="wizard_no_actual_bg">기저 계산에는 최근 BG가 없습니다!</string>
<string name="wizard_no_active_profile">활성화된 프로파일 설정이 없습니다!</string>
<string name="wizard_no_cob">알 수 없는 COB입니다! BG 판독이 누락되었거나, 최근 앱을 다시 시작하였습니까?</string>
@ -578,6 +583,7 @@
<string name="cleanup_db_confirm_sync">데이터베이스를 정리하시겠습니까?\n3개월 이상 경과한 추적된 변경 내용 및 기록 데이터가 제거됩니다.\n이 작업을 수행하면 전체 동기화 속도가 크게 향상됩니다.</string>
<string name="cleared_entries">입력된 내용 제거됨</string>
<!-- Weekday-->
<string name="weekday_sunday_short"></string>
<string name="weekday_saturday_short"></string>
<string name="weekday_friday_short"></string>
<string name="weekday_thursday_short"></string>
@ -593,4 +599,6 @@
<string name="saturday_short"></string>
<string name="sunday_short"></string>
<!-- DecimalFormatterImpl -->
<string name="format_insulin_units1">%1$.1f U</string>
<string name="format_insulin_units">%1$.2f U</string>
</resources>

View file

@ -33,14 +33,14 @@
<string name="result">Rezultatas</string>
<string name="settings">Parametrai</string>
<string name="statuslights">Būklės indikatoriai</string>
<string name="do_ns_upload_title">Perduoti KG duomenis į NS</string>
<string name="do_ns_upload_title">Siųsti glikemijos duomenis į NS</string>
<string name="configbuilder_insulin">Insulinas</string>
<string name="value_unavailable_short">n/a</string>
<string name="master_password">Pagrindinis slaptažodis</string>
<string name="ue_export_to_csv">Eksportuoti naudotojo įrašus į Excel (csv)</string>
<string name="confirm">Patvirtinti</string>
<string name="pump">Pompa</string>
<string name="missed_bg_readings">Negauti KG duomenys</string>
<string name="missed_bg_readings">Negauti glikemijos duomenys</string>
<string name="treatments_iob_label_string">AIO:</string>
<string name="mute5min">Nutildyti 5 minutėms</string>
<string name="mute">Nutildyti</string>
@ -109,10 +109,10 @@
<string name="add_new">Pridėti naują</string>
<string name="addnew_above">Pridėti naują aukščiau</string>
<string name="wrong_pump_data">Duomenys gaunami iš kitos pompos. Pakeiskite pompos valdiklį.</string>
<string name="bg_label">KG</string>
<string name="bg_label">Glikemija</string>
<string name="calibration">Kalibravimas</string>
<string name="alarminxmin">Pranešti po %1$d min</string>
<string name="treatmentdeliveryerror">Boluso suleidimo klaida. Rankiniu būdu patikrinkite faktiškai suleistą kiekį</string>
<string name="treatmentdeliveryerror">Boluso suleidimo klaida. Patikrinkite faktiškai suleistą kiekį</string>
<string name="bolus_reminder">Priminimas apie bolusą</string>
<string name="duration_label">Trukmė</string>
<string name="shortgramm">g</string>
@ -135,7 +135,7 @@
<string name="a11y_inrange">ribose</string>
<string name="a11y_low">žemas</string>
<string name="average">Vidurkis</string>
<string name="tir">LNR</string>
<string name="tir">LTR</string>
<string name="none"><![CDATA[<none>]]></string>
<string name="remove_label">PAŠALINTI</string>
<string name="activate_profile">Aktyvuoti profilį</string>
@ -146,7 +146,7 @@
<string name="confirm_remove_multiple_items">Ar tikrai norite pašalinti %1$d elementus</string>
<string name="overview_treatment_label">Terapija</string>
<string name="copytolocalprofile">Kurti naują profilį iš šito profilio?</string>
<string name="wear_wizard_settings">Vedlio nustatymai</string>
<string name="wear_wizard_settings">Skaičiuotuvo nustatymai</string>
<string name="bg_trend_label">15 min tendencija</string>
<string name="treatments_wizard_cob_label">AAO</string>
<string name="bolus_iob_label">Bolusų AIO</string>
@ -194,8 +194,8 @@
<string name="mins">%1$d min.</string>
<!-- Translator-->
<string name="careportal">Priežiūra</string>
<string name="careportal_bgcheck">KG testas</string>
<string name="careportal_mbg">KG iš kraujo arba kalibracija</string>
<string name="careportal_bgcheck">Gliukomatis</string>
<string name="careportal_mbg">Gliukomačio rodmenys</string>
<string name="careportal_announcement">Pranešimas</string>
<string name="careportal_note">Pastaba</string>
<string name="careportal_question">Klausimas</string>
@ -305,7 +305,7 @@
<string name="uel_treatments_ns_refresh">ATNAUJINTI TERAPIJĄ NS</string>
<string name="uel_tt_ns_refresh">ATNAUJINTI LAIKINĄ TIKSLĄ NS</string>
<string name="uel_automation_removed">AUTOMATIZAVIMAS PAŠALINTAS</string>
<string name="uel_bg_removed">KG PAŠALINTA</string>
<string name="uel_bg_removed">PAŠALINTA</string>
<string name="uel_careportal_removed">TERAPIJOS PORTALAS PAŠALINTAS</string>
<string name="uel_bolus_removed">BOLUSAS PAŠALINTAS</string>
<string name="uel_carbs_removed">AV PAŠALINTI</string>
@ -462,6 +462,7 @@
<string name="bolus_recorded_only">Bolusas bus tik įrašytas (nebus suleistas)</string>
<string name="advisoralarm">Pranešti apie laiką valgyti</string>
<string name="no_action_selected">Veiksmas nepasirinktas, nieko neįvyks</string>
<string name="wizard_no_insulin_required">Insulino nereikia!</string>
<string name="wizard_no_actual_bg">Nėra naujausių cukraus duomenų, kuriais būtų galima pagrįsti skaičiavimus!</string>
<string name="wizard_no_active_profile">Neparinktas aktyvus profilis!</string>
<string name="wizard_no_cob">Nežinomi AAO! Nėra glikemijos duomenų arba programa paleista iš naujo?</string>
@ -469,7 +470,7 @@
<string name="wizard_explain_calc">Kalk (IA: %1$.1f, JIF: %2$.1f)</string>
<string name="wizard_explain_carbs">AV: %1$.2fv</string>
<string name="wizard_explain_cob">AAO: %1$.0fg %2$.2fv</string>
<string name="wizard_explain_bg">KG: %1$.2fv</string>
<string name="wizard_explain_bg">Glikemija: %1$.2fv</string>
<string name="wizard_explain_iob">AIO: %1$.2fv</string>
<string name="wizard_explain_superbolus">Superbolus: %1$.2fv</string>
<string name="wizard_explain_trend">15\' tendencija: %1$.2fv</string>
@ -557,7 +558,7 @@
<string name="location_not_found_title">Vietovės nustatymas neįjungtas</string>
<string name="location_not_found_message">Vietos nustatymo paslauga turi būti įjungta, kad Bluetooth aptikimas veiktų naujesniuose įrenginiuose. AAPS neseka Jūsų lokacijos, o vietos nustatymo paslauga gali būti išjungta po sėkmingo įrenginių susiejimo.</string>
<!-- Preferences -->
<string name="nav_plugin_preferences">Įskiepių nustatymai</string>
<string name="nav_plugin_preferences">Pradžios ekrano nustatymai</string>
<!-- SmsCommunicator -->
<string name="smscommunicator_missingsmspermission">Trūksta leidimo SMS</string>
<!-- About -->

View file

@ -225,7 +225,7 @@
<string name="pump_battery_change">Bytte pumpebatteri</string>
<string name="temporary_target">Midlertidig mål</string>
<string name="careportal_temporarytargetvalue">Midlertidig målverdi</string>
<string name="careportal_temporarytargetcancel">Avbryt midl. mål</string>
<string name="careportal_temporarytargetcancel">Avbryt midlertidig mål</string>
<string name="boluswizard">Boluskalkulator</string>
<string name="glucosetype_finger">Finger</string>
<string name="glucosetype_sensor">Sensor</string>
@ -275,7 +275,7 @@
<string name="uel_carbs">KARBO</string>
<string name="uel_extended_carbs">FORLENGET KARBO</string>
<string name="uel_temp_basal">MIDL. BASAL</string>
<string name="uel_tt">MIDL. MÅL</string>
<string name="uel_tt">MIDLERTIDIG MÅL</string>
<string name="uel_new_profile">NY PROFIL</string>
<string name="uel_clone_profile">KOPIER PROFIL</string>
<string name="uel_store_profile">LAGRE PROFIL</string>
@ -296,7 +296,7 @@
<string name="uel_cancel_temp_basal">AVBRYT MIDL. BASAL</string>
<string name="uel_cancel_bolus">AVBRYT BOLUS</string>
<string name="uel_cancel_extended_bolus">AVBRYT FORLENGET BOLUS</string>
<string name="uel_cancel_tt">AVBRYT MIDL. MÅL</string>
<string name="uel_cancel_tt">AVBRYT MIDLERTIDIG MÅL</string>
<string name="uel_careportal">HELSEPORTAL</string>
<string name="uel_site_change">BYTTE SLANGESETT</string>
<string name="uel_reservoir_change">BYTTE RESERVOAR</string>
@ -306,13 +306,13 @@
<string name="uel_careportal_ns_refresh">HELSEPORTAL NS-OPPDATERING</string>
<string name="uel_profile_switch_ns_refresh">PROFILBYTTE NS OPPDATERING</string>
<string name="uel_treatments_ns_refresh">BEHANDLINGER NS OPPDATERING</string>
<string name="uel_tt_ns_refresh">OPPDATER MIDL. MÅL NS</string>
<string name="uel_tt_ns_refresh">OPPDATER MIDLERTIDIG MÅL NS</string>
<string name="uel_automation_removed">AUTOMASJON FJERNET</string>
<string name="uel_bg_removed">BS FJERNET</string>
<string name="uel_careportal_removed">HELSEPORTAL FJERNET</string>
<string name="uel_bolus_removed">BOLUS FJERNET</string>
<string name="uel_carbs_removed">KARBO FJERNET</string>
<string name="uel_temp_basal_removed">MIDL. MÅL FJERNET</string>
<string name="uel_temp_basal_removed">MIDLERTIDIG MÅL FJERNET</string>
<string name="uel_extended_bolus_removed">FORLENGET BOLUS FJERNET</string>
<string name="uel_food">MAT</string>
<string name="uel_food_removed">MÅLTID FJERNET</string>
@ -320,7 +320,7 @@
<string name="uel_profile_switch_removed">PROFILBYTTE FJERNET</string>
<string name="uel_restart_events_removed">RESTART HENDELSER FJERNET</string>
<string name="uel_treatment_removed">BEHANDLING FJERNET</string>
<string name="uel_tt_removed">MIDL. MÅL FJERNET</string>
<string name="uel_tt_removed">MIDLERTIDIG MÅL FJERNET</string>
<string name="uel_ns_paused">NS PAUSET</string>
<string name="uel_ns_resume">GJENOPPTA NS</string>
<string name="uel_ns_queue_cleared">NS KØ SLETTET</string>
@ -362,9 +362,9 @@
<!-- HardLimits -->
<string name="profile_low_target">Profil lavt mål</string>
<string name="profile_high_target">Profil høyt mål</string>
<string name="temp_target_low_target">Nedre grense for midl. mål</string>
<string name="temp_target_high_target">Øvre grense for midl. mål</string>
<string name="temp_target_value">Midl. målverdi</string>
<string name="temp_target_low_target">Nedre grense for midlertidig mål</string>
<string name="temp_target_high_target">Øvre grense for midlertidig mål</string>
<string name="temp_target_value">Midlertidig målverdi</string>
<string name="profile_dia">Profil DIA verdi</string>
<string name="profile_sensitivity_value">Profilens insulinfølsomhet</string>
<string name="profile_max_daily_basal_value">Maksimal profil basalverdi</string>
@ -480,7 +480,7 @@
<string name="wizard_explain_trend">15\' trend: %1$.2fE</string>
<string name="wizard_explain_percent">Prosent: %1$.2fE x %2$d%% ≈ %3$.2fE</string>
<string name="wizard_constraint_bolus_size">Insulinbegrensning nådd!\nKan ikke levere %1$.2fE</string>
<string name="wizard_explain_tt">TempT: %1$s</string>
<string name="wizard_explain_tt">Midl. mål: %1$s</string>
<string name="wizard_explain_tt_to">%1$s til %2$s</string>
<string name="wizard_pump_not_available">Ingen pumpe tilgjengelig!</string>
<string name="quickwizard">Hurtigknapp</string>

View file

@ -51,6 +51,7 @@
<string name="extended_bolus">Bolus extins</string>
<string name="paused">Suspendat</string>
<string name="tdd_total">Total TDD</string>
<string name="tdd_old_data">Date vechi</string>
<string name="goingtodeliver">Se vor livra %1$.2fU</string>
<string name="waitingforpump">Se așteaptă pompa</string>
<string name="androidaps_start">AAPS pornit</string>
@ -167,6 +168,8 @@
<string name="virtualpump_uploadstatus_title">Trimitere status către NS sau Tidepool</string>
<string name="suspendloop_label">Buclă dezactivată/suspendată</string>
<string name="iob_label">Insulină activă (IOB)</string>
<string name="loopstatus_targets">ȚINTE:</string>
<string name="loopstatus_OAPS_result">REZULTATUL OAPS:</string>
<!-- Protection-->
<string name="wrongpassword">Parola greșită</string>
<string name="wrongpin">PIN greșit</string>
@ -462,6 +465,8 @@
<string name="bolus_recorded_only">Bolusul va fi doar consemnat (nu va fi livrat de pompă)</string>
<string name="advisoralarm">Rulează alarma când este timpul să mănânci</string>
<string name="no_action_selected">Nicio acțiune selectată, nu se va întâmpla nimic</string>
<string name="carb_equal_zero_no_action">Carbohidrați = 0. Nicio acțiune efectuată!</string>
<string name="wizard_no_insulin_required">Nu este necesară insulină!</string>
<string name="wizard_no_actual_bg">Nicio glicemie recentă pe care să se bazeze calculul!</string>
<string name="wizard_no_active_profile">Niciun profil activ stabilit!</string>
<string name="wizard_no_cob">COB necunoscut! Lipsesc datele de glicemie sau aplicația a fost repornită de curând?</string>

View file

@ -51,6 +51,7 @@
<string name="extended_bolus">Пролонгированный болюс</string>
<string name="paused">На паузе</string>
<string name="tdd_total">Суммарный суточный инсулин TDD</string>
<string name="tdd_old_data">Старые данные</string>
<string name="goingtodeliver">Будет подано %1$.2f ед инс</string>
<string name="waitingforpump">Ожидание помпы</string>
<string name="androidaps_start">AAPS запущен</string>
@ -167,6 +168,8 @@
<string name="virtualpump_uploadstatus_title">Передавать статус помпы в NS или Tidepool</string>
<string name="suspendloop_label">Отключенный/приостановленный цикл</string>
<string name="iob_label">Активный инсулин (IOB)</string>
<string name="loopstatus_targets">ЦЕЛИ:</string>
<string name="loopstatus_OAPS_result">РЕЗУЛЬТАТ: OAPS:</string>
<!-- Protection-->
<string name="wrongpassword">Неверный пароль</string>
<string name="wrongpin">Неверный PIN-код</string>
@ -462,6 +465,8 @@
<string name="bolus_recorded_only">Болюс будет только записан (без подачи помпой)</string>
<string name="advisoralarm">Напомнить о еде</string>
<string name="no_action_selected">Действие не выбрано, ничего не произойдет</string>
<string name="carb_equal_zero_no_action">Carbs = 0. Никаких мер не принято!</string>
<string name="wizard_no_insulin_required">Инсулин не требуется!</string>
<string name="wizard_no_actual_bg">Нет данных ГК для основы расчета!</string>
<string name="wizard_no_active_profile">Активный профиль не установлен!</string>
<string name="wizard_no_cob">Неизвестный COB! Отсутствуют данные ГК или приложения недавно перезапущено?</string>

View file

@ -51,6 +51,7 @@
<string name="extended_bolus">Predĺžený bolus</string>
<string name="paused">Pozastavené</string>
<string name="tdd_total">CDD celkom</string>
<string name="tdd_old_data">Staré dáta</string>
<string name="goingtodeliver">Podávanie %1$.2f J inzulínu</string>
<string name="waitingforpump">Čakám na pumpu</string>
<string name="androidaps_start">AAPS spustený</string>
@ -167,6 +168,8 @@
<string name="virtualpump_uploadstatus_title">Nahrávať stav pumpy do NS, alebo Tidepoolu</string>
<string name="suspendloop_label">Deaktivovaný/pozastavený uzavretý okruh</string>
<string name="iob_label">Aktívny inzulín (IOB)</string>
<string name="loopstatus_targets">CIELE:</string>
<string name="loopstatus_OAPS_result">VÝSLEDOK OAPS:</string>
<!-- Protection-->
<string name="wrongpassword">Nesprávne heslo</string>
<string name="wrongpin">Nesprávny PIN</string>
@ -462,6 +465,8 @@
<string name="bolus_recorded_only">Bolus bude iba zaznamenaný (nie pumpou vydaný)</string>
<string name="advisoralarm">Spustiť výstrahu, keď je čas na jedlo</string>
<string name="no_action_selected">Žiadna akcia nevybraná, nič sa neudeje</string>
<string name="carb_equal_zero_no_action">Sacharidy = 0. Žiadna akcia!</string>
<string name="wizard_no_insulin_required">Nie je požadovaný žiadny inzulín!</string>
<string name="wizard_no_actual_bg">Žiadna aktuálna glykémia k základnému výpočtu!</string>
<string name="wizard_no_active_profile">Nie je nastavený žiadny aktívny profil!</string>
<string name="wizard_no_cob">Neznáme COB! Chýbajú glykémie, alebo bola práve reštartovaná aplikácia?</string>

View file

@ -51,6 +51,7 @@
<string name="extended_bolus">Yayma Bolus</string>
<string name="paused">Duraklatıldı</string>
<string name="tdd_total">GTD Toplam</string>
<string name="tdd_old_data">Eski veri</string>
<string name="goingtodeliver">%1$.2f Ü gönderilecek</string>
<string name="waitingforpump">Pompa bekleniyor</string>
<string name="androidaps_start">AAPS başladı</string>
@ -167,6 +168,8 @@
<string name="virtualpump_uploadstatus_title">Pompa durumunu NS veya Tidepool\'a yükleyin</string>
<string name="suspendloop_label">Döngüyü Devre Dışı bırakma/Askıya alma</string>
<string name="iob_label">Aktif İnsülin (AİNS)</string>
<string name="loopstatus_targets">HEDEFLER:</string>
<string name="loopstatus_OAPS_result">OAPS SONUCU:</string>
<!-- Protection-->
<string name="wrongpassword">Hatalı parola</string>
<string name="wrongpin">Yanlış PIN</string>
@ -462,6 +465,8 @@
<string name="bolus_recorded_only">Bolus yalnızca kaydedilecektir (pompa ile iletilmez)</string>
<string name="advisoralarm">Yemek zamanı alarmı çalıştır</string>
<string name="no_action_selected">Seçili eylem yok, hiçbir şey olmayacak</string>
<string name="carb_equal_zero_no_action">Karb = 0. Hiçbir şey yapılmadı!</string>
<string name="wizard_no_insulin_required">İnsülin gerekmiyor!</string>
<string name="wizard_no_actual_bg">Hesaplamayı temel alacak yeni bir KŞ yok!</string>
<string name="wizard_no_active_profile">Etkin profil ayarlanmadı!</string>
<string name="wizard_no_cob">Aktif karbonhidrat (AKRB) bilinmiyor! KŞ okuması eksik veya son uygulama yeniden başlatılsın mı?</string>

View file

@ -155,5 +155,6 @@
<string name="key_virtual_pump_upload_status" translatable="false">virtualpump_uploadstatus</string>
<string name="key_use_autosens" translatable="false">openapsama_useautosens</string>
<string name="key_used_autosens_on_main_phone" translatable="false">used_autosens_on_main_phone</string>
<string name="key_openapsma_max_basal" translatable="false">openapsma_max_basal</string>
</resources>

View file

@ -181,7 +181,7 @@ class PluginStore @Inject constructor(
get() = activeProfile ?: checkNotNull(activeProfile) { "No profile selected" }
override val activeInsulin: Insulin
get() = activeInsulinStore ?: checkNotNull(activeInsulinStore) { "No insulin selected" }
get() = activeInsulinStore ?: getDefaultPlugin(PluginType.INSULIN) as Insulin
override val activeAPS: APS
get() = activeAPSStore ?: checkNotNull(activeAPSStore) { "No APS selected" }

View file

@ -9,7 +9,6 @@ import app.aaps.core.interfaces.stats.DexcomTIR
import app.aaps.core.interfaces.stats.DexcomTirCalculator
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.MidnightTime
import app.aaps.core.interfaces.utils.T
import app.aaps.database.impl.AppRepository
import javax.inject.Inject
import javax.inject.Singleton
@ -24,7 +23,7 @@ class DexcomTirCalculatorImpl @Inject constructor(
val days = 14L
override fun calculate(): DexcomTIR {
val startTime = MidnightTime.calc(dateUtil.now() - T.days(days).msecs())
val startTime = MidnightTime.calcDaysBack(days)
val endTime = MidnightTime.calc(dateUtil.now())
val bgReadings = repository.compatGetBgReadingsDataFromTime(startTime, endTime, true).blockingGet()

View file

@ -39,9 +39,8 @@ class TddCalculatorImpl @Inject constructor(
) : TddCalculator {
override fun calculate(days: Long, allowMissingDays: Boolean): LongSparseArray<TotalDailyDose>? {
var startTime = MidnightTime.calc(dateUtil.now() - T.days(days).msecs())
var startTime = MidnightTime.calcDaysBack(days)
val endTime = MidnightTime.calc(dateUtil.now())
//val stepSize = T.hours(24).msecs() // this is not true on DST change
val result = LongSparseArray<TotalDailyDose>()
// Try to load cached values

View file

@ -15,7 +15,6 @@ import app.aaps.core.interfaces.stats.TIR
import app.aaps.core.interfaces.stats.TirCalculator
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.MidnightTime
import app.aaps.core.interfaces.utils.T
import app.aaps.database.impl.AppRepository
import javax.inject.Inject
import javax.inject.Singleton
@ -31,7 +30,7 @@ class TirCalculatorImpl @Inject constructor(
override fun calculate(days: Long, lowMgdl: Double, highMgdl: Double): LongSparseArray<TIR> {
if (lowMgdl < 39) throw RuntimeException("Low below 39")
if (lowMgdl > highMgdl) throw RuntimeException("Low > High")
val startTime = MidnightTime.calc(dateUtil.now() - T.days(days).msecs())
val startTime = MidnightTime.calcDaysBack(days)
val endTime = MidnightTime.calc(dateUtil.now())
val bgReadings = repository.compatGetBgReadingsDataFromTime(startTime, endTime, true).blockingGet()

View file

@ -3,75 +3,16 @@ package app.aaps.implementation.utils
import app.aaps.core.interfaces.aps.AutosensDataStore
import app.aaps.core.interfaces.iob.InMemoryGlucoseValue
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.utils.T
import app.aaps.core.interfaces.utils.TrendCalculator
import app.aaps.database.entities.GlucoseValue
import app.aaps.database.impl.AppRepository
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class TrendCalculatorImpl @Inject constructor(
private val repository: AppRepository,
private val rh: ResourceHelper
) : TrendCalculator {
override fun getTrendArrow(glucoseValue: GlucoseValue?): GlucoseValue.TrendArrow =
when {
glucoseValue?.trendArrow == null -> GlucoseValue.TrendArrow.NONE
glucoseValue.trendArrow != GlucoseValue.TrendArrow.NONE -> glucoseValue.trendArrow
else -> calculateDirection(InMemoryGlucoseValue(glucoseValue))
}
override fun getTrendArrow(glucoseValue: InMemoryGlucoseValue?): GlucoseValue.TrendArrow =
when {
glucoseValue?.trendArrow == null -> GlucoseValue.TrendArrow.NONE
glucoseValue.trendArrow != GlucoseValue.TrendArrow.NONE -> glucoseValue.trendArrow
else -> calculateDirection(glucoseValue)
}
override fun getTrendDescription(glucoseValue: GlucoseValue?): String =
when (getTrendArrow(glucoseValue)) {
GlucoseValue.TrendArrow.DOUBLE_DOWN -> rh.gs(app.aaps.core.ui.R.string.a11y_arrow_double_down)
GlucoseValue.TrendArrow.SINGLE_DOWN -> rh.gs(app.aaps.core.ui.R.string.a11y_arrow_single_down)
GlucoseValue.TrendArrow.FORTY_FIVE_DOWN -> rh.gs(app.aaps.core.ui.R.string.a11y_arrow_forty_five_down)
GlucoseValue.TrendArrow.FLAT -> rh.gs(app.aaps.core.ui.R.string.a11y_arrow_flat)
GlucoseValue.TrendArrow.FORTY_FIVE_UP -> rh.gs(app.aaps.core.ui.R.string.a11y_arrow_forty_five_up)
GlucoseValue.TrendArrow.SINGLE_UP -> rh.gs(app.aaps.core.ui.R.string.a11y_arrow_single_up)
GlucoseValue.TrendArrow.DOUBLE_UP -> rh.gs(app.aaps.core.ui.R.string.a11y_arrow_double_up)
GlucoseValue.TrendArrow.NONE -> rh.gs(app.aaps.core.ui.R.string.a11y_arrow_none)
else -> rh.gs(app.aaps.core.ui.R.string.a11y_arrow_unknown)
}
private fun calculateDirection(glucoseValue: InMemoryGlucoseValue): GlucoseValue.TrendArrow {
val toTime = glucoseValue.timestamp
val readings = repository.compatGetBgReadingsDataFromTime(toTime - T.mins(10).msecs(), toTime, false).blockingGet()
if (readings.size < 2)
return GlucoseValue.TrendArrow.NONE
val current = readings[0]
val previous = readings[1]
// Avoid division by 0
val slope =
if (current.timestamp == previous.timestamp) 0.0
else (previous.value - current.value) / (previous.timestamp - current.timestamp)
val slopeByMinute = slope * 60000
return when {
slopeByMinute <= -3.5 -> GlucoseValue.TrendArrow.DOUBLE_DOWN
slopeByMinute <= -2 -> GlucoseValue.TrendArrow.SINGLE_DOWN
slopeByMinute <= -1 -> GlucoseValue.TrendArrow.FORTY_FIVE_DOWN
slopeByMinute <= 1 -> GlucoseValue.TrendArrow.FLAT
slopeByMinute <= 2 -> GlucoseValue.TrendArrow.FORTY_FIVE_UP
slopeByMinute <= 3.5 -> GlucoseValue.TrendArrow.SINGLE_UP
slopeByMinute <= 40 -> GlucoseValue.TrendArrow.DOUBLE_UP
else -> GlucoseValue.TrendArrow.NONE
}
}
override fun getTrendArrow(autosensDataStore: AutosensDataStore): GlucoseValue.TrendArrow? {
val data = autosensDataStore.getBucketedDataTableCopy() ?: return null
if (data.size == 0) return null

View file

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="bg_label">KG</string>
<string name="bg_label">Glikemija</string>
<string name="executing_right_now">Komanda vykdoma</string>
<string name="basal_value_below_minimum">Valandinės bazės vertė mažesnė už minimalią. Profilis nenustatytas!</string>
<string name="permission">Leidimas</string>
<string name="need_whitelisting">%1$s įtraukite į baterijos neoptimizavimo sąrašą tinkamam veikimui užtikrinti</string>
<string name="need_location_permission">Programai reikia vietos nustatymo leidimo, kad būtų galima naudoti Bluetooth ir WiFi</string>
<string name="need_storage_permission">Aplikacijai reikia leidimo prieigai prie saugyklos, kad galėtų išsaugoti žurnalo įrašus ir eksportavimo nustatymus</string>
<string name="need_whitelisting">Įtraukite %1$s į baterijos optimizavimo išimčių sąrašą tinkamam veikimui užtikrinti</string>
<string name="need_location_permission">Reikalingas vietovės leidimas, kad būtų galima naudoti Bluetooth ir WiFi</string>
<string name="need_storage_permission">Reikalingas saugyklos leidimas, kad būtų išsaugomi žurnalo įrašai ir nustatymų eksportai</string>
<!-- Stats -->
<string name="veryLow" comment="below 3.1">Labai žemas</string>
<string name="low" comment="3.1-3.9">Žemas</string>
<string name="high" comment="10.0-13.9">Aukštas</string>
<string name="veryHigh" comment="above 13.9">Labai aukštas</string>
<string name="low" comment="3.1-3.9">Žema</string>
<string name="high" comment="10.0-13.9">Aukšta</string>
<string name="veryHigh" comment="above 13.9">Labai aukšta</string>
<string name="below" comment="below &quot;in range&quot;">Žemiau</string>
<string name="in_range">Ribose</string>
<string name="above" comment="above &quot;in range&quot;">Virš</string>
<string name="hba1c">HbA1c: </string>
<string name="std_deviation">SD: %1$s</string>
<string name="detailed_14_days">14 d. detaliai</string>
<string name="day_tir">Dienos LNR</string>
<string name="night_tir">Nakties LNR</string>
<string name="day_tir">Dienos LTR</string>
<string name="night_tir">Nakties LTR</string>
<string name="carbs_short" comment="max 6 characters">AV</string>
</resources>

View file

@ -331,18 +331,21 @@ class AutotunePlugin @Inject constructor(
jsonSettings.put("tune_insulin_curve", false)
val peakTime: Int = insulinInterface.peak
if (insulinInterface.id === Insulin.InsulinType.OREF_ULTRA_RAPID_ACTING)
jsonSettings.put("curve", "ultra-rapid")
else if (insulinInterface.id === Insulin.InsulinType.OREF_RAPID_ACTING)
jsonSettings.put("curve", "rapid-acting")
else if (insulinInterface.id === Insulin.InsulinType.OREF_LYUMJEV) {
jsonSettings.put("curve", "ultra-rapid")
jsonSettings.put("useCustomPeakTime", true)
jsonSettings.put("insulinPeakTime", peakTime)
} else if (insulinInterface.id === Insulin.InsulinType.OREF_FREE_PEAK) {
jsonSettings.put("curve", if (peakTime > 55) "rapid-acting" else "ultra-rapid")
jsonSettings.put("useCustomPeakTime", true)
jsonSettings.put("insulinPeakTime", peakTime)
when {
insulinInterface.id === Insulin.InsulinType.OREF_ULTRA_RAPID_ACTING -> jsonSettings.put("curve", "ultra-rapid")
insulinInterface.id === Insulin.InsulinType.OREF_RAPID_ACTING -> jsonSettings.put("curve", "rapid-acting")
insulinInterface.id === Insulin.InsulinType.OREF_LYUMJEV -> {
jsonSettings.put("curve", "ultra-rapid")
jsonSettings.put("useCustomPeakTime", true)
jsonSettings.put("insulinPeakTime", peakTime)
}
insulinInterface.id === Insulin.InsulinType.OREF_FREE_PEAK -> {
jsonSettings.put("curve", if (peakTime > 55) "rapid-acting" else "ultra-rapid")
jsonSettings.put("useCustomPeakTime", true)
jsonSettings.put("insulinPeakTime", peakTime)
}
}
jsonString = jsonSettings.toString(4).replace("\\/", "/")
} catch (e: JSONException) {
@ -392,7 +395,7 @@ class AutotunePlugin @Inject constructor(
}
}
for (i in days.weekdays.indices) {
json.put(WeekDay.DayOfWeek.values()[i].name, days.weekdays[i])
json.put(WeekDay.DayOfWeek.entries[i].name, days.weekdays[i])
}
json.put("result", result)
json.put("updateButtonVisibility", updateButtonVisibility)
@ -429,7 +432,7 @@ class AutotunePlugin @Inject constructor(
}
}
for (i in days.weekdays.indices)
days.weekdays[i] = JsonHelper.safeGetBoolean(json, WeekDay.DayOfWeek.values()[i].name, true)
days.weekdays[i] = JsonHelper.safeGetBoolean(json, WeekDay.DayOfWeek.entries[i].name, true)
result = JsonHelper.safeGetString(json, "result", "")
updateButtonVisibility = JsonHelper.safeGetInt(json, "updateButtonVisibility")
lastRunSuccess = true
@ -440,8 +443,8 @@ class AutotunePlugin @Inject constructor(
fun calcDays(daysBack: Int): Int {
var endTime = MidnightTime.calc(dateUtil.now()) + autotuneStartHour * 60 * 60 * 1000L
if (endTime > dateUtil.now()) endTime -= T.days(1).msecs() // Check if 4 AM is before now
val startTime = endTime - daysBack * T.days(1).msecs()
if (endTime > dateUtil.now()) endTime = MidnightTime.calcDaysBack(1) // Check if 4 AM is before now
val startTime = MidnightTime.calcDaysBack(endTime, daysBack.toLong())
var result = 0
for (i in 0 until daysBack) {
if (days.isSet(startTime + i * T.days(1).msecs()))

View file

@ -247,7 +247,7 @@ class OpenAPSAMAPlugin @Inject constructor(
override fun applyBasalConstraints(absoluteRate: Constraint<Double>, profile: Profile): Constraint<Double> {
if (isEnabled()) {
var maxBasal = sp.getDouble(R.string.key_openapsma_max_basal, 1.0)
var maxBasal = sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 1.0)
if (maxBasal < profile.getMaxDailyBasal()) {
maxBasal = profile.getMaxDailyBasal()
absoluteRate.addReason(rh.gs(R.string.increasing_max_basal), this)

View file

@ -58,7 +58,7 @@ open class OpenAPSSMBPlugin @Inject constructor(
private val hardLimits: HardLimits,
private val profiler: Profiler,
private val sp: SP,
private val dateUtil: DateUtil,
protected val dateUtil: DateUtil,
private val repository: AppRepository,
private val glucoseStatusProvider: GlucoseStatusProvider,
private val bgQualityCheck: BgQualityCheck,
@ -107,9 +107,10 @@ open class OpenAPSSMBPlugin @Inject constructor(
override fun preprocessPreferences(preferenceFragment: PreferenceFragmentCompat) {
super.preprocessPreferences(preferenceFragment)
val smbAlwaysEnabled = sp.getBoolean(R.string.key_enableSMB_always, false)
preferenceFragment.findPreference<SwitchPreference>(rh.gs(R.string.key_enableSMB_with_COB))?.isVisible = !smbAlwaysEnabled
preferenceFragment.findPreference<SwitchPreference>(rh.gs(R.string.key_enableSMB_with_temptarget))?.isVisible = !smbAlwaysEnabled
preferenceFragment.findPreference<SwitchPreference>(rh.gs(R.string.key_enableSMB_after_carbs))?.isVisible = !smbAlwaysEnabled
val advancedFiltering = activePlugin.activeBgSource.advancedFilteringSupported()
preferenceFragment.findPreference<SwitchPreference>(rh.gs(R.string.key_enableSMB_with_COB))?.isVisible = !smbAlwaysEnabled || !advancedFiltering
preferenceFragment.findPreference<SwitchPreference>(rh.gs(R.string.key_enableSMB_with_temptarget))?.isVisible = !smbAlwaysEnabled || !advancedFiltering
preferenceFragment.findPreference<SwitchPreference>(rh.gs(R.string.key_enableSMB_after_carbs))?.isVisible = !smbAlwaysEnabled || !advancedFiltering
}
override fun invoke(initiator: String, tempBasalFallback: Boolean) {
@ -313,7 +314,7 @@ open class OpenAPSSMBPlugin @Inject constructor(
override fun applyBasalConstraints(absoluteRate: Constraint<Double>, profile: Profile): Constraint<Double> {
if (isEnabled()) {
var maxBasal = sp.getDouble(R.string.key_openapsma_max_basal, 1.0)
var maxBasal = sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 1.0)
if (maxBasal < profile.getMaxDailyBasal()) {
maxBasal = profile.getMaxDailyBasal()
absoluteRate.addReason(rh.gs(R.string.increasing_max_basal), this)

View file

@ -6,9 +6,11 @@ import app.aaps.core.interfaces.aps.DetermineBasalAdapter
import app.aaps.core.interfaces.bgQualityCheck.BgQualityCheck
import app.aaps.core.interfaces.constraints.Constraint
import app.aaps.core.interfaces.constraints.ConstraintsChecker
import app.aaps.core.interfaces.constraints.Objectives
import app.aaps.core.interfaces.iob.GlucoseStatusProvider
import app.aaps.core.interfaces.iob.IobCobCalculator
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.notifications.Notification
import app.aaps.core.interfaces.plugin.ActivePlugin
import app.aaps.core.interfaces.profile.ProfileFunction
import app.aaps.core.interfaces.profiling.Profiler
@ -16,8 +18,10 @@ import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.stats.TddCalculator
import app.aaps.core.interfaces.ui.UiInteraction
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.HardLimits
import app.aaps.core.interfaces.utils.T
import app.aaps.database.impl.AppRepository
import app.aaps.plugins.aps.R
import app.aaps.plugins.aps.openAPSSMB.DetermineBasalAdapterSMBJS
@ -46,7 +50,9 @@ class OpenAPSSMBDynamicISFPlugin @Inject constructor(
repository: AppRepository,
glucoseStatusProvider: GlucoseStatusProvider,
bgQualityCheck: BgQualityCheck,
tddCalculator: TddCalculator
tddCalculator: TddCalculator,
private val uiInteraction: UiInteraction,
private val objectives: Objectives
) : OpenAPSSMBPlugin(
injector,
aapsLogger,
@ -76,11 +82,21 @@ class OpenAPSSMBDynamicISFPlugin @Inject constructor(
.setDefault(false)
}
override fun specialEnableCondition(): Boolean =
objectives.isStarted(Objectives.DYN_ISF_OBJECTIVE)
// If there is no TDD data fallback to SMB as ISF calculation may be really off
override fun provideDetermineBasalAdapter(): DetermineBasalAdapter =
if (tdd1D == null || tdd7D == null || tddLast4H == null || tddLast8to4H == null || tddLast24H == null || !dynIsfEnabled.value())
if (tdd1D == null || tdd7D == null || tddLast4H == null || tddLast8to4H == null || tddLast24H == null || !dynIsfEnabled.value()) {
uiInteraction.addNotificationValidTo(
Notification.SMB_FALLBACK, dateUtil.now(),
rh.gs(R.string.fallback_smb_no_tdd), Notification.INFO, dateUtil.now() + T.mins(1).msecs()
)
DetermineBasalAdapterSMBJS(ScriptReader(context), injector)
else DetermineBasalAdapterSMBDynamicISFJS(ScriptReader(context), injector)
} else {
uiInteraction.dismissNotification(Notification.SMB_FALLBACK)
DetermineBasalAdapterSMBDynamicISFJS(ScriptReader(context), injector)
}
override fun isAutosensModeEnabled(value: Constraint<Boolean>): Constraint<Boolean> {
value.set(false, rh.gs(R.string.autosens_disabled_in_dyn_isf), this)

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Настройка на чувствителност и кръвна захар</string>
<string name="DynISFAdjust_title" formatted="false">Настройка на динамична инсулинова чувствителност %</string>
<string name="DynISFAdjust_summary" formatted="false">Настройка на динамична инсулинова чувствителност. Настройте над 100% за по-агресивни корекционни дози и под 100% за по-не агресивни корекции.</string>
<string name="high_temptarget_raises_sensitivity_title">Високите временни цели да вдигат ли чувствителността?</string>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Upravit citlivost a glykémii</string>
<string name="dynisf_adjust_sensitivity">Povolit, aby citlivost založená na CDD mohla upravovat bazál a cílovou glykémii</string>
<string name="dynisf_adjust_sensitivity_summary">K výpočtu citlivosti použité pro zvýšení nebo snížení bazálu se používá CDD za posledních 24 h / 7 D a také upravuje cílovou glykémii, pokud je tato možnost povolena, stejně jako to dělá Autosens. Tuto možnost je doporučeno pro začátek vypnout.</string>
<string name="DynISFAdjust_title" formatted="false">Korekční faktor pro DynamicISF v %</string>
<string name="DynISFAdjust_summary" formatted="false">Korekční faktor pro DynamicISF. Pro agresivnější korekční dávky nastavte hodnoty vyšší než 100 %, pro méně agresivní korekce nižší než 100 %.</string>
<string name="high_temptarget_raises_sensitivity_title">Vysoký dočasný cíl zvýší senzitivitu</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Justér følsomhed og BG</string>
<string name="DynISFAdjust_title" formatted="false">DynamiskISF-justeringsfaktor %</string>
<string name="DynISFAdjust_summary" formatted="false">Justeringsfaktor for DynamiskISF. Indstil mere end 100% for mere aggressive korrektionsdoser og mindre end 100% for mindre aggressive korrektioner.</string>
<string name="high_temptarget_raises_sensitivity_title">Høj midlertidig basal øger sensitivitet</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Empfindlichkeit und BZ anpassen</string>
<string name="DynISFAdjust_title" formatted="false">DynamicISF Anpassungsfaktor %</string>
<string name="DynISFAdjust_summary" formatted="false">Anpassungsfaktor für DynamicISF. Stelle mehr als 100 % für aggressivere Korrekturdosen ein, und weniger als 100 % für weniger aggressive Korrekturen.</string>
<string name="high_temptarget_raises_sensitivity_title">Hohe temporäre Ziele erhöhen die Sensitivität</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Ρύθμιση ευαισθησίας και γλυκόζης αίματος</string>
<string name="DynISFAdjust_title" formatted="false">DynamicISF Συντελεστής Προσαρμογής %</string>
<string name="DynISFAdjust_summary" formatted="false">Συντελεστής Προσαρμογής για το DynamicISF. Ρυθμίστε περισσότερο από 100% για πιο επιθετικές διορθωτικές δόσεις και λιγότερο από 100% για λιγότερο επιθετικές διορθώσεις.</string>
<string name="high_temptarget_raises_sensitivity_title">Ο υψηλός προσωρινός στόχος ανεβάζει την ευαισθησία</string>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Ajustar sensibilidad y glucosa</string>
<string name="dynisf_adjust_sensitivity">Habilitar la relación de sensibilidad basada en TDD para modificar las basales y el objetivo de glucosa</string>
<string name="dynisf_adjust_sensitivity_summary">Utiliza las últimas 24h TDD/7D TDD para calcular el ratio de sensibilidad utilizado para aumentar o disminuir la tasa basal, y también ajustar el objetivo de glucosa si estas opciones están activadas, de la misma forma que lo hace Autosens. Se recomienda comenzar con esta opción desactivada</string>
<string name="DynISFAdjust_title" formatted="false">Factor de ajuste de ISF Dinámico %</string>
<string name="DynISFAdjust_summary" formatted="false">Factor de ajuste para ISF Dinámico. Establezca más de 100% para una corrección más agresiva, y menos de 100% para correcciones más susves.</string>
<string name="high_temptarget_raises_sensitivity_title">Objetivo temporal alto aumenta la sensibilidad</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Ajuster la sensibilité et la glycémie</string>
<string name="DynISFAdjust_title" formatted="false">Facteur d\'ajustement Si dynamique %</string>
<string name="DynISFAdjust_summary" formatted="false">Facteur d\'ajustement pour Si dynamique. Définissez plus de 100 % pour des corrections plus agressives et moins de 100 % pour des corrections moins agressives.</string>
<string name="high_temptarget_raises_sensitivity_title">Cible temp. haute élève la sensibilité</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Podesite osjetljivost i GUK</string>
<string name="openapsma_no_glucose_data">Nema dostupnih podataka o glukozi</string>
<string name="description_ama">Stanje algoritma iz 2017.</string>
<string name="description_smb">Najnoviji algoritam za napredne korisnike</string>

View file

@ -1,19 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Regola sensibilità e BG</string>
<string name="dynisf_adjust_sensitivity">Abilita il rapporto di sensibilità basato sul TDD per la modifica della basale e del target del glucosio</string>
<string name="dynisf_adjust_sensitivity_summary">Usa le ultime 24h TDD/7D TDD per calcolare il rapporto di sensibilità utilizzato per aumentare o diminuire la velocità basale e anche per regolare il target di glucosio se le relative opzioni sono abilitate, allo stesso modo in cui fa Autosens. Si consiglia di iniziare con questa opzione disattivata</string>
<string name="DynISFAdjust_title" formatted="false">Fattore di regolazione per ISF Dinamico (%)</string>
<string name="DynISFAdjust_summary" formatted="false">Fattore di regolazione per ISF Dinamico. Imposta più del 100% per dosi di correzione più aggressive e meno del 100% per correzioni meno aggressive.</string>
<string name="high_temptarget_raises_sensitivity_title">Temp-Target \"alto\" aumenta la sensibilità</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Aumenta la sensibilità per temp-target >= 100]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Temp-Target \"basso\" riduce la sensibilità</string>
<string name="low_temptarget_lowers_sensitivity_summary"><![CDATA[Riduci la sensibilità per temp-target < 100]]></string>
<string name="high_temptarget_raises_sensitivity_title">Target temporaneo \"alto\" aumenta la sensibilità</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Aumenta la sensibilità per Target temporaneo >= 100]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Target temporaneo \"basso\" riduce la sensibilità</string>
<string name="low_temptarget_lowers_sensitivity_summary"><![CDATA[Riduci la sensibilità per Target temporaneo < 100]]></string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">ISF Dinamico</string>
<string name="smb_interval_summary">Frequenza erogazione SMB (min)</string>
<string name="resistance_lowers_target_title">La resistenza abbassa il target</string>
<string name="resistance_lowers_target_summary">Quando viene rilevata resistenza, ridurre la glicemia target</string>
<string name="sensitivity_raises_target_title">La sensibilità aumenta il target</string>
<string name="sensitivity_raises_target_summary">Quando viene rilevata sensibilità, aumentare la glicemia target</string>
<string name="sensitivity_raises_target_summary">Quando viene rilevata sensibilità, aumenta la glicemia target</string>
<string name="openapsma_disabled">Il plugin è disabilitato</string>
<string name="openapsma_no_glucose_data">Dati glicemia non disponibili</string>
<string name="openaps_no_as_data">Nessun dato autosens disponibile</string>
@ -46,7 +47,7 @@
<string name="openapsama_autosens_adjust_targets_summary">[Valore predefinito: vero]\nViene usato per consentire ad autosens di regolare i target glicemici, in aggiunta a ISF e basali.</string>
<string name="openapsama_autosens_adjust_targets">Autosens regola anche i target</string>
<string name="openapsama_min_5m_carb_impact_summary">[Valore predefinito: 3.0 (AMA) o 8.0 (SMB)]. Questa è un\'impostazione per l\'impatto di assorbimento predefinito dei carboidrati in 5 minuti. L\'impostazione predefinita è una previsione di 3mg/dl/5min. Ha effetto sulla velocità di decadimento dei COB (carboidrati attivi) e su quanto il loro assorbimento incide nella previsione dellandamento glicemico, quando la glicemia sta scendendo più del previsto o non sta salendo quanto previsto.</string>
<string name="openapsama_max_daily_safety_multiplier_summary">[Valore predefinito: 3] Questo è un parametro di sicurezza chiave in OpenAPS. Ciò che fa è limitare le tue basali a essere 3 volte, al più, la tua velocità basale massima. Probabilmente non avrai bisogno di cambiare questo valore, ma dovresti essere consapevole di cosa significa il gruppo di parametri \"3x max giornaliera; 4x corrente\" e per quali motivi di sicurezza siano stati impostati tali valori.</string>
<string name="openapsama_max_daily_safety_multiplier_summary">[Valore predefinito: 3] Questo è un parametro di sicurezza chiave in OpenAPS. Ciò che fa è limitare la tua basale ad un valore pari alla tua velocità basale massima moltiplicata per 3. Probabilmente non avrai bisogno di cambiare questo valore ma dovresti essere consapevole di cosa significa il gruppo di parametri \"3x max giornaliera; 4x corrente\" e per quali motivi di sicurezza siano stati impostati tali valori.</string>
<string name="openapsama_current_basal_safety_multiplier_summary">[Valore predefinito: 4] Questo è un ulteriore parametro di sicurezza chiave in OpenAPS. La tua basale temporanea, indipendentemente dalla basale massima impostata sul micro, non può mai essere più alta di questo valore moltiplicato per la tua basale corrente in ogni specifico momento. Questo serve a impedire alle persone di addentrarsi in \"territori pericolosi\" impostando basali massime eccessivamente alte prima di aver capito come funziona l\'algoritmo. Ancora una volta, il valore predefinito è 4x; la maggior parte delle persone non avrà bisogno di modificare questo valore e avrà, invece, maggiori probabilità di dover regolare altre impostazioni se ha la sensazione di \"scontrarsi\" con questo limite di sicurezza.</string>
<string name="openapsama_bolus_snooze_dia_divisor_summary">[Valore predefinito: 2]\nBolus snooze è attivato dopo un bolo pasto per fare in modo che il loop non imposti basali temporanee basse quando hai appena mangiato. AndroidAPS non imposterà velocità basali troppo basse nel periodo corrispondente a DIA diviso il parametro bolus snooze - divisore DIA. Con DIA di 3 ore \"bolus snooze\" durerà 1.5 ore (3/2).</string>
<string name="openapsama_link_to_preference_json_doc_txt">Attenzione!\nNormalmente non dovresti modificare questi valori. FAI CLICK QUI e leggi il testo e assicurati di AVERLO CAPITO prima di cambiare uno di questi valori.</string>
@ -55,10 +56,10 @@
<string name="openapsama_max_daily_safety_multiplier">Moltiplicatore di sicurezza max basale giornaliera</string>
<string name="openapsama_current_basal_safety_multiplier">Moltiplicatore di sicurezza basale corrente</string>
<string name="openapssmb_max_iob_title">Max IOB totale a cui limitare OpenAPS [U]</string>
<string name="openapssmb_max_iob_summary">Questo valore è chiamato Max IOB nel contesto OpenAPS\nOpenAPS non aggiungerà ulteriore insulina se IOB corrente è maggiore di questo valore</string>
<string name="openapssmb_max_iob_summary">Questo valore è chiamato Max IOB nel contesto OpenAPS\nOpenAPS non aggiungerà ulteriore insulina se l\'IOB corrente è maggiore di questo valore</string>
<string name="enable_uam">Abilita UAM</string>
<string name="enable_smb">Abilita SMB</string>
<string name="enable_smb_summary">Usa super-micro-boli al posto della basale temporanea per un\'azione più veloce</string>
<string name="enable_smb_summary">Usa super-micro-boli (SMB) al posto della basale temporanea per un\'azione più veloce</string>
<string name="enable_uam_summary">Rilevamento dei pasti non annunciati</string>
<string name="enable_smb_always">Abilita SMB sempre</string>
<string name="enable_smb_always_summary">Abilita SMB sempre, indipendentemente dai boli. Possibile solo con sorgente glicemia con un buon filtraggio dei dati, come G5</string>
@ -75,7 +76,7 @@
<string name="uam_smb_max_minutes_summary">Max minuti di basale a cui limitare SMB per UAM</string>
<string name="carbs_req_threshold">CHO minimi richiesti per il suggerimento</string>
<string name="carbs_req_threshold_summary">Quantità minima di carboidrati (in grammi) necessaria per visualizzare un avviso di suggerimento CHO. Al di sotto di questo numero non verrà attivata alcuna notifica.</string>
<string name="lgs_threshold_summary">Glicemia sotto la quale l\'erogazione d\'insulina è sospesa. Il valore predefinito utilizza il modello target standard. L\'utente può impostare un valore compreso tra 60 mg/dl (3.3mmol/l) e 100mg/dl (5.5mmol/l). Con valori inferiori a 65/3.6 viene usato il modello predefinito</string>
<string name="lgs_threshold_summary">Glicemia sotto la quale l\'erogazione d\'insulina è sospesa. Il valore predefinito utilizza il modello target standard. L\'utente può impostare un valore compreso tra 60 mg/dl (3.3mmol/l) e 100mg/dl (5.5mmol/l). Con valori inferiori a 65 mg/dl (3.6mmol/l) viene usato il modello predefinito</string>
<string name="lgs_threshold_title">Glicemia sotto la quale si attiva la sospensione per glicemia bassa</string>
<string name="increasing_max_basal">Aumento del valore max basale perché l\'impostazione è inferiore alla tua basale massima nel profilo</string>
<string name="max_basal_multiplier">moltiplicatore max basale</string>
@ -83,6 +84,7 @@
<string name="smb_disabled_in_preferences">SMB disabilitato nelle preferenze</string>
<string name="uam_disabled_in_preferences">UAM disabilitato nelle preferenze</string>
<string name="autosens_disabled_in_preferences">Autosens disabilitato nelle preferenze</string>
<string name="autosens_disabled_in_dyn_isf">Autosens disabilitato in ISFdin</string>
<!-- Verify if needed in safety-->
<string name="limiting_iob">Limitazione IOB a %1$.1f U a causa di: %2$s</string>
<string name="maxvalueinpreferences">valore max nelle preferenze</string>
@ -114,4 +116,5 @@
<string name="loop_smb_set_by_pump_label">SMB impostato dal micro</string>
<string name="loop_open_mode_min_change">Richiesta minima di modifica [%]</string>
<string name="loop_open_mode_min_change_summary" formatted="false">Il loop aperto mostrerà una nuova richiesta di modifica solo se la modifica è maggiore di questo valore in %. Il valore predefinito è 20%</string>
<string name="fallback_smb_no_tdd">Ripiego a SMB. Dati TDD insufficienti.</string>
</resources>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">כיוונון הרגישות והסוכר בדם</string>
<string name="DynISFAdjust_title" formatted="false">כיוונון פקטור הרגישות הדינאמית %</string>
<string name="DynISFAdjust_summary" formatted="false">כיוונון פקטור הרגישות הדינאמית. הגדירו יותר מ-100% לקבלת תיקונים אגרסיביים יותר ופחות מ-100% לקבלת תיקונים עדינים יותר.</string>
<string name="high_temptarget_raises_sensitivity_title">ערך מטרה זמני גבוה מעלה את הרגישות</string>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">감도 및 BG 조정</string>
<string name="dynisf_adjust_sensitivity">Basal 및 혈당 목표 수정을 위한 TDD 기반 민감도 비율 활성화</string>
<string name="dynisf_adjust_sensitivity_summary">지난 24시간 TDD/7일 TDD를 사용하여 Basal 증가 또는 감소에 사용되는 민감도 비율을 계산하고, 이 옵션이 활성화된 경우 Autosens와 동일한 방식으로 혈당 목표도 조정합니다. 이 옵션을 끈 상태에서 시작하는 것이 좋습니다.</string>
<string name="DynISFAdjust_title" formatted="false">동적ISF 조정 계수 %</string>
<string name="DynISFAdjust_summary" formatted="false">동적ISF 에 대한 조정 계수. 더 호전적인 보정 양인 경우 100% 이상으로 설정하고, 덜 호전적인 보정의 경우 100% 미만으로 설정합니다.</string>
<string name="high_temptarget_raises_sensitivity_title">높은 임시목표는 민감도를 올립니다.</string>
@ -83,6 +84,7 @@
<string name="smb_disabled_in_preferences">설정에서 SMB가 비활성화 되었습니다.</string>
<string name="uam_disabled_in_preferences">설정에서 UAM이 비활성화 되었습니다.</string>
<string name="autosens_disabled_in_preferences">설정에서 Autosens가 비활성화 되었습니다.</string>
<string name="autosens_disabled_in_dyn_isf">DynISF에서 Autosens 비활성화</string>
<!-- Verify if needed in safety-->
<string name="limiting_iob">%2$s로 인해 IOB가 %1$.1f U으로 제한됩니다.</string>
<string name="maxvalueinpreferences">설정에서의 최대값</string>
@ -114,4 +116,5 @@
<string name="loop_smb_set_by_pump_label">펌프에 의한 SMB 설정</string>
<string name="loop_open_mode_min_change">최소 요청 변경 [%]</string>
<string name="loop_open_mode_min_change_summary" formatted="false">변경 사항이 %의 값보다 큰 경우에만 열린 루프의 새 변경 요청을 팝업합니다. 기본값은 20%입니다.</string>
<string name="fallback_smb_no_tdd">SMB로 폴백. TDD 데이터가 충분하지 않습니다.</string>
</resources>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Derinti jautrumą ir KG</string>
<string name="DynISFAdjust_title" formatted="false">Dinaminio JIF derinimo faktorius %</string>
<string name="DynISFAdjust_summary" formatted="false">Dinaminio JIF derinimo faktorius. Nustatykite daugiau nei 100% agresyvesniam koregavimui arba mažiau nei 100% švelnesniam koregavimui.</string>
<string name="high_temptarget_raises_sensitivity_title">Intensyvus laikinas tikslas didina jautrumą</string>
@ -61,7 +60,7 @@
<string name="enable_smb_summary">Naudoti Super Mikro Bolusus vietoj laikinos bazės greitesniam veikimui</string>
<string name="enable_uam_summary">Nedeklaruoto maisto (NDM) aptikimas</string>
<string name="enable_smb_always">Įjungti SMB visada</string>
<string name="enable_smb_always_summary">Leisti SMB visada, nepriklausomai nuo bolusų. Įmanoma tik naudojant patikimų, filtruotų KG duomenų šaltinį, pvz.: Dexcom G5</string>
<string name="enable_smb_always_summary">Leisti SMB visada, nepriklausomai nuo bolusų. Įmanoma tik naudojant patikimų, filtruotų glikemijos duomenų šaltinį, pvz.: Dexcom.</string>
<string name="enable_smb_after_carbs">Įjungti SMB su angliavandeniais</string>
<string name="enable_smb_after_carbs_summary">Leisti SMB iki 6 val po angliavandenių įvedimo, net jei AAO yra 0. Įmanoma tik naudojant patikimų, filtruotų glikemijos duomenų šaltinį, pvz.: Dexcom</string>
<string name="enable_smb_with_cob">Įjungti SMB su AAO</string>

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Juster sensitivitet og BS</string>
<string name="dynisf_adjust_sensitivity">Aktiver TDD-basert sensitivitetsberegning for justering av basal og blodsukkermål</string>
<string name="dynisf_adjust_sensitivity_summary">Bruker de siste 24t TDD/7D TDD til å beregne sensitivitet som grunnlag til å øke eller redusere basaldosen, samt justere blodsukkermål hvis disse valgene er aktivert, på samme måte som Autosens gjør. Det er anbefalt å starte med dette valget slått av</string>
<string name="DynISFAdjust_title" formatted="false">Dynamisk ISF justeringsfaktor %</string>
<string name="DynISFAdjust_summary" formatted="false">Justeringsfaktor for dynamisk ISF. Verdier over 100% vil gi mer aggressive korreksjonsdoser, mens verdier under 100% vil gi mildere korreksjonsdoser.</string>
<string name="high_temptarget_raises_sensitivity_title">Høyt midl. mål øker sensitiviteten</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Øk sensitiviteten for midl. mål >= 100]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Lavt midl. mål reduserer sensitiviteten</string>
<string name="low_temptarget_lowers_sensitivity_summary"><![CDATA[Reduser sensitiviteten for midl. mål < 100]]></string>
<string name="high_temptarget_raises_sensitivity_title">Høyt midlertidig mål øker sensitiviteten</string>
<string name="high_temptarget_raises_sensitivity_summary"><![CDATA[Øk sensitiviteten for midlertidig mål >= 5,6]]></string>
<string name="low_temptarget_lowers_sensitivity_title">Lavt midlertidig mål reduserer sensitiviteten</string>
<string name="low_temptarget_lowers_sensitivity_summary"><![CDATA[Reduser sensitiviteten for midlertidig mål < 5,6]]></string>
<string name="openapssmb">OpenAPS SMB</string>
<string name="openaps_smb_dynamic_isf">Dynamisk ISF</string>
<string name="smb_interval_summary">Minste antall minutter mellom hver SMB</string>
@ -17,7 +18,7 @@
<string name="openapsma_disabled">Plugin er deaktivert</string>
<string name="openapsma_no_glucose_data">Ingen BS data tilgjengelig</string>
<string name="openaps_no_as_data">Ingen data tilgjengelig for autosens</string>
<string name="dynisf_shortname">DYNISF</string>
<string name="dynisf_shortname">DISF</string>
<string name="executing">Utfører</string>
<string name="openapsama">OpenAPS AMA</string>
<string name="array_of_elements">Liste med %1$d elementer.\nFaktisk verdi:</string>
@ -39,7 +40,7 @@
<string name="openapsma_autosensdata_label">Autosens-data</string>
<string name="openapsma_script_debug_data_label">Script feilsøking</string>
<string name="openapsama_use_autosens">Bruk Autosens-funksjon</string>
<string name="openapsma_max_basal_title">Max E/t en midl. basal kan settes til</string>
<string name="openapsma_max_basal_title">Maks E/t en midlertidig basal kan settes til</string>
<string name="openapsma_max_basal_summary">Denne verdien kalles max basal i OpenAPS</string>
<string name="openapsma_max_iob_title">Maksimum basal IOB som OpenAPS kan levere [E]</string>
<string name="openapsma_max_iob_summary">Denne verdien kalles Max IOB i OpenAPS.\nDet er maks insulinmengde i [E] som APS kan levere i en dose.</string>
@ -58,21 +59,21 @@
<string name="openapssmb_max_iob_summary">Denne verdien kalles Maks IOB av OpenAPS\nAAPS vil ikke gi mere insulin hvis mengden insulin ombord (IOB) overstiger denne verdien</string>
<string name="enable_uam">Aktiver UAM</string>
<string name="enable_smb">Aktiver SMB</string>
<string name="enable_smb_summary">Bruk Supermikrobolus i stedet for midl. basal for raskere resultat</string>
<string name="enable_smb_summary">Bruk Super Micro Boluser i kombinasjon med midlertidig basal for raskere resultat</string>
<string name="enable_uam_summary">Oppdage uannonsert måltid (UAM)</string>
<string name="enable_smb_always">Aktiver SMB alltid</string>
<string name="enable_smb_always_summary">Aktiver SMB alltid uavhengig av boluser. Bare mulig med en bra filtrert BS kilde som f.eks. Dexcom G5/G6</string>
<string name="enable_smb_after_carbs">Aktiver SMB etter karbohydrater</string>
<string name="enable_smb_after_carbs_summary">Aktiver SMB i 6t etter karbohydratinntak, selv med 0 COB. Bare mulig med en bra filtrert BS kilde som f. eks. Dexcom G5/G6</string>
<string name="enable_smb_after_carbs_summary">Aktiver SMB i 6 timer etter inntak av karbohydrater, selv med 0 COB (Karbo ombord). Bare mulig med en bra filtrert BS-kilde som f. eks. Dexcom G5/G6</string>
<string name="enable_smb_with_cob">Aktiver SMB med COB</string>
<string name="enable_smb_with_cob_summary">Aktiver SMB når COB (karbohydrater ombord) er aktiv.</string>
<string name="enable_smb_with_temp_target">Aktiver SMB med midl. målverdi</string>
<string name="enable_smb_with_temp_target_summary">Aktiver SMB når midl. målverdi er aktivert (spise snart, trening)</string>
<string name="enable_smb_with_high_temp_target">Aktiver SMB ved høy midl. målverdi</string>
<string name="enable_smb_with_high_temp_target_summary">Aktiver SMB når det er aktiv midl. målverdi (trening, over 100 mg/dl eller 5,5 mmol/l)</string>
<string name="enable_smb_with_temp_target">Aktiver SMB med midlertidig målverdi</string>
<string name="enable_smb_with_temp_target_summary">Aktiver SMB når midlertidig målverdi er aktivert (spise snart, aktivitet)</string>
<string name="enable_smb_with_high_temp_target">Aktiver SMB ved høy midlertidig målverdi</string>
<string name="enable_smb_with_high_temp_target_summary">Aktiver SMB når det er en høy aktiv midlertidig målverdi (trening, over 100 mg/dl eller 5,5 mmol/l)</string>
<string name="smb_max_minutes_summary">Maks antall minutter med basal som kan bli SMB</string>
<string name="uam_smb_max_minutes">UAM SMB maks minutter</string>
<string name="uam_smb_max_minutes_summary">Maks antall minutter basal som kan bli SMB ved UAM</string>
<string name="uam_smb_max_minutes_summary">Maks antall minutter med basal som kan bli SMB ved UAM</string>
<string name="carbs_req_threshold">Minimumsgrense for KH-forslag</string>
<string name="carbs_req_threshold_summary">Minste KH-mengde i gram som kreves for å vise varsel. Karbohydrater under denne mengden vil ikke utløse et varsel.</string>
<string name="lgs_threshold_summary">Terskelverdi for BS hvor all insulintilførsel stoppes. Bruker kan definere verdier mellom 3.3mmol/l (60mg/dl) og 5.5mmol/l (100mg/dl). Verdier under 3.6/65 bruker standardmodell</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Wijzig gevoeligheid en BG</string>
<string name="DynISFAdjust_title" formatted="false">Dynamische Isf aanpassingsfactor %</string>
<string name="DynISFAdjust_summary" formatted="false">Aanpassingsfactor voor DynamicISF. Stel meer dan 100% in voor een agressievere correctie en minder dan 100% voor minder agressieve correctie.</string>
<string name="high_temptarget_raises_sensitivity_title">Hoog tijdelijk streefdoel verhoogt gevoeligheid</string>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Dostosuj wrażliwość i glikemię</string>
<string name="dynisf_adjust_sensitivity">Włącz współczynnik czułości oparty na DDI dla modyfikacji docelowej dawki bazowej i docelowej glikemii</string>
<string name="dynisf_adjust_sensitivity_summary">Używa 24-godzinną DDI / 7-dniową DDI do obliczenia współczynnika czułości używanego do zwiększania lub zmniejszania dawki bazowej, a także do dostosowania docelowej glikemii, jeśli te opcje są włączone, w ten sam sposób, w jaki robi to Autosens. Zalecane jest rozpoczęcie przy wyłączonej tej opcji</string>
<string name="DynISFAdjust_title" formatted="false">Współczynnik korygujący dynamicznego ISF %</string>
<string name="DynISFAdjust_summary" formatted="false">Współczynnik korygujący dla DynamicISF. Ustaw więcej niż 100% dla bardziej agresywnych dawek korekcyjnych i mniej niż 100% dla mniej agresywnych korekt.</string>
<string name="high_temptarget_raises_sensitivity_title">Wysoki tymczasowy cel zwiększy wrażliwość</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Ajustar sensibilidade e GLIC</string>
<string name="DynISFAdjust_title" formatted="false">Fator de Ajuste FSI dinâmico %</string>
<string name="DynISFAdjust_summary" formatted="false">Fator de ajuste para FSI dinâmico. Defina mais de 100%% para doses de correção mais agressivas e menos de 100%% para correções menos agressivas.</string>
<string name="high_temptarget_raises_sensitivity_title">Alto alvotempo aumenta sensibilidade</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Ajustar sensibilidade e glicemia</string>
<string name="DynISFAdjust_title" formatted="false">% do fator de Ajuste DynamicISF</string>
<string name="DynISFAdjust_summary" formatted="false">Fator de ajuste para DynamicISF. Defina mais de 100% para doses de correção mais agressivas e menos de 100% para correções menos agressivas.</string>
<string name="high_temptarget_raises_sensitivity_title">Alto alvotempo aumenta sensibilidade</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Reglaţi sensibilitatea şi valoarea glicemiei</string>
<string name="DynISFAdjust_title" formatted="false">Factor de ajustare dinamic %</string>
<string name="DynISFAdjust_summary" formatted="false">Factorul de ajustare pentru DynamicISF. Setează mai mult de 100% pentru doze de corecție mai agresive și mai puțin de 100% pentru corecții mai puțin agresive.</string>
<string name="high_temptarget_raises_sensitivity_title">Ținte temporare mai mari cresc sensibilitatea</string>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Настроить чувствительность относительно ГК</string>
<string name="dynisf_adjust_sensitivity">Включить коэффициент чувствительности на основе суточной дозировки инсулина TDD для изменения базальной скорости и целевых значений гликемии</string>
<string name="dynisf_adjust_sensitivity_summary">Если эти опции включены, AAPS использует последние 24 часа TDD/7D TDD для расчета коэффициента чувствительности, на основе которого производится увеличение или снижение скорости базала, а также коррекция целевой гликемии, как и при работе Autosens. Рекомендуется начинать при выключенной опции</string>
<string name="DynISFAdjust_title" formatted="false">Коэффициент регулировки динамического диапазона чувствительности ISF %</string>
<string name="DynISFAdjust_summary" formatted="false">Коэффициент корректировки динамического диапазона чувствительности ISF. Установите более 100% для агрессивных доз коррекции и менее 100% для менее агрессивной коррекции.</string>
<string name="high_temptarget_raises_sensitivity_title">Высокая ВЦ повышает чувствительность</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Upraviť citlivosť a glykémiu</string>
<string name="DynISFAdjust_title" formatted="false">Korekčný faktor pre Dynamickú ISF v %</string>
<string name="DynISFAdjust_summary" formatted="false">Korekčný faktor pre dynamickú ISF. Pre agresivnejšie korekčné dávky nastavte hodnoty väčšie ako 100%, pre menej agresívne korekcie, menšie než 100%.</string>
<string name="high_temptarget_raises_sensitivity_title">Vysoký dočasný cieľ zvýši citlivosť</string>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Justera känslighet och BG</string>
<string name="DynISFAdjust_title" formatted="false">DynamicISF justeringsfaktor %</string>
<string name="DynISFAdjust_summary" formatted="false">Justeringsfaktor för DynamicISF. Ställ in mer än 100% för mer aggressiva korrigeringsdoser, och mindre än 100% för mindre aggressiva korrigeringar.</string>
<string name="high_temptarget_raises_sensitivity_title">Högt målvärde höjer känsligheten</string>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dynisf_adjust_sensitivity">Duyarlılığı ve KŞ\'ni ayarlayın</string>
<string name="dynisf_adjust_sensitivity">Bazal ve glikoz hedefi değişikliği için TGD bazlı duyarlılık oranını etkinleştirin</string>
<string name="dynisf_adjust_sensitivity_summary">Bazal oranı artırmak veya azaltmak için kullanılan duyarlılık oranını hesaplamak için son 24 saatlik TGD/7Gün TGD\'yi kullanır ve aynı zamanda bu seçenek etkinse Otoduyarlılığın yaptığı gibi glikoz hedefini ayarlar. Bu seçenek kapalıyken başlamanız önerilir</string>
<string name="DynISFAdjust_title" formatted="false">DinamikİDF Ayar Faktörü %</string>
<string name="DynISFAdjust_summary" formatted="false">DinamikİDF için ayarlama faktörü. Daha agresif düzeltme dozları için %100\'den fazla ve daha az agresif düzeltmeler için %100\'den az ayarlayın.</string>
<string name="high_temptarget_raises_sensitivity_title">Yüksek geçici hedefler duyarlılığı artırır</string>

View file

@ -22,9 +22,9 @@
<string name="key_lgs_threshold" translatable="false">lgsThreshold</string>
<string name="key_DynISFAdjust" translatable="false">DynISFAdjust</string>
<string name="key_adjust_sensitivity" translatable="false">dynisf_adjust_sensitivity</string>
<string name="key_openapsma_max_basal" translatable="false">openapsma_max_basal</string>
<string name="dynisf_adjust_sensitivity">Adjust sensitivity and BG</string>
<string name="dynisf_adjust_sensitivity">Enable TDD based sensitivity ratio for basal and glucose target modification</string>
<string name="dynisf_adjust_sensitivity_summary">Uses the last 24h TDD/7D TDD to calculate sensitivity ratio used for increasing or decreasing basal rate, and also adjust glucose target if these options are enabled, in the same way Autosens does. It is recommended to start with this option turned off</string>
<string name="DynISFAdjust_title" formatted="false">DynamicISF Adjustment Factor %</string>
<string name="DynISFAdjust_summary" formatted="false">Adjustment factor for DynamicISF. Set more than 100% for more aggressive correction doses, and less than 100% for less aggressive corrections.</string>
<string name="high_temptarget_raises_sensitivity_title">High temptarget raises sensitivity</string>
@ -151,4 +151,5 @@
<string name="fallback_smb_no_tdd">Fallback to SMB. Not enough TDD data.</string>
</resources>
</resources>

View file

@ -52,8 +52,23 @@
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_adjust_sensitivity"
android:summary="@string/dynisf_adjust_sensitivity_summary"
android:title="@string/dynisf_adjust_sensitivity" />
<SwitchPreference
android:defaultValue="true"
android:dependency="@string/key_adjust_sensitivity"
android:key="@string/key_sensitivity_raises_target"
android:summary="@string/sensitivity_raises_target_summary"
android:title="@string/sensitivity_raises_target_title" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_adjust_sensitivity"
android:key="@string/key_resistance_lowers_target"
android:summary="@string/resistance_lowers_target_summary"
android:title="@string/resistance_lowers_target_title" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_use_smb"
@ -140,16 +155,6 @@
android:summary="@string/enable_uam_summary"
android:title="@string/enable_uam" />
<SwitchPreference
android:defaultValue="true"
android:key="@string/key_sensitivity_raises_target"
android:summary="@string/sensitivity_raises_target_summary"
android:title="@string/sensitivity_raises_target_title" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_resistance_lowers_target"
android:summary="@string/resistance_lowers_target_summary"
android:title="@string/resistance_lowers_target_title" />
<!-- TODO AS-FIX -->
<!--<SwitchPreference
android:defaultValue="false"

View file

@ -57,7 +57,7 @@ class InputTime(private val rh: ResourceHelper, private val dateUtil: DateUtil)
})
}
private fun toMills(minutesSinceMidnight: Int): Long = MidnightTime.calcPlusMinutes(minutesSinceMidnight)
private fun toMills(minutesSinceMidnight: Int): Long = MidnightTime.calcMidnightPlusMinutes(minutesSinceMidnight)
private fun getMinSinceMidnight(time: Long): Int = MidnightUtils.secondsFromMidnight(time) / 60

View file

@ -83,7 +83,7 @@ class InputTimeRange(private val rh: ResourceHelper, private val dateUtil: DateU
})
}
private fun toMills(minutesSinceMidnight: Int): Long = MidnightTime.calcPlusMinutes(minutesSinceMidnight)
private fun toMills(minutesSinceMidnight: Int): Long = MidnightTime.calcMidnightPlusMinutes(minutesSinceMidnight)
private fun getMinSinceMidnight(time: Long): Int = MidnightUtils.secondsFromMidnight(time) / 60

View file

@ -13,6 +13,7 @@ import app.aaps.plugins.automation.elements.StaticLabel
import dagger.android.HasAndroidInjector
import org.json.JSONObject
import java.util.Optional
import kotlin.math.roundToInt
class TriggerBg(injector: HasAndroidInjector) : Trigger(injector) {
@ -54,7 +55,7 @@ class TriggerBg(injector: HasAndroidInjector) : Trigger(injector) {
aapsLogger.debug(LTag.AUTOMATION, "NOT ready for execution: " + friendlyDescription())
return false
}
if (comparator.value.check(glucoseStatus.glucose, profileUtil.convertToMgdl(bg.value, bg.units))) {
if (comparator.value.check(glucoseStatus.glucose.roundToInt(), profileUtil.convertToMgdl(bg.value, bg.units).roundToInt())) {
aapsLogger.debug(LTag.AUTOMATION, "Ready for execution: " + friendlyDescription())
return true
}

View file

@ -13,6 +13,7 @@ import app.aaps.plugins.automation.elements.StaticLabel
import dagger.android.HasAndroidInjector
import org.json.JSONObject
import java.util.Optional
import kotlin.math.roundToInt
class TriggerProfilePercent(injector: HasAndroidInjector) : Trigger(injector) {
@ -54,13 +55,13 @@ class TriggerProfilePercent(injector: HasAndroidInjector) : Trigger(injector) {
return false
}
if (profile is ProfileSealed.EPS) {
if (comparator.value.check(profile.value.originalPercentage.toDouble(), pct.value)) {
if (comparator.value.check(profile.value.originalPercentage, pct.value.roundToInt())) {
aapsLogger.debug(LTag.AUTOMATION, "Ready for execution: " + friendlyDescription())
return true
}
}
if (profile is ProfileSealed.Pure) {
if (comparator.value.check(100.0, pct.value)) {
if (comparator.value.check(100, pct.value.roundToInt())) {
aapsLogger.debug(LTag.AUTOMATION, "Ready for execution: " + friendlyDescription())
return true
}

View file

@ -50,7 +50,7 @@ class TriggerRecurringTime(injector: HasAndroidInjector) : Trigger(injector) {
val data = JSONObject()
.put("time", time.value)
for (i in days.weekdays.indices) {
data.put(WeekDay.DayOfWeek.values()[i].name, days.weekdays[i])
data.put(WeekDay.DayOfWeek.entries[i].name, days.weekdays[i])
}
return data
}
@ -58,7 +58,7 @@ class TriggerRecurringTime(injector: HasAndroidInjector) : Trigger(injector) {
override fun fromJSON(data: String): Trigger {
val o = JSONObject(data)
for (i in days.weekdays.indices)
days.weekdays[i] = JsonHelper.safeGetBoolean(o, WeekDay.DayOfWeek.values()[i].name)
days.weekdays[i] = JsonHelper.safeGetBoolean(o, WeekDay.DayOfWeek.entries[i].name)
if (o.has("hour")) {
// do conversion from 2.5.1 format
val hour = JsonHelper.safeGetInt(o, "hour")
@ -90,7 +90,7 @@ class TriggerRecurringTime(injector: HasAndroidInjector) : Trigger(injector) {
override fun duplicate(): Trigger = TriggerRecurringTime(injector, this)
private fun toMills(minutesSinceMidnight: Int): Long = MidnightTime.calcPlusMinutes(minutesSinceMidnight)
private fun toMills(minutesSinceMidnight: Int): Long = MidnightTime.calcMidnightPlusMinutes(minutesSinceMidnight)
private fun getMinSinceMidnight(time: Long): Int = MidnightUtils.secondsFromMidnight(time) / 60

View file

@ -14,6 +14,7 @@ import app.aaps.plugins.automation.elements.StaticLabel
import dagger.android.HasAndroidInjector
import org.json.JSONObject
import java.util.Optional
import kotlin.math.roundToInt
class TriggerTempTargetValue(injector: HasAndroidInjector) : Trigger(injector) {
@ -51,7 +52,7 @@ class TriggerTempTargetValue(injector: HasAndroidInjector) : Trigger(injector) {
aapsLogger.debug(LTag.AUTOMATION, "Ready for execution: " + friendlyDescription())
return true
}
if (tt is ValueWrapper.Existing && comparator.value.check(tt.value.lowTarget, profileUtil.convertToMgdl(ttValue.value, ttValue.units))) {
if (tt is ValueWrapper.Existing && comparator.value.check(tt.value.lowTarget.roundToInt(), profileUtil.convertToMgdl(ttValue.value, ttValue.units).roundToInt())) {
aapsLogger.debug(LTag.AUTOMATION, "Ready for execution: " + friendlyDescription())
return true
}

View file

@ -70,7 +70,7 @@ class TriggerTimeRange(injector: HasAndroidInjector) : Trigger(injector) {
override fun duplicate(): Trigger = TriggerTimeRange(injector, range.start, range.end)
private fun toMills(minutesSinceMidnight: Int): Long = MidnightTime.calcPlusMinutes(minutesSinceMidnight)
private fun toMills(minutesSinceMidnight: Int): Long = MidnightTime.calcMidnightPlusMinutes(minutesSinceMidnight)
private fun getMinSinceMidnight(time: Long): Int = MidnightUtils.secondsFromMidnight(time) / 60

View file

@ -37,7 +37,7 @@
<string name="glucoseisnotavailable">Glicemia non disponibile</string>
<string name="glucosecomparedmgdl">Glicemia %1$s %2$.0f %3$s</string>
<string name="glucosecomparedmmol">Glicemia %1$s %2$.1f %3$s</string>
<string name="notemptarget">Il target temporaneo non esiste</string>
<string name="notemptarget">Il target temporaneo non è impostato</string>
<string name="temptargetcomparedmgdl">Temp-Target %1$s %2$.0f %3$s</string>
<string name="temptargetcomparedmmol">Temp-Target %1$s %2$.1f %3$s</string>
<string name="percentagecompared">PCT profilo %1$s %2$d</string>

View file

@ -73,8 +73,8 @@
<string name="autosenscompared">Autosens %1$s %2$s %%</string>
<string name="autosenslabel">Autosens %</string>
<string name="deltacompared">%3$s %1$s %2$s</string>
<string name="deltalabel">KG skirtumas</string>
<string name="deltalabel_u">KG skirtumas [%1$s]</string>
<string name="deltalabel">Glikemijos skirtumas</string>
<string name="deltalabel_u">Glikemijos skirtumas [%1$s]</string>
<string name="currentlocation">Dabartinė vieta</string>
<string name="location">Vieta</string>
<string name="latitude_short">Platuma:</string>

View file

@ -27,7 +27,7 @@
<string name="sendsmsactionlabel">Send SMS: %1$s</string>
<string name="sendsmsactiondescription">Send SMS til alle numre</string>
<string name="sendsmsactiontext">Send SMS med tekst</string>
<string name="starttemptarget">Start midl. mål</string>
<string name="starttemptarget">Start midlertidig mål</string>
<string name="islesser">er mindre enn</string>
<string name="isequalorlesser">er lik eller mindre enn</string>
<string name="isequal">er lik som</string>
@ -37,9 +37,9 @@
<string name="glucoseisnotavailable">BS-data er ikke tilgjengelig</string>
<string name="glucosecomparedmgdl">BS %1$s %2$.0f %3$s</string>
<string name="glucosecomparedmmol">BS %1$s %2$.1f %3$s</string>
<string name="notemptarget">Midl. mål finnes ikke</string>
<string name="temptargetcomparedmgdl">Midl. mål %1$s %2$.0f %3$s</string>
<string name="temptargetcomparedmmol">Midl. mål %1$s %2$.1f %3$s</string>
<string name="notemptarget">Midlertidig mål finnes ikke</string>
<string name="temptargetcomparedmgdl">Midlertidig mål %1$s %2$.0f %3$s</string>
<string name="temptargetcomparedmmol">Midlertidig mål %1$s %2$.1f %3$s</string>
<string name="percentagecompared">Profilprosent %1$s %2$d</string>
<string name="iobcompared">IOB %1$s %2$.1f</string>
<string name="or">Eller</string>
@ -66,7 +66,7 @@
<string name="delete_short">SLETT</string>
<string name="add_short">LEGG TIL</string>
<string name="copy_short">KOPIER</string>
<string name="temptargetcompared">Midl. mål %1$s</string>
<string name="temptargetcompared">Midlertidig mål %1$s</string>
<string name="btdevicecompared">Bluetoothtilkobling til enheten %1$s %2$s</string>
<string name="btdevice">Tilkobling til Bluetoothenhet </string>
<string name="wifissidcompared">WiFi SSID %1$s %2$s</string>

View file

@ -16,7 +16,7 @@ class TriggerTimeRangeTest : TriggerTestBase() {
@BeforeEach
fun mock() {
now = 754 // in minutes from midnight
val nowMills = MidnightTime.calcPlusMinutes(now.toInt())
val nowMills = MidnightTime.calcMidnightPlusMinutes(now.toInt())
`when`(dateUtil.now()).thenReturn(nowMills)
`when`(rh.gs(R.string.timerange_value)).thenReturn("Time is between %1\$s and %2\$s")
}

View file

@ -17,6 +17,7 @@ import app.aaps.core.interfaces.androidPermissions.AndroidPermission
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.notifications.Notification
import app.aaps.core.interfaces.plugin.ActivePlugin
import app.aaps.core.interfaces.pump.VirtualPump
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator
import app.aaps.core.ui.dialogs.OKDialog
@ -105,20 +106,21 @@ class AndroidPermissionImpl @Inject constructor(
@SuppressLint("MissingPermission")
@Synchronized
override fun notifyForBtConnectPermission(activity: FragmentActivity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// Manifest.permission.BLUETOOTH_CONNECT
if (permissionNotGranted(activity, Manifest.permission.BLUETOOTH_CONNECT) || permissionNotGranted(activity, Manifest.permission.BLUETOOTH_SCAN))
activePlugin.activeOverview.addNotification(
id = Notification.PERMISSION_BT,
text = rh.gs(app.aaps.core.ui.R.string.need_connect_permission),
level = Notification.URGENT,
actionButtonId = R.string.request
) { askForPermission(activity, arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT)) }
else {
activity.startActivity(Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE))
activePlugin.activeOverview.dismissNotification(Notification.PERMISSION_BT)
if (activePlugin.activePump !is VirtualPump)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// Manifest.permission.BLUETOOTH_CONNECT
if (permissionNotGranted(activity, Manifest.permission.BLUETOOTH_CONNECT) || permissionNotGranted(activity, Manifest.permission.BLUETOOTH_SCAN))
activePlugin.activeOverview.addNotification(
id = Notification.PERMISSION_BT,
text = rh.gs(app.aaps.core.ui.R.string.need_connect_permission),
level = Notification.URGENT,
actionButtonId = R.string.request
) { askForPermission(activity, arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT)) }
else {
activity.startActivity(Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE))
activePlugin.activeOverview.dismissNotification(Notification.PERMISSION_BT)
}
}
}
}
@Synchronized

View file

@ -7,11 +7,9 @@ import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.maintenance.PrefFileListProvider
import app.aaps.core.interfaces.maintenance.PrefMetadata
import app.aaps.core.interfaces.maintenance.PrefsFile
import app.aaps.core.interfaces.maintenance.PrefsImportDir
import app.aaps.core.interfaces.maintenance.PrefsMetadataKey
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.weardata.CwfData
import app.aaps.core.interfaces.rx.weardata.CwfFile
import app.aaps.core.interfaces.rx.weardata.EventData
import app.aaps.core.interfaces.rx.weardata.ZipWatchfaceFormat
@ -30,7 +28,6 @@ import org.joda.time.Hours
import org.joda.time.LocalDateTime
import org.joda.time.format.DateTimeFormat
import java.io.File
import java.util.zip.ZipInputStream
import javax.inject.Inject
import kotlin.math.abs
@ -61,41 +58,29 @@ class PrefFileListProviderImpl @Inject constructor(
}
/**
* This function tries to list possible preference files from main SDCard root dir and AAPS/preferences dir
* This function tries to list possible preference files from AAPS/preferences dir
* and tries to do quick assessment for preferences format plausibility.
* It does NOT load full metadata or is 100% accurate - it tries to do QUICK detection, based on:
* - file name and extension
* - predicted file contents
*/
override fun listPreferenceFiles(loadMetadata: Boolean): MutableList<PrefsFile> {
override fun listPreferenceFiles(): MutableList<PrefsFile> {
val prefFiles = mutableListOf<PrefsFile>()
// searching rood dir for legacy files
path.walk().maxDepth(1).filter { it.isFile && (it.name.endsWith(".json") || it.name.contains("Preferences")) }.forEach {
val contents = storage.getFileContents(it)
val detectedNew = encryptedPrefsFormat.isPreferencesFile(it, contents)
if (detectedNew) {
prefFiles.add(PrefsFile(it.name, it, path, PrefsImportDir.ROOT_DIR, metadataFor(loadMetadata, contents)))
}
}
// searching dedicated dir, only for new JSON format
aapsPath.walk().filter { it.isFile && it.name.endsWith(".json") }.forEach {
val contents = storage.getFileContents(it)
if (encryptedPrefsFormat.isPreferencesFile(it, contents)) {
prefFiles.add(PrefsFile(it.name, it, aapsPath, PrefsImportDir.AAPS_DIR, metadataFor(loadMetadata, contents)))
prefFiles.add(PrefsFile(it.name, it, aapsPath, metadataFor(contents)))
}
}
// we sort only if we have metadata to be used for that
if (loadMetadata) {
prefFiles.sortWith(
compareByDescending<PrefsFile> { it.metadata[PrefsMetadataKeyImpl.AAPS_FLAVOUR]?.status as PrefsStatusImpl }
.thenByDescending { it.metadata[PrefsMetadataKeyImpl.CREATED_AT]?.value }
)
}
return prefFiles
val filtered = prefFiles
.filter { it.metadata[PrefsMetadataKeyImpl.AAPS_FLAVOUR]?.status != null }
.filter { (it.metadata[PrefsMetadataKeyImpl.AAPS_FLAVOUR]?.status as PrefsStatusImpl) != PrefsStatusImpl.ERROR }
.toMutableList()
filtered.sortWith(
compareByDescending<PrefsFile> { it.metadata[PrefsMetadataKeyImpl.AAPS_FLAVOUR]?.status as PrefsStatusImpl }
.thenByDescending { it.metadata[PrefsMetadataKeyImpl.CREATED_AT]?.value }
)
return filtered
}
override fun listCustomWatchfaceFiles(): MutableList<CwfFile> {
@ -126,12 +111,8 @@ class PrefFileListProviderImpl @Inject constructor(
return customWatchfaceFiles
}
private fun metadataFor(loadMetadata: Boolean, contents: String): PrefMetadataMap {
if (!loadMetadata) {
return mapOf()
}
return checkMetadata(encryptedPrefsFormat.loadMetadata(contents))
}
private fun metadataFor(contents: String): PrefMetadataMap =
checkMetadata(encryptedPrefsFormat.loadMetadata(contents))
override fun ensureExportDirExists(): File {
if (!aapsPath.exists()) {

View file

@ -39,7 +39,7 @@ class PrefImportListActivity : TranslatedDaggerAppCompatActivity() {
supportActionBar?.setDisplayShowTitleEnabled(true)
binding.recyclerview.layoutManager = LinearLayoutManager(this)
binding.recyclerview.adapter = RecyclerViewAdapter(prefFileListProvider.listPreferenceFiles(loadMetadata = true))
binding.recyclerview.adapter = RecyclerViewAdapter(prefFileListProvider.listPreferenceFiles())
}
inner class RecyclerViewAdapter internal constructor(private var prefFileList: List<PrefsFile>) : RecyclerView.Adapter<RecyclerViewAdapter.PrefFileViewHolder>() {

View file

@ -9,7 +9,7 @@ class SWButton(injector: HasAndroidInjector) : SWItem(injector, Type.BUTTON) {
private var buttonRunnable: Runnable? = null
private var buttonText = 0
private var buttonValidator: (() -> Boolean)? = { false }
private var buttonValidator: (() -> Boolean)? = null
private var button: Button? = null
fun text(buttonText: Int): SWButton {

View file

@ -88,7 +88,7 @@
<string name="preferences_export_canceled">Esportazione annullata! Le preferenze NON sono state esportate!</string>
<string name="preferences_import_canceled">Importazione annullata! Le preferenze NON sono state importate!</string>
<string name="preferences_import_impossible">Impossibile importare le preferenze!</string>
<string name="check_preferences_details_btn">Descrivi i problemi importazione…</string>
<string name="check_preferences_details_btn">Descrivi i problemi di importazione…</string>
<string name="check_preferences_details_title">Dettagli dei problemi di importazione</string>
<string name="check_preferences_import_btn">Importa</string>
<string name="check_preferences_import_anyway_btn">Importa comunque (PERICOLOSO!)</string>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="units">Vienetai</string>
<string name="setupwizard_units_prompt">Pasirinkite vienetus, kurių vertes norite parodyti</string>
<string name="next_button">Kitas</string>
<string name="previous_button">Ankstesnis</string>
<string name="setupwizard_units_prompt">Pasirinkite glikemijos matavimo vienetus</string>
<string name="next_button">Toliau</string>
<string name="previous_button">Atgal</string>
<string name="nav_setupwizard">Sąrankos vedlys</string>
<string name="setupwizard_finish">UŽBAIGTI</string>
<string name="welcome">Sveiki</string>
@ -17,22 +17,22 @@
<string name="low_mark_comment">Mažiausia tikslinės srities vertė (tik rodymui)</string>
<string name="high_mark_comment">Didžiausia tikslinės srities vertė (tik rodymui)</string>
<string name="permission">Leidimas</string>
<string name="need_system_window_permission">Norint gauti pranešimus, programai reikalingas sisteminio lango leidimas</string>
<string name="need_system_window_permission">Programai reikalingas leidimas rodyti virš kitų programų</string>
<string name="need_location_permission">Programai reikia vietos nustatymo leidimo, kad būtų galima naudoti Bluetooth ir WiFi</string>
<string name="need_storage_permission">Aplikacijai reikia leidimo prieigai prie saugyklos, kad galėtų išsaugoti žurnalo įrašus ir eksportavimo nustatymus</string>
<string name="need_storage_permission">Programai reikia leidimo prieigai prie saugyklos, kad būtų išsaugomi žurnalo įrašai ir nustatymų eksportai</string>
<string name="askforpermission">Prašyti leidimo</string>
<string name="need_whitelisting">%1$s įtraukite į baterijos neoptimizavimo sąrašą tinkamam veikimui užtikrinti</string>
<string name="need_whitelisting">Įtraukite %1$s į baterijos optimizavimo išimčių sąrašą tinkamam veikimui užtikrinti</string>
<string name="storedsettingsfound">Rasti išsaugoti nustatymai</string>
<string name="master_password_summary">Pagrindinis slaptažodis naudojamas atsarginiam šifravimui ir programos saugumo ignoravimui. Atsiminkite jį arba laikykite užsirašę saugioje vietoje.</string>
<string name="master_password_summary">Pagrindinis slaptažodis naudojamas atsarginės nustatymų kopijos šifravimui ir programos saugumui užtikrinti. Atsiminkite jį arba užsirašykite saugioje vietoje.</string>
<string name="current_master_password">Dabartinis pagrindinis slaptažodis</string>
<string name="common_values">Naudokite gausiausio patiekalo, kurį paprastai valgote, reikšmes\n</string>
<string name="syncinfotext">Sinchronizuokite duomenis debesyje. Jūs galite kol kas praleisti šį veiksmą, bet negalėsite baigti mokymosi programos, kol nenustatysite duomenų perdavimo į Nightscout arba Tidepool.</string>
<string name="status">Statusas:</string>
<string name="patient_name">Paciento vardas</string>
<string name="patient_name_summary">Pateikite paciento vardą arba slapyvardį, kad galima būtų atskirti tarp skirtingų konfigūracijų.</string>
<string name="patient_name_summary">Įrašykite paciento vardą arba slapyvardį, kad galima būtų atskirti tarp skirtingų konfigūracijų.</string>
<string name="privacy_settings">Privatumo nuostatos</string>
<string name="privacy_summary">Nurodykite el. pašto adresą (neprivaloma), jei norite gauti informaciją apie programos strigimus. Tai nėra automatizuota paslauga. Kūrėjai susisieks esant pavojingoms situacijoms.</string>
<string name="diawarning">Atminkite: DKS profiliams reikia IVT bent 5 val. IVT = 5 - 6 val DKS profilyje atitinka IVT = 3 val sename (pompos terapijos) insulino profilyje.</string>
<string name="privacy_summary">Nurodykite el. pašto adresą (neprivaloma), jei norite gauti informaciją apie programos klaidas. Tai nėra automatizuota paslauga. Kūrėjai susisieks esant pavojingoms situacijoms.</string>
<string name="diawarning">Svarbu: DKS profiliuose IVT turi būti bent 5 val. Tai atitinka 3 val. IVT įprastoje pompos terapijoje.</string>
<string name="profile">Profilis</string>
<string name="doprofileswitch">Profilio keitimas</string>
<string name="exitwizard">Praleisti sąrankos vedlį</string>
@ -48,7 +48,7 @@
<string name="data_choices">Duomenų pasirinkimas</string>
<string name="fabric_upload">Duomenų perdavimas kūrėjams</string>
<string name="allow_automated_crash_reporting">Leisti automatinį pranešimų apie programos trikdžius ir funkcijų naudojimo duomenų siuntimą kūrėjams, naudojant fabric.io servisą.</string>
<string name="summary_email_for_crash_report">Šis identifikatorius bus pridėtas prie gedimų ataskaitų, kad skubiais atvejais galėtume su jumis susisiekti. Jis neprivalomas.</string>
<string name="summary_email_for_crash_report">Šis identifikatorius bus pridėtas prie gedimų ataskaitų, kad skubiais atvejais galėtume su Jumis susisiekti. Jis neprivalomas.</string>
<string name="identification">Identifikacija (el. paštas, FB, Discord slapyvardis ar kt.)</string>
<string name="request">Užklausa</string>
<string name="apsmode_title">DKS režimas</string>
@ -155,7 +155,7 @@
<!-- Custom Watchface -->
<string name="wear_import_custom_watchface_title">Pasirinkite laikrodžio ekraną</string>
<!-- Permissions -->
<string name="alert_dialog_storage_permission_text">Prašome perkrauti telefoną arba sistemos nustatymuose iš naujo paleisti AAPS \nkitaip AndroidAPS negalės registruoti prisijungimų (svarbu stebėti ir tikrinti, ar algoritmai veikia tinkamai)!</string>
<string name="alert_dialog_storage_permission_text">Iš naujo paleiskite telefoną arba sistemos nustatymuose iš naujo paleiskite AAPS \nkitaip AAPS negalės registruoti žurnalo įrašų (jie svarbūs stebint ir tikrinant, ar algoritmai veikia tinkamai)!</string>
<!-- Maintenance -->
<string name="metadata_label_format">Failo formatas</string>
<string name="metadata_label_created_at">Sukurta</string>

View file

@ -46,7 +46,7 @@
<string name="setupwizard_pump_riley_link_status">RileyLink status:</string>
<string name="readstatus">Lesestatus</string>
<string name="data_choices">Datavalg</string>
<string name="fabric_upload">Innlesing av fabrikkinnstillinger</string>
<string name="fabric_upload">Send krasjrapporter automatisk</string>
<string name="allow_automated_crash_reporting">Tillat automatisk rapportering av appkrasj og bruksdata til utviklerne via fabrioc.io-tjenesten.</string>
<string name="summary_email_for_crash_report">Denne e-postadressen vedlegges krasjrapporter slik at vi kan kontakte deg i akutte tilfeller. Det er valgfritt.</string>
<string name="identification">Identifikasjon (e-post, Facebook eller Discord-nick osv.)</string>
@ -153,7 +153,7 @@
<string name="prefdecrypt_issue_wrong_format">Mangler krypteringsinformasjon, formatet på innstillinger er ugyldig!</string>
<string name="prefdecrypt_issue_wrong_algorithm">Ugyldig eller ikke spesifisert krypteringsalgoritme!</string>
<!-- Custom Watchface -->
<string name="wear_import_custom_watchface_title">Velg tilpasset klokkebakgrunn</string>
<string name="wear_import_custom_watchface_title">Velg tilpasset urskive</string>
<!-- Permissions -->
<string name="alert_dialog_storage_permission_text">Vennligst start mobilen på nytt eller restart AAPS fra Innstillinger \nellers vil ikke AAPS ha aktivert loggføring (viktig for å spore og kontrollere at algoritmene fungerer riktig)!</string>
<!-- Maintenance -->

View file

@ -2,11 +2,13 @@ package app.aaps.plugins.constraints.di
import app.aaps.core.interfaces.bgQualityCheck.BgQualityCheck
import app.aaps.core.interfaces.constraints.ConstraintsChecker
import app.aaps.core.interfaces.constraints.Objectives
import app.aaps.core.interfaces.versionChecker.VersionCheckerUtils
import dagger.Binds
import dagger.Module
import app.aaps.plugins.constraints.ConstraintsCheckerImpl
import app.aaps.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin
import app.aaps.plugins.constraints.objectives.ObjectivesPlugin
import app.aaps.plugins.constraints.versionChecker.VersionCheckerUtilsImpl
@Module(
@ -25,5 +27,6 @@ abstract class PluginsConstraintsModule {
@Binds fun bindVersionCheckerUtils(versionCheckerUtils: VersionCheckerUtilsImpl): VersionCheckerUtils
@Binds fun bindBgQualityCheck(bgQualityCheck: BgQualityCheckPlugin): BgQualityCheck
@Binds fun bindsConstraintChecker(constraintsCheckerImpl: ConstraintsCheckerImpl): ConstraintsChecker
@Binds fun bindsObjectives(objectivesPlugin: ObjectivesPlugin): Objectives
}
}

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