Merge branch 'dev' into omnipod_eros_dev_upstream_merge
This commit is contained in:
commit
d49f0571b2
148 changed files with 2088 additions and 850 deletions
|
@ -22,14 +22,6 @@ jacoco {
|
|||
toolVersion = "0.8.3"
|
||||
}
|
||||
|
||||
ext {
|
||||
powermockVersion = "1.7.3"
|
||||
dexmakerVersion = "1.2"
|
||||
retrofit2Version = '2.9.0'
|
||||
okhttp3Version = '4.9.0'
|
||||
}
|
||||
|
||||
|
||||
repositories {
|
||||
jcenter { url "https://jcenter.bintray.com/" }
|
||||
mavenCentral()
|
||||
|
@ -230,11 +222,9 @@ android {
|
|||
|
||||
allprojects {
|
||||
repositories {
|
||||
jcenter()
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -250,63 +240,6 @@ dependencies {
|
|||
implementation project(':omnipod')
|
||||
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.google.android.gms:play-services-wearable:17.0.0'
|
||||
implementation 'com.google.android.gms:play-services-location:17.1.0'
|
||||
implementation platform('com.google.firebase:firebase-bom:25.12.0')
|
||||
implementation "com.google.firebase:firebase-analytics-ktx"
|
||||
implementation 'com.google.firebase:firebase-auth-ktx'
|
||||
implementation 'com.google.firebase:firebase-database-ktx'
|
||||
|
||||
implementation "androidx.appcompat:appcompat:$appcompat_verison"
|
||||
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.biometric:biometric:1.0.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
||||
implementation 'androidx.percentlayout:percentlayout:1.0.0'
|
||||
implementation "androidx.preference:preference-ktx:$preferencektx_version"
|
||||
implementation "androidx.activity:activity-ktx:${activityVersion}"
|
||||
implementation "androidx.fragment:fragment-ktx:${fragmentktx_version}"
|
||||
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
|
||||
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
|
||||
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
|
||||
implementation "com.google.android.material:material:$material_version"
|
||||
|
||||
implementation "io.reactivex.rxjava2:rxandroid:${rxandroid_version}"
|
||||
|
||||
implementation "com.j256.ormlite:ormlite-core:${ormLiteVersion}"
|
||||
implementation "com.j256.ormlite:ormlite-android:${ormLiteVersion}"
|
||||
implementation("com.github.tony19:logback-android-classic:1.1.1-6") {
|
||||
exclude group: "com.google.android", module: "android"
|
||||
}
|
||||
implementation "org.apache.commons:commons-lang3:$commonslang3_version"
|
||||
implementation 'org.slf4j:slf4j-api:1.7.30'
|
||||
// Graphview cannot be upgraded
|
||||
implementation "com.jjoe64:graphview:4.0.1"
|
||||
implementation "com.joanzapata.iconify:android-iconify-fontawesome:2.2.2"
|
||||
implementation 'com.madgag.spongycastle:core:1.58.0.0'
|
||||
implementation("com.google.android:flexbox:0.3.0") {
|
||||
exclude group: "com.android.support"
|
||||
}
|
||||
implementation("io.socket:socket.io-client:1.0.0") {
|
||||
// excluding org.json which is provided by Android
|
||||
exclude group: "org.json", module: "json"
|
||||
}
|
||||
implementation "com.google.code.gson:gson:2.8.6"
|
||||
implementation('com.google.guava:guava:30.0-jre') {
|
||||
exclude group: "com.google.code.findbugs", module: "jsr305"
|
||||
}
|
||||
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
|
||||
implementation 'net.danlew:android.joda:2.10.6'
|
||||
|
||||
implementation 'org.mozilla:rhino:1.7.13'
|
||||
|
||||
implementation 'com.github.DavidProdinger:weekdays-selector:1.1.0'
|
||||
|
||||
implementation 'com.github.kenglxn.QRGen:android:2.6.0'
|
||||
implementation 'com.eatthepath:java-otp:0.2.0'
|
||||
|
||||
testImplementation "junit:junit:$junit_version"
|
||||
testImplementation 'org.json:json:20200518'
|
||||
|
@ -323,31 +256,16 @@ dependencies {
|
|||
testImplementation "org.skyscreamer:jsonassert:1.5.0"
|
||||
testImplementation "org.hamcrest:hamcrest-all:1.3"
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
|
||||
|
||||
// new for tidepool
|
||||
implementation "com.squareup.okhttp3:okhttp:$okhttp3Version"
|
||||
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3Version"
|
||||
implementation "com.squareup.retrofit2:retrofit:$retrofit2Version"
|
||||
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit2Version"
|
||||
implementation "com.squareup.retrofit2:converter-gson:$retrofit2Version"
|
||||
|
||||
// Phone checker
|
||||
implementation 'com.scottyab:rootbeer-lib:0.0.8'
|
||||
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha03'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test:rules:1.3.0-beta01'
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidx_junit"
|
||||
androidTestImplementation "androidx.test:rules:$androidx_rules"
|
||||
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
|
||||
/* Dagger2 - We are going to use dagger.android which includes
|
||||
* support for Activity and fragment injection so we need to include
|
||||
* the following dependencies */
|
||||
implementation "com.google.dagger:dagger-android:$dagger_version"
|
||||
implementation "com.google.dagger:dagger-android-support:$dagger_version"
|
||||
|
||||
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
|
@ -356,15 +274,6 @@ dependencies {
|
|||
kapt "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
|
||||
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
||||
|
||||
//WorkManager
|
||||
implementation "androidx.work:work-runtime:$work_version"
|
||||
implementation "androidx.work:work-runtime-ktx:$work_version"
|
||||
implementation "androidx.work:work-rxjava2:$work_version"
|
||||
|
||||
implementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.0.0'
|
||||
|
||||
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="info.nightscout.androidaps">
|
||||
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
@ -71,6 +72,10 @@
|
|||
<activity android:name=".activities.ProfileHelperActivity"
|
||||
android:theme="@style/ProfileHelperAppTheme" />
|
||||
<activity android:name=".activities.StatsActivity" />
|
||||
<activity
|
||||
android:name="com.google.firebase.auth.internal.FederatedSignInActivity"
|
||||
tools:replace="android:launchMode"
|
||||
android:launchMode="standard" />
|
||||
|
||||
<!-- Receive new BG readings from other local apps -->
|
||||
<receiver
|
||||
|
|
|
@ -2,3 +2,5 @@
|
|||
51:6D:12:67:4C:27:F4:9B:9F:E5:42:9B:01:B3:98:E4:66:2B:85:B7:A8:DD:70:32:B7:6A:D7:97:9A:0D:97:10
|
||||
#Leaked
|
||||
55:5D:70:C9:BE:10:41:7E:4B:01:A9:C4:C6:44:4A:F8:69:71:35:25:ED:95:23:16:C7:15:E8:EB:C6:08:FC:B1
|
||||
E0:71:A3:6E:96:60:5A:FC:B3:77:DB:2F:C4:E0:92:F3:39:A6:27:24:91:F5:7E:BB:55:9B:60:C6:CC:A3:03:41
|
||||
32:99:61:C4:A0:92:E8:D2:C7:65:04:74:04:17:7E:2D:2A:16:2A:5A:63:48:69:6A:0A:C4:53:3C:7C:78:22:95
|
||||
|
|
|
@ -27,6 +27,7 @@ import androidx.viewpager2.widget.ViewPager2
|
|||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
import com.joanzapata.iconify.Iconify
|
||||
import com.joanzapata.iconify.fonts.FontAwesomeModule
|
||||
import dev.doubledot.doki.ui.DokiActivity
|
||||
import info.nightscout.androidaps.activities.ProfileHelperActivity
|
||||
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity
|
||||
import info.nightscout.androidaps.activities.PreferencesActivity
|
||||
|
@ -135,12 +136,12 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
if (it.recreate) recreate()
|
||||
else setupViews()
|
||||
setWakeLock()
|
||||
}) { fabricPrivacy::logException }
|
||||
}, fabricPrivacy::logException )
|
||||
)
|
||||
disposable.add(rxBus
|
||||
.toObservable(EventPreferenceChange::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ processPreferenceChange(it) }) { fabricPrivacy::logException }
|
||||
.subscribe({ processPreferenceChange(it) }, fabricPrivacy::logException )
|
||||
)
|
||||
if (!sp.getBoolean(R.string.key_setupwizard_processed, false) && !isRunningRealPumpTest()) {
|
||||
val intent = Intent(this, SetupWizardActivity::class.java)
|
||||
|
@ -172,8 +173,8 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
override fun onResume() {
|
||||
super.onResume()
|
||||
protectionCheck.queryProtection(this, ProtectionCheck.Protection.APPLICATION, null,
|
||||
UIRunnable(Runnable { OKDialog.show(this, "", resourceHelper.gs(R.string.authorizationfailed), Runnable { finish() }) }),
|
||||
UIRunnable(Runnable { OKDialog.show(this, "", resourceHelper.gs(R.string.authorizationfailed), Runnable { finish() }) })
|
||||
UIRunnable { OKDialog.show(this, "", resourceHelper.gs(R.string.authorizationfailed)) { finish() } },
|
||||
UIRunnable { OKDialog.show(this, "", resourceHelper.gs(R.string.authorizationfailed)) { finish() } }
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -192,14 +193,14 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
val pageAdapter = TabPageAdapter(this)
|
||||
main_navigation_view.setNavigationItemSelectedListener { true }
|
||||
val menu = main_navigation_view.menu.also { it.clear() }
|
||||
for (p in activePlugin.pluginsList) {
|
||||
for (p in activePlugin.getPluginsList()) {
|
||||
pageAdapter.registerNewFragment(p)
|
||||
if (p.isEnabled() && p.hasFragment() && !p.isFragmentVisible() && !p.pluginDescription.neverVisible) {
|
||||
val menuItem = menu.add(p.name)
|
||||
menuItem.isCheckable = true
|
||||
menuItem.setOnMenuItemClickListener {
|
||||
val intent = Intent(this, SingleFragmentActivity::class.java)
|
||||
intent.putExtra("plugin", activePlugin.pluginsList.indexOf(p))
|
||||
intent.putExtra("plugin", activePlugin.getPluginsList().indexOf(p))
|
||||
startActivity(intent)
|
||||
main_drawer_layout.closeDrawers()
|
||||
true
|
||||
|
@ -273,7 +274,7 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.nav_preferences -> {
|
||||
protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, Runnable {
|
||||
protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, {
|
||||
val i = Intent(this, PreferencesActivity::class.java)
|
||||
i.putExtra("id", -1)
|
||||
startActivity(i)
|
||||
|
@ -304,9 +305,10 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
.setIcon(iconsProvider.getIcon())
|
||||
.setMessage(messageSpanned)
|
||||
.setPositiveButton(resourceHelper.gs(R.string.ok), null)
|
||||
.create().also {
|
||||
it.show()
|
||||
(it.findViewById<View>(android.R.id.message) as TextView).movementMethod = LinkMovementMethod.getInstance()
|
||||
.setNeutralButton(resourceHelper.gs(R.string.cta_dont_kill_my_app_info)) { _, _ -> DokiActivity.start(context = this@MainActivity) }
|
||||
.create().apply {
|
||||
show()
|
||||
findViewById<TextView>(android.R.id.message)?.movementMethod = LinkMovementMethod.getInstance()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
@ -321,7 +323,7 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
|
||||
R.id.nav_plugin_preferences -> {
|
||||
val plugin = (main_pager.adapter as TabPageAdapter).getPluginAt(main_pager.currentItem)
|
||||
protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, Runnable {
|
||||
protectionCheck.queryProtection(this, ProtectionCheck.Protection.PREFERENCES, {
|
||||
val i = Intent(this, PreferencesActivity::class.java)
|
||||
i.putExtra("id", plugin.preferencesId)
|
||||
startActivity(i)
|
||||
|
|
|
@ -61,6 +61,7 @@ import javax.inject.Inject
|
|||
class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListener, HasAndroidInjector {
|
||||
|
||||
private var pluginId = -1
|
||||
private var filter = ""
|
||||
|
||||
@Inject lateinit var rxBus: RxBusWrapper
|
||||
@Inject lateinit var resourceHelper: ResourceHelper
|
||||
|
@ -115,11 +116,13 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
|
|||
override fun setArguments(args: Bundle?) {
|
||||
super.setArguments(args)
|
||||
pluginId = args?.getInt("id") ?: -1
|
||||
filter = args?.getString("filter") ?: ""
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
outState.putInt("id", pluginId)
|
||||
outState.putString("filter", filter)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
@ -150,6 +153,9 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
|
|||
if (bundle.containsKey("id")) {
|
||||
pluginId = bundle.getInt("id")
|
||||
}
|
||||
if (bundle.containsKey("filter")) {
|
||||
filter = bundle.getString("filter") ?: ""
|
||||
}
|
||||
}
|
||||
if (pluginId != -1) {
|
||||
addPreferencesFromResource(pluginId, rootKey)
|
||||
|
@ -191,6 +197,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
|
|||
}
|
||||
initSummary(preferenceScreen, pluginId != -1)
|
||||
preprocessPreferences()
|
||||
if (filter != "") updateFilterVisibility(filter, preferenceScreen)
|
||||
}
|
||||
|
||||
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
|
||||
|
@ -288,6 +295,33 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
|
|||
}
|
||||
}
|
||||
|
||||
private fun updateFilterVisibility(filter: String, p: Preference): Boolean {
|
||||
|
||||
var visible = false
|
||||
|
||||
if (p is PreferenceGroup) {
|
||||
for (i in 0 until p.preferenceCount) {
|
||||
visible = updateFilterVisibility(filter, p.getPreference(i)) || visible
|
||||
}
|
||||
if (visible && p is PreferenceCategory) {
|
||||
p.initialExpandedChildrenCount = Int.MAX_VALUE
|
||||
}
|
||||
} else {
|
||||
if (p.key != null) {
|
||||
visible = visible || p.key.contains(filter, true)
|
||||
}
|
||||
if (p.title != null) {
|
||||
visible = visible || p.title.contains(filter, true)
|
||||
}
|
||||
if (p.summary != null) {
|
||||
visible = visible || p.summary.contains(filter, true)
|
||||
}
|
||||
}
|
||||
|
||||
p.isVisible = visible
|
||||
return visible
|
||||
}
|
||||
|
||||
private fun updatePrefSummary(pref: Preference?) {
|
||||
if (pref is ListPreference) {
|
||||
pref.setSummary(pref.entry)
|
||||
|
@ -391,4 +425,9 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
|
|||
}
|
||||
return super.onPreferenceTreeClick(preference)
|
||||
}
|
||||
|
||||
public fun setFilter(filter: String) {
|
||||
this.filter = filter
|
||||
updateFilterVisibility(filter, preferenceScreen)
|
||||
}
|
||||
}
|
|
@ -2,11 +2,15 @@ package info.nightscout.androidaps.activities
|
|||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.PreferenceScreen
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.utils.locale.LocaleHelper
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import kotlinx.android.synthetic.main.activity_preferences.*
|
||||
import kotlinx.android.synthetic.main.local_insight_status_item.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class PreferencesActivity : NoSplashAppCompatActivity(), PreferenceFragmentCompat.OnPreferenceStartScreenCallback {
|
||||
|
@ -14,18 +18,35 @@ class PreferencesActivity : NoSplashAppCompatActivity(), PreferenceFragmentCompa
|
|||
@Inject lateinit var resourceHelper: ResourceHelper
|
||||
|
||||
var preferenceId = 0
|
||||
var myPreferenceFragment: MyPreferenceFragment? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_single_fragment)
|
||||
setContentView(R.layout.activity_preferences)
|
||||
|
||||
pref_filter.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
|
||||
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
|
||||
filterPreferences()
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable) {}
|
||||
})
|
||||
|
||||
pref_filter_clear.setOnClickListener() {
|
||||
pref_filter.setText("");
|
||||
}
|
||||
|
||||
title = resourceHelper.gs(R.string.nav_preferences)
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
supportActionBar?.setDisplayShowHomeEnabled(true)
|
||||
val myPreferenceFragment = MyPreferenceFragment()
|
||||
myPreferenceFragment = MyPreferenceFragment()
|
||||
preferenceId = intent.getIntExtra("id", -1)
|
||||
val args = Bundle()
|
||||
args.putInt("id", preferenceId)
|
||||
myPreferenceFragment.arguments = args
|
||||
supportFragmentManager.beginTransaction().replace(R.id.frame_layout, myPreferenceFragment).commit()
|
||||
args.putString("filter", pref_filter.text.toString())
|
||||
myPreferenceFragment?.arguments = args
|
||||
supportFragmentManager.beginTransaction().replace(R.id.frame_layout, myPreferenceFragment!!).commit()
|
||||
}
|
||||
|
||||
override fun onPreferenceStartScreen(caller: PreferenceFragmentCompat, pref: PreferenceScreen): Boolean {
|
||||
|
@ -44,4 +65,8 @@ class PreferencesActivity : NoSplashAppCompatActivity(), PreferenceFragmentCompa
|
|||
override fun attachBaseContext(newBase: Context) {
|
||||
super.attachBaseContext(LocaleHelper.wrap(newBase))
|
||||
}
|
||||
|
||||
private fun filterPreferences() {
|
||||
myPreferenceFragment?.setFilter(pref_filter.text.toString())
|
||||
}
|
||||
}
|
|
@ -417,6 +417,8 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
|||
try {
|
||||
getDaoBgReadings().update(bgReading);
|
||||
openHumansUploader.enqueueBGReading(bgReading);
|
||||
aapsLogger.debug(LTag.DATABASE, "BG: Updating record from: "+ bgReading.toString());
|
||||
scheduleBgHistoryChange(bgReading.date); // trigger cache invalidation
|
||||
} catch (SQLException e) {
|
||||
aapsLogger.error("Unhandled exception", e);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class CalibrationDialog : DialogFragmentWithDate() {
|
|||
val units = profileFunction.getUnits()
|
||||
val unitLabel = if (units == Constants.MMOL) resourceHelper.gs(R.string.mmol) else resourceHelper.gs(R.string.mgdl)
|
||||
val actions: LinkedList<String?> = LinkedList()
|
||||
val bg = overview_calibration_bg.value
|
||||
val bg = overview_calibration_bg?.value ?: return false
|
||||
actions.add(resourceHelper.gs(R.string.treatments_wizard_bg_label) + ": " + Profile.toCurrentUnitsString(profileFunction, bg) + " " + unitLabel)
|
||||
if (bg > 0) {
|
||||
activity?.let { activity ->
|
||||
|
|
|
@ -150,7 +150,7 @@ class CarbsDialog : DialogFragmentWithDate() {
|
|||
}
|
||||
|
||||
override fun submit(): Boolean {
|
||||
val carbs = overview_carbs_carbs.value.toInt()
|
||||
val carbs = overview_carbs_carbs?.value?.toInt() ?: return false
|
||||
val carbsAfterConstraints = constraintChecker.applyCarbsConstraints(Constraint(carbs)).value()
|
||||
val units = profileFunction.getUnits()
|
||||
val activityTTDuration = defaultValueHelper.determineActivityTTDuration()
|
||||
|
|
|
@ -62,7 +62,7 @@ class ExtendedBolusDialog : DialogFragmentWithDate() {
|
|||
}
|
||||
|
||||
override fun submit(): Boolean {
|
||||
val insulin = SafeParse.stringToDouble(actions_extendedbolus_insulin.text)
|
||||
val insulin = SafeParse.stringToDouble(actions_extendedbolus_insulin?.text ?: return false)
|
||||
val durationInMinutes = actions_extendedbolus_duration.value.toInt()
|
||||
val actions: LinkedList<String> = LinkedList()
|
||||
val insulinAfterConstraint = constraintChecker.applyExtendedBolusConstraints(Constraint(insulin)).value()
|
||||
|
|
|
@ -85,7 +85,7 @@ class FillDialog : DialogFragmentWithDate() {
|
|||
}
|
||||
|
||||
override fun submit(): Boolean {
|
||||
val insulin = SafeParse.stringToDouble(fill_insulinamount.text)
|
||||
val insulin = SafeParse.stringToDouble(fill_insulinamount?.text ?: return false)
|
||||
val actions: LinkedList<String?> = LinkedList()
|
||||
|
||||
val insulinAfterConstraints = constraintChecker.applyBolusConstraints(Constraint(insulin)).value()
|
||||
|
|
|
@ -129,7 +129,7 @@ class InsulinDialog : DialogFragmentWithDate() {
|
|||
|
||||
override fun submit(): Boolean {
|
||||
val pumpDescription = activePlugin.activePump.pumpDescription
|
||||
val insulin = SafeParse.stringToDouble(overview_insulin_amount.text)
|
||||
val insulin = SafeParse.stringToDouble(overview_insulin_amount?.text ?: return false)
|
||||
val insulinAfterConstraints = constraintChecker.applyBolusConstraints(Constraint(insulin)).value()
|
||||
val actions: LinkedList<String?> = LinkedList()
|
||||
val units = profileFunction.getUnits()
|
||||
|
|
|
@ -91,7 +91,7 @@ class ProfileSwitchDialog : DialogFragmentWithDate() {
|
|||
?: return false
|
||||
|
||||
val actions: LinkedList<String> = LinkedList()
|
||||
val duration = overview_profileswitch_duration.value.toInt()
|
||||
val duration = overview_profileswitch_duration?.value?.toInt() ?: return false
|
||||
if (duration > 0)
|
||||
actions.add(resourceHelper.gs(R.string.duration) + ": " + resourceHelper.gs(R.string.format_mins, duration))
|
||||
val profile = overview_profileswitch_profile.selectedItem.toString()
|
||||
|
|
|
@ -84,7 +84,7 @@ class TempBasalDialog : DialogFragmentWithDate() {
|
|||
override fun submit(): Boolean {
|
||||
var percent = 0
|
||||
var absolute = 0.0
|
||||
val durationInMinutes = actions_tempbasal_duration.value.toInt()
|
||||
val durationInMinutes = actions_tempbasal_duration?.value?.toInt() ?: return false
|
||||
val profile = profileFunction.getProfile() ?: return false
|
||||
val actions: LinkedList<String> = LinkedList()
|
||||
if (isPercentPump) {
|
||||
|
|
|
@ -116,7 +116,7 @@ class TempTargetDialog : DialogFragmentWithDate() {
|
|||
|
||||
override fun submit(): Boolean {
|
||||
val actions: LinkedList<String> = LinkedList()
|
||||
val reason = overview_temptarget_reason.selectedItem.toString()
|
||||
val reason = overview_temptarget_reason?.selectedItem?.toString() ?: return false
|
||||
val unitResId = if (profileFunction.getUnits() == Constants.MGDL) R.string.mgdl else R.string.mmol
|
||||
val target = overview_temptarget_temptarget.value
|
||||
val duration = overview_temptarget_duration.value.toInt()
|
||||
|
|
|
@ -94,7 +94,7 @@ class TreatmentDialog : DialogFragmentWithDate() {
|
|||
|
||||
override fun submit(): Boolean {
|
||||
val pumpDescription = activePlugin.activePump.pumpDescription
|
||||
val insulin = SafeParse.stringToDouble(overview_treatment_insulin.text)
|
||||
val insulin = SafeParse.stringToDouble(overview_treatment_insulin?.text ?: return false)
|
||||
val carbs = SafeParse.stringToInt(overview_treatment_carbs.text)
|
||||
val recordOnlyChecked = overview_treatment_record_only.isChecked
|
||||
val actions: LinkedList<String?> = LinkedList()
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.view.ViewGroup
|
|||
import android.widget.LinearLayout
|
||||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.jjoe64.graphview.GraphView
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
|
@ -37,7 +38,6 @@ import io.reactivex.disposables.CompositeDisposable
|
|||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.android.synthetic.main.activity_historybrowse.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.util.*
|
||||
|
@ -168,7 +168,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
|||
if (it.cause is EventCustomCalculationFinished) {
|
||||
updateGUI("EventAutosensCalculationFinished", bgOnly = false)
|
||||
}
|
||||
}) { fabricPrivacy::logException }
|
||||
}, fabricPrivacy::logException )
|
||||
)
|
||||
disposable.add(rxBus
|
||||
.toObservable(EventAutosensBgLoaded::class.java)
|
||||
|
@ -178,12 +178,12 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
|||
if (it.cause is EventCustomCalculationFinished) {
|
||||
updateGUI("EventAutosensCalculationFinished", bgOnly = true)
|
||||
}
|
||||
}) { fabricPrivacy::logException }
|
||||
}, fabricPrivacy::logException )
|
||||
)
|
||||
disposable.add(rxBus
|
||||
.toObservable(EventIobCalculationProgress::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ overview_iobcalculationprogess?.text = it.progress }) { fabricPrivacy::logException }
|
||||
.subscribe({ overview_iobcalculationprogess?.text = it.progress }, fabricPrivacy::logException )
|
||||
)
|
||||
disposable.add(rxBus
|
||||
.toObservable(EventRefreshOverview::class.java)
|
||||
|
@ -193,7 +193,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
|||
prepareGraphs()
|
||||
updateGUI("EventRefreshOverview", bgOnly = false)
|
||||
}
|
||||
}) { fabricPrivacy::logException }
|
||||
}, fabricPrivacy::logException )
|
||||
)
|
||||
if (start == 0L) {
|
||||
// set start of current day
|
||||
|
@ -256,7 +256,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
|||
}
|
||||
|
||||
private fun runCalculation(from: String) {
|
||||
GlobalScope.launch(Dispatchers.Default) {
|
||||
lifecycleScope.launch(Dispatchers.Default) {
|
||||
treatmentsPluginHistory.initializeData(start - T.hours(8).msecs())
|
||||
val end = start + T.hours(rangeToDisplay.toLong()).msecs()
|
||||
iobCobCalculatorPluginHistory.stopCalculation(from)
|
||||
|
@ -273,7 +273,7 @@ class HistoryBrowseActivity : NoSplashAppCompatActivity() {
|
|||
val lowLine = defaultValueHelper.determineLowLine()
|
||||
val highLine = defaultValueHelper.determineHighLine()
|
||||
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
lifecycleScope.launch(Dispatchers.Main) {
|
||||
historybrowse_noprofile?.visibility = (profile == null).toVisibility()
|
||||
profile ?: return@launch
|
||||
|
||||
|
|
|
@ -46,17 +46,17 @@ class ConfigBuilderPlugin @Inject constructor(
|
|||
}
|
||||
|
||||
private fun setAlwaysEnabledPluginsEnabled() {
|
||||
for (plugin in activePlugin.pluginsList) {
|
||||
for (plugin in activePlugin.getPluginsList()) {
|
||||
if (plugin.pluginDescription.alwaysEnabled) plugin.setPluginEnabled(plugin.getType(), true)
|
||||
}
|
||||
storeSettings("setAlwaysEnabledPluginsEnabled")
|
||||
}
|
||||
|
||||
override fun storeSettings(from: String) {
|
||||
activePlugin.pluginsList
|
||||
activePlugin.getPluginsList()
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Storing settings from: $from")
|
||||
activePlugin.verifySelectionInCategories()
|
||||
for (p in activePlugin.pluginsList) {
|
||||
for (p in activePlugin.getPluginsList()) {
|
||||
val type = p.getType()
|
||||
if (p.pluginDescription.alwaysEnabled && p.pluginDescription.alwaysVisible) continue
|
||||
if (p.pluginDescription.alwaysEnabled && p.pluginDescription.neverVisible) continue
|
||||
|
@ -82,7 +82,7 @@ class ConfigBuilderPlugin @Inject constructor(
|
|||
|
||||
private fun loadSettings() {
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Loading stored settings")
|
||||
for (p in activePlugin.pluginsList) {
|
||||
for (p in activePlugin.getPluginsList()) {
|
||||
val type = p.getType()
|
||||
loadPref(p, type, true)
|
||||
if (p.getType() == PluginType.PUMP) {
|
||||
|
@ -110,7 +110,7 @@ class ConfigBuilderPlugin @Inject constructor(
|
|||
}
|
||||
|
||||
fun logPluginStatus() {
|
||||
for (p in activePlugin.pluginsList) {
|
||||
for (p in activePlugin.getPluginsList()) {
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, p.name + ":" +
|
||||
(if (p.isEnabled(PluginType.GENERAL)) " GENERAL" else "") +
|
||||
(if (p.isEnabled(PluginType.TREATMENT)) " TREATMENT" else "") +
|
||||
|
@ -147,7 +147,7 @@ class ConfigBuilderPlugin @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
fun performPluginSwitch(changedPlugin: PluginBase, enabled: Boolean, type: PluginType) {
|
||||
override fun performPluginSwitch(changedPlugin: PluginBase, enabled: Boolean, type: PluginType) {
|
||||
changedPlugin.setPluginEnabled(type, enabled)
|
||||
changedPlugin.setFragmentVisible(type, enabled)
|
||||
processOnEnabledCategoryChanged(changedPlugin, type)
|
||||
|
|
|
@ -15,13 +15,13 @@ class PluginStore @Inject constructor(
|
|||
|
||||
lateinit var plugins: List<@JvmSuppressWildcards PluginBase>
|
||||
|
||||
private var activeBgSource: BgSourceInterface? = null
|
||||
private var activePump: PumpInterface? = null
|
||||
private var activeBgSourceStore: BgSourceInterface? = null
|
||||
private var activePumpStore: PumpInterface? = null
|
||||
private var activeProfile: ProfileInterface? = null
|
||||
private var activeAPS: APSInterface? = null
|
||||
private var activeInsulin: InsulinInterface? = null
|
||||
private var activeSensitivity: SensitivityInterface? = null
|
||||
private var activeTreatments: TreatmentsInterface? = null
|
||||
private var activeAPSStore: APSInterface? = null
|
||||
private var activeInsulinStore: InsulinInterface? = null
|
||||
private var activeSensitivityStore: SensitivityInterface? = null
|
||||
private var activeTreatmentsStore: TreatmentsInterface? = null
|
||||
|
||||
fun loadDefaults() {
|
||||
verifySelectionInCategories()
|
||||
|
@ -71,34 +71,34 @@ class PluginStore @Inject constructor(
|
|||
// PluginType.APS
|
||||
if (!config.NSCLIENT && !config.PUMPCONTROL) {
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.APS)
|
||||
activeAPS = getTheOneEnabledInArray(pluginsInCategory, PluginType.APS) as APSInterface?
|
||||
if (activeAPS == null) {
|
||||
activeAPS = getDefaultPlugin(PluginType.APS) as APSInterface
|
||||
(activeAPS as PluginBase).setPluginEnabled(PluginType.APS, true)
|
||||
activeAPSStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.APS) as APSInterface?
|
||||
if (activeAPSStore == null) {
|
||||
activeAPSStore = getDefaultPlugin(PluginType.APS) as APSInterface
|
||||
(activeAPSStore as PluginBase).setPluginEnabled(PluginType.APS, true)
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting APSInterface")
|
||||
}
|
||||
setFragmentVisiblities((activeAPS as PluginBase).name, pluginsInCategory, PluginType.APS)
|
||||
setFragmentVisiblities((activeAPSStore as PluginBase).name, pluginsInCategory, PluginType.APS)
|
||||
}
|
||||
|
||||
// PluginType.INSULIN
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.INSULIN)
|
||||
activeInsulin = getTheOneEnabledInArray(pluginsInCategory, PluginType.INSULIN) as InsulinInterface?
|
||||
if (activeInsulin == null) {
|
||||
activeInsulin = getDefaultPlugin(PluginType.INSULIN) as InsulinInterface
|
||||
(activeInsulin as PluginBase).setPluginEnabled(PluginType.INSULIN, true)
|
||||
activeInsulinStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.INSULIN) as InsulinInterface?
|
||||
if (activeInsulinStore == null) {
|
||||
activeInsulinStore = getDefaultPlugin(PluginType.INSULIN) as InsulinInterface
|
||||
(activeInsulinStore as PluginBase).setPluginEnabled(PluginType.INSULIN, true)
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting InsulinInterface")
|
||||
}
|
||||
setFragmentVisiblities((activeInsulin as PluginBase).name, pluginsInCategory, PluginType.INSULIN)
|
||||
setFragmentVisiblities((activeInsulinStore as PluginBase).name, pluginsInCategory, PluginType.INSULIN)
|
||||
|
||||
// PluginType.SENSITIVITY
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.SENSITIVITY)
|
||||
activeSensitivity = getTheOneEnabledInArray(pluginsInCategory, PluginType.SENSITIVITY) as SensitivityInterface?
|
||||
if (activeSensitivity == null) {
|
||||
activeSensitivity = getDefaultPlugin(PluginType.SENSITIVITY) as SensitivityInterface
|
||||
(activeSensitivity as PluginBase).setPluginEnabled(PluginType.SENSITIVITY, true)
|
||||
activeSensitivityStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.SENSITIVITY) as SensitivityInterface?
|
||||
if (activeSensitivityStore == null) {
|
||||
activeSensitivityStore = getDefaultPlugin(PluginType.SENSITIVITY) as SensitivityInterface
|
||||
(activeSensitivityStore as PluginBase).setPluginEnabled(PluginType.SENSITIVITY, true)
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting SensitivityInterface")
|
||||
}
|
||||
setFragmentVisiblities((activeSensitivity as PluginBase).name, pluginsInCategory, PluginType.SENSITIVITY)
|
||||
setFragmentVisiblities((activeSensitivityStore as PluginBase).name, pluginsInCategory, PluginType.SENSITIVITY)
|
||||
|
||||
// PluginType.PROFILE
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.PROFILE)
|
||||
|
@ -112,33 +112,33 @@ class PluginStore @Inject constructor(
|
|||
|
||||
// PluginType.BGSOURCE
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.BGSOURCE)
|
||||
activeBgSource = getTheOneEnabledInArray(pluginsInCategory, PluginType.BGSOURCE) as BgSourceInterface?
|
||||
if (activeBgSource == null) {
|
||||
activeBgSource = getDefaultPlugin(PluginType.BGSOURCE) as BgSourceInterface
|
||||
(activeBgSource as PluginBase).setPluginEnabled(PluginType.BGSOURCE, true)
|
||||
activeBgSourceStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.BGSOURCE) as BgSourceInterface?
|
||||
if (activeBgSourceStore == null) {
|
||||
activeBgSourceStore = getDefaultPlugin(PluginType.BGSOURCE) as BgSourceInterface
|
||||
(activeBgSourceStore as PluginBase).setPluginEnabled(PluginType.BGSOURCE, true)
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting BgInterface")
|
||||
}
|
||||
setFragmentVisiblities((activeBgSource as PluginBase).name, pluginsInCategory, PluginType.PUMP)
|
||||
setFragmentVisiblities((activeBgSourceStore as PluginBase).name, pluginsInCategory, PluginType.PUMP)
|
||||
|
||||
// PluginType.PUMP
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.PUMP)
|
||||
activePump = getTheOneEnabledInArray(pluginsInCategory, PluginType.PUMP) as PumpInterface?
|
||||
if (activePump == null) {
|
||||
activePump = getDefaultPlugin(PluginType.PUMP) as PumpInterface
|
||||
(activePump as PluginBase).setPluginEnabled(PluginType.PUMP, true)
|
||||
activePumpStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.PUMP) as PumpInterface?
|
||||
if (activePumpStore == null) {
|
||||
activePumpStore = getDefaultPlugin(PluginType.PUMP) as PumpInterface
|
||||
(activePumpStore as PluginBase).setPluginEnabled(PluginType.PUMP, true)
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting PumpInterface")
|
||||
}
|
||||
setFragmentVisiblities((activePump as PluginBase).name, pluginsInCategory, PluginType.PUMP)
|
||||
setFragmentVisiblities((activePumpStore as PluginBase).name, pluginsInCategory, PluginType.PUMP)
|
||||
|
||||
// PluginType.TREATMENT
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.TREATMENT)
|
||||
activeTreatments = getTheOneEnabledInArray(pluginsInCategory, PluginType.TREATMENT) as TreatmentsInterface?
|
||||
if (activeTreatments == null) {
|
||||
activeTreatments = getDefaultPlugin(PluginType.TREATMENT) as TreatmentsInterface
|
||||
(activeTreatments as PluginBase).setPluginEnabled(PluginType.TREATMENT, true)
|
||||
activeTreatmentsStore = getTheOneEnabledInArray(pluginsInCategory, PluginType.TREATMENT) as TreatmentsInterface?
|
||||
if (activeTreatmentsStore == null) {
|
||||
activeTreatmentsStore = getDefaultPlugin(PluginType.TREATMENT) as TreatmentsInterface
|
||||
(activeTreatmentsStore as PluginBase).setPluginEnabled(PluginType.TREATMENT, true)
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting PumpInterface")
|
||||
}
|
||||
setFragmentVisiblities((activeTreatments as PluginBase).name, pluginsInCategory, PluginType.TREATMENT)
|
||||
setFragmentVisiblities((activeTreatmentsStore as PluginBase).name, pluginsInCategory, PluginType.TREATMENT)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -203,27 +203,31 @@ class PluginStore @Inject constructor(
|
|||
|
||||
// ***** Interface *****
|
||||
|
||||
override fun getActiveBgSource(): BgSourceInterface {
|
||||
return activeBgSource ?: checkNotNull(activeBgSource) { "No bg source selected" }
|
||||
}
|
||||
override val activeBgSource: BgSourceInterface
|
||||
get() = activeBgSourceStore ?: checkNotNull(activeBgSourceStore) { "No bg source selected" }
|
||||
|
||||
override fun getActiveProfileInterface(): ProfileInterface =
|
||||
activeProfile ?: checkNotNull(activeProfile) { "No profile selected" }
|
||||
override val activeProfileInterface: ProfileInterface
|
||||
get() = activeProfile ?: checkNotNull(activeProfile) { "No profile selected" }
|
||||
|
||||
override fun getActiveInsulin(): InsulinInterface =
|
||||
activeInsulin ?: checkNotNull(activeInsulin) { "No insulin selected" }
|
||||
override val activeInsulin: InsulinInterface
|
||||
get() = activeInsulinStore ?: checkNotNull(activeInsulinStore) { "No insulin selected" }
|
||||
|
||||
override fun getActiveAPS(): APSInterface =
|
||||
activeAPS ?: checkNotNull(activeAPS) { "No APS selected" }
|
||||
override val activeAPS: APSInterface
|
||||
get() = activeAPSStore ?: checkNotNull(activeAPSStore) { "No APS selected" }
|
||||
|
||||
override fun getActivePump(): PumpInterface =
|
||||
activePump ?: checkNotNull(activePump) { "No pump selected" }
|
||||
override val activePump: PumpInterface
|
||||
get() = activePumpStore ?: checkNotNull(activePumpStore) { "No pump selected" }
|
||||
|
||||
override fun getActiveSensitivity(): SensitivityInterface =
|
||||
activeSensitivity ?: checkNotNull(activeSensitivity) { "No sensitivity selected" }
|
||||
override val activeSensitivity: SensitivityInterface
|
||||
get() = activeSensitivityStore
|
||||
?: checkNotNull(activeSensitivityStore) { "No sensitivity selected" }
|
||||
|
||||
override fun getActiveTreatments(): TreatmentsInterface =
|
||||
activeTreatments ?: checkNotNull(activeTreatments) { "No treatments selected" }
|
||||
override val activeTreatments: TreatmentsInterface
|
||||
get() = activeTreatmentsStore
|
||||
?: checkNotNull(activeTreatmentsStore) { "No treatments selected" }
|
||||
|
||||
override val activeOverview: OverviewInterface
|
||||
get() = getSpecificPluginsListByInterface(OverviewInterface::class.java).first() as OverviewInterface
|
||||
|
||||
override fun getPluginsList(): ArrayList<PluginBase> = ArrayList(plugins)
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ class EditEventDialog : DialogFragmentWithDate() {
|
|||
|
||||
override fun submit(): Boolean {
|
||||
// check for title
|
||||
val title = automation_inputEventTitle.text.toString()
|
||||
val title = automation_inputEventTitle?.text?.toString() ?: return false
|
||||
if (title.isEmpty()) {
|
||||
ToastUtils.showToastInUiThread(context, R.string.automation_missing_task_name)
|
||||
return false
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package info.nightscout.androidaps.plugins.general.maintenance
|
||||
|
||||
import android.Manifest
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.bluetooth.BluetoothAdapter
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.provider.Settings
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
|
@ -21,6 +21,7 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
|||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.formats.*
|
||||
import info.nightscout.androidaps.utils.AndroidPermission
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.ToastUtils
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
|
@ -43,12 +44,6 @@ import javax.inject.Singleton
|
|||
* Created by mike on 03.07.2016.
|
||||
*/
|
||||
|
||||
private const val REQUEST_EXTERNAL_STORAGE = 1
|
||||
private val PERMISSIONS_STORAGE = arrayOf(
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||
)
|
||||
|
||||
@Singleton
|
||||
class ImportExportPrefs @Inject constructor(
|
||||
private var log: AAPSLogger,
|
||||
|
@ -57,6 +52,7 @@ class ImportExportPrefs @Inject constructor(
|
|||
private val buildHelper: BuildHelper,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val passwordCheck: PasswordCheck,
|
||||
private val androidPermission: AndroidPermission,
|
||||
private val classicPrefsFormat: ClassicPrefsFormat,
|
||||
private val encryptedPrefsFormat: EncryptedPrefsFormat,
|
||||
private val prefFileList: PrefFileListProvider
|
||||
|
@ -73,12 +69,15 @@ class ImportExportPrefs @Inject constructor(
|
|||
}
|
||||
|
||||
fun verifyStoragePermissions(fragment: Fragment, onGranted: Runnable) {
|
||||
fragment.context?.let {
|
||||
val permission = ContextCompat.checkSelfPermission(it,
|
||||
fragment.context?.let { ctx ->
|
||||
val permission = ContextCompat.checkSelfPermission(ctx,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
if (permission != PackageManager.PERMISSION_GRANTED) {
|
||||
// We don't have permission so prompt the user
|
||||
fragment.requestPermissions(PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE)
|
||||
fragment.activity?.let {
|
||||
androidPermission.askForPermission(it, arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE), AndroidPermission.CASE_STORAGE)
|
||||
}
|
||||
} else {
|
||||
onGranted.run()
|
||||
}
|
||||
|
|
|
@ -15,10 +15,13 @@ import javax.inject.Inject;
|
|||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.Config;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.interfaces.ConfigInterface;
|
||||
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||
import info.nightscout.androidaps.logging.LTag;
|
||||
import info.nightscout.androidaps.plugins.aps.loop.APSResult;
|
||||
import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration;
|
||||
import info.nightscout.androidaps.utils.DateUtil;
|
||||
import info.nightscout.androidaps.utils.HtmlHelper;
|
||||
import info.nightscout.androidaps.utils.Round;
|
||||
|
@ -85,6 +88,8 @@ public class NSDeviceStatus {
|
|||
private final SP sp;
|
||||
private final ResourceHelper resourceHelper;
|
||||
private final NSSettingsStatus nsSettingsStatus;
|
||||
private final ConfigInterface config;
|
||||
private final RunningConfiguration runningConfiguration;
|
||||
|
||||
private JSONObject data = null;
|
||||
|
||||
|
@ -93,12 +98,16 @@ public class NSDeviceStatus {
|
|||
AAPSLogger aapsLogger,
|
||||
SP sp,
|
||||
ResourceHelper resourceHelper,
|
||||
NSSettingsStatus nsSettingsStatus
|
||||
NSSettingsStatus nsSettingsStatus,
|
||||
ConfigInterface config,
|
||||
RunningConfiguration runningConfiguration
|
||||
) {
|
||||
this.aapsLogger = aapsLogger;
|
||||
this.sp = sp;
|
||||
this.resourceHelper = resourceHelper;
|
||||
this.nsSettingsStatus = nsSettingsStatus;
|
||||
this.config = config;
|
||||
this.runningConfiguration = runningConfiguration;
|
||||
}
|
||||
|
||||
public void handleNewData(JSONArray devicestatuses) {
|
||||
|
@ -114,8 +123,13 @@ public class NSDeviceStatus {
|
|||
// Objectives 0
|
||||
sp.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, true);
|
||||
}
|
||||
if (devicestatusJson.has("configuration") && config.getNSCLIENT()) {
|
||||
// copy configuration of Insulin and Sensitivity from main AAPS
|
||||
runningConfiguration.apply(devicestatusJson.getJSONObject("configuration"));
|
||||
}
|
||||
}
|
||||
} catch (JSONException ignored) {
|
||||
} catch (JSONException jsonException) {
|
||||
jsonException.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ class OpenHumansAPI(
|
|||
.toSingle()
|
||||
.map { response ->
|
||||
response.use { _ ->
|
||||
val body = response.body
|
||||
val jsonObject = body?.let { JSONObject(it.string()) }
|
||||
val responseBody = response.body
|
||||
val jsonObject = responseBody?.let { JSONObject(it.string()) }
|
||||
if (!response.isSuccessful) throw OHHttpException(response.code, response.message, jsonObject?.getString("error"))
|
||||
if (jsonObject == null) throw OHHttpException(response.code, response.message, "No body")
|
||||
if (!jsonObject.has("expires_in")) throw OHMissingFieldException("expires_in")
|
||||
|
|
|
@ -564,7 +564,7 @@ class OpenHumansUploader @Inject constructor(
|
|||
creationDate = uploadDate.time
|
||||
),
|
||||
content = bytes,
|
||||
highestQueueId = items.map { it.id }.max()
|
||||
highestQueueId = items.map { it.id }.maxOrNull()
|
||||
))
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import android.widget.LinearLayout
|
|||
import android.widget.RelativeLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.text.toSpanned
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.jjoe64.graphview.GraphView
|
||||
import dagger.android.HasAndroidInjector
|
||||
|
@ -99,7 +100,6 @@ import kotlinx.android.synthetic.main.overview_info_layout.overview_timeagoshort
|
|||
import kotlinx.android.synthetic.main.overview_loop_pumpstatus_layout.*
|
||||
import kotlinx.android.synthetic.main.overview_statuslights_layout.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.util.*
|
||||
|
@ -185,7 +185,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
|||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
// pre-process landscape mode
|
||||
skinProvider.activeSkin().preProcessLandscapeOverviewLayout(dm, overview_iob_llayout, overview_time_llayout)
|
||||
skinProvider.activeSkin().preProcessLandscapeOverviewLayout(dm, view, resourceHelper.gb(R.bool.isTablet))
|
||||
|
||||
overview_pumpstatus?.setBackgroundColor(resourceHelper.gc(R.color.colorInitializingBorder))
|
||||
|
||||
|
@ -684,7 +684,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
|||
|
||||
// Basal, TBR
|
||||
val activeTemp = treatmentsPlugin.getTempBasalFromHistory(System.currentTimeMillis())
|
||||
overview_basebasal?.text = activeTemp?.let { if (resourceHelper.shortTextMode()) "T:" + activeTemp.toStringVeryShort() else activeTemp.toStringFull() }
|
||||
overview_basebasal?.text = activeTemp?.let { "T:" + activeTemp.toStringVeryShort() }
|
||||
?: resourceHelper.gs(R.string.pump_basebasalrate, profile.basal)
|
||||
overview_basal_llayout?.setOnClickListener {
|
||||
var fullText = "${resourceHelper.gs(R.string.basebasalrate_label)}: ${resourceHelper.gs(R.string.pump_basebasalrate, profile.basal)}"
|
||||
|
@ -705,10 +705,10 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
|||
|
||||
// Extended bolus
|
||||
val extendedBolus = treatmentsPlugin.getExtendedBolusFromHistory(System.currentTimeMillis())
|
||||
overview_extendedbolus?.text = if (extendedBolus != null && !pump.isFakingTempsByExtendedBoluses) {
|
||||
if (resourceHelper.shortTextMode()) resourceHelper.gs(R.string.pump_basebasalrate, extendedBolus.absoluteRate())
|
||||
else extendedBolus.toStringMedium()
|
||||
} else ""
|
||||
overview_extendedbolus?.text =
|
||||
if (extendedBolus != null && !pump.isFakingTempsByExtendedBoluses)
|
||||
resourceHelper.gs(R.string.pump_basebasalrate, extendedBolus.absoluteRate())
|
||||
else ""
|
||||
overview_extendedbolus?.setOnClickListener {
|
||||
if (extendedBolus != null) activity?.let {
|
||||
OKDialog.show(it, resourceHelper.gs(R.string.extended_bolus), extendedBolus.toString())
|
||||
|
@ -733,15 +733,8 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
|||
treatmentsPlugin.updateTotalIOBTempBasals()
|
||||
val bolusIob = treatmentsPlugin.lastCalculationTreatments.round()
|
||||
val basalIob = treatmentsPlugin.lastCalculationTempBasals.round()
|
||||
overview_iob?.text = when {
|
||||
resourceHelper.shortTextMode() ->
|
||||
resourceHelper.gs(R.string.formatinsulinunits, bolusIob.iob + basalIob.basaliob)
|
||||
overview_iob?.text = resourceHelper.gs(R.string.formatinsulinunits, bolusIob.iob + basalIob.basaliob)
|
||||
|
||||
else ->
|
||||
resourceHelper.gs(R.string.formatinsulinunits, bolusIob.iob + basalIob.basaliob) + " (" +
|
||||
resourceHelper.gs(R.string.formatinsulinunits, bolusIob.iob) + "/" +
|
||||
resourceHelper.gs(R.string.formatinsulinunits, basalIob.basaliob) + ")"
|
||||
}
|
||||
overview_iob_llayout?.setOnClickListener {
|
||||
activity?.let {
|
||||
OKDialog.show(it, resourceHelper.gs(R.string.iob),
|
||||
|
@ -805,7 +798,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
|||
} ?: ""
|
||||
|
||||
// ****** GRAPH *******
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
viewLifecycleOwner.lifecycleScope.launch(Dispatchers.Main) {
|
||||
overview_bggraph ?: return@launch
|
||||
val graphData = GraphData(injector, overview_bggraph, iobCobCalculatorPlugin, treatmentsPlugin)
|
||||
val secondaryGraphsData: ArrayList<GraphData> = ArrayList()
|
||||
|
|
|
@ -6,6 +6,7 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.Config
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.events.EventRefreshOverview
|
||||
import info.nightscout.androidaps.interfaces.OverviewInterface
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.PluginDescription
|
||||
import info.nightscout.androidaps.interfaces.PluginType
|
||||
|
@ -16,9 +17,12 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotifi
|
|||
import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.extensions.plusAssign
|
||||
import info.nightscout.androidaps.utils.extensions.*
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import org.json.JSONObject
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
@ -28,6 +32,7 @@ class OverviewPlugin @Inject constructor(
|
|||
private val notificationStore: NotificationStore,
|
||||
private val fabricPrivacy: FabricPrivacy,
|
||||
private val rxBus: RxBusWrapper,
|
||||
private val sp: SP,
|
||||
aapsLogger: AAPSLogger,
|
||||
resourceHelper: ResourceHelper,
|
||||
private val config: Config
|
||||
|
@ -41,7 +46,7 @@ class OverviewPlugin @Inject constructor(
|
|||
.preferencesId(R.xml.pref_overview)
|
||||
.description(R.string.description_overview),
|
||||
aapsLogger, resourceHelper, injector
|
||||
) {
|
||||
), OverviewInterface {
|
||||
|
||||
private var disposable: CompositeDisposable = CompositeDisposable()
|
||||
|
||||
|
@ -82,4 +87,57 @@ class OverviewPlugin @Inject constructor(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun configuration(): JSONObject =
|
||||
JSONObject()
|
||||
.putString(R.string.key_quickwizard, sp, resourceHelper)
|
||||
.putInt(R.string.key_eatingsoon_duration, sp, resourceHelper)
|
||||
.putDouble(R.string.key_eatingsoon_target, sp, resourceHelper)
|
||||
.putInt(R.string.key_activity_duration, sp, resourceHelper)
|
||||
.putDouble(R.string.key_activity_target, sp, resourceHelper)
|
||||
.putInt(R.string.key_hypo_duration, sp, resourceHelper)
|
||||
.putDouble(R.string.key_hypo_target, sp, resourceHelper)
|
||||
.putDouble(R.string.key_low_mark, sp, resourceHelper)
|
||||
.putDouble(R.string.key_high_mark, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_cage_warning, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_cage_critical, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_iage_warning, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_iage_critical, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_sage_warning, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_sage_critical, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_sbat_warning, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_sbat_critical, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_bage_warning, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_bage_critical, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_res_warning, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_res_critical, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_bat_warning, sp, resourceHelper)
|
||||
.putDouble(R.string.key_statuslights_bat_critical, sp, resourceHelper)
|
||||
|
||||
override fun applyConfiguration(configuration: JSONObject) {
|
||||
configuration
|
||||
.storeString(R.string.key_quickwizard, sp, resourceHelper)
|
||||
.storeInt(R.string.key_eatingsoon_duration, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_eatingsoon_target, sp, resourceHelper)
|
||||
.storeInt(R.string.key_activity_duration, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_activity_target, sp, resourceHelper)
|
||||
.storeInt(R.string.key_hypo_duration, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_hypo_target, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_low_mark, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_high_mark, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_cage_warning, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_cage_critical, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_iage_warning, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_iage_critical, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_sage_warning, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_sage_critical, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_sbat_warning, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_sbat_critical, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_bage_warning, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_bage_critical, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_res_warning, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_res_critical, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_bat_warning, sp, resourceHelper)
|
||||
.storeDouble(R.string.key_statuslights_bat_critical, sp, resourceHelper)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import info.nightscout.androidaps.logging.AAPSLogger
|
|||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification
|
||||
import info.nightscout.androidaps.services.AlarmSoundService
|
||||
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.resources.IconsProvider
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
|
@ -39,6 +39,7 @@ class NotificationStore @Inject constructor(
|
|||
private val resourceHelper: ResourceHelper,
|
||||
private val context: Context,
|
||||
private val iconsProvider: IconsProvider,
|
||||
private val alarmSoundServiceHelper: AlarmSoundServiceHelper,
|
||||
private val dateUtil: DateUtil
|
||||
) {
|
||||
|
||||
|
@ -46,10 +47,12 @@ class NotificationStore @Inject constructor(
|
|||
private var usesChannels = false
|
||||
|
||||
companion object {
|
||||
|
||||
private const val CHANNEL_ID = "AndroidAPS-Overview"
|
||||
}
|
||||
|
||||
inner class NotificationComparator : Comparator<Notification> {
|
||||
|
||||
override fun compare(o1: Notification, o2: Notification): Int {
|
||||
return o1.level - o2.level
|
||||
}
|
||||
|
@ -68,17 +71,9 @@ class NotificationStore @Inject constructor(
|
|||
store.add(n)
|
||||
if (sp.getBoolean(R.string.key_raise_notifications_as_android_notifications, false) && n !is NotificationWithAction) {
|
||||
raiseSystemNotification(n)
|
||||
if (usesChannels && n.soundId != null && n.soundId != 0) {
|
||||
val alarm = Intent(context, AlarmSoundService::class.java)
|
||||
alarm.putExtra("soundid", n.soundId)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(alarm) else context.startService(alarm)
|
||||
}
|
||||
if (usesChannels && n.soundId != null && n.soundId != 0) alarmSoundServiceHelper.startAlarm(context, n.soundId)
|
||||
} else {
|
||||
if (n.soundId != null && n.soundId != 0) {
|
||||
val alarm = Intent(context, AlarmSoundService::class.java)
|
||||
alarm.putExtra("soundid", n.soundId)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(alarm) else context.startService(alarm)
|
||||
}
|
||||
if (n.soundId != null && n.soundId != 0) alarmSoundServiceHelper.startAlarm(context, n.soundId)
|
||||
}
|
||||
Collections.sort(store, NotificationComparator())
|
||||
return true
|
||||
|
@ -87,10 +82,7 @@ class NotificationStore @Inject constructor(
|
|||
@Synchronized fun remove(id: Int): Boolean {
|
||||
for (i in store.indices) {
|
||||
if (store[i].id == id) {
|
||||
if (store[i].soundId != null) {
|
||||
val alarm = Intent(context, AlarmSoundService::class.java)
|
||||
context.stopService(alarm)
|
||||
}
|
||||
if (store[i].soundId != null) alarmSoundServiceHelper.stopService(context)
|
||||
store.removeAt(i)
|
||||
return true
|
||||
}
|
||||
|
@ -195,10 +187,10 @@ class NotificationStore @Inject constructor(
|
|||
@Suppress("SetTextI18n")
|
||||
holder.text.text = dateUtil.timeString(notification.date) + " " + notification.text
|
||||
when (notification.level) {
|
||||
Notification.URGENT -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationUrgent))
|
||||
Notification.NORMAL -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationNormal))
|
||||
Notification.LOW -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationLow))
|
||||
Notification.INFO -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationInfo))
|
||||
Notification.URGENT -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationUrgent))
|
||||
Notification.NORMAL -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationNormal))
|
||||
Notification.LOW -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationLow))
|
||||
Notification.INFO -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationInfo))
|
||||
Notification.ANNOUNCEMENT -> holder.cv.setBackgroundColor(resourceHelper.gc(R.color.notificationAnnouncement))
|
||||
}
|
||||
}
|
||||
|
@ -208,6 +200,7 @@ class NotificationStore @Inject constructor(
|
|||
}
|
||||
|
||||
inner class NotificationsViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
var cv: CardView = itemView.findViewById(R.id.notification_cardview)
|
||||
var text: TextView = itemView.findViewById(R.id.notification_text)
|
||||
var dismiss: Button = itemView.findViewById(R.id.notification_dismiss)
|
||||
|
|
|
@ -44,7 +44,7 @@ class DummyService : DaggerService() {
|
|||
.subscribe({
|
||||
aapsLogger.debug(LTag.CORE, "EventAppExit received")
|
||||
stopSelf()
|
||||
}) { fabricPrivacy::logException }
|
||||
}, fabricPrivacy::logException )
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -22,9 +22,9 @@ class InsulinFragment : DaggerFragment() {
|
|||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
insulin_name?.setText(activePlugin.getActiveInsulin().getFriendlyName())
|
||||
insulin_comment?.setText(activePlugin.getActiveInsulin().getComment())
|
||||
insulin_dia?.text = resourceHelper.gs(R.string.dia) + ": " + activePlugin.getActiveInsulin().getDia() + "h"
|
||||
insulin_graph?.show(activePlugin.getActiveInsulin())
|
||||
insulin_name?.setText(activePlugin.activeInsulin.friendlyName)
|
||||
insulin_comment?.setText(activePlugin.activeInsulin.comment)
|
||||
insulin_dia?.text = resourceHelper.gs(R.string.dia) + ": " + activePlugin.activeInsulin.dia + "h"
|
||||
insulin_graph?.show(activePlugin.activeInsulin)
|
||||
}
|
||||
}
|
|
@ -3,10 +3,11 @@ package info.nightscout.androidaps.plugins.insulin
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import org.json.JSONObject
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
@ -18,10 +19,11 @@ class InsulinLyumjevPlugin @Inject constructor(
|
|||
rxBus: RxBusWrapper, aapsLogger: AAPSLogger
|
||||
) : InsulinOrefBasePlugin(injector, resourceHelper, profileFunction, rxBus, aapsLogger) {
|
||||
|
||||
override val id get(): InsulinInterface.InsulinType = InsulinInterface.InsulinType.OREF_LYUMJEV
|
||||
override val friendlyName get(): String = resourceHelper.gs(R.string.lyumjev)
|
||||
|
||||
override fun getId(): Int = InsulinInterface.OREF_LYUMJEV
|
||||
|
||||
override fun getFriendlyName(): String = resourceHelper.gs(R.string.lyumjev)
|
||||
override fun configuration(): JSONObject = JSONObject()
|
||||
override fun applyConfiguration(configuration: JSONObject) {}
|
||||
|
||||
override fun commentStandardText(): String = resourceHelper.gs(R.string.lyumjev)
|
||||
|
||||
|
|
|
@ -3,16 +3,16 @@ package info.nightscout.androidaps.plugins.insulin
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.data.Iob
|
||||
import info.nightscout.androidaps.db.Treatment
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.PluginDescription
|
||||
import info.nightscout.androidaps.interfaces.PluginType
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification
|
||||
import info.nightscout.androidaps.db.Treatment
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
|
||||
/**
|
||||
|
@ -35,15 +35,16 @@ abstract class InsulinOrefBasePlugin(
|
|||
), InsulinInterface {
|
||||
|
||||
private var lastWarned: Long = 0
|
||||
override fun getDia(): Double {
|
||||
val dia = userDefinedDia
|
||||
return if (dia >= MIN_DIA) {
|
||||
dia
|
||||
} else {
|
||||
sendShortDiaNotification(dia)
|
||||
MIN_DIA
|
||||
override val dia
|
||||
get(): Double {
|
||||
val dia = userDefinedDia
|
||||
return if (dia >= MIN_DIA) {
|
||||
dia
|
||||
} else {
|
||||
sendShortDiaNotification(dia)
|
||||
MIN_DIA
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open fun sendShortDiaNotification(dia: Double) {
|
||||
if (System.currentTimeMillis() - lastWarned > 60 * 1000) {
|
||||
|
@ -62,17 +63,13 @@ abstract class InsulinOrefBasePlugin(
|
|||
return profile?.dia ?: MIN_DIA
|
||||
}
|
||||
|
||||
fun iobCalcForTreatment(treatment: Treatment, time: Long): Iob {
|
||||
return this.iobCalcForTreatment(treatment, time, 0.0)
|
||||
}
|
||||
|
||||
override fun iobCalcForTreatment(treatment: Treatment, time: Long, dia: Double): Iob {
|
||||
val result = Iob()
|
||||
val peak = peak
|
||||
if (treatment.insulin != 0.0) {
|
||||
val bolusTime = treatment.date
|
||||
val t = (time - bolusTime) / 1000.0 / 60.0
|
||||
val td = getDia() * 60 //getDIA() always >= MIN_DIA
|
||||
val td = dia * 60 //getDIA() always >= MIN_DIA
|
||||
val tp = peak.toDouble()
|
||||
// force the IOB to 0 if over DIA hours have passed
|
||||
if (t < td) {
|
||||
|
@ -86,19 +83,21 @@ abstract class InsulinOrefBasePlugin(
|
|||
return result
|
||||
}
|
||||
|
||||
override fun getComment(): String {
|
||||
var comment = commentStandardText()
|
||||
val userDia = userDefinedDia
|
||||
if (userDia < MIN_DIA) {
|
||||
comment += "\n" + resourceHelper.gs(R.string.dia_too_short, userDia, MIN_DIA)
|
||||
override val comment
|
||||
get(): String {
|
||||
var comment = commentStandardText()
|
||||
val userDia = userDefinedDia
|
||||
if (userDia < MIN_DIA) {
|
||||
comment += "\n" + resourceHelper.gs(R.string.dia_too_short, userDia, MIN_DIA)
|
||||
}
|
||||
return comment
|
||||
}
|
||||
return comment
|
||||
}
|
||||
|
||||
abstract val peak: Int
|
||||
abstract fun commentStandardText(): String
|
||||
|
||||
companion object {
|
||||
|
||||
const val MIN_DIA = 5.0
|
||||
}
|
||||
}
|
|
@ -3,11 +3,14 @@ package info.nightscout.androidaps.plugins.insulin
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.utils.extensions.storeInt
|
||||
import info.nightscout.androidaps.utils.extensions.putInt
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.json.JSONObject
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
@ -23,12 +26,13 @@ class InsulinOrefFreePeakPlugin @Inject constructor(
|
|||
rxBus: RxBusWrapper, aapsLogger: AAPSLogger
|
||||
) : InsulinOrefBasePlugin(injector, resourceHelper, profileFunction, rxBus, aapsLogger) {
|
||||
|
||||
override fun getId(): Int {
|
||||
return InsulinInterface.OREF_FREE_PEAK
|
||||
}
|
||||
override val id get(): InsulinInterface.InsulinType = InsulinInterface.InsulinType.OREF_FREE_PEAK
|
||||
|
||||
override fun getFriendlyName(): String {
|
||||
return resourceHelper.gs(R.string.free_peak_oref)
|
||||
override val friendlyName get(): String = resourceHelper.gs(R.string.free_peak_oref)
|
||||
|
||||
override fun configuration(): JSONObject = JSONObject().putInt(R.string.key_insulin_oref_peak, sp, resourceHelper)
|
||||
override fun applyConfiguration(configuration: JSONObject) {
|
||||
configuration.storeInt(R.string.key_insulin_oref_peak, sp, resourceHelper)
|
||||
}
|
||||
|
||||
override fun commentStandardText(): String {
|
||||
|
@ -39,6 +43,7 @@ class InsulinOrefFreePeakPlugin @Inject constructor(
|
|||
get() = sp.getInt(R.string.key_insulin_oref_peak, DEFAULT_PEAK)
|
||||
|
||||
companion object {
|
||||
|
||||
private const val DEFAULT_PEAK = 75
|
||||
}
|
||||
|
||||
|
|
|
@ -3,10 +3,11 @@ package info.nightscout.androidaps.plugins.insulin
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import org.json.JSONObject
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
@ -21,18 +22,13 @@ class InsulinOrefRapidActingPlugin @Inject constructor(
|
|||
rxBus: RxBusWrapper, aapsLogger: AAPSLogger
|
||||
) : InsulinOrefBasePlugin(injector, resourceHelper, profileFunction, rxBus, aapsLogger) {
|
||||
|
||||
override val id get(): InsulinInterface.InsulinType = InsulinInterface.InsulinType.OREF_RAPID_ACTING
|
||||
override val friendlyName get(): String = resourceHelper.gs(R.string.rapid_acting_oref)
|
||||
|
||||
override fun getId(): Int {
|
||||
return InsulinInterface.OREF_RAPID_ACTING
|
||||
}
|
||||
override fun configuration(): JSONObject = JSONObject()
|
||||
override fun applyConfiguration(configuration: JSONObject) {}
|
||||
|
||||
override fun getFriendlyName(): String {
|
||||
return resourceHelper.gs(R.string.rapid_acting_oref)
|
||||
}
|
||||
|
||||
override fun commentStandardText(): String {
|
||||
return resourceHelper.gs(R.string.fastactinginsulincomment)
|
||||
}
|
||||
override fun commentStandardText(): String = resourceHelper.gs(R.string.fastactinginsulincomment)
|
||||
|
||||
override val peak = 75
|
||||
|
||||
|
|
|
@ -3,10 +3,11 @@ package info.nightscout.androidaps.plugins.insulin
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import org.json.JSONObject
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
@ -21,10 +22,11 @@ class InsulinOrefUltraRapidActingPlugin @Inject constructor(
|
|||
rxBus: RxBusWrapper, aapsLogger: AAPSLogger
|
||||
) : InsulinOrefBasePlugin(injector, resourceHelper, profileFunction, rxBus, aapsLogger) {
|
||||
|
||||
override val id get(): InsulinInterface.InsulinType = InsulinInterface.InsulinType.OREF_ULTRA_RAPID_ACTING
|
||||
override val friendlyName get(): String = resourceHelper.gs(R.string.ultrarapid_oref)
|
||||
|
||||
override fun getId(): Int = InsulinInterface.OREF_ULTRA_RAPID_ACTING
|
||||
|
||||
override fun getFriendlyName(): String = resourceHelper.gs(R.string.ultrarapid_oref)
|
||||
override fun configuration(): JSONObject = JSONObject()
|
||||
override fun applyConfiguration(configuration: JSONObject) {}
|
||||
|
||||
override fun commentStandardText(): String = resourceHelper.gs(R.string.ultrafastactinginsulincomment)
|
||||
|
||||
|
|
|
@ -404,7 +404,7 @@ class VirtualPumpPlugin @Inject constructor(
|
|||
}
|
||||
|
||||
fun refreshConfiguration() {
|
||||
val pumptype = sp.getString(R.string.key_virtualpump_type, "Generic AAPS")
|
||||
val pumptype = sp.getString(R.string.key_virtualpump_type, PumpType.GenericAAPS.description)
|
||||
val pumpTypeNew = PumpType.getByDescription(pumptype)
|
||||
aapsLogger.debug(LTag.PUMP, "Pump in configuration: $pumptype, PumpType object: $pumpTypeNew")
|
||||
if (pumpType == pumpTypeNew) return
|
||||
|
|
|
@ -3,6 +3,10 @@ package info.nightscout.androidaps.plugins.sensitivity;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.collection.LongSparseArray;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
@ -11,6 +15,7 @@ import javax.inject.Inject;
|
|||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
|
@ -22,6 +27,7 @@ import info.nightscout.androidaps.interfaces.PluginType;
|
|||
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||
import info.nightscout.androidaps.logging.LTag;
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction;
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.SMBDefaults;
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData;
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult;
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
|
||||
|
@ -179,4 +185,36 @@ public class SensitivityAAPSPlugin extends AbstractSensitivityPlugin {
|
|||
|
||||
return output;
|
||||
}
|
||||
|
||||
@NotNull @Override public SensitivityType getId() {
|
||||
return SensitivityType.SENSITIVITY_AAPS;
|
||||
}
|
||||
|
||||
@NotNull @Override public JSONObject configuration() {
|
||||
JSONObject c = new JSONObject();
|
||||
try {
|
||||
c.put(getResourceHelper().gs(R.string.key_absorption_maxtime), getSp().getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME));
|
||||
c.put(getResourceHelper().gs(R.string.key_openapsama_autosens_period), getSp().getInt(R.string.key_openapsama_autosens_period, 24));
|
||||
c.put(getResourceHelper().gs(R.string.key_openapsama_autosens_max), getSp().getDouble(R.string.key_openapsama_autosens_max, 1.2));
|
||||
c.put(getResourceHelper().gs(R.string.key_openapsama_autosens_min), getSp().getDouble(R.string.key_openapsama_autosens_min, 0.7));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override public void applyConfiguration(@NotNull JSONObject configuration) {
|
||||
try {
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_absorption_maxtime)))
|
||||
getSp().putDouble(R.string.key_absorption_maxtime, configuration.getDouble(getResourceHelper().gs(R.string.key_absorption_maxtime)));
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_autosens_period)))
|
||||
getSp().putDouble(R.string.key_openapsama_autosens_period, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_autosens_period)));
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_autosens_max)))
|
||||
getSp().getDouble(R.string.key_openapsama_autosens_max, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_autosens_max)));
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_autosens_min)))
|
||||
getSp().getDouble(R.string.key_openapsama_autosens_min, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_autosens_min)));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package info.nightscout.androidaps.plugins.sensitivity;
|
|||
import androidx.collection.LongSparseArray;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -12,6 +14,7 @@ import javax.inject.Inject;
|
|||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
|
@ -23,6 +26,7 @@ import info.nightscout.androidaps.interfaces.PluginType;
|
|||
import info.nightscout.androidaps.interfaces.ProfileFunction;
|
||||
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||
import info.nightscout.androidaps.logging.LTag;
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.SMBDefaults;
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult;
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData;
|
||||
|
@ -246,4 +250,36 @@ public class SensitivityOref1Plugin extends AbstractSensitivityPlugin {
|
|||
|
||||
return output;
|
||||
}
|
||||
|
||||
@NotNull @Override public JSONObject configuration() {
|
||||
JSONObject c = new JSONObject();
|
||||
try {
|
||||
c.put(getResourceHelper().gs(R.string.key_openapsama_min_5m_carbimpact), getSp().getDouble(R.string.key_openapsama_min_5m_carbimpact, SMBDefaults.min_5m_carbimpact));
|
||||
c.put(getResourceHelper().gs(R.string.key_absorption_cutoff), getSp().getDouble(R.string.key_absorption_cutoff, Constants.DEFAULT_MAX_ABSORPTION_TIME));
|
||||
c.put(getResourceHelper().gs(R.string.key_openapsama_autosens_max), getSp().getDouble(R.string.key_openapsama_autosens_max, 1.2));
|
||||
c.put(getResourceHelper().gs(R.string.key_openapsama_autosens_min), getSp().getDouble(R.string.key_openapsama_autosens_min, 0.7));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override public void applyConfiguration(@NotNull JSONObject configuration) {
|
||||
try {
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_min_5m_carbimpact)))
|
||||
getSp().putDouble(R.string.key_openapsama_min_5m_carbimpact, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_min_5m_carbimpact)));
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_absorption_cutoff)))
|
||||
getSp().putDouble(R.string.key_absorption_cutoff, configuration.getDouble(getResourceHelper().gs(R.string.key_absorption_cutoff)));
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_autosens_max)))
|
||||
getSp().getDouble(R.string.key_openapsama_autosens_max, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_autosens_max)));
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_autosens_min)))
|
||||
getSp().getDouble(R.string.key_openapsama_autosens_min, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_autosens_min)));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull @Override public SensitivityType getId() {
|
||||
return SensitivityType.SENSITIVITY_OREF1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,17 @@ package info.nightscout.androidaps.plugins.sensitivity;
|
|||
|
||||
import androidx.collection.LongSparseArray;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.Constants;
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
|
@ -199,4 +204,36 @@ public class SensitivityWeightedAveragePlugin extends AbstractSensitivityPlugin
|
|||
|
||||
return output;
|
||||
}
|
||||
|
||||
@NotNull @Override public SensitivityType getId() {
|
||||
return SensitivityType.SENSITIVITY_WEIGHTED;
|
||||
}
|
||||
|
||||
@NotNull @Override public JSONObject configuration() {
|
||||
JSONObject c = new JSONObject();
|
||||
try {
|
||||
c.put(getResourceHelper().gs(R.string.key_absorption_maxtime), getSp().getDouble(R.string.key_absorption_maxtime, Constants.DEFAULT_MAX_ABSORPTION_TIME));
|
||||
c.put(getResourceHelper().gs(R.string.key_openapsama_autosens_period), getSp().getInt(R.string.key_openapsama_autosens_period, 24));
|
||||
c.put(getResourceHelper().gs(R.string.key_openapsama_autosens_max), getSp().getDouble(R.string.key_openapsama_autosens_max, 1.2));
|
||||
c.put(getResourceHelper().gs(R.string.key_openapsama_autosens_min), getSp().getDouble(R.string.key_openapsama_autosens_min, 0.7));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
@Override public void applyConfiguration(@NotNull JSONObject configuration) {
|
||||
try {
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_absorption_maxtime)))
|
||||
getSp().putDouble(R.string.key_absorption_maxtime, configuration.getDouble(getResourceHelper().gs(R.string.key_absorption_maxtime)));
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_autosens_period)))
|
||||
getSp().putDouble(R.string.key_openapsama_autosens_period, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_autosens_period)));
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_autosens_max)))
|
||||
getSp().getDouble(R.string.key_openapsama_autosens_max, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_autosens_max)));
|
||||
if (configuration.has(getResourceHelper().gs(R.string.key_openapsama_autosens_min)))
|
||||
getSp().getDouble(R.string.key_openapsama_autosens_min, configuration.getDouble(getResourceHelper().gs(R.string.key_openapsama_autosens_min)));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,22 +7,27 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.db.BgReading
|
||||
import info.nightscout.androidaps.events.EventNewBG
|
||||
import info.nightscout.androidaps.interfaces.DatabaseHelperInterface
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryBgData
|
||||
import info.nightscout.androidaps.plugins.source.BGSourceFragment.RecyclerViewAdapter.BgReadingsViewHolder
|
||||
import info.nightscout.androidaps.utils.DateUtil
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.ListDiffCallback
|
||||
import info.nightscout.androidaps.utils.ListUpdateCallbackHelper
|
||||
import info.nightscout.androidaps.utils.T
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.androidaps.utils.extensions.toVisibility
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
|
@ -30,6 +35,7 @@ import kotlinx.android.synthetic.main.bgsource_fragment.*
|
|||
import javax.inject.Inject
|
||||
|
||||
class BGSourceFragment : DaggerFragment() {
|
||||
|
||||
@Inject lateinit var rxBus: RxBusWrapper
|
||||
@Inject lateinit var fabricPrivacy: FabricPrivacy
|
||||
@Inject lateinit var resourceHelper: ResourceHelper
|
||||
|
@ -51,14 +57,24 @@ class BGSourceFragment : DaggerFragment() {
|
|||
bgsource_recyclerview.setHasFixedSize(true)
|
||||
bgsource_recyclerview.layoutManager = LinearLayoutManager(view.context)
|
||||
val now = System.currentTimeMillis()
|
||||
bgsource_recyclerview.adapter = RecyclerViewAdapter(MainApp.getDbHelper().getAllBgreadingsDataFromTime(now - MILLS_TO_THE_PAST, false))
|
||||
bgsource_recyclerview.adapter = RecyclerViewAdapter(getBgData(now))
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
bgsource_recyclerview?.adapter = null // avoid leaks
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
disposable.add(rxBus
|
||||
.toObservable(EventAutosensCalculationFinished::class.java)
|
||||
.toObservable(EventNewBG::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ updateGUI() }) { fabricPrivacy.logException(it) }
|
||||
)
|
||||
disposable.add(rxBus
|
||||
.toObservable(EventNewHistoryBgData::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ updateGUI() }) { fabricPrivacy.logException(it) }
|
||||
)
|
||||
|
@ -73,30 +89,62 @@ class BGSourceFragment : DaggerFragment() {
|
|||
|
||||
private fun updateGUI() {
|
||||
val now = System.currentTimeMillis()
|
||||
bgsource_recyclerview?.swapAdapter(RecyclerViewAdapter(MainApp.getDbHelper().getAllBgreadingsDataFromTime(now - MILLS_TO_THE_PAST, false)), true)
|
||||
(bgsource_recyclerview?.adapter as? RecyclerViewAdapter)?.setData(getBgData(now))
|
||||
}
|
||||
|
||||
inner class RecyclerViewAdapter internal constructor(private var bgReadings: List<BgReading>) : RecyclerView.Adapter<BgReadingsViewHolder>() {
|
||||
private fun getBgData(now: Long) = MainApp.getDbHelper()
|
||||
.getAllBgreadingsDataFromTime(now - MILLS_TO_THE_PAST, false)
|
||||
|
||||
inner class RecyclerViewAdapter internal constructor(bgReadings: List<BgReading>) : RecyclerView.Adapter<BgReadingsViewHolder>() {
|
||||
|
||||
private var callbackHelper = ListUpdateCallbackHelper(this) { bgsource_recyclerview?.smoothScrollToPosition(0) }
|
||||
|
||||
private val currentData: MutableList<BgReading> = mutableListOf<BgReading>().also { it.addAll(bgReadings) }
|
||||
|
||||
fun setData(newList: List<BgReading>) {
|
||||
val diffResult = DiffUtil.calculateDiff(getListDiffCallback(ArrayList(newList), ArrayList(currentData)))
|
||||
currentData.clear()
|
||||
currentData.addAll(newList)
|
||||
diffResult.dispatchUpdatesTo(callbackHelper)
|
||||
}
|
||||
|
||||
private fun getListDiffCallback(newItems: List<BgReading>, oldItems: List<BgReading>): ListDiffCallback<BgReading> =
|
||||
object : ListDiffCallback<BgReading>(newItems, oldItems) {
|
||||
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
val new = newItems[newItemPosition]
|
||||
val old = oldItems[oldItemPosition]
|
||||
return new.hasValidNS == old.hasValidNS &&
|
||||
new.isValid == old.isValid &&
|
||||
new.date == old.date &&
|
||||
new.value == old.value
|
||||
}
|
||||
|
||||
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
|
||||
newItems[newItemPosition].date == oldItems[oldItemPosition].date
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): BgReadingsViewHolder {
|
||||
val v = LayoutInflater.from(viewGroup.context).inflate(R.layout.bgsource_item, viewGroup, false)
|
||||
return BgReadingsViewHolder(v)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: BgReadingsViewHolder, position: Int) {
|
||||
val bgReading = bgReadings[position]
|
||||
holder.ns.visibility = if (NSUpload.isIdValid(bgReading._id)) View.VISIBLE else View.GONE
|
||||
holder.invalid.visibility = if (!bgReading.isValid) View.VISIBLE else View.GONE
|
||||
val bgReading = currentData[position]
|
||||
holder.ns.visibility = (NSUpload.isIdValid(bgReading._id)).toVisibility()
|
||||
holder.invalid.visibility = bgReading.isValid.not().toVisibility()
|
||||
holder.date.text = dateUtil.dateAndTimeString(bgReading.date)
|
||||
holder.value.text = bgReading.valueToUnitsToString(profileFunction.getUnits())
|
||||
holder.direction.setImageResource(bgReading.directionToIcon(databaseHelper))
|
||||
holder.remove.tag = bgReading
|
||||
holder.remove.visibility = bgReading.isValid.toVisibility()
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return bgReadings.size
|
||||
return currentData.size
|
||||
}
|
||||
|
||||
inner class BgReadingsViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
var date: TextView = itemView.findViewById(R.id.bgsource_date)
|
||||
var value: TextView = itemView.findViewById(R.id.bgsource_value)
|
||||
var direction: ImageView = itemView.findViewById(R.id.bgsource_direction)
|
||||
|
@ -112,7 +160,6 @@ class BGSourceFragment : DaggerFragment() {
|
|||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.removerecord), text, Runnable {
|
||||
bgReading.isValid = false
|
||||
MainApp.getDbHelper().update(bgReading)
|
||||
updateGUI()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -120,4 +167,7 @@ class BGSourceFragment : DaggerFragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val BgReading.hasValidNS
|
||||
get() = NSUpload.isIdValid(this._id)
|
|
@ -145,8 +145,12 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
|
|||
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.careportal_profileswitch), resourceHelper.gs(R.string.copytolocalprofile) + "\n" + profileSwitch.customizedName + "\n" + dateUtil.dateAndTimeString(profileSwitch.date), Runnable {
|
||||
profileSwitch.profileObject?.let {
|
||||
val nonCustomized = it.convertToNonCustomizedProfile()
|
||||
localProfilePlugin.addProfile(localProfilePlugin.copyFrom(nonCustomized, profileSwitch.customizedName + " " + dateUtil.dateAndTimeString(profileSwitch.date).replace(".", "_")))
|
||||
rxBus.send(EventLocalProfileChanged())
|
||||
if (nonCustomized.isValid(resourceHelper.gs(R.string.careportal_profileswitch, false))) {
|
||||
localProfilePlugin.addProfile(localProfilePlugin.copyFrom(nonCustomized, profileSwitch.customizedName + " " + dateUtil.dateAndTimeString(profileSwitch.date).replace(".", "_")))
|
||||
rxBus.send(EventLocalProfileChanged())
|
||||
} else {
|
||||
OKDialog.show(activity, resourceHelper.gs(R.string.careportal_profileswitch), resourceHelper.gs(R.string.copytolocalprofile_invalid))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ public class DataService extends DaggerIntentService {
|
|||
aapsLogger.debug(LTag.DATASERVICE, "onHandleIntent " + BundleLogger.log(intent.getExtras()));
|
||||
|
||||
|
||||
boolean acceptNSData = !sp.getBoolean(R.string.key_ns_upload_only, false);
|
||||
boolean acceptNSData = !sp.getBoolean(R.string.key_ns_upload_only, true);
|
||||
|
||||
final String action = intent.getAction();
|
||||
if (Intents.ACTION_NEW_BG_ESTIMATE.equals(action)) {
|
||||
|
|
|
@ -1,35 +1,81 @@
|
|||
package info.nightscout.androidaps.skins
|
||||
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.TypedValue.COMPLEX_UNIT_PX
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.LayoutRes
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import info.nightscout.androidaps.R
|
||||
import kotlinx.android.synthetic.main.overview_fragment_nsclient.view.*
|
||||
import kotlinx.android.synthetic.main.overview_info_layout.view.*
|
||||
import kotlinx.android.synthetic.main.overview_statuslights_layout.view.*
|
||||
|
||||
interface SkinInterface {
|
||||
@get:StringRes val description : Int
|
||||
|
||||
val mainGraphHeight : Int // in dp
|
||||
val secondaryGraphHeight : Int // in dp
|
||||
@LayoutRes fun overviewLayout(isLandscape : Boolean, isTablet : Boolean, isSmallHeight : Boolean): Int
|
||||
@LayoutRes fun actionsLayout(isLandscape : Boolean, isSmallWidth : Boolean): Int = R.layout.actions_fragment
|
||||
@get:StringRes val description: Int
|
||||
|
||||
fun preProcessLandscapeOverviewLayout(dm: DisplayMetrics, iobLayout: LinearLayout, timeLayout: LinearLayout) {
|
||||
val mainGraphHeight: Int // in dp
|
||||
val secondaryGraphHeight: Int // in dp
|
||||
|
||||
@LayoutRes
|
||||
fun overviewLayout(isLandscape: Boolean, isTablet: Boolean, isSmallHeight: Boolean): Int
|
||||
|
||||
@LayoutRes
|
||||
fun actionsLayout(isLandscape: Boolean, isSmallWidth: Boolean): Int = R.layout.actions_fragment
|
||||
|
||||
fun preProcessLandscapeOverviewLayout(dm: DisplayMetrics, view: View, isTablet: Boolean) {
|
||||
// pre-process landscape mode
|
||||
val screenWidth = dm.widthPixels
|
||||
val screenHeight = dm.heightPixels
|
||||
val landscape = screenHeight < screenWidth
|
||||
|
||||
if (landscape) {
|
||||
val iobLayoutParams = iobLayout.layoutParams as ConstraintLayout.LayoutParams
|
||||
val iobLayoutParams = view.overview_iob_llayout.layoutParams as ConstraintLayout.LayoutParams
|
||||
iobLayoutParams.startToStart = ConstraintLayout.LayoutParams.UNSET
|
||||
iobLayoutParams.startToEnd = timeLayout.id
|
||||
iobLayoutParams.startToEnd = view.overview_time_llayout.id
|
||||
iobLayoutParams.topToBottom = ConstraintLayout.LayoutParams.UNSET
|
||||
iobLayoutParams.topToTop = ConstraintLayout.LayoutParams.PARENT_ID
|
||||
val timeLayoutParams = timeLayout.layoutParams as ConstraintLayout.LayoutParams
|
||||
val timeLayoutParams = view.overview_time_llayout.layoutParams as ConstraintLayout.LayoutParams
|
||||
timeLayoutParams.endToEnd = ConstraintLayout.LayoutParams.UNSET
|
||||
timeLayoutParams.endToStart = iobLayout.id
|
||||
timeLayoutParams.endToStart = view.overview_iob_llayout.id
|
||||
val cobLayoutParams = view.overview_cob_llayout.layoutParams as ConstraintLayout.LayoutParams
|
||||
cobLayoutParams.topToTop = ConstraintLayout.LayoutParams.PARENT_ID
|
||||
val basalLayoutParams = view.overview_basal_llayout.layoutParams as ConstraintLayout.LayoutParams
|
||||
basalLayoutParams.topToTop = ConstraintLayout.LayoutParams.PARENT_ID
|
||||
val extendedLayoutParams = view.overview_extended_llayout.layoutParams as ConstraintLayout.LayoutParams
|
||||
extendedLayoutParams.topToTop = ConstraintLayout.LayoutParams.PARENT_ID
|
||||
val asLayoutParams = view.overview_as_llayout.layoutParams as ConstraintLayout.LayoutParams
|
||||
asLayoutParams.topToTop = ConstraintLayout.LayoutParams.PARENT_ID
|
||||
|
||||
if (isTablet) {
|
||||
for (v in listOf<TextView>(
|
||||
view.overview_bg,
|
||||
view.overview_time,
|
||||
view.overview_timeagoshort,
|
||||
view.overview_iob,
|
||||
view.overview_cob,
|
||||
view.overview_basebasal,
|
||||
view.overview_extendedbolus,
|
||||
view.overview_sensitivity
|
||||
)) v.setTextSize(COMPLEX_UNIT_PX, v.textSize * 1.5f)
|
||||
for (v in listOf<TextView>(
|
||||
view.overview_pump,
|
||||
view.overview_openaps,
|
||||
view.overview_uploader,
|
||||
view.careportal_canulaage,
|
||||
view.careportal_insulinage,
|
||||
view.careportal_reservoirlevel,
|
||||
view.careportal_reservoirlevel,
|
||||
view.careportal_sensorage,
|
||||
view.careportal_pbage,
|
||||
view.careportal_batterylevel
|
||||
)) v.setTextSize(COMPLEX_UNIT_PX, v.textSize * 1.3f)
|
||||
view.overview_time_llayout.orientation = LinearLayout.HORIZONTAL
|
||||
view.overview_timeagoshort.setTextSize(COMPLEX_UNIT_PX, view.overview_time.textSize)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.skins
|
||||
|
||||
import android.util.DisplayMetrics
|
||||
import android.widget.LinearLayout
|
||||
import android.view.View
|
||||
import info.nightscout.androidaps.Config
|
||||
import info.nightscout.androidaps.R
|
||||
import javax.inject.Inject
|
||||
|
@ -17,15 +17,15 @@ class SkinLowRes @Inject constructor(private val config: Config) : SkinInterface
|
|||
override fun overviewLayout(isLandscape: Boolean, isTablet: Boolean, isSmallHeight: Boolean): Int =
|
||||
when {
|
||||
config.NSCLIENT -> R.layout.overview_fragment_nsclient
|
||||
isSmallHeight || isLandscape -> R.layout.overview_fragment_landscape
|
||||
isLandscape -> R.layout.overview_fragment_landscape
|
||||
else -> R.layout.overview_fragment
|
||||
}
|
||||
|
||||
override fun actionsLayout(isLandscape: Boolean, isSmallWidth: Boolean): Int =
|
||||
when {
|
||||
isLandscape || !isSmallWidth -> R.layout.actions_fragment
|
||||
isLandscape -> R.layout.actions_fragment
|
||||
else -> R.layout.actions_fragment_lowres
|
||||
}
|
||||
|
||||
override fun preProcessLandscapeOverviewLayout(dm: DisplayMetrics, iobLayout: LinearLayout, timeLayout: LinearLayout) {}
|
||||
}
|
||||
override fun preProcessLandscapeOverviewLayout(dm: DisplayMetrics, view: View, isTablet: Boolean) {}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class AndroidPermission @Inject constructor(
|
|||
private var permission_battery_optimization_failed = false
|
||||
|
||||
@SuppressLint("BatteryLife")
|
||||
private fun askForPermission(activity: FragmentActivity, permission: Array<String>, requestCode: Int) {
|
||||
fun askForPermission(activity: FragmentActivity, permission: Array<String>, requestCode: Int) {
|
||||
var test = false
|
||||
var testBattery = false
|
||||
for (s in permission) {
|
||||
|
|
|
@ -68,7 +68,7 @@ class TddCalculator @Inject constructor(
|
|||
val absoluteRate = tbr?.tempBasalConvertedToAbsolute(t, profile) ?: profile.getBasal(t)
|
||||
tdd.basal += absoluteRate / 60.0 * 5.0
|
||||
|
||||
if (!activePlugin.getActivePump().isFakingTempsByExtendedBoluses()) {
|
||||
if (!activePlugin.activePump.isFakingTempsByExtendedBoluses()) {
|
||||
// they are not included in TBRs
|
||||
val eb = getExtendedBolusFromHistory(t)
|
||||
val absoluteEbRate = eb?.absoluteRate() ?: 0.0
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package info.nightscout.androidaps.utils.wizard
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
|
@ -16,7 +17,7 @@ class QuickWizard @Inject constructor(
|
|||
private var storage = JSONArray()
|
||||
|
||||
init {
|
||||
setData(JSONArray(sp.getString("QuickWizard", "[]")))
|
||||
setData(JSONArray(sp.getString(R.string.key_quickwizard, "[]")))
|
||||
}
|
||||
|
||||
fun getActive(): QuickWizardEntry? {
|
||||
|
@ -32,7 +33,7 @@ class QuickWizard @Inject constructor(
|
|||
}
|
||||
|
||||
fun save() {
|
||||
sp.putString("QuickWizard", storage.toString())
|
||||
sp.putString(R.string.key_quickwizard, storage.toString())
|
||||
}
|
||||
|
||||
fun size(): Int = storage.length()
|
||||
|
|
55
app/src/main/res/layout/activity_preferences.xml
Normal file
55
app/src/main/res/layout/activity_preferences.xml
Normal file
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/filter"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Medium"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/pref_filter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:inputType="text" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pref_filter_clear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:srcCompat="@android:drawable/ic_menu_close_clear_cancel" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"></FrameLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
|
@ -35,6 +35,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/overview_bg"
|
||||
app:layout_constraintEnd_toStartOf="@+id/overview_apsmode_llayout"
|
||||
app:layout_constraintStart_toEndOf="@+id/overview_arrow"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
@ -111,6 +112,7 @@
|
|||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/overview_bg"
|
||||
app:layout_constraintEnd_toStartOf="@id/overview_time_llayout"
|
||||
app:layout_constraintStart_toEndOf="@id/overview_deltas_llayout"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
@ -142,6 +144,7 @@
|
|||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/overview_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/overview_apsmode_llayout"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
@ -178,6 +181,7 @@
|
|||
android:layout_marginStart="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/overview_cob_llayout"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/overview_bg">
|
||||
|
@ -206,15 +210,16 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/overview_basal_llayout"
|
||||
app:layout_constraintStart_toEndOf="@+id/overview_iob_llayout"
|
||||
app:layout_constraintTop_toTopOf="@+id/overview_iob_llayout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/overview_carbs_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:id="@+id/overview_carbs_icon"
|
||||
android:background="@drawable/anim_carbs" />
|
||||
|
||||
<TextView
|
||||
|
@ -235,6 +240,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/overview_extended_llayout"
|
||||
app:layout_constraintStart_toEndOf="@+id/overview_cob_llayout"
|
||||
app:layout_constraintTop_toTopOf="@+id/overview_iob_llayout">
|
||||
|
@ -264,6 +270,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/overview_as_llayout"
|
||||
app:layout_constraintStart_toEndOf="@+id/overview_basal_llayout"
|
||||
app:layout_constraintTop_toTopOf="@+id/overview_iob_llayout">
|
||||
|
@ -292,6 +299,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/overview_extended_llayout"
|
||||
app:layout_constraintTop_toTopOf="@+id/overview_iob_llayout">
|
||||
|
|
|
@ -570,7 +570,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Basale koers is verander op pomp, maar kon nie dit teruglees nie</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Kontroleer tans vir geskiedenis veranderinge</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Veelvuldige boluses met dieselfde hoeveelheid binne die dieselfde minuut was nounet ingevoer. Slegs een rekord kon bygevoeg word in behandelings. Kontroleer asseblief die pomp en voeg per hand \'n bolus rekord met behulp van die Careportal oortjie maak seker om \'n bolus te skep met \'n tyd deur geen ander bolus gebruik.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">Die laaste bolus is ouer as 24 uur of is in die toekoms. Kontroleer asseblief of die datum op die pomp reg ingestel is.</string>
|
||||
<string name="combo_suspious_bolus_time">Tyd/datum van die gelewerde bolus op pomp lyk verkeerd, IAB is waarskynlik verkeerd. Kontroleer asseblief pomp tyd/datum.</string>
|
||||
<string name="profileswitch_ismissing">ProfileSwitch ontbreek. Doen \'n profiel skakelaar of druk \"Aktiveer profiel\" in die LokaleProfiel.</string>
|
||||
|
|
|
@ -405,11 +405,13 @@
|
|||
<string name="wear_detailedIOB_summary">Раздели IOB от болус и от базал на часовника</string>
|
||||
<string name="nosuccess">неуспешно - моля проверете телефона</string>
|
||||
<string name="notavailable">---</string>
|
||||
<string name="patientage">Тип пациент</string>
|
||||
<string name="child">Дете</string>
|
||||
<string name="teenage">Тийнейджър</string>
|
||||
<string name="adult">Възрастен</string>
|
||||
<string name="resistantadult">Възрастни с голяма инсулинова резистентност</string>
|
||||
<string name="pregnant">Бременност</string>
|
||||
<string name="patientage_summary">Моля, изберете тип на пациента за настройка на границите за безопастност</string>
|
||||
<string name="patient_name">Име на пациента</string>
|
||||
<string name="patient_name_summary">Моля, посочете име на пациента или измислено име, за да се различават</string>
|
||||
<string name="patient_name_default" comment="This is default patient display name, when user does not provide real one">Потребител</string>
|
||||
|
@ -717,7 +719,7 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Базалният процент е променен в помпата, но прочитането е неуспешно</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Проверка за промени в историята на помпата</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Бяха внесени няколко болуса със същото количество в рамките на една и съща минута. Само един запис може да бъде добавен към лечението. Моля, проверете помпата и ръчно добавете болус запис, като използвате раздела Careportal . Уверете се, че сте създали болус и нямате друг болус за същото време.</string>
|
||||
<string name="about_link_urls"> http://www.androidaps.org facebook: http://facebook.androidaps.org</string>
|
||||
<string name="about_link_urls">\n\nдокументация:\nhttps://androidaps.readthedocs.io\n\nfacebook:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
|
||||
<string name="combo_check_date">Последният болус е с време от преди 24 часа или е в бъдеще. Моля, проверете дали датата на помпата е зададена правилно.</string>
|
||||
<string name="combo_suspious_bolus_time">Времето/датата на доставения болус на помпата изглежда погрешно, IOB вероятно е неправилно. Моля, проверете часа/датата на помпата.</string>
|
||||
<string name="profileswitch_ismissing">Смяната на профила не е отразена. Моля, направете превключване на потребителския профил или натиснете \"Активирай профил\" в Локален профил.</string>
|
||||
|
@ -1231,4 +1233,7 @@
|
|||
<string name="uploaded_data">Качени данни</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Следните данни ще бъдат качвани във вашия Open Humans акаунт: Глюкозни стойности, болуси, въглехидрати, удължени болуси, профилни смени, общи дневни дози, временни базали, временни цели, предпочитания, версия на AAPS, модел на телефона и размери на екрана. Тайна или лична информация, като например вашия адрес на Nightscout или API, няма да бъдат качени.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">RileyLink статус:</string>
|
||||
<string name="filter">Филтър</string>
|
||||
<string name="copytolocalprofile_invalid">Не може да се създаде локален профил. Профилът е невалиден.</string>
|
||||
<string name="cta_dont_kill_my_app_info">Не убивай приложението?</string>
|
||||
</resources>
|
||||
|
|
|
@ -386,7 +386,7 @@
|
|||
<string name="nsclientinternal_url">Adresa URL:</string>
|
||||
<string name="nsclientinternal_autoscroll">Posouvat</string>
|
||||
<string name="restart">Restart</string>
|
||||
<string name="nsclientinternal_title">Interní NSClient</string>
|
||||
<string name="nsclientinternal_title">NSClient</string>
|
||||
<string name="nsclientinternal_url_title">Adresa Nightscoutu</string>
|
||||
<string name="nsclientinternal_url_dialogmessage">Vložte adresu Nightscoutu</string>
|
||||
<string name="nsclientinternal_secret_title">NS heslo (API secret)</string>
|
||||
|
@ -719,7 +719,7 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Bazál na pumpě byl změněn, ale čtení selhalo</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Kontroluji změny v historii</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Byly načteny bolusy stejné velikosti během jedné minuty. Do ošetření je možné přidat jen jeden. Zkontrolujte pumpu a přidejte bolus do ošetření ručně tak, aby čas nekolidoval.</string>
|
||||
<string name="about_link_urls">\nhttp://www.androidaps.org\n\nfacebook: \nhttp://facebook.androidaps.org</string>
|
||||
<string name="about_link_urls">\n\ndokumentace:\nhttps://androidaps.readthedocs.io\n\nfacebook:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
|
||||
<string name="combo_check_date">Poslední bolus je starší než 24h nebo v budoucnu. Zkontrolujte čas v pumpě.</string>
|
||||
<string name="combo_suspious_bolus_time">Datum/čas podaného bolusu se zdá špatně. IOB bude chybné. Zkontrolujte čas v pumpě.</string>
|
||||
<string name="profileswitch_ismissing">Přepnutí profilu chybí. Proveďte přepnutí profilu nebo ho aktivujte na záložce lokálního profilu.</string>
|
||||
|
@ -1233,4 +1233,7 @@
|
|||
<string name="uploaded_data">Odeslaná data</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Následující data budou nahrána do vašeho účtu Open Humans: hodnoty glykémie, bolusy, sacharidy, události péče (kromě poznámek), rozložené bolusy, přepnutí profilu, celkové denní dávky, dočasné bazály, nastavení, verze aplikace, model zařízení a rozměry obrazovky. Tajné nebo soukromé informace, jako je URL nebo API heslo vašeho Nightscoutu, nahrány nebudou.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">Status RileyLink:</string>
|
||||
<string name="filter">Filtr</string>
|
||||
<string name="copytolocalprofile_invalid">Nelze vytvořit lokální profil. Profil je neplatný.</string>
|
||||
<string name="cta_dont_kill_my_app_info">Nezabíjet mou aplikaci?</string>
|
||||
</resources>
|
||||
|
|
|
@ -719,7 +719,7 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Das Einlesen der geänderten Basalrate in der Pumpe schlug fehl</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Änderungen der Historie werden gesucht</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Der Import mehrerer Boli der gleichen Menge, abgegeben in der gleichen Minute, ist gescheitert: Nur ein Datensatz konnte den Behandlungen hinzugefügt werden. Bitte überprüfe die Pumpe und verwende das Careportal, um fehlende Einträge hinzuzufügen. Stelle sicher, dass keine Einträge für genau dieselbe Minute mit derselben Menge hinzugefügt werden.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nSupport:\nhttps://de.loopercommunity.org/\nhttp://facebook.androidaps.org</string>
|
||||
<string name="about_link_urls">\n\nDokumentation:\nhttps://androidaps.readthedocs.io\n\nLooper-Community:\nhttps://loopercommunity.org\n\nfacebook:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
|
||||
<string name="combo_check_date">Der letzte Bolus liegt mehr als 24 Stunden zurück oder liegt in der Zukunft. Prüfe bitte das Datum auf der Pumpe.</string>
|
||||
<string name="combo_suspious_bolus_time">Zeit/Datum des abgegebenen Boluses auf der Pumpe erscheint falsch, IOB ist wahrscheinlich nicht korrekt. Bitte prüfe Zeit/Datum der Pumpe.</string>
|
||||
<string name="profileswitch_ismissing">Profil-Wechsel fehlt, bitte nimm einen Profil-Wechsel vor oder drücke \"AKTIVIERE PROFIL\" im lokalen Profil.</string>
|
||||
|
@ -1234,4 +1234,7 @@ Unerwartetes Verhalten.</string>
|
|||
<string name="uploaded_data">Daten hochgeladen</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Die folgenden Daten werden auf Dein Open Humans-Konto hochgeladen: Glukosewerte, Boli, Kohlenhydrate, Careportal-Ereignisse (außer Notizen), erweiterte Boli, Profilwechsel, Gesamttagesdosen, temporäre Basalwerte, Temporäre Ziele, Einstellungen, Anwendungsversion, Gerätemodell und Bildschirmabmessungen. Vertrauliche oder private Informationen wie z.B. Deine Nightscout-URL oder Dein API-Secret werden nicht hochgeladen.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">RileyLink Status:</string>
|
||||
<string name="filter">Filter</string>
|
||||
<string name="copytolocalprofile_invalid">Lokales Profil kann nicht erstellt werden. Profil ist ungültig.</string>
|
||||
<string name="cta_dont_kill_my_app_info">Don\'t kill my app?</string>
|
||||
</resources>
|
||||
|
|
|
@ -575,7 +575,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Ο βασικός ρυθμός της αντλίας έχει αλλάξει αλλά η ανάγνωση έχει αποτύχει</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Έλεγχος για αλλαγές στο ιστορικό</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Πολλαπλά bolus της ίδιας ποσότητας φορτώθηκαν μέσα σε ένα λεπτό. Μόνο μία εγγραφή μπορεί να προστεθεί στη θεραπεία. Ελέγξτε την αντλία και προσθέστε χειροκίνητα το bolus χρησιμοποιώντας το Careportal. Σιγουρευτείτε ότι δημιουργήσατε ένα bolus σε χρόνο που να μη γίνεται άλλο bolus.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">Το τελευταίο bolus είναι παλαιότερο από 24 ώρες ή είναι προγραμματισμένο στο μέλλον. Ελέγξτε αν είναι σωστή η ώρα στην αντλία.</string>
|
||||
<string name="combo_suspious_bolus_time">Η ημερομηνία/ώρα έγχυσης του bolus φαίνεται λάθος. Το IOB είναι λάθος. Ελέγξτε την ώρα/ημερομηνία της αντλίας.</string>
|
||||
<string name="profileswitch_ismissing">Η αλλαγή προφίλ λείπει. Αλλάξτε το προφίλ ή πατήστε \"Ενεργοποίηση Προφίλ\" στο Τοπικό Προφίλ.</string>
|
||||
|
|
|
@ -701,7 +701,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Tasa Basal cambiada en bomba, pero falló al leer</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Comprobando cambios en el historial</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Múltiples bolos con la misma cantidad en el mismo minuto fueron importados. Sólo se puede agregar un registro a los tratamientos. Verifique la bomba y agregue manualmente un registro de bolo usando la pestaña Careportal. Asegúrese de crear un bolo con un tiempo que no use otro bolo.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">El último bolo tiene más de 24 horas o está en el futuro. Comprueba que la fecha en la bomba está configurada correctamente.</string>
|
||||
<string name="combo_suspious_bolus_time">La hora / fecha del bolo administrado en la bomba parece incorrecta; es probable que la IOB sea incorrecta. Verifique la hora / fecha de la bomba.</string>
|
||||
<string name="profileswitch_ismissing">Falta Cambio de Perfil. Haga un Cambio de Perfil o presione \"Activar perfil\" en PerfilLocal.</string>
|
||||
|
|
|
@ -720,7 +720,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Le pourcentage de basal a changé dans la pompe mais sa lecture a échoué</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Vérification des modifications de l\'historique</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">De multiples bolus similaires viennent d\'être importés dans la même minute. Un seul enregistrement a pu être ajouté aux traitements. Merci de vérifier la pompe et d\'ajouter manuellement un enregistrement de bolus en utilisant l\'onglet Careportal. Assurez vous de créer ce bolus avec un temps différent de tous les autres Bolus.</string>
|
||||
<string name="about_link_urls">\n\nhttps://androidaps.readthedocs.io/en/latest/CROWDIN/fr\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">Le dernier bolus enregistré date d\'il y a plus de 24h ou est dans le futur. Vérifiez que la date dans la pompe est correctement définie.</string>
|
||||
<string name="combo_suspious_bolus_time">L\'heure/date sur la pompe du dernier bolus administré semble erroné. L\'IA est probablement incorrecte. Vérifiez l\'heure/date de la pompe.</string>
|
||||
<string name="profileswitch_ismissing">ProfileSwitch manquant. S’il vous plaît faire un changement de profil ou appuyez sur « Activer le profil » dans le LocalProfile.</string>
|
||||
|
@ -1234,4 +1233,5 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
|
|||
<string name="uploaded_data">Données transférées</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Les données suivantes seront téléchargées sur votre compte Open Humans : glycémie, bolus, glucides, événements Careportal (sauf les notes), bolus étendus, changements de profil, doses quotidiennes totales, basales temporaires, cibles temporaires, préférences, version de l\'application, modèle de l\'appareil et dimensions de l\'écran. Les informations secrètes ou privées telles que votre URL Nightscout ou votre API secret ne seront pas téléchargés.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">État du RileyLink :</string>
|
||||
<string name="filter">Filtrer</string>
|
||||
</resources>
|
||||
|
|
|
@ -719,7 +719,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Velocità basale cambiata sul micro, ma la sua lettura è fallita</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Controllo modifiche allo storico</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Sono appena stati importati più boli con la stessa quantità nello stesso minuto. Solo un record può essere aggiunto ai trattamenti. Controlla il micro e aggiungi manualmente un record di bolo utilizzando la sezione Portale. Assicurati di creare un bolo con un\'ora non utilizzata da nessun altro bolo.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\n\nfacebook:\nhttp://facebook.androidaps.org</string>
|
||||
<string name="combo_check_date">L\'ultimo bolo è più vecchio di 24 ore o ha una data nel futuro. Controlla che la data sul micro sia impostata correttamente.</string>
|
||||
<string name="combo_suspious_bolus_time">L\'ora/la data del bolo erogato sul micro sembra errata, IOB probabilmente non è corretto. Controlla l\'ora e/o la data del micro.</string>
|
||||
<string name="profileswitch_ismissing">Nessun cambio profilo. Effettua un cambio profilo o premi \"Attiva profilo\" nella sezione Profilo locale.</string>
|
||||
|
@ -1233,4 +1232,5 @@
|
|||
<string name="uploaded_data">Dati caricati</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">I seguenti dati verranno caricati sul tuo account Open Humans: valori glicemia, boli, carboidrati, eventi portale (eccetto note), boli estesi, cambi profilo, dosi giornaliere totali (TDD), basali temporanee, target temporanei, preferenze, versione dell\'applicazione, modello del dispositivo e dimensioni dello schermo. Informazioni segrete o private come l\'URL di Nightscout o l\'API secret non verranno caricate.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">Stato RileyLink:</string>
|
||||
<string name="filter">Filtro</string>
|
||||
</resources>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<string name="reset_db_confirm">אתם בטוחים שאתם רוצים לאפס את מסדי הנתונים?</string>
|
||||
<string name="nav_exit">יציאה</string>
|
||||
<string name="ns_sync_use_absolute_title">השתמש תמיד בערכים בזאלים מוחלטים</string>
|
||||
<string name="alert_dialog_storage_permission_text">בבקשה אתחל את הסמרטפון שלך או תרענן את אפלקצית AndroidAPS בהגדרות המערכת \nאחרת AndroidAPS לא יוכל לבצע רישום (חשוב לעקוב אחר ולוודא כי האלגוריתמים פועלים כראוי)!</string>
|
||||
<string name="alert_dialog_storage_permission_text">נא לאתחל את הסמרטפון שלכם או הפעילו מחדש את אפלקציית AndroidAPS בהגדרות המערכת \nאחרת AndroidAPS לא יוכל לבצע רישום (חשוב לעקוב ולוודא כי האלגוריתמים פועלים כראוי)!</string>
|
||||
<string name="alert_dialog_permission_battery_optimization_failed">נראה שמכשיר זה אינו תומך ברשימת היתרים למיטוב הסוללה - ייתכן שתיתקל בבעיות ביצועים.</string>
|
||||
<string name="description_actions">לחצנים לגישה מהירה לפונקציות שימושיות</string>
|
||||
<string name="description_config_builder">משמש לקביעת תצורה של תוספים פעילים</string>
|
||||
|
@ -89,7 +89,7 @@
|
|||
<string name="virtualpump">משאבה וירטואלית</string>
|
||||
<string name="careportal">פורטל טיפולים</string>
|
||||
<string name="configbuilder_pump">משאבה</string>
|
||||
<string name="configbuilder_pump_description">עם משאבה אתם מעוניינים להשתמש ב-AndroidAPS?</string>
|
||||
<string name="configbuilder_pump_description">עם איזו משאבה אתם מעוניינים להשתמש ב-AndroidAPS?</string>
|
||||
<string name="configbuilder_treatments">טיפולים</string>
|
||||
<string name="configbuilder_treatments_description">איזה תוסף ישמש לתפעול הטיפולים?</string>
|
||||
<string name="configbuilder_profile">פרופיל</string>
|
||||
|
@ -719,7 +719,7 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">המינון הבזאלי במשאבה השתנה אך קריאתו נכשלה</string>
|
||||
<string name="combo_activity_checking_for_history_changes">בודק שינויים בהיסטוריה</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">בולוסים מרובים באותו הגודל בתוך הובאו באותה דקה. ניתן להוסיף רק רשומה אחת לטיפולים. בדקו את המשאבה והוסיפו באופן ידני רשומת בולוס בלשונית פורטל הטיפולים. יש ליצור רשומות בולוס עם זמנים שונים מבולוסים אחרים.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="about_link_urls">\n\nתיעוד:\nhttps://androidaps.readthedocs.io\n\nפייסבוק:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
|
||||
<string name="combo_check_date">הבולוס האחרון נרשם לפני 24 שעות או בשעה עתידית, נא לבדוק את כיוון השעון ותאריך במשאבה.</string>
|
||||
<string name="combo_suspious_bolus_time">זמן\תאריך הבולוס שהוזרק מהמשאבה נראה לא נכון, IOB כנראה שגוי, בדקו את השעון ואת התאריך במשאבה.</string>
|
||||
<string name="profileswitch_ismissing">שינוי פרופיל חסר. אנא החליפו פרופיל או לחצו על \"הפעל פרופיל\" בפרופיל המקומי.</string>
|
||||
|
@ -1233,4 +1233,7 @@
|
|||
<string name="uploaded_data">נתונים שהועלו</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">הנתונים הבאים יועלו לחשבון Open Humans שלכם: ערכי גלוקוז, בולוסים, פחמימות, אירועים מפורטל הטיפולים (מלבד הערות), בולוסים ממושכים, החלפות פרופיל, מינונים יומיים כוללים, באזאלים זמניים, ערכי מטרה זמניים, העדפות, גרסת יישום, דגם המכשיר ומממדי המסך. מידע סודי או פרטי כגון כתובת ה-Nightscout האישית או סוד ה-API שלכם לא יועלו.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">מצב ריילילינק:</string>
|
||||
<string name="filter">סינון</string>
|
||||
<string name="copytolocalprofile_invalid">לא ניתן ליצור פרופיל מקומי. הפרופיל אינו חוקי.</string>
|
||||
<string name="cta_dont_kill_my_app_info">לא להשבית את האפליקציה שלי?</string>
|
||||
</resources>
|
||||
|
|
|
@ -596,7 +596,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">펌프의 Basal 양이 변경되었지만 읽기를 실패했습니다.</string>
|
||||
<string name="combo_activity_checking_for_history_changes">이력 변경 확인중</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">동일한 시간(분)에 동일한 양의 2개이상의 Bolus가 주입되었습니다. 오직 하나의 기록만이 관리에 입력될 수 있습니다. 펌프를 확인한 후 케어포털 탭에서 Bolus 기록을 수동으로 추가하세요. 동일한 시간에 동일한 양의 Bolus를 주입하지 않도록 하세요.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">최근 Bolus가 24시간 전 혹은 미래에 있습니다. 펌프의 날짜가 제대로 설정되어 있는지 확인해보세요.</string>
|
||||
<string name="combo_suspious_bolus_time">펌프에서 주입된 Bolus의 시간/날짜가 잘못되었습니다. IOB가 부정확할 수 있습니다. 펌프 시간/날짜를 확인하세요.</string>
|
||||
<string name="profileswitch_ismissing">프로파일변경 누락. 로컬 프로파일에서 프로파일 변경을 하거나 \"프로파일 활성화하기\"를 누르세요.</string>
|
||||
|
|
|
@ -707,7 +707,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Valandinė bazė pompoje pasikeitė, bet nuskaityti nepavyko</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Tikrinami istorijos pokyčiai</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Keletas bolusų su tuo pačiu kiekiu buvo importuoti per tą pačią minutę. Tik vienas įrašas gali būti pridėtas. Prašome patikrinti pompą ir rankiniu būdu įveskite bolusą, naudojant Priežiūra skiltį. Įsitikinkite, kad boluso įrašo laikas nesutampa su kitais įrašais.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">Paskutinis bolusas įrašytas anksčiau nei prieš 24 val. arba yra ateityje. Prašome patikrinti, ar data pompoje nustatyta teisingai.</string>
|
||||
<string name="combo_suspious_bolus_time">Suleisto boluso laikas/data pompoje yra neteisingas, AIO panašu yra nekorektiškas. Prašome patikrinti pompos laiką/datą.</string>
|
||||
<string name="profileswitch_ismissing">Neatliktas profilio keitimas. Prašome atlikti profilio keitimą arba paspausti \"Aktyvuoti profilį\" Vietinio profilio (VP) skiltyje.</string>
|
||||
|
|
|
@ -134,6 +134,8 @@
|
|||
<string name="ic_increasingvalue">Hogere KH ratios leiden tot minder insuline afgifte voor een bepaalde hoeveelheid koolhydraten.</string>
|
||||
<string name="ic_decreasingvalue">Lagere KH ratios leiden tot minder insuline afgifte voor een bepaalde hoeveelheid koolhydraten.</string>
|
||||
<string name="ic_noeffect">Als je 0 COB hebt zal het veranderen van KH ratio leiden tot een andere hoeveelheid insuline om jouw BG te corrigeren.</string>
|
||||
<string name="ic_different">KH ratio zal anders zijn als je een brood-eenheid telt als 10g of 12g koolhydraten.</string>
|
||||
<string name="ic_meaning">KH ratio betekent: Hoeveel koolhydraten gebruik je voor 1E insuline.</string>
|
||||
<string name="ic_hint1">https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Getting-Started/FAQ.html#Koolhydraat-ratio-KH-g-E</string>
|
||||
<string name="profileswitch_label">Onderwerp: Profiel wissels</string>
|
||||
<string name="profileswitch_pctwillchange"> Bij het opgeven van 90% in je profiel wissel…</string>
|
||||
|
|
|
@ -261,6 +261,7 @@
|
|||
<string name="valueoutofrange">Waarde %1$s valt buiten de toegestane harde limieten</string>
|
||||
<string name="smscommunicator_pumpconnectwithcode">Om verbinding te maken met pomp antwoord met code %1$s</string>
|
||||
<string name="smscommunicator_pumpconnectfail">Verbinding maken met pomp is mislukt</string>
|
||||
<string name="smscommunicator_pumpdisconnectwithcode">Om de pomp te ontkoppelen voor %1$d minuten antwoord met code %2$s</string>
|
||||
<string name="smscommunicator_pumpdisconnected">Pomp verbinding verbroken</string>
|
||||
<string name="smscommunicator_reconnect">Pomp opnieuw verbonden</string>
|
||||
<string name="smscommunicator_remotecommandnotallowed">Commando\'s op afstand zijn niet toegestaan</string>
|
||||
|
@ -404,10 +405,13 @@
|
|||
<string name="wear_detailedIOB_summary">Splits IOB in bolus en basaal op de watchface</string>
|
||||
<string name="nosuccess">Niet geslaagd - controleer de telefoon</string>
|
||||
<string name="notavailable">n.v.t.</string>
|
||||
<string name="patientage">Type patiënt</string>
|
||||
<string name="child">Kind</string>
|
||||
<string name="teenage">Tiener</string>
|
||||
<string name="adult">Volwassene</string>
|
||||
<string name="resistantadult">insuline resistente volwassene</string>
|
||||
<string name="pregnant">Zwangerschap</string>
|
||||
<string name="patientage_summary">Selecteer het type patiënt om de veiligheidslimieten in te stellen</string>
|
||||
<string name="patient_name">Naam patiënt</string>
|
||||
<string name="patient_name_summary">Geef de naam of roepnaam van de patiënt op om onderscheid te maken tussen meerdere setups</string>
|
||||
<string name="patient_name_default" comment="This is default patient display name, when user does not provide real one">Gebruiker</string>
|
||||
|
@ -451,6 +455,8 @@
|
|||
<string name="statuslights_iage_critical">Drempel alarm insuline leeftijd [h]</string>
|
||||
<string name="statuslights_sage_warning">Drempel waarschuwing sensor leeftijd [h]</string>
|
||||
<string name="statuslights_sage_critical">Drempel alarm sensor leeftijd [h]</string>
|
||||
<string name="statuslights_sbat_warning">Drempel waarschuwing batterij niveau [%]</string>
|
||||
<string name="statuslights_sbat_critical">Drempel alarm batterij niveau [%]</string>
|
||||
<string name="statuslights_bage_warning">Drempel waarschuwing batterij leeftijd [h]</string>
|
||||
<string name="statuslights_bage_critical">Drempel alarm batterij niveau [h]</string>
|
||||
<string name="statuslights_res_warning">Drempel waarschuwing reservoir niveau [E]</string>
|
||||
|
@ -481,6 +487,12 @@
|
|||
<string name="careportal_insulinage_label">Ouderdom insuline</string>
|
||||
<string name="doprofileswitch">Profiel wissel uitvoeren</string>
|
||||
<string name="careportal_pbage_label">Ouderdom batterij</string>
|
||||
<string name="careportal_sensor_label">Sensor</string>
|
||||
<string name="careportal_canula_label">Canule</string>
|
||||
<string name="careportal_insulin_label">Insuline</string>
|
||||
<string name="careportal_pb_label">Pomp batterij</string>
|
||||
<string name="careportal_age_label">leeftijd:</string>
|
||||
<string name="careportal_level_label">level:</string>
|
||||
<string name="ns_alarmoptions">Alarm opties</string>
|
||||
<string name="ns_alarms">Maak meldingen van NS alarmen</string>
|
||||
<string name="ns_announcements">Maak meldingen van NS aankondigingen</string>
|
||||
|
@ -707,7 +719,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Basaal patroon op de pomp is gewijzigd, maar kunnen niet worden uitgelezen</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Controle van historiek op wijzigingen</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Verschillende bolussen met dezelfde hoeveelheid op hetzelfde tijdstip zijn geïmporteerd. Er is er maar 1 toegevoegd aan de behandelingen lijst. Controleer op de pomp en voeg eventueel toe via het Careportal menu. Er mogen geen 2 bolussen op hetzelfde tijdstip aanwezig zijn.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org \n\nfacebook:\nhttp://facebook.androidaps.org</string>
|
||||
<string name="combo_check_date">De laatste bolus is ouder dan 24 uren of bevind zich in de toekomst. Controleer de datum en tijd in de pomp aub.</string>
|
||||
<string name="combo_suspious_bolus_time">Datum/tijd van de geleverde bolus op de pomp is niet correct, IOB is waarschijnlijk foutief. Controleer aub de datum/tijd op de pomp.</string>
|
||||
<string name="profileswitch_ismissing">Profiel wissel ontbreekt. Doe aub een profiel wissel of duw op Activeer Profiel in het Lokale profiel.</string>
|
||||
|
@ -1175,6 +1186,7 @@
|
|||
<string name="statuslights_copy_ns">Kopieer instellingen van NS</string>
|
||||
<string name="copyexistingvalues">NS instellingen kopiëren (indien aanwezig)?</string>
|
||||
<string name="classic_description">Klassiek weergave thema</string>
|
||||
<string name="lowres_description">Lage resolutie skin</string>
|
||||
<string name="buttonson_description">Knoppen worden altijd weergegeven aan de onderkant van het scherm</string>
|
||||
<string name="largedisplay_description">Groot scherm</string>
|
||||
<string name="skin">Skin</string>
|
||||
|
@ -1220,4 +1232,5 @@
|
|||
<string name="uploaded_data">Geüploade gegevens</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">De volgende gegevens worden geüpload naar je Open Humans account: glucosewaarden, bolussen, koolhydraten, careportal-events (met uitzondering van notities), verlengde bolussen, profielwissels, totale dagelijkse doses, tijdelijke basaalstanden, tijdelijke doelen, voorkeuren, app-versie, apparaatmodel en schermafmetingen. Geheime of persoonlijke gegevens zoals je Nightscout-URL of API-secret worden niet geüpload.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">RileyLink Status:</string>
|
||||
<string name="filter">Filter</string>
|
||||
</resources>
|
||||
|
|
|
@ -719,7 +719,7 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Basal raten i pumpen er endret, men feilet i å lese ny verdi</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Sjekker for endringer i historikken</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Flere boluser levert i samme minutt og med samme insulinmengde ble importert. Bare en av doseringene ble lagt til i behandlinger. Vennligst sjekk pumpen og legg til manuelt ekstra bolus doseringer i Careportal. Ikke legg til flere boluser i samme minutt.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="about_link_urls">\n\ndokumentasjon:\nhttps://androidaps.readthedocs.io\n\nfacebook:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
|
||||
<string name="combo_check_date">Den siste bolus er eldre enn 24t eller er i fremtiden. Vennligst sjekk at datoen i pumpen er korrekt.</string>
|
||||
<string name="combo_suspious_bolus_time">Tid/dato for levert bolus i pumpen er trolig feil, og IOB beregningen blir da feil. Vennligst sjekk pumpens tid/dato.</string>
|
||||
<string name="profileswitch_ismissing">Profil bytte mangler. Utfør et profil bytte og trykk på \"Aktiver profil\" i din lokale profil.</string>
|
||||
|
@ -1233,4 +1233,7 @@
|
|||
<string name="uploaded_data">Opplastede data</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Følgende data vil bli lastet opp til din Open Humans konto: glukoseverdier, boluser, karbohydrater, careportalhendelser (bortsett fra merknader), forlengede boluser, profilbytter, totale daglige doser, temp basaler, endringer i BS mål, innstillinger, app versjon, mobilmerke og skjermstørrelser. Hemmelig eller privat informasjon som din Nightscout URL eller API secret vil ikke bli lastet opp.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">RileyLink status:</string>
|
||||
<string name="filter">Filter</string>
|
||||
<string name="copytolocalprofile_invalid">Klarte ikke å opprette lokal profil. Profilen er ikke gyldig.</string>
|
||||
<string name="cta_dont_kill_my_app_info">Avslutte app?</string>
|
||||
</resources>
|
||||
|
|
|
@ -720,7 +720,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Dawka podstawowa zmieniła się na pompie, ale jej odczyt nie powiódł się</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Sprawdzanie zmian w historii</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Wielokrotne bolusy o tej samej wielkości w tej samej minucie zostały właśnie zaimportowane. Do leczenia można dodać tylko jeden taki rekord. Sprawdź pompę i ręcznie dodaj zapis bolusa za pomocą zakładki PortalOpieki. Upewnij się, że tworzysz bolus z czasem, którego nie używa żaden inny bolus.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">Ostatni bolus jest starszy niż 24 godziny lub jest w przyszłości. Sprawdź, czy data na pompie jest ustawiona prawidłowo.</string>
|
||||
<string name="combo_suspious_bolus_time">Czas/data dostarczonego bolusa na pompie wydaje się błędna, IOB jest prawdopodobnie niepoprawny. Sprawdź czas/datę pompy.</string>
|
||||
<string name="profileswitch_ismissing">Brakuje ZmianyProfilu. Proszę wykonać ZmianęProfilu lub nacisnąć \"Aktywuj Profil\" w ProfiluLokalnym</string>
|
||||
|
|
|
@ -657,7 +657,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Rácio da basal foi alterado na bomba, mas a leitura falhou</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Verificando alterações de histórico</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Bólus múltiplos, com a mesma quantidade e no mesmo minuto acabaram de ser importados. Apenas um registo pôde ser adicionado aos tratamentos. Por favor confirma na bomba e adicione o registo de bólus manualmente, utilizando o separador do Careportal. Tenha em atenção que deve criar um bólus com um tempo em que nã oexistem outros registos de bólus.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">O último bólus tem mais de 24 horas ou está no futuro. Por favor verifique se a data está definida correctamente na bomba.</string>
|
||||
<string name="combo_suspious_bolus_time">Hora/data da entrega do bólus na bomba parece errado, IOB aparentemente está incorrecto. Verifique hora/data na bomba.</string>
|
||||
<string name="profileswitch_ismissing">TrocaPerfil em falta. Por favor faça uma troca de perfil ou pressione \"Ativar Perfil\" em PerfilLocal.</string>
|
||||
|
|
|
@ -707,7 +707,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Rácio da basal foi alterado na bomba, mas a leitura falhou</string>
|
||||
<string name="combo_activity_checking_for_history_changes">A verificar se há alterações de histórico</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Bólus múltiplos, com a mesma quantidade e no mesmo minuto acabaram de ser importados. Apenas um registo pôde ser adicionado aos tratamentos. Por favor confirma na bomba e adicione o registo de bólus manualmente, utilizando o separador do Careportal. Tenha em atenção que deve criar um bólus com um tempo em que nã oexistem outros registos de bólus.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">O último bólus tem mais de 24 horas ou está no futuro. Por favor verifique se a data está definida correctamente na bomba.</string>
|
||||
<string name="combo_suspious_bolus_time">Hora/data da administração do bólus na bomba parece errado, IOB aparentemente está incorrecto. Verifique hora/data na bomba.</string>
|
||||
<string name="profileswitch_ismissing">TrocaPerfil em falta. Por favor faça uma troca de perfil ou pressione \"Activar Perfil\" em PerfilLocal.</string>
|
||||
|
|
|
@ -707,7 +707,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Rata bazală schimbată în pompă, dar nu s-a putut actualiza</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Se verifică schimbările în istoric</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Mai multe bolusuri de aceeași valoare au fost importate. Doar o singură înregistrare va fi adăugată în tratamente. Verifcați manual în pompă și adăugați înregistrările folosind Careportal. Asigurați-vă că veți crea un bolus care nu se suprapune peste altul în timp.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">Ultimul bolus este mai vechi de 24 ore sau este în viitor. Verificați ca data să fie configurată corect în pompă.</string>
|
||||
<string name="combo_suspious_bolus_time">Ora/data bolusului livrat de pompă pare eronat, IOB este probabil incorect. Verificați ora/data pompei.</string>
|
||||
<string name="profileswitch_ismissing">Lipsă SchimbareProfil. Efectuați o schimbare de profil sau apăsați \"Activare profil\" în ProfilulLocal.</string>
|
||||
|
|
|
@ -719,7 +719,7 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Скорость базала на помпе изменилась, но учесть ее не удалось</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Проверка изменений в истории событий помпы</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Только что импортировано несколько болюсов с одинаковым количеством инсулина в течение одной минуты. В лог лечения может быть добавлена только одна запись. Пожалуйста проверьте помпу и вручную введите запись о болюсе через вкладку портала назначений. Убедитесь, что данному времени соответствует только одна запись о болюсе.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de) \n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="about_link_urls">\n\nДокументация:\nhttps://androidaps.readthedocs.io\n\nFacebook:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
|
||||
<string name="combo_check_date">Новый болюс старше 24 часов или запись относится к будущему. Пожалуйста убедитесь что дата на помпе установлена правильно.</string>
|
||||
<string name="combo_suspious_bolus_time">Время/дата поданного болюса неверны. Вероятно, кол-во активного инсулина IOB также неверно. Проверьте время/дату помпы.</string>
|
||||
<string name="profileswitch_ismissing">Профиль не переключен. Пожалуйста переключите профиль или нажмите \"активировать профиль\" в LocalProfile.</string>
|
||||
|
@ -1235,4 +1235,6 @@ Context | Edit Context</string>
|
|||
<string name="uploaded_data">Загруженные данные</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">На ваш аккаунт Open Humans будут загружены следующие данные: значения ГК, события careportal (за исключением примечаний), пролонгированные болюсы, переключения профиля, суммарные суточные дозы, временные базалы, временные цели, настройки, версии приложения, модель устройства и размеры экрана. Секретная или конфиденциальная информация, такая как адрес вашего сайта Nightscout или API secret, не будет загружена.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">Статус RileyLink:</string>
|
||||
<string name="filter">Фильтр</string>
|
||||
<string name="cta_dont_kill_my_app_info">Не закрывать приложение?</string>
|
||||
</resources>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<string name="description_food">Zobrazenie prednastavených jedál, definovaných v Nightscoute</string>
|
||||
<string name="description_insulin_rapid">Predvoľba pre inzulín Humalog a Novorapid</string>
|
||||
<string name="description_insulin_ultra_rapid">Predvoľba pre inzulín Fiasp</string>
|
||||
<string name="description_insulin_lyumjev">Predvoľba pre inzulín Lyumjev</string>
|
||||
<string name="description_insulin_free_peak">Umožňuje definovať vrchol účinnosti inzulínu a malo by byť používané iba pokročilými užívateľmi</string>
|
||||
<string name="description_loop">Aktivuje alebo deaktivuje spustenie uzavretého okruhu.</string>
|
||||
<string name="description_ns_client">Synchronizuje vaše dáta s NS</string>
|
||||
|
@ -260,6 +261,7 @@
|
|||
<string name="valueoutofrange">Hodnota %1$s je mimo prednastavený rozsah</string>
|
||||
<string name="smscommunicator_pumpconnectwithcode">Ak chcete pripojiť pumpu, odpovedzte pomocou SMS s kódom %1$s</string>
|
||||
<string name="smscommunicator_pumpconnectfail">Pripojenie k pumpe zlyhalo</string>
|
||||
<string name="smscommunicator_pumpdisconnectwithcode">Ak chcete odpojiť pumpu na %1$d minút, odpovedzte pomocou SMS s kódom %2$s</string>
|
||||
<string name="smscommunicator_pumpdisconnected">Pumpa odpojená</string>
|
||||
<string name="smscommunicator_reconnect">Pumpa bola znovu pripojená</string>
|
||||
<string name="smscommunicator_remotecommandnotallowed">Príkazy na diaľku nie sú povolené</string>
|
||||
|
@ -403,10 +405,13 @@
|
|||
<string name="wear_detailedIOB_summary">Rozpísať IOB na hodinkách do bolusového a bazálneho</string>
|
||||
<string name="nosuccess">Neúspešné - skontrolujte telefón</string>
|
||||
<string name="notavailable">nie je k dispozícii</string>
|
||||
<string name="patientage">Typ pacienta</string>
|
||||
<string name="child">Dieťa</string>
|
||||
<string name="teenage">Dospievajúci</string>
|
||||
<string name="adult">Dospelý</string>
|
||||
<string name="resistantadult">Dospelý s nízkou citlivosťou</string>
|
||||
<string name="pregnant">Tehotenstvo</string>
|
||||
<string name="patientage_summary">Prosím vyberte typ pacienta pre nastavenie bezpečnostných limitov</string>
|
||||
<string name="patient_name">Meno pacienta</string>
|
||||
<string name="patient_name_summary">Zadajte meno pacienta, alebo prezývku pre rozlíšenie medzi viacerými nastaveniami</string>
|
||||
<string name="patient_name_default" comment="This is default patient display name, when user does not provide real one">Používateľ</string>
|
||||
|
@ -450,6 +455,8 @@
|
|||
<string name="statuslights_iage_critical">Prah kritického veku inzulínu [h]</string>
|
||||
<string name="statuslights_sage_warning">Prah upozornenia na vek senzora [h]</string>
|
||||
<string name="statuslights_sage_critical">Prah kritického veku senzora [h]</string>
|
||||
<string name="statuslights_sbat_warning">Prah upozornenia na úroveň batérie senzora [%]</string>
|
||||
<string name="statuslights_sbat_critical">Prah kritickej úrovne batérie senzora [%]</string>
|
||||
<string name="statuslights_bage_warning">Prah upozornenia na úroveň batérie [h]</string>
|
||||
<string name="statuslights_bage_critical">Prah kritickej úrovne batérie [h]</string>
|
||||
<string name="statuslights_res_warning">Prah upozornenia na úroveň hladiny zásobníka [JI]</string>
|
||||
|
@ -480,6 +487,12 @@
|
|||
<string name="careportal_insulinage_label">Vek inzulínu</string>
|
||||
<string name="doprofileswitch">Vykonajte zmenu profilu</string>
|
||||
<string name="careportal_pbage_label">Vek batérie v pumpe</string>
|
||||
<string name="careportal_sensor_label">Senzor</string>
|
||||
<string name="careportal_canula_label">Kanyla</string>
|
||||
<string name="careportal_insulin_label">Inzulín</string>
|
||||
<string name="careportal_pb_label">Batéria do pumpy</string>
|
||||
<string name="careportal_age_label">vek:</string>
|
||||
<string name="careportal_level_label">úroveň:</string>
|
||||
<string name="ns_alarmoptions">Nastavenie alarmov</string>
|
||||
<string name="ns_alarms">Vytvoriť oznámenia z alarmov NS</string>
|
||||
<string name="ns_announcements">Vytvoriť oznámenia z upozornení NS</string>
|
||||
|
@ -532,6 +545,7 @@
|
|||
<string name="free_peak_oref">Voliteľný vrchol - Oref</string>
|
||||
<string name="rapid_acting_oref">Rýchlo pôsobiaci - Oref</string>
|
||||
<string name="ultrarapid_oref">Ultra rýchly - Oref</string>
|
||||
<string name="lyumjev">Lyumjev</string>
|
||||
<string name="dia_too_short">DIA %1$f je príliš krátke - AAPS namiesto toho použilo %2$f !</string>
|
||||
<string name="activate_profile">Aktivovať profil</string>
|
||||
<string name="invalid">NEPLATNÝ</string>
|
||||
|
@ -705,7 +719,7 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Bazál na pumpe bol zmenený, ale jeho načítanie zlyhalo</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Kontrolujem zmeny v histórii</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Boli načítané bolusy rovnakej veľkosti v priebehu jednej minúty. Do ošetrení je možné pridať iba jeden. Skontrolujte pumpu a pridajte bolus do ošetrení ručne tak, aby čas nekolidoval.</string>
|
||||
<string name="about_link_urls">\nhttp://www.androidaps.org\n\nfacebook: \nhttp://facebook.androidaps.org</string>
|
||||
<string name="about_link_urls">\n\ndokumentácia:\nhttps://androidaps.readthedocs.io\n\nfacebook:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
|
||||
<string name="combo_check_date">Posledný bolus je starší ako 24h, alebo je v budúcnosti. Skontrolujte čas v pumpe.</string>
|
||||
<string name="combo_suspious_bolus_time">Dátum/čas podaného bolusu se zdá byť nesprávny. IOB bude pravdepodobne chybné. Skontrolujte čas v pumpe.</string>
|
||||
<string name="profileswitch_ismissing">Prepnutie profilu chýba. Vykonajte prepnutie profilu, alebo ho aktivujte na záložke lokálneho profilu.</string>
|
||||
|
@ -794,6 +808,8 @@
|
|||
<string name="bgsourcesetup">Konfigurácia zdroja glykémií</string>
|
||||
<string name="setupwizard_profile_description">Vyberte zdroj profilov. Pokiaľ ide o dieťa, využijete pravdepodobne NS profil. Pokiaľ Vás nikto cez NS nesleduje, budete pravdepodobne preferovať lokálny profil. Uvedomte si, že nastavujete iba zdroj profilov. Na to aby se naozaj profil začal používať, je potrebné vykonať aktiváciu profilu použitím funkcie \"Prepnutie profilu\"</string>
|
||||
<string name="setupwizard_aps_description">Vyberte jeden z algoritmov. Sú zoradené od najstaršieho po najnovší. Novší je obvykle lepší a agresívnejší, ale vyžaduje presnejšie nastavenie. Preto pokiaľ s uzavretým okruhom začínate, mali by ste najskôr vybrať jen AMA a nie ten posledný. Nezabudnite si prečítať dokumentáciu k OpenAPS a prejsť nastavenia, kým ho začnete používať.</string>
|
||||
<string name="setupwizard_pump_waiting_for_riley_link_connection">Čakám na pripojenie RileyLink…\n</string>
|
||||
<string name="setupwizard_pump_pump_not_initialized"><b>Poznámka:</b> Po inicializácii pumpy môžete pokračovať v nastavení.\n</string>
|
||||
<string name="startobjective">Spusťte prvý cieľ</string>
|
||||
<string name="permission">Povolenie</string>
|
||||
<string name="askforpermission">Vyžiadať si povolenie</string>
|
||||
|
@ -983,6 +999,7 @@
|
|||
<string name="storage">obmedzenie interného úložiska</string>
|
||||
<string name="diskfull">Uvoľnite aspoň %1$d MB z interného úložiska! Uzavretý okruh zakázaný!</string>
|
||||
<string name="wrongformat">Chybný formát</string>
|
||||
<string name="wrongTbrDuration">Trvanie dočasného bazálu musí byť násobkom %1$d minút a musí byť väčšie ako 0.</string>
|
||||
<string name="sms_wrongcode">Nesprávný kód. Príkaz zrušený.</string>
|
||||
<string name="notconfigured">Nie je nakonfigurované</string>
|
||||
<string name="profileswitchcreated">Prepnutie profilu vytvorené</string>
|
||||
|
@ -1148,6 +1165,9 @@
|
|||
<string name="smscommunicator_otp_reset_title">Resetovať autentifikačný kľúč</string>
|
||||
<string name="smscommunicator_otp_reset_prompt">Ste si istý, že chcete obnoviť autentifikačný kľúč? Vyresetujete tým všetky aktuálne nakonfigurované autentikátory a budete ich musieť znovu nastaviť.</string>
|
||||
<string name="smscommunicator_otp_reset_successful">Bol vygenerovaný nový autentifikačný kľúč! Prosím, použite aktualizovaný QR kód pre nastavenie autentifikátorov.</string>
|
||||
<string name="smscommunicator_otp_export_title">Export OTP tajného kľúča</string>
|
||||
<string name="smscommunicator_otp_export_prompt">Ste si istý, že chcete skopírovať tajný OTP kľúč do schránky?\n\nPravdepodobne to budete potrebovať iba v prípade, keď bude mať vaša overovacia aplikácia problém so skenováním QR kódu, chcete ho zadať ručne, alebo chcete nakonfigurovať hardwarový OTP token pomocou špeciálnej aplikácie.</string>
|
||||
<string name="smscommunicator_otp_export_successful">Tajné OTP heslo (vo formáte Base32) bolo vyexportované a skopírované do schránky. Vložte ho do autentikátora, alebo programátora OTP hardwaru!</string>
|
||||
<string name="smscommunicator_otp_step1_install_header">1. Nainštalujte Autentifikátor</string>
|
||||
<string name="smscommunicator_otp_step2_provisioning_header">2. Naskenujte kód pre nastavenie AndroidAPS OTP kódov</string>
|
||||
<string name="smscommunicator_otp_step3_test_header">3. Odtestujte jednorázové heslo</string>
|
||||
|
@ -1167,6 +1187,7 @@
|
|||
<string name="statuslights_copy_ns">Kopírovať nastavenia z NS</string>
|
||||
<string name="copyexistingvalues">Skopírovať nastavenia NS (ak existujú)?</string>
|
||||
<string name="classic_description">Pôvodný vzhľad</string>
|
||||
<string name="lowres_description">Vzhľad pre nízke rozlišenie</string>
|
||||
<string name="buttonson_description">Tlačidlá sú vždy zobrazené v spodnej časti obrazovky</string>
|
||||
<string name="largedisplay_description">Veľký displej</string>
|
||||
<string name="skin">Vzhľad</string>
|
||||
|
@ -1211,4 +1232,8 @@
|
|||
<string name="worker_state">Stav procesu: %s</string>
|
||||
<string name="uploaded_data">Odoslané údaje</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">Následujúce dáta budú nahraté do vašeho účtu Open Humans: hodnoty glykémie, bolusy, sacharidy, udalosti starostlivosti (okrem poznámok), rozložené bolusy, prepnutia profilov, celkové denné dávky, dočasné bazály, nastavenia, verzia aplikácie, model zariadenia a rozmery obrazovky. Tajné, alebo súkromné informácie, ako je URL, alebo API heslo vašeho Nightscoutu, nahraté nebudú.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">Stav RileyLinku:</string>
|
||||
<string name="filter">Filter</string>
|
||||
<string name="copytolocalprofile_invalid">Nie je možné vytvoriť lokálny profil. Profil je neplatný.</string>
|
||||
<string name="cta_dont_kill_my_app_info">Nepotláčať moju aplikáciu?</string>
|
||||
</resources>
|
||||
|
|
|
@ -720,7 +720,6 @@ Eversense-appen.</string>
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Basalen ändrad i pumpen, men det gick inte att läsa till vad</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Letar efter förändringar i historiken</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Flera bolusar med samma mängd insulin importerades just. Endast en kan läggas till i Careportal. Vänligen kontrollera pumpen och gör ändringar i Careportal manuellt vid behov. Observera att man bara kan ha en bolus per klockslag.</string>
|
||||
<string name="about_link_urls">\n\nWeb: http://www.androidaps.org\n\nDocs: http://wiki.androidaps.org\n\nFB: http://facebook.androidaps.org</string>
|
||||
<string name="combo_check_date">Den senaste bolusen är äldre än 24 timmar eller i framtiden. Vänligen kontrollera tid och datum i pumpen.</string>
|
||||
<string name="combo_suspious_bolus_time">Tid/datum för bolusen verkar fel. IOB är troligen missvisande. Vänligen kontrollera tid och datum i pumpen.</string>
|
||||
<string name="profileswitch_ismissing">Profilbyte saknas. Vänligen gör ett profilbyte eller tryck Aktivera profil under Lokal Profil.</string>
|
||||
|
|
|
@ -542,7 +542,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Bazal oranı pompada değiştirildi, ancak okuma başarısız oldu</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Geçmiş değişiklikleri kontrol ediliyor</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Aynı dakika içinde aynı miktarda birden fazla boluslar eklenildi. Tedavilere sadece bir kayıt eklenebilir. Lütfen pompayı kontrol edin ve Careportal sekmesini kullanarak elle bir bolus kaydı ekleyin. Başka bolus kullanmayan bir zamana sahip bir bolus oluşturduğunuzdan emin olun.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">Son bolus 24 saatten daha eski veya gelecekte. Lütfen pompadaki tarihin doğru ayarlandığını kontrol edin.</string>
|
||||
<string name="combo_suspious_bolus_time">Teslim edilen bolusun pompadaki zamanı/tarihı yanlış görünüyor, IOB (Insulin On Board) muhtemelen yanlıştır. Lütfen pompa zamanını/tarihini kontrol edin.</string>
|
||||
<string name="profileswitch_ismissing">Profildeğiştir kayıp. Lütfen bir profil değiştir seçin veya YerelPorfil\'de \"Profili Etkinleştir\" düğmesine basın.</string>
|
||||
|
|
|
@ -567,7 +567,6 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">泵上的基础率改变了,但是读取失败</string>
|
||||
<string name="combo_activity_checking_for_history_changes">检查历史记录变化</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">在同一分钟内使用相同数量的多个大剂量记录被导入的。治疗中只能增加一项记录。请手动检查泵并使用记录标签手动添加一个大剂量记录。确保创建一个和其他大剂量记录时间不重复的大剂量记录.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">最后一次大剂量的输注时间是在24个小时以前或者在未来的时间,请检查泵上的日期设置的的是否正确</string>
|
||||
<string name="combo_suspious_bolus_time">输注过的大剂量的时间/日期看着好像错了,活性胰岛素可能不准确。请检查泵的时间/日期</string>
|
||||
<string name="profileswitch_ismissing">配置文件切换缺失。请做一次配置文件切换或者在本地配置文件里按“激活配置文件”</string>
|
||||
|
|
|
@ -851,7 +851,7 @@
|
|||
<string name="combo_error_failure_reading_changed_basal_rate">Basal rate changed on pump, but reading it failed</string>
|
||||
<string name="combo_activity_checking_for_history_changes">Checking for history changes</string>
|
||||
<string name="combo_error_multiple_boluses_with_identical_timestamp">Multiple boluses with the same amount within the same minute were just imported. Only one record could be added to treatments. Please check the pump and manually add a bolus record using the Careportal tab. Make sure to create a bolus with a time no other bolus uses.</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="about_link_urls">\n\ndocumentation:\nhttps://androidaps.readthedocs.io\n\nfacebook:\nhttps://www.facebook.com/groups/AndroidAPSUsers</string>
|
||||
<string name="combo_check_date">The last bolus is older than 24 hours or is in the future. Please check the date on the pump is set correctly.</string>
|
||||
<string name="combo_suspious_bolus_time">Time/date of the delivered bolus on pump seems wrong, IOB is likely incorrect. Please check pump time/date.</string>
|
||||
<string name="profileswitch_ismissing">ProfileSwitch missing. Please do a profile switch or press \"Activate Profile\" in the LocalProfile.</string>
|
||||
|
@ -932,7 +932,6 @@
|
|||
<string name="openapsama_max_daily_safety_multiplier">Max daily safety multiplier</string>
|
||||
<string name="openapsama_current_basal_safety_multiplier">Current basal safety multiplier</string>
|
||||
<string name="value_unavailable_short">n/a</string>
|
||||
<string name="key_virtualpump_type" translatable="false">virtualpump_type</string>
|
||||
<string name="key_virtualpump_uploadstatus" translatable="false">virtualpump_uploadstatus</string>
|
||||
<string name="virtualpump_type">Virtual Pump Type</string>
|
||||
<string name="virtualpump_definition">Pump Definition</string>
|
||||
|
@ -1466,4 +1465,8 @@
|
|||
<string name="uploaded_data">Uploaded Data</string>
|
||||
<string name="the_following_data_will_be_uploaded_to_your_open_humans_account">The following data will be uploaded to your Open Humans account: Glucose values, boluses, carbs, careportal events (except notes), extended boluses, profile switches, total daily doses, temporary basals, temp targets, preferences, application version, device model and screen dimensions. Secret or private information such as your Nightscout URL or API secret will not be uploaded.</string>
|
||||
<string name="setupwizard_pump_riley_link_status">RileyLink status:</string>
|
||||
<string name="filter">Filter</string>
|
||||
<string name="copytolocalprofile_invalid">Unable to create local profile. Profile is invalid.</string>
|
||||
<string name="cta_dont_kill_my_app_info">Don\'t kill my app?</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -40,7 +40,7 @@ class ProfileTest : TestBaseWithProfile() {
|
|||
|
||||
@Before
|
||||
fun prepare() {
|
||||
`when`(activePluginProvider.getActivePump()).thenReturn(virtualPumpPlugin)
|
||||
`when`(activePluginProvider.activePump).thenReturn(virtualPumpPlugin)
|
||||
`when`(virtualPumpPlugin.pumpDescription).thenReturn(pumpDescription)
|
||||
`when`(resourceHelper.gs(R.string.profile_per_unit)).thenReturn("/U")
|
||||
`when`(resourceHelper.gs(R.string.profile_carbs_per_unit)).thenReturn("g/U")
|
||||
|
|
|
@ -61,7 +61,7 @@ class LoopPluginTest : TestBase() {
|
|||
hardLimits = HardLimits(aapsLogger, rxBus, sp, resourceHelper, context, nsUpload)
|
||||
|
||||
loopPlugin = LoopPlugin(injector, aapsLogger, rxBus, sp, constraintChecker, resourceHelper, profileFunction, context, commandQueue, activePlugin, treatmentsPlugin, virtualPumpPlugin, actionStringHandler, iobCobCalculatorPlugin, receiverStatusStore, fabricPrivacy, nsUpload, hardLimits)
|
||||
`when`(activePlugin.getActivePump()).thenReturn(virtualPumpPlugin)
|
||||
`when`(activePlugin.activePump).thenReturn(virtualPumpPlugin)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -47,7 +47,7 @@ class InsulinLyumjevPluginTest {
|
|||
|
||||
@Test
|
||||
fun getIdTest() {
|
||||
assertEquals(InsulinInterface.OREF_LYUMJEV, sut.id)
|
||||
assertEquals(InsulinInterface.InsulinType.OREF_LYUMJEV, sut.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -2,6 +2,7 @@ package info.nightscout.androidaps.plugins.insulin
|
|||
|
||||
import dagger.android.AndroidInjector
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.Constants
|
||||
import info.nightscout.androidaps.data.Iob
|
||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
|
@ -9,8 +10,10 @@ import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
|||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.plugins.insulin.InsulinOrefBasePlugin.Companion.MIN_DIA
|
||||
import info.nightscout.androidaps.db.Treatment
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
|
@ -46,8 +49,10 @@ class InsulinOrefBasePluginTest {
|
|||
get() = testPeak
|
||||
|
||||
override fun commentStandardText(): String = ""
|
||||
override fun getId(): Int = 0
|
||||
override fun getFriendlyName(): String = ""
|
||||
override val id get(): InsulinInterface.InsulinType = InsulinInterface.InsulinType.UNKNOWN
|
||||
override val friendlyName get(): String = ""
|
||||
override fun configuration(): JSONObject = JSONObject()
|
||||
override fun applyConfiguration(configuration: JSONObject) {}
|
||||
}
|
||||
|
||||
@get:Rule
|
||||
|
@ -104,22 +109,22 @@ class InsulinOrefBasePluginTest {
|
|||
// check directly after bolus
|
||||
treatment.date = time
|
||||
treatment.insulin = 10.0
|
||||
Assert.assertEquals(10.0, sut.iobCalcForTreatment(treatment, time).iobContrib, 0.1)
|
||||
Assert.assertEquals(10.0, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||
// check after 1 hour
|
||||
treatment.date = time - 1 * 60 * 60 * 1000 // 1 hour
|
||||
treatment.insulin = 10.0
|
||||
Assert.assertEquals(3.92, sut.iobCalcForTreatment(treatment, time).iobContrib, 0.1)
|
||||
Assert.assertEquals(3.92, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||
// check after 2 hour
|
||||
treatment.date = time - 2 * 60 * 60 * 1000 // 1 hour
|
||||
treatment.insulin = 10.0
|
||||
Assert.assertEquals(0.77, sut.iobCalcForTreatment(treatment, time).iobContrib, 0.1)
|
||||
Assert.assertEquals(0.77, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||
// check after 3 hour
|
||||
treatment.date = time - 3 * 60 * 60 * 1000 // 1 hour
|
||||
treatment.insulin = 10.0
|
||||
Assert.assertEquals(0.10, sut.iobCalcForTreatment(treatment, time).iobContrib, 0.1)
|
||||
Assert.assertEquals(0.10, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||
// check after dia
|
||||
treatment.date = time - 4 * 60 * 60 * 1000
|
||||
treatment.insulin = 10.0
|
||||
Assert.assertEquals(0.0, sut.iobCalcForTreatment(treatment, time).iobContrib, 0.1)
|
||||
Assert.assertEquals(0.0, sut.iobCalcForTreatment(treatment, time, Constants.defaultDIA).iobContrib, 0.1)
|
||||
}
|
||||
}
|
|
@ -54,7 +54,7 @@ class InsulinOrefFreePeakPluginTest : TestBase() {
|
|||
|
||||
@Test
|
||||
fun getIdTest() {
|
||||
assertEquals(InsulinInterface.OREF_FREE_PEAK, sut.id)
|
||||
assertEquals(InsulinInterface.InsulinType.OREF_FREE_PEAK, sut.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -47,7 +47,7 @@ class InsulinOrefRapidActingPluginTest {
|
|||
|
||||
@Test
|
||||
fun getIdTest() {
|
||||
assertEquals(InsulinInterface.OREF_RAPID_ACTING, sut.id)
|
||||
assertEquals(InsulinInterface.InsulinType.OREF_RAPID_ACTING, sut.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -47,7 +47,7 @@ class InsulinOrefUltraRapidActingPluginTest {
|
|||
|
||||
@Test
|
||||
fun getIdTest() {
|
||||
assertEquals(InsulinInterface.OREF_ULTRA_RAPID_ACTING, sut.id)
|
||||
assertEquals(InsulinInterface.InsulinType.OREF_ULTRA_RAPID_ACTING, sut.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -5,11 +5,13 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculatorInterface
|
||||
import info.nightscout.androidaps.interfaces.PluginDescription
|
||||
import info.nightscout.androidaps.interfaces.SensitivityInterface
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
@ -28,6 +30,13 @@ class AbstractSensitivityPluginTest : TestBase() {
|
|||
override fun detectSensitivity(plugin: IobCobCalculatorInterface, fromTime: Long, toTime: Long): AutosensResult {
|
||||
return AutosensResult()
|
||||
}
|
||||
|
||||
override val id: SensitivityInterface.SensitivityType
|
||||
get() = SensitivityInterface.SensitivityType.UNKNOWN
|
||||
|
||||
override fun configuration(): JSONObject = JSONObject()
|
||||
|
||||
override fun applyConfiguration(configuration: JSONObject) { }
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
14
build.gradle
14
build.gradle
|
@ -2,7 +2,7 @@
|
|||
|
||||
buildscript {
|
||||
ext {
|
||||
kotlin_version = '1.4.10'
|
||||
kotlin_version = '1.4.20'
|
||||
coreVersion = '1.3.2'
|
||||
rxjava_version = '2.2.19'
|
||||
rxandroid_version = '2.1.1'
|
||||
|
@ -17,12 +17,19 @@ buildscript {
|
|||
nav_version = '2.3.1'
|
||||
appcompat_verison = '1.2.0'
|
||||
material_version = '1.2.1'
|
||||
constraintlayout_version = '2.0.2'
|
||||
constraintlayout_version = '2.0.4'
|
||||
preferencektx_version = '1.1.1'
|
||||
commonslang3_version = '3.11'
|
||||
work_version = '2.4.0'
|
||||
|
||||
junit_version = '4.13.1'
|
||||
powermockVersion = "1.7.3"
|
||||
dexmakerVersion = "1.2"
|
||||
retrofit2Version = '2.9.0'
|
||||
okhttp3Version = '4.9.0'
|
||||
|
||||
androidx_junit = '1.1.2'
|
||||
androidx_rules = '1.3.1-alpha02'
|
||||
}
|
||||
repositories {
|
||||
google()
|
||||
|
@ -31,7 +38,7 @@ buildscript {
|
|||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.1'
|
||||
classpath 'com.google.gms:google-services:4.3.4'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
|
||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
@ -54,6 +61,7 @@ allprojects {
|
|||
artifact '/[organisation]/[module]/archive/[revision].[ext]'
|
||||
}
|
||||
}
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
//Support @JvmDefault
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||
|
|
|
@ -39,52 +39,5 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation "androidx.appcompat:appcompat:$appcompat_verison"
|
||||
implementation "androidx.preference:preference-ktx:$preferencektx_version"
|
||||
implementation 'androidx.biometric:biometric:1.0.1'
|
||||
implementation "androidx.activity:activity:${activityVersion}"
|
||||
implementation "androidx.activity:activity-ktx:${activityVersion}"
|
||||
implementation "com.google.android.material:material:$material_version"
|
||||
|
||||
implementation "com.google.dagger:dagger-android:$dagger_version"
|
||||
implementation "com.google.dagger:dagger-android-support:$dagger_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
kapt "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
|
||||
//Logger
|
||||
implementation 'org.slf4j:slf4j-api:1.7.30'
|
||||
//Fabric
|
||||
implementation platform('com.google.firebase:firebase-bom:25.12.0')
|
||||
implementation "com.google.firebase:firebase-analytics-ktx"
|
||||
implementation "com.google.firebase:firebase-crashlytics-ktx"
|
||||
implementation "com.google.firebase:firebase-messaging-ktx"
|
||||
|
||||
//RxBus
|
||||
implementation "io.reactivex.rxjava2:rxandroid:${rxandroid_version}"
|
||||
implementation "org.apache.commons:commons-lang3:$commonslang3_version"
|
||||
|
||||
//CryptoUtil
|
||||
implementation 'com.madgag.spongycastle:core:1.58.0.0'
|
||||
|
||||
// Graphview cannot be upgraded
|
||||
implementation "com.jjoe64:graphview:4.0.1"
|
||||
|
||||
//DateUtil
|
||||
implementation 'net.danlew:android.joda:2.10.6'
|
||||
|
||||
//db
|
||||
implementation "com.j256.ormlite:ormlite-core:${ormLiteVersion}"
|
||||
implementation "com.j256.ormlite:ormlite-android:${ormLiteVersion}"
|
||||
|
||||
// pumpCommon
|
||||
implementation "com.google.code.gson:gson:2.8.6"
|
||||
|
||||
testImplementation "junit:junit:$junit_version"
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
}
|
||||
apply from: 'core_dependencies.gradle'
|
120
core/core_dependencies.gradle
Normal file
120
core/core_dependencies.gradle
Normal file
|
@ -0,0 +1,120 @@
|
|||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
||||
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
|
||||
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
|
||||
api "androidx.core:core-ktx:$coreVersion"
|
||||
api 'androidx.legacy:legacy-support-v13:1.0.0'
|
||||
api 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
api "androidx.appcompat:appcompat:$appcompat_verison"
|
||||
api "androidx.preference:preference-ktx:$preferencektx_version"
|
||||
api 'androidx.biometric:biometric:1.0.1'
|
||||
api "androidx.activity:activity-ktx:${activityVersion}"
|
||||
api "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
|
||||
api 'androidx.cardview:cardview:1.0.0'
|
||||
api 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
api 'androidx.gridlayout:gridlayout:1.0.0'
|
||||
api 'androidx.percentlayout:percentlayout:1.0.0'
|
||||
api "com.google.android.material:material:$material_version"
|
||||
|
||||
api "com.google.dagger:dagger-android:$dagger_version"
|
||||
api "com.google.dagger:dagger-android-support:$dagger_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
kapt "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
|
||||
//Logger
|
||||
api 'org.slf4j:slf4j-api:1.7.30'
|
||||
api("com.github.tony19:logback-android-classic:1.1.1-6") {
|
||||
exclude group: "com.google.android", module: "android"
|
||||
}
|
||||
|
||||
//Firebase
|
||||
api platform('com.google.firebase:firebase-bom:25.12.0')
|
||||
api "com.google.firebase:firebase-analytics-ktx"
|
||||
api "com.google.firebase:firebase-crashlytics-ktx"
|
||||
api "com.google.firebase:firebase-messaging-ktx"
|
||||
api 'com.google.firebase:firebase-auth-ktx'
|
||||
api 'com.google.firebase:firebase-database-ktx'
|
||||
|
||||
//RxBus
|
||||
api "io.reactivex.rxjava2:rxandroid:${rxandroid_version}"
|
||||
api "org.apache.commons:commons-lang3:$commonslang3_version"
|
||||
|
||||
//CryptoUtil
|
||||
api 'com.madgag.spongycastle:core:1.58.0.0'
|
||||
|
||||
// Graphview cannot be upgraded
|
||||
api "com.jjoe64:graphview:4.0.1"
|
||||
|
||||
//DateUtil
|
||||
api 'net.danlew:android.joda:2.10.6'
|
||||
|
||||
//db
|
||||
api "com.j256.ormlite:ormlite-core:${ormLiteVersion}"
|
||||
api "com.j256.ormlite:ormlite-android:${ormLiteVersion}"
|
||||
|
||||
// pumpCommon
|
||||
api "com.google.code.gson:gson:2.8.6"
|
||||
|
||||
// don't kill my app
|
||||
api('dev.doubledot.doki:library:0.0.1@aar') {
|
||||
transitive = true
|
||||
}
|
||||
|
||||
//WorkManager
|
||||
api "androidx.work:work-runtime:$work_version"
|
||||
api "androidx.work:work-runtime-ktx:$work_version"
|
||||
api "androidx.work:work-rxjava2:$work_version"
|
||||
api 'com.google.androidbrowserhelper:androidbrowserhelper:2.0.1'
|
||||
api 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
|
||||
|
||||
// new for tidepool
|
||||
api "com.squareup.okhttp3:okhttp:$okhttp3Version"
|
||||
api "com.squareup.okhttp3:logging-interceptor:$okhttp3Version"
|
||||
api "com.squareup.retrofit2:retrofit:$retrofit2Version"
|
||||
api "com.squareup.retrofit2:adapter-rxjava2:$retrofit2Version"
|
||||
api "com.squareup.retrofit2:converter-gson:$retrofit2Version"
|
||||
|
||||
api "com.joanzapata.iconify:android-iconify-fontawesome:2.2.2"
|
||||
api 'net.danlew:android.joda:2.10.6'
|
||||
|
||||
api "androidx.fragment:fragment-ktx:${fragmentktx_version}"
|
||||
api "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
|
||||
api 'androidx.navigation:navigation-runtime-ktx:2.3.1'
|
||||
api "androidx.navigation:navigation-fragment-ktx:$nav_version"
|
||||
api "androidx.navigation:navigation-ui-ktx:$nav_version"
|
||||
|
||||
api 'com.google.android.gms:play-services-wearable:17.0.0'
|
||||
api 'com.google.android.gms:play-services-location:17.1.0'
|
||||
|
||||
api("com.google.android:flexbox:0.3.0") {
|
||||
exclude group: "com.android.support"
|
||||
}
|
||||
api("io.socket:socket.io-client:1.0.0") {
|
||||
// excluding org.json which is provided by Android
|
||||
exclude group: "org.json", module: "json"
|
||||
}
|
||||
|
||||
api('com.google.guava:guava:30.0-jre') {
|
||||
exclude group: "com.google.code.findbugs", module: "jsr305"
|
||||
}
|
||||
api 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
|
||||
api 'org.mozilla:rhino:1.7.13'
|
||||
|
||||
api 'com.github.DavidProdinger:weekdays-selector:1.1.0'
|
||||
|
||||
api 'com.github.kenglxn.QRGen:android:2.6.0'
|
||||
api 'com.eatthepath:java-otp:0.2.0'
|
||||
|
||||
// Phone checker
|
||||
api 'com.scottyab:rootbeer-lib:0.0.8'
|
||||
|
||||
testImplementation "junit:junit:$junit_version"
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidx_junit"
|
||||
androidTestImplementation "androidx.test:rules:$androidx_rules"
|
||||
}
|
|
@ -63,7 +63,7 @@ public class ExtendedBolus implements Interval, DataPointWithLabelInterface {
|
|||
public int durationInMinutes = 0; // duration == 0 means end of extended bolus
|
||||
|
||||
@DatabaseField
|
||||
public int insulinInterfaceID = InsulinInterface.OREF_RAPID_ACTING;
|
||||
public int insulinInterfaceID = InsulinInterface.InsulinType.OREF_RAPID_ACTING.getValue();
|
||||
|
||||
@DatabaseField
|
||||
public double dia = Constants.defaultDIA;
|
||||
|
|
|
@ -65,7 +65,7 @@ public class Treatment implements DataPointWithLabelInterface, DbObjectBase {
|
|||
public boolean isSMB = false;
|
||||
|
||||
@DatabaseField
|
||||
public int insulinInterfaceID = InsulinInterface.OREF_RAPID_ACTING; // currently unused, will be used in the future
|
||||
public int insulinInterfaceID = InsulinInterface.InsulinType.OREF_RAPID_ACTING.getValue(); // currently unused, will be used in the future
|
||||
@DatabaseField
|
||||
public double dia = Constants.defaultDIA; // currently unused, will be used in the future
|
||||
@DatabaseField
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package info.nightscout.androidaps.dialogs
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
@ -13,11 +10,13 @@ import dagger.android.support.DaggerDialogFragment
|
|||
import info.nightscout.androidaps.activities.ErrorHelperActivity
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.services.AlarmSoundService
|
||||
import info.nightscout.androidaps.services.AlarmSoundServiceHelper
|
||||
import kotlinx.android.synthetic.main.dialog_error.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class ErrorDialog : DaggerDialogFragment() {
|
||||
|
||||
@Inject lateinit var alarmSoundServiceHelper: AlarmSoundServiceHelper
|
||||
@Inject lateinit var aapsLogger: AAPSLogger
|
||||
|
||||
var helperActivity: ErrorHelperActivity? = null
|
||||
|
@ -80,17 +79,10 @@ class ErrorDialog : DaggerDialogFragment() {
|
|||
}
|
||||
|
||||
private fun startAlarm() {
|
||||
if (sound != 0) {
|
||||
val alarm = Intent(context, AlarmSoundService::class.java)
|
||||
alarm.putExtra("soundid", sound)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
context?.startForegroundService(alarm)
|
||||
} else {
|
||||
context?.startService(alarm)
|
||||
}
|
||||
}
|
||||
if (sound != 0)
|
||||
context?.let { context -> alarmSoundServiceHelper.startAlarm(context, sound) }
|
||||
}
|
||||
|
||||
private fun stopAlarm() =
|
||||
context?.stopService(Intent(context, AlarmSoundService::class.java))
|
||||
context?.let { context -> alarmSoundServiceHelper.stopService(context) }
|
||||
}
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
package info.nightscout.androidaps.interfaces;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public interface ActivePluginProvider {
|
||||
|
||||
@NotNull BgSourceInterface getActiveBgSource(); // Forced to Dexcom
|
||||
|
||||
@NotNull ProfileInterface getActiveProfileInterface(); // Forced to LocalProfile if not changed
|
||||
|
||||
@NotNull InsulinInterface getActiveInsulin(); // Forced to RapidActing if not changed
|
||||
|
||||
@NotNull APSInterface getActiveAPS(); // Forced to SMB
|
||||
|
||||
@NotNull PumpInterface getActivePump(); // Use in places not reachable without active pump. Otherwise IllegalStateException is thrown
|
||||
|
||||
@NotNull SensitivityInterface getActiveSensitivity(); // Forced to oref1 if not changed
|
||||
|
||||
@NotNull TreatmentsInterface getActiveTreatments(); // Forced to treatments
|
||||
|
||||
@NotNull ArrayList<PluginBase> getPluginsList();
|
||||
|
||||
@NotNull ArrayList<PluginBase> getSpecificPluginsVisibleInListByInterface(Class interfaceClass, PluginType type);
|
||||
|
||||
@NotNull ArrayList<PluginBase> getSpecificPluginsVisibleInList(PluginType type);
|
||||
|
||||
@NotNull ArrayList<PluginBase> getSpecificPluginsListByInterface(Class interfaceClass);
|
||||
|
||||
// @NotNull ArrayList<PluginBase> getSpecificPluginsVisibleInList(Class interfaceClass);
|
||||
|
||||
void verifySelectionInCategories();
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package info.nightscout.androidaps.interfaces
|
||||
|
||||
import java.util.*
|
||||
|
||||
interface ActivePluginProvider {
|
||||
|
||||
val activeBgSource: BgSourceInterface // Forced to Dexcom
|
||||
val activeProfileInterface: ProfileInterface // Forced to LocalProfile if not changed
|
||||
val activeInsulin: InsulinInterface // Forced to RapidActing if not changed
|
||||
val activeAPS: APSInterface // Forced to SMB
|
||||
val activePump: PumpInterface // Use in places not reachable without active pump. Otherwise IllegalStateException is thrown
|
||||
val activeSensitivity: SensitivityInterface // Forced to oref1 if not changed
|
||||
val activeTreatments: TreatmentsInterface // Forced to treatments
|
||||
val activeOverview: OverviewInterface // Forced to overview
|
||||
|
||||
fun getPluginsList(): ArrayList<PluginBase>
|
||||
|
||||
fun getSpecificPluginsVisibleInListByInterface(interfaceClass: Class<*>, type: PluginType): ArrayList<PluginBase>
|
||||
fun getSpecificPluginsVisibleInList(type: PluginType): ArrayList<PluginBase>
|
||||
fun getSpecificPluginsListByInterface(interfaceClass: Class<*>): ArrayList<PluginBase>
|
||||
fun verifySelectionInCategories()
|
||||
}
|
|
@ -2,4 +2,5 @@ package info.nightscout.androidaps.interfaces
|
|||
|
||||
interface ConfigBuilderInterface {
|
||||
fun storeSettings(from: String)
|
||||
fun performPluginSwitch(changedPlugin: PluginBase, enabled: Boolean, type: PluginType)
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package info.nightscout.androidaps.interfaces
|
||||
|
||||
import org.json.JSONObject
|
||||
|
||||
interface ConfigExportImportInterface {
|
||||
|
||||
fun configuration(): JSONObject
|
||||
fun applyConfiguration(configuration: JSONObject)
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package info.nightscout.androidaps.interfaces;
|
||||
|
||||
import info.nightscout.androidaps.data.Iob;
|
||||
import info.nightscout.androidaps.db.Treatment;
|
||||
|
||||
/**
|
||||
* Created by mike on 17.04.2017.
|
||||
*/
|
||||
|
||||
public interface InsulinInterface {
|
||||
// int FASTACTINGINSULIN = 0; // old model no longer available
|
||||
// int FASTACTINGINSULINPROLONGED = 1; // old model no longer available
|
||||
int OREF_RAPID_ACTING = 2;
|
||||
int OREF_ULTRA_RAPID_ACTING = 3;
|
||||
int OREF_FREE_PEAK = 4;
|
||||
int OREF_LYUMJEV = 5;
|
||||
|
||||
|
||||
int getId();
|
||||
String getFriendlyName();
|
||||
String getComment();
|
||||
double getDia();
|
||||
Iob iobCalcForTreatment(Treatment treatment, long time, double dia);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package info.nightscout.androidaps.interfaces
|
||||
|
||||
import info.nightscout.androidaps.data.Iob
|
||||
import info.nightscout.androidaps.db.Treatment
|
||||
import org.json.JSONObject
|
||||
|
||||
interface InsulinInterface : ConfigExportImportInterface{
|
||||
|
||||
enum class InsulinType(val value: Int) {
|
||||
UNKNOWN(-1),
|
||||
// int FASTACTINGINSULIN = 0; // old model no longer available
|
||||
// int FASTACTINGINSULINPROLONGED = 1; // old model no longer available
|
||||
OREF_RAPID_ACTING(2),
|
||||
OREF_ULTRA_RAPID_ACTING(3),
|
||||
OREF_FREE_PEAK(4),
|
||||
OREF_LYUMJEV(5);
|
||||
|
||||
companion object {
|
||||
private val map = values().associateBy(InsulinType::value)
|
||||
fun fromInt(type: Int) = map[type]
|
||||
}
|
||||
}
|
||||
|
||||
val id: InsulinType
|
||||
val friendlyName: String
|
||||
val comment: String
|
||||
val dia: Double
|
||||
|
||||
fun iobCalcForTreatment(treatment: Treatment, time: Long, dia: Double): Iob
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package info.nightscout.androidaps.interfaces
|
||||
|
||||
interface OverviewInterface : ConfigExportImportInterface
|
|
@ -1,16 +0,0 @@
|
|||
package info.nightscout.androidaps.interfaces;
|
||||
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult;
|
||||
|
||||
/**
|
||||
* Created by mike on 24.06.2017.
|
||||
*/
|
||||
|
||||
public interface SensitivityInterface {
|
||||
|
||||
double MIN_HOURS = 1;
|
||||
double MIN_HOURS_FULL_AUTOSENS = 4;
|
||||
|
||||
AutosensResult detectSensitivity(IobCobCalculatorInterface plugin, long fromTime, long toTime);
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package info.nightscout.androidaps.interfaces
|
||||
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult
|
||||
import org.json.JSONObject
|
||||
|
||||
interface SensitivityInterface : ConfigExportImportInterface {
|
||||
|
||||
enum class SensitivityType(val value: Int) {
|
||||
UNKNOWN(-1),
|
||||
SENSITIVITY_AAPS(0),
|
||||
SENSITIVITY_WEIGHTED(1),
|
||||
SENSITIVITY_OREF1(2);
|
||||
|
||||
companion object {
|
||||
private val map = values().associateBy(SensitivityType::value)
|
||||
fun fromInt(type: Int) = map[type]
|
||||
}
|
||||
}
|
||||
|
||||
val id: SensitivityType
|
||||
fun detectSensitivity(plugin: IobCobCalculatorInterface, fromTime: Long, toTime: Long): AutosensResult
|
||||
|
||||
companion object {
|
||||
const val MIN_HOURS = 1.0
|
||||
const val MIN_HOURS_FULL_AUTOSENS = 4.0
|
||||
}
|
||||
}
|
|
@ -375,6 +375,7 @@ public class DeviceStatus {
|
|||
public JSONObject iob = null;
|
||||
public int uploaderBattery = 0;
|
||||
public String created_at = null;
|
||||
public JSONObject configuration = null;
|
||||
|
||||
public DeviceStatus(AAPSLogger aapsLogger) {
|
||||
this.aapsLogger = aapsLogger;
|
||||
|
@ -393,6 +394,7 @@ public class DeviceStatus {
|
|||
record.put("openaps", openaps);
|
||||
if (uploaderBattery != 0) record.put("uploaderBattery", uploaderBattery);
|
||||
if (created_at != null) record.put("created_at", created_at);
|
||||
if (configuration != null) record.put("configuration", configuration);
|
||||
} catch (JSONException e) {
|
||||
aapsLogger.error("Unhandled exception", e);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
package info.nightscout.androidaps.plugins.configBuilder
|
||||
|
||||
import info.nightscout.androidaps.core.R
|
||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||
import info.nightscout.androidaps.interfaces.ConfigBuilderInterface
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface
|
||||
import info.nightscout.androidaps.interfaces.PluginType
|
||||
import info.nightscout.androidaps.interfaces.SensitivityInterface
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType
|
||||
import info.nightscout.androidaps.utils.JsonHelper
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class RunningConfiguration @Inject constructor(
|
||||
private val activePlugin: ActivePluginProvider,
|
||||
private val configBuilder: ConfigBuilderInterface,
|
||||
private val sp: SP,
|
||||
private val aapsLogger: AAPSLogger
|
||||
) {
|
||||
|
||||
private var counter = 0
|
||||
private val every = 20 // Send only every 20 devicestatus to save traffic
|
||||
|
||||
// called in AAPS mode only
|
||||
fun configuration(): JSONObject {
|
||||
val json = JSONObject()
|
||||
if (counter++ % every == 0)
|
||||
try {
|
||||
val insulinInterface = activePlugin.activeInsulin
|
||||
val sensitivityInterface = activePlugin.activeSensitivity
|
||||
val pumpInterface = activePlugin.activePump
|
||||
val overviewInterface = activePlugin.activeOverview
|
||||
|
||||
json.put("insulin", insulinInterface.id.value)
|
||||
json.put("insulinConfiguration", insulinInterface.configuration())
|
||||
json.put("sensitivity", sensitivityInterface.id.value)
|
||||
json.put("sensitivityConfiguration", sensitivityInterface.configuration())
|
||||
json.put("overviewConfiguration", overviewInterface.configuration())
|
||||
json.put("pump", pumpInterface.model().description)
|
||||
} catch (e: JSONException) {
|
||||
aapsLogger.error("Unhandled exception", e)
|
||||
}
|
||||
return json
|
||||
}
|
||||
|
||||
// called in NSClient mode only
|
||||
fun apply(configuration: JSONObject) {
|
||||
val insulin = InsulinInterface.InsulinType.fromInt(JsonHelper.safeGetInt(configuration, "insulin", InsulinInterface.InsulinType.UNKNOWN.value))
|
||||
for (p in activePlugin.getSpecificPluginsListByInterface(InsulinInterface::class.java)) {
|
||||
val insulinPlugin = p as InsulinInterface
|
||||
if (insulinPlugin.id == insulin) {
|
||||
if (!p.isEnabled()) {
|
||||
aapsLogger.debug(LTag.CORE, "Changing insulin plugin to ${insulin.name}")
|
||||
configBuilder.performPluginSwitch(p, true, PluginType.INSULIN)
|
||||
}
|
||||
insulinPlugin.applyConfiguration(configuration.getJSONObject("insulinConfiguration"))
|
||||
}
|
||||
}
|
||||
|
||||
val sensitivity = SensitivityInterface.SensitivityType.fromInt(JsonHelper.safeGetInt(configuration, "sensitivity", SensitivityInterface.SensitivityType.UNKNOWN.value))
|
||||
for (p in activePlugin.getSpecificPluginsListByInterface(SensitivityInterface::class.java)) {
|
||||
val sensitivityPlugin = p as SensitivityInterface
|
||||
if (sensitivityPlugin.id == sensitivity) {
|
||||
if (!p.isEnabled()) {
|
||||
aapsLogger.debug(LTag.CORE, "Changing sensitivity plugin to ${sensitivity.name}")
|
||||
configBuilder.performPluginSwitch(p, true, PluginType.SENSITIVITY)
|
||||
}
|
||||
sensitivityPlugin.applyConfiguration(configuration.getJSONObject("sensitivityConfiguration"))
|
||||
}
|
||||
}
|
||||
|
||||
val pumpType = JsonHelper.safeGetString(configuration, "pump", PumpType.GenericAAPS.description)
|
||||
sp.putString(R.string.key_virtualpump_type, pumpType)
|
||||
activePlugin.activePump.pumpDescription.setPumpDescription(PumpType.getByDescription(pumpType))
|
||||
|
||||
if (configuration.has("overviewConfiguration"))
|
||||
activePlugin.activeOverview.applyConfiguration(configuration.getJSONObject("overviewConfiguration"))
|
||||
}
|
||||
}
|
|
@ -42,10 +42,10 @@ import info.nightscout.androidaps.interfaces.ProfileStore;
|
|||
import info.nightscout.androidaps.interfaces.PumpInterface;
|
||||
import info.nightscout.androidaps.interfaces.UploadQueueInterface;
|
||||
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||
import info.nightscout.androidaps.logging.L;
|
||||
import info.nightscout.androidaps.logging.LTag;
|
||||
import info.nightscout.androidaps.plugins.aps.loop.APSResult;
|
||||
import info.nightscout.androidaps.plugins.aps.loop.DeviceStatus;
|
||||
import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration;
|
||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore;
|
||||
import info.nightscout.androidaps.utils.DateUtil;
|
||||
import info.nightscout.androidaps.utils.JsonHelper;
|
||||
|
@ -65,6 +65,7 @@ public class NSUpload {
|
|||
private final Context context;
|
||||
private final UploadQueueInterface uploadQueue;
|
||||
private final DatabaseHelperInterface databaseHelper;
|
||||
private final RunningConfiguration runningConfiguration;
|
||||
|
||||
@Inject
|
||||
public NSUpload(
|
||||
|
@ -74,6 +75,7 @@ public class NSUpload {
|
|||
SP sp,
|
||||
Context context,
|
||||
UploadQueueInterface uploadQueue,
|
||||
RunningConfiguration runningConfiguration,
|
||||
DatabaseHelperInterface databaseHelper
|
||||
) {
|
||||
this.injector = injector;
|
||||
|
@ -82,6 +84,7 @@ public class NSUpload {
|
|||
this.sp = sp;
|
||||
this.context = context;
|
||||
this.uploadQueue = uploadQueue;
|
||||
this.runningConfiguration = runningConfiguration;
|
||||
this.databaseHelper = databaseHelper;
|
||||
}
|
||||
|
||||
|
@ -249,6 +252,9 @@ public class NSUpload {
|
|||
deviceStatus.uploaderBattery = batteryLevel;
|
||||
|
||||
deviceStatus.created_at = DateUtil.toISOString(new Date());
|
||||
|
||||
deviceStatus.configuration = runningConfiguration.configuration();
|
||||
|
||||
uploadQueue.add(new DbRequest("dbAdd", "devicestatus", deviceStatus.mongoRecord()));
|
||||
} catch (JSONException e) {
|
||||
aapsLogger.error("Unhandled exception", e);
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.media.AudioManager
|
||||
import android.media.MediaPlayer
|
||||
import android.os.Binder
|
||||
import android.os.Handler
|
||||
import android.os.IBinder
|
||||
import dagger.android.DaggerService
|
||||
|
@ -18,6 +19,7 @@ import kotlin.math.ln
|
|||
import kotlin.math.pow
|
||||
|
||||
class AlarmSoundService : DaggerService() {
|
||||
|
||||
@Inject lateinit var aapsLogger: AAPSLogger
|
||||
@Inject lateinit var resourceHelper: ResourceHelper
|
||||
@Inject lateinit var notificationHolder: NotificationHolderInterface
|
||||
|
@ -27,6 +29,7 @@ class AlarmSoundService : DaggerService() {
|
|||
private var resourceId = R.raw.error
|
||||
|
||||
companion object {
|
||||
|
||||
private const val VOLUME_INCREASE_STEPS = 40 // Total number of steps to increase volume with
|
||||
private const val VOLUME_INCREASE_INITIAL_SILENT_TIME_MILLIS = 3_000L // Number of milliseconds that the notification should initially be silent
|
||||
private const val VOLUME_INCREASE_BASE_DELAY_MILLIS = 15_000 // Base delay between volume increments
|
||||
|
@ -41,23 +44,31 @@ class AlarmSoundService : DaggerService() {
|
|||
|
||||
}
|
||||
|
||||
inner class LocalBinder : Binder() {
|
||||
|
||||
fun getService(): AlarmSoundService = this@AlarmSoundService
|
||||
}
|
||||
|
||||
private val binder = LocalBinder()
|
||||
override fun onBind(intent: Intent): IBinder = binder
|
||||
|
||||
private val increaseVolumeHandler = Handler()
|
||||
private var currentVolumeLevel = 0
|
||||
|
||||
override fun onBind(intent: Intent): IBinder? = null
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
aapsLogger.debug(LTag.CORE, "onCreate")
|
||||
aapsLogger.debug(LTag.CORE, "onCreate parent called")
|
||||
startForeground(notificationHolder.notificationID, notificationHolder.notification)
|
||||
aapsLogger.debug(LTag.CORE, "onCreate End")
|
||||
}
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
aapsLogger.debug(LTag.CORE, "onStartCommand")
|
||||
startForeground(notificationHolder.notificationID, notificationHolder.notification)
|
||||
aapsLogger.debug(LTag.CORE, "onStartCommand Foreground called")
|
||||
|
||||
player?.let { if (it.isPlaying) it.stop() }
|
||||
|
||||
aapsLogger.debug(LTag.CORE, "onStartCommand")
|
||||
if (intent?.hasExtra("soundid") == true) resourceId = intent.getIntExtra("soundid", R.raw.error)
|
||||
player = MediaPlayer()
|
||||
try {
|
||||
|
@ -80,19 +91,19 @@ class AlarmSoundService : DaggerService() {
|
|||
} catch (e: Exception) {
|
||||
aapsLogger.error("Unhandled exception", e)
|
||||
}
|
||||
aapsLogger.debug(LTag.CORE, "onStartCommand End")
|
||||
return START_STICKY
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
aapsLogger.debug(LTag.CORE, "onDestroy")
|
||||
increaseVolumeHandler.removeCallbacks(volumeUpdater)
|
||||
player?.stop()
|
||||
player?.release()
|
||||
aapsLogger.debug(LTag.CORE, "onDestroy")
|
||||
aapsLogger.debug(LTag.CORE, "onDestroy End")
|
||||
}
|
||||
|
||||
private fun getAudioManager(): AudioManager {
|
||||
return getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
}
|
||||
private fun getAudioManager() = getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
|
||||
// TODO replace with VolumeShaper when min API level >= 26
|
||||
private val volumeUpdater = object : Runnable {
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
package info.nightscout.androidaps.services
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.ServiceConnection
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import info.nightscout.androidaps.interfaces.NotificationHolderInterface
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
/*
|
||||
This code replaces following
|
||||
val alarm = Intent(context, AlarmSoundService::class.java)
|
||||
alarm.putExtra("soundid", n.soundId)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) context.startForegroundService(alarm) else context.startService(alarm)
|
||||
|
||||
it fails randomly with error
|
||||
Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{e317f7e u0 info.nightscout.nsclient/info.nightscout.androidaps.services.AlarmSoundService}
|
||||
|
||||
*/
|
||||
@Singleton
|
||||
class AlarmSoundServiceHelper @Inject constructor(
|
||||
private val notificationHolder: NotificationHolderInterface
|
||||
) {
|
||||
|
||||
fun startAlarm(context: Context, sound: Int) {
|
||||
val connection = object : ServiceConnection {
|
||||
override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
|
||||
// The binder of the service that returns the instance that is created.
|
||||
val binder: AlarmSoundService.LocalBinder = service as AlarmSoundService.LocalBinder
|
||||
|
||||
val alarmSoundService: AlarmSoundService = binder.getService()
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
context.startForegroundService(getServiceIntent(context, sound))
|
||||
else
|
||||
context.startService(getServiceIntent(context, sound))
|
||||
|
||||
// This is the key: Without waiting Android Framework to call this method
|
||||
// inside Service.onCreate(), immediately call here to post the notification.
|
||||
alarmSoundService.startForeground(notificationHolder.notificationID, notificationHolder.notification)
|
||||
|
||||
// Release the connection to prevent leaks.
|
||||
context.unbindService(this)
|
||||
}
|
||||
|
||||
override fun onServiceDisconnected(name: ComponentName?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
context.bindService(getServiceIntent(context, sound), connection, Context.BIND_AUTO_CREATE)
|
||||
} catch (ignored: RuntimeException) {
|
||||
// This is probably a broadcast receiver context even though we are calling getApplicationContext().
|
||||
// Just call startForegroundService instead since we cannot bind a service to a
|
||||
// broadcast receiver context. The service also have to call startForeground in
|
||||
// this case.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
context.startForegroundService(getServiceIntent(context, sound))
|
||||
else
|
||||
context.startService(getServiceIntent(context, sound))
|
||||
}
|
||||
}
|
||||
|
||||
fun stopService(context: Context) {
|
||||
val alarm = Intent(context, AlarmSoundService::class.java)
|
||||
context.stopService(alarm)
|
||||
}
|
||||
|
||||
private fun getServiceIntent(context: Context, sound: Int): Intent {
|
||||
val alarm = Intent(context, AlarmSoundService::class.java)
|
||||
alarm.putExtra("soundid", sound)
|
||||
return alarm
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue