move to plugins module
This commit is contained in:
parent
417305d1f6
commit
d108755814
|
@ -8,6 +8,7 @@
|
|||
<w>actionstring</w>
|
||||
<w>aidex</w>
|
||||
<w>alarmack</w>
|
||||
<w>alexpr</w>
|
||||
<w>allowednumbers</w>
|
||||
<w>androidaps</w>
|
||||
<w>autosens</w>
|
||||
|
@ -43,9 +44,14 @@
|
|||
<w>dexcom</w>
|
||||
<w>dexdrip</w>
|
||||
<w>diaconn</w>
|
||||
<w>dlvoy</w>
|
||||
<w>dttm</w>
|
||||
<w>ecarbs</w>
|
||||
<w>enteredby</w>
|
||||
<w>enteredinsulin</w>
|
||||
<w>eoflow</w>
|
||||
<w>eopatch</w>
|
||||
<w>epss</w>
|
||||
<w>eveningoutpost</w>
|
||||
<w>eversense</w>
|
||||
<w>extendedbolus</w>
|
||||
|
@ -56,12 +62,15 @@
|
|||
<w>gson</w>
|
||||
<w>hmac</w>
|
||||
<w>iage</w>
|
||||
<w>infinivocgm</w>
|
||||
<w>insulet</w>
|
||||
<w>intelligo</w>
|
||||
<w>iobtotal</w>
|
||||
<w>joda</w>
|
||||
<w>libre</w>
|
||||
<w>listdelimiter</w>
|
||||
<w>localprofile</w>
|
||||
<w>lyumjev</w>
|
||||
<w>mdtp</w>
|
||||
<w>medtronic</w>
|
||||
<w>mgdl</w>
|
||||
|
@ -74,6 +83,7 @@
|
|||
<w>nightscout</w>
|
||||
<w>notif</w>
|
||||
<w>nsclient</w>
|
||||
<w>oaps</w>
|
||||
<w>okcancel</w>
|
||||
<w>omnipod</w>
|
||||
<w>openaps</w>
|
||||
|
@ -88,10 +98,12 @@
|
|||
<w>profileswitch</w>
|
||||
<w>pumpbtcomm</w>
|
||||
<w>pumpcontrol</w>
|
||||
<w>pumpdrivers</w>
|
||||
<w>quickwizard</w>
|
||||
<w>readstatus</w>
|
||||
<w>realduration</w>
|
||||
<w>refresheventsfromnightscout</w>
|
||||
<w>rfspy</w>
|
||||
<w>rileylink</w>
|
||||
<w>roboelectric</w>
|
||||
<w>rozman</w>
|
||||
|
@ -104,6 +116,8 @@
|
|||
<w>soundid</w>
|
||||
<w>splitted</w>
|
||||
<w>ssid</w>
|
||||
<w>statuslight</w>
|
||||
<w>statuslights</w>
|
||||
<w>superbolus</w>
|
||||
<w>targethigh</w>
|
||||
<w>targetlow</w>
|
||||
|
@ -119,6 +133,7 @@
|
|||
<w>totp</w>
|
||||
<w>tunedays</w>
|
||||
<w>uart</w>
|
||||
<w>unfinshed</w>
|
||||
<w>urgentalarm</w>
|
||||
<w>wizzardpage</w>
|
||||
<w>xdrip</w>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
package info.nightscout.rx.events
|
||||
|
||||
class EventSWUpdate(var redraw: Boolean) : Event()
|
|
@ -222,9 +222,6 @@ dependencies {
|
|||
// MainApp
|
||||
api "com.uber.rxdogtag2:rxdogtag:2.0.1"
|
||||
|
||||
// Overview
|
||||
api 'com.google.android.flexbox:flexbox:3.0.0'
|
||||
|
||||
// APS
|
||||
api 'org.mozilla:rhino:1.7.14'
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
|||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin
|
||||
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
|
||||
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin
|
||||
import info.nightscout.androidaps.plugins.general.wear.WearPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
||||
|
|
|
@ -25,6 +25,7 @@ import info.nightscout.automation.di.AutomationModule
|
|||
import info.nightscout.database.impl.DatabaseModule
|
||||
import info.nightscout.implementation.di.ImplementationModule
|
||||
import info.nightscout.plugins.di.PluginsModule
|
||||
import info.nightscout.plugins.di.SkinsModule
|
||||
import info.nightscout.rx.di.RxModule
|
||||
import info.nightscout.shared.di.SharedModule
|
||||
import info.nightscout.ui.di.UiModule
|
||||
|
@ -36,12 +37,10 @@ import javax.inject.Singleton
|
|||
AndroidInjectionModule::class,
|
||||
AppModule::class,
|
||||
PluginsListModule::class,
|
||||
SkinsModule::class,
|
||||
ActivitiesModule::class,
|
||||
FragmentsModule::class,
|
||||
ReceiversModule::class,
|
||||
ServicesModule::class,
|
||||
ObjectivesModule::class,
|
||||
WizardModule::class,
|
||||
APSModule::class,
|
||||
WorkflowModule::class,
|
||||
|
|
|
@ -3,13 +3,13 @@ package info.nightscout.androidaps.di
|
|||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.activities.MyPreferenceFragment
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.dialogs.NtpProgressDialog
|
||||
import info.nightscout.plugins.constraints.objectives.dialogs.NtpProgressDialog
|
||||
import info.nightscout.androidaps.plugins.aps.OpenAPSFragment
|
||||
import info.nightscout.androidaps.plugins.aps.loop.LoopFragment
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderFragment
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragment
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.activities.ObjectivesExamDialog
|
||||
import info.nightscout.androidaps.plugins.general.actions.ActionsFragment
|
||||
import info.nightscout.plugins.constraints.objectives.ObjectivesFragment
|
||||
import info.nightscout.plugins.constraints.objectives.activities.ObjectivesExamDialog
|
||||
import info.nightscout.plugins.general.actions.ActionsFragment
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.MaintenanceFragment
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewFragment
|
||||
import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog
|
||||
|
|
|
@ -1,23 +1,2 @@
|
|||
package info.nightscout.androidaps.di
|
||||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.*
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class ObjectivesModule {
|
||||
|
||||
@ContributesAndroidInjector abstract fun objectiveInjector(): Objective
|
||||
@ContributesAndroidInjector abstract fun objective0Injector(): Objective0
|
||||
@ContributesAndroidInjector abstract fun objective1Injector(): Objective1
|
||||
@ContributesAndroidInjector abstract fun objective2Injector(): Objective2
|
||||
@ContributesAndroidInjector abstract fun objective3Injector(): Objective3
|
||||
@ContributesAndroidInjector abstract fun objective4Injector(): Objective4
|
||||
@ContributesAndroidInjector abstract fun objective5Injector(): Objective5
|
||||
@ContributesAndroidInjector abstract fun objective6Injector(): Objective6
|
||||
@ContributesAndroidInjector abstract fun objective7Injector(): Objective7
|
||||
@ContributesAndroidInjector abstract fun objective9Injector(): Objective9
|
||||
@ContributesAndroidInjector abstract fun objective10Injector(): Objective10
|
||||
|
||||
}
|
|
@ -15,9 +15,9 @@ import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
|||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin
|
||||
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin
|
||||
import info.nightscout.plugins.constraints.objectives.ObjectivesPlugin
|
||||
import info.nightscout.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.plugins.general.actions.ActionsPlugin
|
||||
import info.nightscout.androidaps.plugins.general.dataBroadcaster.DataBroadcastPlugin
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin
|
||||
import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin
|
||||
|
|
|
@ -3,7 +3,7 @@ package info.nightscout.androidaps.di
|
|||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.ui.widget.WidgetConfigureActivity
|
||||
import info.nightscout.androidaps.skins.SkinListPreference
|
||||
import info.nightscout.plugins.skins.SkinListPreference
|
||||
import info.nightscout.ui.widget.Widget
|
||||
|
||||
@Module
|
||||
|
|
|
@ -6,14 +6,20 @@ import android.os.Bundle
|
|||
import androidx.annotation.RawRes
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import info.nightscout.androidaps.MainActivity
|
||||
import info.nightscout.androidaps.activities.HistoryBrowseActivity
|
||||
import info.nightscout.androidaps.activities.SingleFragmentActivity
|
||||
import info.nightscout.androidaps.services.AlarmSoundService
|
||||
import info.nightscout.interfaces.ui.ActivityNames
|
||||
import info.nightscout.ui.activities.BolusProgressHelperActivity
|
||||
import info.nightscout.ui.activities.ErrorHelperActivity
|
||||
import info.nightscout.ui.activities.TDDStatsActivity
|
||||
import info.nightscout.ui.dialogs.CareDialog
|
||||
import info.nightscout.ui.dialogs.ExtendedBolusDialog
|
||||
import info.nightscout.ui.dialogs.FillDialog
|
||||
import info.nightscout.ui.dialogs.ProfileSwitchDialog
|
||||
import info.nightscout.ui.dialogs.ProfileViewerDialog
|
||||
import info.nightscout.ui.dialogs.TempBasalDialog
|
||||
import info.nightscout.ui.dialogs.TempTargetDialog
|
||||
import info.nightscout.ui.dialogs.WizardDialog
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -21,6 +27,7 @@ class ActivityNamesImpl @Inject constructor() : ActivityNames {
|
|||
|
||||
override val mainActivityClass: Class<*> = MainActivity::class.java
|
||||
override val tddStatsActivity: Class<*> = TDDStatsActivity::class.java
|
||||
override val historyBrowseActivity: Class<*> = HistoryBrowseActivity::class.java
|
||||
override val errorHelperActivity: Class<*> = ErrorHelperActivity::class.java
|
||||
override val bolusProgressHelperActivity: Class<*> = BolusProgressHelperActivity::class.java
|
||||
override val singleFragmentActivity: Class<*> = SingleFragmentActivity::class.java
|
||||
|
@ -50,6 +57,26 @@ class ActivityNamesImpl @Inject constructor() : ActivityNames {
|
|||
.show(fragmentManager, "ProfileSwitchDialog")
|
||||
}
|
||||
|
||||
override fun runTempBasalDialog(fragmentManager: FragmentManager) {
|
||||
TempBasalDialog()
|
||||
.show(fragmentManager, "TempBasalDialog")
|
||||
}
|
||||
|
||||
override fun runTempTargetDialog(fragmentManager: FragmentManager) {
|
||||
TempTargetDialog()
|
||||
.show(fragmentManager, "TempTargetDialog")
|
||||
}
|
||||
|
||||
override fun runExtendedBolusDialog(fragmentManager: FragmentManager) {
|
||||
ExtendedBolusDialog()
|
||||
.show(fragmentManager, "ExtendedBolusDialog")
|
||||
}
|
||||
|
||||
override fun runFillDialog(fragmentManager: FragmentManager) {
|
||||
FillDialog()
|
||||
.show(fragmentManager, "FillDialog")
|
||||
}
|
||||
|
||||
override fun runProfileViewerDialog(fragmentManager: FragmentManager, time: Long, mode: ActivityNames.Mode, customProfile: String?, customProfileName: String?, customProfile2: String?) {
|
||||
ProfileViewerDialog()
|
||||
.also {
|
||||
|
@ -61,6 +88,17 @@ class ActivityNamesImpl @Inject constructor() : ActivityNames {
|
|||
bundle.putString("customProfile2", customProfile2)
|
||||
}
|
||||
}
|
||||
.show(fragmentManager, "ProfileSwitchDialog")
|
||||
.show(fragmentManager, "ProfileViewer")
|
||||
}
|
||||
|
||||
override fun runCareDialog(fragmentManager: FragmentManager, options: ActivityNames.EventType, event: Int) {
|
||||
CareDialog()
|
||||
.also {
|
||||
it.arguments = Bundle().also { bundle ->
|
||||
bundle.putInt("event", event)
|
||||
bundle.putInt("options", options.ordinal)
|
||||
}
|
||||
}
|
||||
.show(fragmentManager, "CareDialog")
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@ import info.nightscout.rx.bus.RxBus
|
|||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.rx.logging.LTag
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import org.json.JSONException
|
||||
import javax.inject.Inject
|
||||
|
@ -55,7 +56,8 @@ class OpenAPSAMAPlugin @Inject constructor(
|
|||
private val fabricPrivacy: FabricPrivacy,
|
||||
private val dateUtil: DateUtil,
|
||||
private val repository: AppRepository,
|
||||
private val glucoseStatusProvider: GlucoseStatusProvider
|
||||
private val glucoseStatusProvider: GlucoseStatusProvider,
|
||||
private val sp: SP
|
||||
) : PluginBase(
|
||||
PluginDescription()
|
||||
.mainType(PluginType.APS)
|
||||
|
@ -66,7 +68,7 @@ class OpenAPSAMAPlugin @Inject constructor(
|
|||
.preferencesId(R.xml.pref_openapsama)
|
||||
.description(R.string.description_ama),
|
||||
aapsLogger, rh, injector
|
||||
), APS {
|
||||
), APS, Constraints {
|
||||
|
||||
// last values
|
||||
override var lastAPSRun: Long = 0
|
||||
|
@ -207,4 +209,13 @@ class OpenAPSAMAPlugin @Inject constructor(
|
|||
|
||||
//deviceStatus.suggested = determineBasalResultAMA.json;
|
||||
}
|
||||
|
||||
override fun applyMaxIOBConstraints(maxIob: Constraint<Double>): Constraint<Double> {
|
||||
if (isEnabled()) {
|
||||
val maxIobPref: Double = sp.getDouble(R.string.key_openapsma_max_iob, 1.5)
|
||||
maxIob.setIfSmaller(aapsLogger, maxIobPref, rh.gs(R.string.limitingiob, maxIobPref, rh.gs(R.string.maxvalueinpreferences)), this)
|
||||
maxIob.setIfSmaller(aapsLogger, hardLimits.maxIobAMA(), rh.gs(R.string.limitingiob, hardLimits.maxIobAMA(), rh.gs(R.string.hardlimit)), this)
|
||||
}
|
||||
return maxIob
|
||||
}
|
||||
}
|
|
@ -240,5 +240,14 @@ class OpenAPSSMBPlugin @Inject constructor(
|
|||
return value
|
||||
}
|
||||
|
||||
override fun applyMaxIOBConstraints(maxIob: Constraint<Double>): Constraint<Double> {
|
||||
if (isEnabled()) {
|
||||
val maxIobPref: Double = sp.getDouble(R.string.key_openapssmb_max_iob, 3.0)
|
||||
maxIob.setIfSmaller(aapsLogger, maxIobPref, rh.gs(R.string.limitingiob, maxIobPref, rh.gs(R.string.maxvalueinpreferences)), this)
|
||||
maxIob.setIfSmaller(aapsLogger, hardLimits.maxIobSMB(), rh.gs(R.string.limitingiob, hardLimits.maxIobSMB(), rh.gs(R.string.hardlimit)), this)
|
||||
}
|
||||
return maxIob
|
||||
}
|
||||
|
||||
fun provideDetermineBasalAdapter(): DetermineBasalAdapterInterface = DetermineBasalAdapterSMBJS(ScriptReader(context), injector)
|
||||
}
|
|
@ -29,7 +29,7 @@ import dagger.android.HasAndroidInjector
|
|||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.data.ProfileSealed
|
||||
import info.nightscout.androidaps.databinding.OverviewFragmentBinding
|
||||
import info.nightscout.plugins.databinding.OverviewFragmentBinding
|
||||
import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged
|
||||
import info.nightscout.androidaps.events.EventNewBG
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
|
@ -54,7 +54,7 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOve
|
|||
import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
|
||||
import info.nightscout.androidaps.skins.SkinProvider
|
||||
import info.nightscout.plugins.skins.SkinProvider
|
||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||
import info.nightscout.androidaps.utils.ToastUtils
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
|
@ -88,6 +88,7 @@ import info.nightscout.plugins.source.DexcomPlugin
|
|||
import info.nightscout.plugins.source.XdripPlugin
|
||||
import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus
|
||||
import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData
|
||||
import info.nightscout.plugins.ui.StatusLightHandler
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventAcceptOpenLoopChange
|
||||
|
|
|
@ -995,7 +995,7 @@ class DataHandlerMobile @Inject constructor(
|
|||
ret += if (!result.isChangeRequested) {
|
||||
rh.gs(R.string.nochangerequested) + "\n"
|
||||
} else if (result.rate == 0.0 && result.duration == 0) {
|
||||
rh.gs(R.string.canceltemp) + "\n"
|
||||
rh.gs(R.string.cancel_temp) + "\n"
|
||||
} else {
|
||||
rh.gs(R.string.rate) + ": " + DecimalFormatter.to2Decimal(result.rate) + " U/h " +
|
||||
"(" + DecimalFormatter.to2Decimal(result.rate / activePlugin.activePump.baseBasalRate * 100) + "%)\n" +
|
||||
|
|
|
@ -4,6 +4,7 @@ import dagger.android.HasAndroidInjector
|
|||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||
import info.nightscout.androidaps.extensions.isPSEvent5minBack
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore
|
||||
|
@ -13,6 +14,7 @@ import info.nightscout.database.entities.TherapyEvent
|
|||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.aps.SMBDefaults
|
||||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.interfaces.plugin.PluginDescription
|
||||
import info.nightscout.interfaces.plugin.PluginType
|
||||
import info.nightscout.interfaces.profile.Profile
|
||||
|
@ -51,7 +53,7 @@ class SensitivityOref1Plugin @Inject constructor(
|
|||
.description(R.string.description_sensitivity_oref1)
|
||||
.setDefault(),
|
||||
injector, aapsLogger, rh, sp
|
||||
) {
|
||||
), Constraints {
|
||||
|
||||
override fun detectSensitivity(ads: AutosensDataStore, fromTime: Long, toTime: Long): AutosensResult {
|
||||
val profile = profileFunction.getProfile()
|
||||
|
@ -235,4 +237,9 @@ class SensitivityOref1Plugin @Inject constructor(
|
|||
|
||||
override val id: SensitivityType
|
||||
get() = SensitivityType.SENSITIVITY_OREF1
|
||||
|
||||
override fun isUAMEnabled(value: Constraint<Boolean>): Constraint<Boolean> {
|
||||
if (!isEnabled()) value.set(aapsLogger, false, rh.gs(info.nightscout.plugins.R.string.uamdisabledoref1notselected), this)
|
||||
return value
|
||||
}
|
||||
}
|
|
@ -14,8 +14,8 @@ import info.nightscout.androidaps.interfaces.ActivePlugin
|
|||
import info.nightscout.androidaps.interfaces.CommandQueue
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragment
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin
|
||||
import info.nightscout.plugins.constraints.objectives.ObjectivesFragment
|
||||
import info.nightscout.plugins.constraints.objectives.ObjectivesPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
|
||||
|
@ -32,7 +32,7 @@ import info.nightscout.androidaps.setupwizard.elements.SWInfoText
|
|||
import info.nightscout.androidaps.setupwizard.elements.SWPlugin
|
||||
import info.nightscout.androidaps.setupwizard.elements.SWPreference
|
||||
import info.nightscout.androidaps.setupwizard.elements.SWRadioButton
|
||||
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
|
||||
import info.nightscout.rx.events.EventSWUpdate
|
||||
import info.nightscout.androidaps.utils.CryptoUtil
|
||||
import info.nightscout.androidaps.utils.extensions.isRunningTest
|
||||
import info.nightscout.interfaces.AndroidPermission
|
||||
|
|
|
@ -13,7 +13,7 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged
|
|||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange
|
||||
import info.nightscout.androidaps.setupwizard.elements.SWItem
|
||||
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
|
||||
import info.nightscout.rx.events.EventSWUpdate
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.core.fabric.FabricPrivacy
|
||||
import info.nightscout.interfaces.locale.LocaleHelper.update
|
||||
|
|
|
@ -9,7 +9,7 @@ import androidx.appcompat.app.AppCompatActivity
|
|||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.events.EventPreferenceChange
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
|
||||
import info.nightscout.rx.events.EventSWUpdate
|
||||
import info.nightscout.androidaps.utils.protection.PasswordCheck
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
|
|
|
@ -12,7 +12,7 @@ import info.nightscout.androidaps.activities.MyPreferenceFragment
|
|||
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
|
||||
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
|
||||
import info.nightscout.androidaps.setupwizard.SWDefinition
|
||||
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
|
||||
import info.nightscout.rx.events.EventSWUpdate
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.plugin.PluginType
|
||||
import info.nightscout.rx.events.EventConfigBuilderChange
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
package info.nightscout.androidaps.setupwizard.events
|
||||
|
||||
import info.nightscout.rx.events.Event
|
||||
|
||||
class EventSWUpdate(var redraw: Boolean) : Event()
|
|
@ -1,14 +1,5 @@
|
|||
package info.nightscout.androidaps.utils
|
||||
|
||||
import android.os.SystemClock
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import java.net.DatagramPacket
|
||||
import java.net.DatagramSocket
|
||||
import java.net.InetAddress
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
*
|
||||
|
@ -23,192 +14,4 @@ import javax.inject.Singleton
|
|||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/ /**
|
||||
* {@hide}
|
||||
*
|
||||
*
|
||||
* Simple SNTP client class for retrieving network time.
|
||||
*
|
||||
*
|
||||
* Sample usage:
|
||||
* <pre>SntpClient client = new SntpClient();
|
||||
* if (client.requestTime("time.foo.com")) {
|
||||
* long now = client.getNtpTime() + SystemClock.elapsedRealtime() - client.getNtpTimeReference();
|
||||
* }
|
||||
</pre> *
|
||||
*/
|
||||
@Singleton
|
||||
class SntpClient @Inject constructor(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val dateUtil: DateUtil
|
||||
) {
|
||||
|
||||
companion object {
|
||||
//private final int REFERENCE_TIME_OFFSET = 16;
|
||||
private const val ORIGINATE_TIME_OFFSET = 24
|
||||
private const val RECEIVE_TIME_OFFSET = 32
|
||||
private const val TRANSMIT_TIME_OFFSET = 40
|
||||
private const val NTP_PACKET_SIZE = 48
|
||||
private const val NTP_PORT = 123
|
||||
private const val NTP_MODE_CLIENT = 3
|
||||
private const val NTP_VERSION = 3
|
||||
|
||||
// Number of seconds between Jan 1, 1900 and Jan 1, 1970
|
||||
// 70 years plus 17 leap days
|
||||
private const val OFFSET_1900_TO_1970 = (365L * 70L + 17L) * 24L * 60L * 60L
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the time computed from the NTP transaction.
|
||||
*
|
||||
* @return time value computed from NTP server response.
|
||||
*/
|
||||
// system time computed from NTP server response
|
||||
private var ntpTime: Long = 0
|
||||
|
||||
/**
|
||||
* Returns the reference clock value (value of SystemClock.elapsedRealtime())
|
||||
* corresponding to the NTP time.
|
||||
*
|
||||
* @return reference clock corresponding to the NTP time.
|
||||
*/
|
||||
// value of SystemClock.elapsedRealtime() corresponding to mNtpTime
|
||||
private var ntpTimeReference: Long = 0
|
||||
|
||||
/**
|
||||
* Returns the round trip time of the NTP transaction
|
||||
*
|
||||
* @return round trip time in milliseconds.
|
||||
*/
|
||||
// round trip time in milliseconds
|
||||
private var roundTripTime: Long = 0
|
||||
|
||||
abstract class Callback : Runnable {
|
||||
|
||||
var networkConnected = false
|
||||
var success = false
|
||||
var time: Long = 0
|
||||
}
|
||||
|
||||
@Synchronized fun ntpTime(callback: Callback, isConnected: Boolean) {
|
||||
callback.networkConnected = isConnected
|
||||
if (callback.networkConnected) {
|
||||
Thread { doNtpTime(callback) }.start()
|
||||
} else {
|
||||
callback.run()
|
||||
}
|
||||
}
|
||||
|
||||
fun doNtpTime(callback: Callback) {
|
||||
aapsLogger.debug("Time detection started")
|
||||
callback.success = requestTime("time.google.com", 5000)
|
||||
callback.time = ntpTime + SystemClock.elapsedRealtime() - ntpTimeReference
|
||||
aapsLogger.debug("Time detection ended: " + callback.success + " " + dateUtil.dateAndTimeString(ntpTime))
|
||||
callback.run()
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SNTP request to the given host and processes the response.
|
||||
*
|
||||
* @param host host name of the server.
|
||||
* @param timeout network timeout in milliseconds.
|
||||
* @return true if the transaction was successful.
|
||||
*/
|
||||
@Suppress("SameParameterValue")
|
||||
@Synchronized private fun requestTime(host: String, timeout: Int): Boolean {
|
||||
try {
|
||||
val socket = DatagramSocket()
|
||||
socket.soTimeout = timeout
|
||||
val address = InetAddress.getByName(host)
|
||||
val buffer = ByteArray(NTP_PACKET_SIZE)
|
||||
val request = DatagramPacket(buffer, buffer.size, address, NTP_PORT)
|
||||
|
||||
// set mode = 3 (client) and version = 3
|
||||
// mode is in low 3 bits of first byte
|
||||
// version is in bits 3-5 of first byte
|
||||
buffer[0] = (NTP_MODE_CLIENT or (NTP_VERSION shl 3)).toByte()
|
||||
|
||||
// get current time and write it to the request packet
|
||||
val requestTime = System.currentTimeMillis()
|
||||
val requestTicks = SystemClock.elapsedRealtime()
|
||||
writeTimeStamp(buffer, TRANSMIT_TIME_OFFSET, requestTime)
|
||||
socket.send(request)
|
||||
|
||||
// read the response
|
||||
val response = DatagramPacket(buffer, buffer.size)
|
||||
socket.receive(response)
|
||||
val responseTicks = SystemClock.elapsedRealtime()
|
||||
val responseTime = requestTime + (responseTicks - requestTicks)
|
||||
socket.close()
|
||||
|
||||
// extract the results
|
||||
val originateTime = readTimeStamp(buffer, ORIGINATE_TIME_OFFSET)
|
||||
val receiveTime = readTimeStamp(buffer, RECEIVE_TIME_OFFSET)
|
||||
val transmitTime = readTimeStamp(buffer, TRANSMIT_TIME_OFFSET)
|
||||
val roundTripTime = responseTicks - requestTicks - (transmitTime - receiveTime)
|
||||
val clockOffset = (receiveTime - originateTime + (transmitTime - responseTime)) / 2
|
||||
|
||||
// save our results - use the times on this side of the network latency
|
||||
// (response rather than request time)
|
||||
ntpTime = responseTime + clockOffset
|
||||
ntpTimeReference = responseTicks
|
||||
this.roundTripTime = roundTripTime
|
||||
} catch (e: Exception) {
|
||||
aapsLogger.debug("request time failed: $e")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads an unsigned 32 bit big endian number from the given offset in the buffer.
|
||||
*/
|
||||
private fun read32(buffer: ByteArray, offset: Int): Long {
|
||||
val b0 = buffer[offset]
|
||||
val b1 = buffer[offset + 1]
|
||||
val b2 = buffer[offset + 2]
|
||||
val b3 = buffer[offset + 3]
|
||||
|
||||
// convert signed bytes to unsigned values
|
||||
val i0 = if (b0.toInt() and 0x80 == 0x80) (b0.toInt() and 0x7F) + 0x80 else b0.toInt()
|
||||
val i1 = if (b1.toInt() and 0x80 == 0x80) (b1.toInt() and 0x7F) + 0x80 else b1.toInt()
|
||||
val i2 = if (b2.toInt() and 0x80 == 0x80) (b2.toInt() and 0x7F) + 0x80 else b2.toInt()
|
||||
val i3 = if (b3.toInt() and 0x80 == 0x80) (b3.toInt() and 0x7F) + 0x80 else b3.toInt()
|
||||
return (i0.toLong() shl 24) + (i1.toLong() shl 16) + (i2.toLong() shl 8) + i3.toLong()
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the NTP time stamp at the given offset in the buffer and returns
|
||||
* it as a system time (milliseconds since January 1, 1970).
|
||||
*/
|
||||
private fun readTimeStamp(buffer: ByteArray, offset: Int): Long {
|
||||
val seconds = read32(buffer, offset)
|
||||
val fraction = read32(buffer, offset + 4)
|
||||
return (seconds - OFFSET_1900_TO_1970) * 1000 + fraction * 1000L / 0x100000000L
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes system time (milliseconds since January 1, 1970) as an NTP time stamp
|
||||
* at the given offset in the buffer.
|
||||
*/
|
||||
@Suppress("SameParameterValue")
|
||||
private fun writeTimeStamp(buffer: ByteArray, offsetParam: Int, time: Long) {
|
||||
var offset = offsetParam
|
||||
var seconds = time / 1000L
|
||||
val milliseconds = time - seconds * 1000L
|
||||
seconds += OFFSET_1900_TO_1970
|
||||
|
||||
// write seconds in big endian format
|
||||
buffer[offset++] = (seconds shr 24).toByte()
|
||||
buffer[offset++] = (seconds shr 16).toByte()
|
||||
buffer[offset++] = (seconds shr 8).toByte()
|
||||
buffer[offset++] = (seconds shr 0).toByte()
|
||||
val fraction = milliseconds * 0x100000000L / 1000L
|
||||
// write fraction in big endian format
|
||||
buffer[offset++] = (fraction shr 24).toByte()
|
||||
buffer[offset++] = (fraction shr 16).toByte()
|
||||
buffer[offset++] = (fraction shr 8).toByte()
|
||||
// low order bits should be random data
|
||||
buffer[offset] = (Math.random() * 255.0).toInt().toByte()
|
||||
}
|
||||
}
|
|
@ -22,7 +22,7 @@
|
|||
android:id="@+id/nav_historybrowser"
|
||||
android:orderInCategory="1"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/nav_historybrowser" />
|
||||
android:title="@string/nav_history_browser" />
|
||||
<item
|
||||
android:id="@+id/nav_setupwizard"
|
||||
android:orderInCategory="1"
|
||||
|
|
|
@ -77,21 +77,6 @@
|
|||
<item>zh</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="ageArray">
|
||||
<item>@string/child</item>
|
||||
<item>@string/teenage</item>
|
||||
<item>@string/adult</item>
|
||||
<item>@string/resistantadult</item>
|
||||
<item>@string/pregnant</item>
|
||||
</string-array>
|
||||
<string-array name="ageValues" translatable="false">
|
||||
<item>@string/key_child</item>
|
||||
<item>@string/key_teenage</item>
|
||||
<item>@string/key_adult</item>
|
||||
<item>@string/key_resistantadult</item>
|
||||
<item>@string/key_pregnant</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="smbMaxMinutes">
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
|
|
|
@ -1,230 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="dia_whatmeansdia">What is true about DIA?</string>
|
||||
<string name="dia_label_exam">Duration of Insulin Action (DIA)</string>
|
||||
<string name="dia_profile">You should set the value for DIA in your profile.</string>
|
||||
<string name="dia_minimumis5h">The minimum allowed value is 5 hours.</string>
|
||||
<string name="dia_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html?#insulin</string>
|
||||
<string name="dia_meaningisequaltodiapump">If you are satisfied that the value for DIA that you used in your pump prior to AAPS worked well, there is no need to change this when you start looping.</string>
|
||||
<string name="dia_valuemustbedetermined">You should determine for yourself the appropriate value for DIA.</string>
|
||||
<string name="hypott_label">Hypo Temp-Target</string>
|
||||
<string name="hypott_whenhypott">What is primary reason to set a hypo temp target?</string>
|
||||
<string name="hypott_wrongbasal">To correct for hypos caused by incorrect basal rate settings.</string>
|
||||
<string name="hypott_preventoversmb">To prevent AAPS from overcorrecting for a blood glucose rise caused by the fast acting carbs used to treat a hypo.</string>
|
||||
<string name="hypott_exercise">To correct for a hypo induced as a result of exercise.</string>
|
||||
<string name="hypott_0basal">To prevent blood glucose from going low if there is already a 0% temporary basal rate running.</string>
|
||||
<string name="hypott_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html</string>
|
||||
<string name="offlineprofile_whatprofile">Which profile can be used and configured offline?</string>
|
||||
<string name="offlineprofile_label">Topic: Offline Profile</string>
|
||||
<string name="offlineprofile_nsprofile">NS Profile can be used, but not configured.</string>
|
||||
<string name="offlineprofile_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#profile</string>
|
||||
<string name="pumpdisconnect_label">Reasons for applying "Disconnect pump" in AAPS</string>
|
||||
<string name="pumpdisconnect_whattodo">What should be done when disconnecting the pump?</string>
|
||||
<string name="pumpdisconnect_unnecessary">This is unnecessary as insulin will not be delivered if the pump is physically disconnected.</string>
|
||||
<string name="pumpdisconnect_missinginsulin">It prevents AAPS from accounting for insulin that was not delivered whilst the pump is physically disconnected. </string>
|
||||
<string name="pumpdisconnect_notstop">It will not stop insulin delivery if the pump remains connected.</string>
|
||||
<string name="pumpdisconnect_openloop">It will send AAPS into open loop mode.</string>
|
||||
<string name="pumpdisconnect_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#other-settings</string>
|
||||
<string name="objectives_label">AAPS Settings</string>
|
||||
<string name="objectives2_label">AAPS Settings</string>
|
||||
<string name="objectives_howtosave">What are the best practices for backing up your settings?</string>
|
||||
<string name="objectives_notesettings">You do not need to export your settings provided that you make a note of them.</string>
|
||||
<string name="objectives_afterobjective">Export your settings after you finish completing an objective.</string>
|
||||
<string name="objectives_afterchange">Export your settings after changing any of your settings.</string>
|
||||
<string name="objectives_afterinitialsetup">Export your settings after you finish your initial set-up and have set your Preferences.</string>
|
||||
<string name="objectives2_maintenance">Export your settings locally using the maintenance menu.</string>
|
||||
<string name="objectives2_internalstorage">Your settings file is found in the folder Internal Storage/AAPS/preferences on your phone.</string>
|
||||
<string name="objectives2_cloud">Copy your preferences file to a safe location outside of your phone (e.g. by using a cloud drive, connecting a cable to a computer, email, etc.)</string>
|
||||
<string name="objectives2_easyrestore">If your phone is damaged or lost, there are easy ways to remotely recover your settings without a backup.</string>
|
||||
<string name="objectives_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/ExportImportSettings.html</string>
|
||||
<string name="objectives_hint2">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#what-emergency-equipment-is-recommended-to-take-with-me</string>
|
||||
<string name="noisycgm_label">Noisy CGM Readings</string>
|
||||
<string name="noisycgm_whattodo">What should be done if CGM data is noisy?</string>
|
||||
<string name="noisycgm_nothing">Do nothing - AAPS will deal with it.</string>
|
||||
<string name="noisycgm_pause">Disable the closed loop to avoid possible over or underdosing.</string>
|
||||
<string name="noisycgm_replacesensor">Replace consistently noisy or inaccurate sensors.</string>
|
||||
<string name="noisycgm_checksmoothing">Verify that your CGM app provides smoothed data.</string>
|
||||
<string name="noisycgm_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Smoothing-Blood-Glucose-Data-in-xDrip.html#smoothing-blood-glucose-data</string>
|
||||
<string name="exerciseprofile_label">Exercise and Profiles</string>
|
||||
<string name="exerciseprofile_whattodo">How can you use profiles to best help the system deal with aerobic exercise?</string>
|
||||
<string name="exerciseprofile_switchprofilebelow100">Do a profile switch to less than 100%.</string>
|
||||
<string name="exerciseprofile_switchprofileabove100">Do a profile switch to more than 100%.</string>
|
||||
<string name="exerciseprofile_leaveat100">Leave the profile set to 100%.</string>
|
||||
<string name="exerciseprofile_suspendloop">Suspend the loop.</string>
|
||||
<string name="exerciseprofile_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html#activity-temp-target</string>
|
||||
<string name="exercise_label">Exercise and Temporary Targets</string>
|
||||
<string name="exercise_whattodo">How can you use temporary targets to best help the system deal with aerobic exercise?</string>
|
||||
<string name="exercise_settt">Set an activity blood glucose target starting a suitable time before beginning exercise.</string>
|
||||
<string name="exercise_setfinished">Set an activity blood glucose target after finishing exercise.</string>
|
||||
<string name="exercise_setunchanged">Leave your blood glucose target unchanged.</string>
|
||||
<string name="exercise_15g">Wait until blood glucose drops below your hypo temp target and then eat 15 g of fast acting carbohydrates.</string>
|
||||
<string name="exercise_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html#activity-temp-target</string>
|
||||
<string name="suspendloop_label">Disabled/Suspended loop</string>
|
||||
<string name="suspendloop_doigetinsulin">Do I receive insulin when the loop is disabled/suspended?</string>
|
||||
<string name="suspendloop_yes">Yes, basal insulin continues to be delivered.</string>
|
||||
<string name="suspendloop_no">No, delivery of insulin is stopped.</string>
|
||||
<string name="basaltest_label">Basal, ISF, and I:C Testing</string>
|
||||
<string name="basaltest_when">When should these values be validated?</string>
|
||||
<string name="basaltest_beforeloop">Before starting looping.</string>
|
||||
<string name="basaltest_havingregularhighlow">When experiencing frequent high or low blood glucose.</string>
|
||||
<string name="basaltest_weekly">At least once per week.</string>
|
||||
<string name="basaltest_fixed">Once set and validated, these values should not change over time.</string>
|
||||
<string name="basaltest_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#androidaps-settings</string>
|
||||
<string name="prerequisites_label">Prerequisites</string>
|
||||
<string name="prerequisites_what">What is essential to set up and use AAPS?</string>
|
||||
<string name="prerequisites_determinedcorrectprofile">Validated profile information (Basal, IC, ISF, DIA).</string>
|
||||
<string name="prerequisites_computer">A computer with Android Studio installed and configured.</string>
|
||||
<string name="prerequisites_phone">A supported phone.</string>
|
||||
<string name="prerequisites_pump">A compatible insulin pump if you are planning to run a closed loop.</string>
|
||||
<string name="prerequisites_nightscout">Nightscout, to keep a log of all data and review settings.</string>
|
||||
<string name="prerequisites_tidepoolaccount">A Tidepool account.</string>
|
||||
<string name="prerequisites_googleaccount">A Google account.</string>
|
||||
<string name="prerequisites_githubaccount">A Github account.</string>
|
||||
<string name="prerequisites_beanandroiddeveloper">Experience in programming or editing code.</string>
|
||||
<string name="prerequisites_own670g">A MiniMed 670G pump.</string>
|
||||
<string name="prerequisites_hint1">https://androidaps.readthedocs.io/en/latest/EN/Module/module.html</string>
|
||||
<string name="prerequisites_smartwatch">A Smartwatch.</string>
|
||||
<string name="prerequisites_supportedcgm">A Supported CGM.</string>
|
||||
<string name="prerequisites2_label">Prerequisites</string>
|
||||
<string name="prerequisites2_what">What is essential to set up and use AAPS?</string>
|
||||
<string name="prerequisites2_profile">Validated information to set up a profile (ISF, I:C ratio, basal rates, DIA etc.).</string>
|
||||
<string name="prerequisites2_device">A compatible Android device (e.g. mobile/cell phone, full Android watch, or tablet).</string>
|
||||
<string name="prerequisites2_internet">AAPS requires an internet connection in order to run in closed loop.</string>
|
||||
<string name="prerequisites2_supportedcgm">A supported CGM and appropriate app to receive blood glucose values on the phone/device.</string>
|
||||
<string name="prerequisites2_hint1">https://androidaps.readthedocs.io/en/latest/EN/Module/module.html</string>
|
||||
<string name="update_label">Updating AAPS</string>
|
||||
<string name="whatistrue">Check all correct answers.</string>
|
||||
<string name="update_git">You need to have Git installed and configured on your computer.</string>
|
||||
<string name="update_asap">When updated versions of AAPS are released, the earlier versions may be remotely limited after a specified time.</string>
|
||||
<string name="update_keys">You should save and note the location of your keystore and use the same signing key for updates as for your previous installation.</string>
|
||||
<string name="update_neverupdate">Never update if the system is working well.</string>
|
||||
<string name="update_askfriend">If you have difficulty building the apk, you can install an apk that has been built by a friend.</string>
|
||||
<string name="update_hint1">https://androidaps.readthedocs.io/en/latest/EN/Installing-AndroidAPS/Update-to-new-version.html#update-to-a-new-version-or-branch</string>
|
||||
<string name="troubleshooting_label">Troubleshooting</string>
|
||||
<string name="troubleshooting_wheretoask">Where can you look for help with AAPS?</string>
|
||||
<string name="troubleshooting_fb">You can ask for advice in the AAPS Users Facebook group.</string>
|
||||
<string name="troubleshooting_wiki">You should read (and re-read) the AAPS documentation.</string>
|
||||
<string name="troubleshooting_gitter">You can ask for advice and log technical problems or issues in the AAPS Discord.</string>
|
||||
<string name="troubleshooting_yourendo">You should ask your diabetes clinic/endocrinologist.</string>
|
||||
<string name="troubleshooting_hint1">https://androidaps.readthedocs.io/en/latest/EN/Installing-AndroidAPS/Update-to-new-version.html#troubleshooting</string>
|
||||
<string name="troubleshooting_hint2">https://www.facebook.com/groups/AndroidAPSUsers/</string>
|
||||
<string name="troubleshooting_hint3">https://discord.gg/4fQUWHZ4Mw</string>
|
||||
<string name="insulin_label">Insulin Plugins</string>
|
||||
<string name="insulin_ultrarapid">Which insulin should you use with the Ultra-Rapid Oref plugin?</string>
|
||||
<string name="insulin_fiasp">Fiasp®</string>
|
||||
<string name="insulin_novorapid">NovoRapid®/Novolog®</string>
|
||||
<string name="insulin_humalog">Humalog®</string>
|
||||
<string name="insulin_actrapid">Actrapid®/Humalin R®/"regular" human insulin.</string>
|
||||
<string name="insulin_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#insulin</string>
|
||||
<string name="sensitivity_label">Sensitivity Plugins</string>
|
||||
<string name="sensitivity_which">Check all correct answers.</string>
|
||||
<string name="sensitivity_adjust">Sensitivity plugins allow AAPS to adjust for temporary or short-lived changes in insulin sensitivity (for example hormonal changes or issues with absorption at the infusion site).</string>
|
||||
<string name="sensitivity_edit">Sensitivity plugins provide the user with suggested changes to basal rates, I:C ratios and ISF that can be used to edit profile.</string>
|
||||
<string name="sensitivity_cannula">Logging a cannula change will reset Autosens ratio back to 100%.</string>
|
||||
<string name="sensitivity_time">Some of the plugin options have configurable time ranges that can be set by the user.</string>
|
||||
<string name="sensitivity_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html</string>
|
||||
<string name="sensitivity_hint2">https://androidaps.readthedocs.io/en/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens</string>
|
||||
<string name="wrongcarbs_label">Carb Entry Errors</string>
|
||||
<string name="wrongcarbs_whattodo">What should you do if you’ve made an incorrect carb entry?</string>
|
||||
<string name="wrongcarbs_treatmentstab">Delete the incorrect entry in Treatments and enter the correct new carb value.</string>
|
||||
<string name="wrongcarbs_addinsulin">Bolus with insulin using the infusion set prime menu.</string>
|
||||
<string name="wrongcarbs_donothing">Do nothing – AAPS will make the appropriate adjustments.</string>
|
||||
<string name="wrongcarbs_bolus">Bolus with insulin using the Insulin (bolus) button in Overview.</string>
|
||||
<string name="wronginsulin_label">Insulin delivery/entry errors</string>
|
||||
<string name="wronginsulin_whattodo">What should you do if you received less insulin than the pump history suggests e.g. due to an occlusion, a failed cannula or forgetting to reattach the pump after a shower? </string>
|
||||
<string name="wronginsulin_careportal">Delete insulin data from Nightscout Careportal to remove it from the pump history.</string>
|
||||
<string name="wronginsulin_compare">Compare values in AAPS and pump history (if pump supports this).</string>
|
||||
<string name="wronginsulin_prime">Bolus a proportion of your calculated ‘missed’ insulin by either syringe/pen or using a prime.</string>
|
||||
<string name="wronginsulin_donothing">Do nothing and allow AAPS to correct any resulting high blood glucose level.</string>
|
||||
<string name="cob_label">Carbs on Board (COB)</string>
|
||||
<string name="cob_question">How changing ISF value affects COB calculation?</string>
|
||||
<string name="cob_longer">Increasing ISF will take absorbing carbs a longer time</string>
|
||||
<string name="cob_shorter">Increasing ISF will take absorbing carbs a shorter time</string>
|
||||
<string name="cob_no_effect">Increasing ISF will not affect calculated carbs absorption</string>
|
||||
<string name="cob2_question">How changing IC value affects COB calculation?</string>
|
||||
<string name="cob2_longer">Increasing IC will take absorbing carbs a longer time</string>
|
||||
<string name="cob2_shorter">Increasing IC will take absorbing carbs a shorter time</string>
|
||||
<string name="cob2_no_effect">Increasing IC will not affect calculated carbs absorption</string>
|
||||
<string name="cob3_question">How changing profile percentage affects COB calculation?</string>
|
||||
<string name="cob3_longer">Setting profile to 150% will take absorbing carbs a longer time</string>
|
||||
<string name="cob3_shorter">Setting profile to 150% will take absorbing carbs a shorter time</string>
|
||||
<string name="cob3_no_effect">Setting profile to 150% will not affect calculated carbs absorption</string>
|
||||
<string name="iob_label">Insulin on Board (IOB)</string>
|
||||
<string name="iob_value">IOB value is affected by issued temporary basals.</string>
|
||||
<string name="iob_hightemp">High temp basal will not be given when your blood sugar is below target.</string>
|
||||
<string name="iob_negiob">Negative IOB for a substantial period in the absence of exercise suggests your profile is too strong and less insulin is needed in your settings.</string>
|
||||
<string name="iob_posiob">Positive IOB for a substantial period suggests insulin resistance or unannounced meals.</string>
|
||||
<string name="breadgrams_label">Carb entry and boluses</string>
|
||||
<string name="breadgrams_grams">Only grams should be used for estimating and recording carbohydrates consumed.</string>
|
||||
<string name="breadgrams_exchange">Carbohydrates consumed can be recorded using an appropriate exchange system (e.g. DAFNE "CHO" exchanges or European "Bread Units").</string>
|
||||
<string name="breadgrams_decay">AAPS uses a dynamic model to estimate carb “decay” and calculate COB.</string>
|
||||
<string name="breadgrams_calc">If blood glucose levels are outside acceptable values (too low or too high) the bolus calculator can be used to provide suggestions for carb or insulin corrections.</string>
|
||||
<string name="breadgrams_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#insulin-to-carb-ratio-ic-g-u</string>
|
||||
<string name="extendedcarbs_label">e-carbs</string>
|
||||
<string name="extendedcarbs_handling">What could you use e-carbs (extended carbs) for?</string>
|
||||
<string name="extendedcarbs_future">To schedule carbs in the future, possibly distributed over an interval (similar to an extended bolus distributing insulin over an interval).</string>
|
||||
<string name="extendedcarbs_free">For logging \'free\' exercise carbs you want to hide from AAPS.</string>
|
||||
<string name="extendedcarbs_fat">e-carbs (distributed in the future) can assist AAPS in dealing with high fat/protein meals.</string>
|
||||
<string name="extendedcarbs_rescue">For logging rescue carbs you use to treat low blood glucose. </string>
|
||||
<string name="extendedcarbs_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Extended-Carbs.html</string>
|
||||
<string name="nsclient_label">Remote Monitoring</string>
|
||||
<string name="nsclient_howcanyou">How can you monitor AAPS (for example for your child) remotely?</string>
|
||||
<string name="nsclient_nightscout">AAPSClient app, Nightscout app and Nightscout webpage all allow you to follow AAPS remotely.</string>
|
||||
<string name="nsclient_dexcomfollow">Other apps (e.g. Dexcom follow, xDrip running in follow mode) allow you to follow some parameters (e.g. blood glucose/sensor values) remotely, but use different algorithms so may have inaccurate IOB or COB values.</string>
|
||||
<string name="nsclient_data">To follow AAPS remotely, both devices must have internet access (e.g. via Wi-Fi or mobile/cellular network data).</string>
|
||||
<string name="nsclient_fullcontrol">AAPSClient used as a remote follower will both monitor and provide full control of AAPS.</string>
|
||||
<string name="nsclient_hint1">https://androidaps.readthedocs.io/en/latest/EN/Children/Children.html</string>
|
||||
<string name="isf_label_exam">Insulin Sensitivity Factor (ISF)</string>
|
||||
<string name="isf_increasingvalue">Raising ISF values will lead to more insulin delivery to cover a specific amount of carbs.</string>
|
||||
<string name="isf_decreasingvalue">Reducing ISF values lead to more insulin delivery to correct for an above target blood glucose.</string>
|
||||
<string name="isf_noeffect">Raising or lowering ISF has no effect on insulin delivery when blood glucose levels are below target.</string>
|
||||
<string name="isf_preferences">ISF should be entered in your AAPS Preferences.</string>
|
||||
<string name="isf_profile">Changing the ISF value in your profile is enough to apply the change.</string>
|
||||
<string name="isf_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#insulin-sensitivity-factor-isf-mmol-l-u-or-mg-dl-u</string>
|
||||
<string name="isf_hint2">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html</string>
|
||||
<string name="ic_multiple">You can use more than one value for I:C ratio in your profile.</string>
|
||||
<string name="ic_isf">If you change your ISF in your profile you should always change your I:C ratio too.</string>
|
||||
<string name="ic_label_exam">Insulin to Carbohydrate Ratio (I:C ratio)</string>
|
||||
<string name="ic_increasingvalue">Higher I:C ratios lead to less insulin delivered for a given amount of carbs.</string>
|
||||
<string name="ic_decreasingvalue">Lower I:C ratios lead to less insulin delivered for a given amount of carbs.</string>
|
||||
<string name="ic_noeffect">If you have 0 COB, changing the IC ratio will lead to a different amount of insulin to correct a given BG value.</string>
|
||||
<string name="ic_different">IC will be different if you count bread (exchange) unit as 10g or 12g.</string>
|
||||
<string name="ic_meaning">IC meaning is: How many bread (exchange) units are covered by 1U of insulin.</string>
|
||||
<string name="ic_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#carbohydrate-to-insulin-ratio-cr-g-u</string>
|
||||
<string name="profileswitch_label">Profile Switching</string>
|
||||
<string name="profileswitch_pctwillchange"> When specifying a 90% profile switch, which answers are true?</string>
|
||||
<string name="profileswitch_basallower">Basal rates will be 10% lower.</string>
|
||||
<string name="profileswitch_isfhigher">ISF will be 10% higher.</string>
|
||||
<string name="profileswitch_iclower">The value of the I:C ratio will be a 10% lower number.</string>
|
||||
<string name="profileswitch_unchanged">ISF and I:C ratios will be unchanged.</string>
|
||||
<string name="profileswitch_hint1" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#profile-switch</string>
|
||||
<string name="profileswitch2_label">Profile Switching</string>
|
||||
<string name="profileswitch2_pctwillchange"> When specifying a 120% profile switch, which answers are true?</string>
|
||||
<string name="profileswitch2_bghigher">Target blood glucose will be 20% higher.</string>
|
||||
<string name="profileswitch2_basalhigher">Basal rates will be 20% higher.</string>
|
||||
<string name="profileswitch2_bgunchanged">Target blood glucose will be unchanged.</string>
|
||||
<string name="profileswitch2_isfhigher">ISF will be 20% higher.</string>
|
||||
<string name="profileswitchtime_label">Profile Switching</string>
|
||||
<string name="profileswitchtime_iwant">If you get up 2 hours earlier than usual, how should you notify AAPS of the change in your schedule?</string>
|
||||
<string name="profileswitchtime_2">Initiate a profile switch with a timeshift of 2</string>
|
||||
<string name="profileswitchtime__2">Initiate a profile switch with a timeshift of -2</string>
|
||||
<string name="profileswitchtime_tt">Set an eating soon temporary target.</string>
|
||||
<string name="profileswitchtime_100">Do a profile switch to more than 100%. </string>
|
||||
<string name="profileswitchtime_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#timeshift</string>
|
||||
<string name="profileswitch4_label">Changes to profiles</string>
|
||||
<string name="profileswitch4_rates">Basal rates, ISF, I:C ratios, etc., should be set in profiles.</string>
|
||||
<string name="profileswitch4_internet">Activating changes to your Nightscout Profile requires your AAPS phone to have an internet connection.</string>
|
||||
<string name="profileswitch4_sufficient">Editing profiles to change values is sufficient to enact any changes made.</string>
|
||||
<string name="profileswitch4_multi">Multiple profiles can be set up and selected to accommodate changing circumstances (e.g. hormonal changes, shift working, weekdays/weekend lifestyle).</string>
|
||||
<string name="basalhelp_hint1">https://androidaps.readthedocs.io/en/latest/EN/Module/module.html#good-individual-dosage-algorithm-for-your-diabetes-therapy</string>
|
||||
<string name="basalhelp_label">Help with basal rates</string>
|
||||
<string name="basalhelp_where">Where to go for help with basalrate etc.</string>
|
||||
<string name="basalhelp_diabetesteam">Your diabetes team</string>
|
||||
<string name="basalhelp_google">Google</string>
|
||||
<string name="basalhelp_facebook">Facebook</string>
|
||||
<string name="blank"></string>
|
||||
<string name="other_medication_label">Other Medication. Please read the statement below and then check the box to accept the declaration.</string>
|
||||
<string name="other_medication_text">AAPS reduces basal rates or suspends insulin delivery to raise blood sugar. Drugs in the class SGLT2 inhibitors (gliflozins) can prevent increases in blood glucose and therefore can produce a dangerous insulin deficiency leading to DKA.
|
||||
\nCommon brand names are: Invokana®, Forxiga®, Jardiance®, Steglatro®, Suglat®, Apleway®, Deberza®, Synjardy®, Vokanamet®, Xigduo®.\n\nI hereby promise that I will not take such drugs when using AAPS or will deactivate the loop before using such drugs.</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -1,62 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="key_objectiveuseactions" translatable="false">ObjectivesActionsUsed</string>
|
||||
<string name="key_objectiveuseloop" translatable="false">ObjectivesLoopUsed</string>
|
||||
<string name="key_objectiveusescale" translatable="false">ObjectivesScaleUsed</string>
|
||||
<string name="key_objectives_request_code" translatable="false">objectives_request_code</string>
|
||||
<string name="key_ObjectivesmanualEnacts" translatable="false">ObjectivesmanualEnacts</string>
|
||||
|
||||
<string name="objectives_button_start">Start</string>
|
||||
<string name="objectives_button_verify">Verify</string>
|
||||
<string name="nth_objective">%1$d. Objective</string>
|
||||
<string name="objectivenotstarted">Objective %1$d not started</string>
|
||||
<string name="objectivenotfinished">Objective %1$d not finished</string>
|
||||
<string name="objectives_0_objective">Setting up visualization and monitoring, and analyzing basals and ratios</string>
|
||||
<string name="objectives_0_gate">Verify that BG is available in Nightscout, and pump insulin data is being uploaded</string>
|
||||
<string name="objectives_openloop_objective">Starting on an open loop</string>
|
||||
<string name="objectives_openloop_gate">Run in Open Loop mode for a few days and manually enact lots of temp basals. Set up and use temporary and default temporary targets (e.g. for activity or hypo treatment carbs)</string>
|
||||
<string name="objectives_maxbasal_objective">Understanding your open loop, including its temp basal recommendations</string>
|
||||
<string name="objectives_maxbasal_gate">Based on that experience, decide what max basal should be, and set it on the pump and preferences</string>
|
||||
<string name="objectives_maxiobzero_objective">Starting to close the loop with Low Glucose Suspend</string>
|
||||
<string name="objectives_maxiobzero_gate">Run in closed loop with max IOB = 0 for a few days without too many LGS events</string>
|
||||
<string name="objectives_maxiob_objective">Tuning the closed loop, raising max IOB above 0 and gradually lowering BG targets</string>
|
||||
<string name="objectives_maxiob_gate">Run for a few days, and at least one night with no low BG alarms, before dropping BG</string>
|
||||
<string name="objectives_autosens_objective">Adjust basals and ratios if needed, and then enable auto-sens</string>
|
||||
<string name="objectives_autosens_gate">1 week successful daytime looping with regular carb entry</string>
|
||||
<string name="objectives_smb_objective">Enabling additional features for daytime use, such as SMB</string>
|
||||
<string name="objectives_auto_objective">Enabling automation</string>
|
||||
<string name="objectives_smb_gate">You must read the wiki and rise maxIOB to get SMBs working fine! A good start is maxIOB=average mealbolus + 3 x max daily basal</string>
|
||||
<string name="objectives_auto_gate">Read the docs on how automation works. Set up your first simple rules. Instead of action let AAPS display only notification. When you are sure automation is triggered at the right time replace notification by real action. (https://androidaps.readthedocs.io/en/latest/EN/Usage/Automation.html)</string>
|
||||
<string name="objectives_bgavailableinns">BG available in NS</string>
|
||||
<string name="objectives_pumpstatusavailableinns">Pump status available in NS</string>
|
||||
<string name="objectives_manualenacts">Manual enacts</string>
|
||||
<string name="accomplished">Accomplished: %1$s</string>
|
||||
<string name="objectives_usage_objective">Learn how to control AAPS</string>
|
||||
<string name="objectives_usage_gate">Perform different actions in AAPS</string>
|
||||
<string name="objectives_useprofileswitch">Set profile 90% for 10 min (Long-press profile name on Overview)</string>
|
||||
<string name="objectives_usedisconnectpump">Simulate shower. Disconnect pump for 1h (Long-press on Open Loop)</string>
|
||||
<string name="objectives_usereconnectpump">... and reconnect back the same way</string>
|
||||
<string name="objectives_usetemptarget">Create custom temporary target with 10 min duration (Long-press on your current target)</string>
|
||||
<string name="objectives_useactions">In Config Builder enable Actions plugin, make it visible and display its content from top menu</string>
|
||||
<string name="objectives_useloop">Display content of Loop plugin</string>
|
||||
<string name="objectives_usescale">Use scale function by long-pressing BG chart</string>
|
||||
<string name="objectives_button_enter">Enter</string>
|
||||
<string name="enter_code_obtained_from_developers_to_bypass_the_rest_of_objectives">If you have at least 3 months of closed loop experience with other systems you might qualify for a code to skip objectives. See https://androidaps.readthedocs.io/en/latest/EN/Usage/Objectives.html#skip-objectives for details.</string>
|
||||
<string name="codeaccepted">Code accepted</string>
|
||||
<string name="codeinvalid">Code invalid</string>
|
||||
<string name="objectives_exam_objective">Prove your knowledge</string>
|
||||
<string name="objectives_exam_gate">Study the questions. You are given four possible answers for each question. There may be more than one correct answer. Please check all those that are correct and select VERIFY.</string>
|
||||
<string name="answerdisabledto">Answering disabled until: %1$s</string>
|
||||
<string name="wronganswer">Wrong answer!</string>
|
||||
<string name="unfinshed_button">Next unfinished</string>
|
||||
<string name="requestcode">Request code: %1$s</string>
|
||||
<string name="objectives_hint">(check all correct answers)</string>
|
||||
<string name="disconnectpump_hint" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#what-to-do-when-taking-a-shower-or-bath</string>
|
||||
<string name="usetemptarget_hint" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/Screenshots.html#the-homescreen</string>
|
||||
<string name="useaction_hint" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/Screenshots.html#config-builder</string>
|
||||
<string name="usescale_hint" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/Screenshots.html#the-homescreen</string>
|
||||
<string name="notconnected">Not connected to the internet</string>
|
||||
<string name="failedretrievetime">Failed retrieve time</string>
|
||||
<string name="requirementnotmet">Objective requirements not met</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -35,9 +35,6 @@
|
|||
<string name="key_openapsama_bolussnooze_dia_divisor" translatable="false">bolussnooze_dia_divisor</string>
|
||||
<string name="key_openapsama_autosens_adjusttargets" translatable="false">autosens_adjust_targets</string>
|
||||
<string name="key_last_cleanup_run" translatable="false">last_cleanup_run</string>
|
||||
<string name="treatmentssafety_title">Treatments safety</string>
|
||||
<string name="treatmentssafety_maxbolus_title">Max allowed bolus [U]</string>
|
||||
<string name="treatmentssafety_maxcarbs_title">Max allowed carbs [g]</string>
|
||||
<string name="treatmentssafety_lgsThreshold_title">BG level below which low glucose suspend occurs</string>
|
||||
<string name="nav_preferences_plugin">%1$s Preferences</string>
|
||||
<string name="nav_preferences">Preferences</string>
|
||||
|
@ -45,9 +42,7 @@
|
|||
<string name="nav_resetdb">Reset Databases</string>
|
||||
<string name="reset_db_confirm">Do you really want to reset the databases?</string>
|
||||
<string name="nav_exit">Exit</string>
|
||||
<string name="description_actions">Some buttons to quickly access common features</string>
|
||||
<string name="description_config_builder">Used for configuring the active plugins</string>
|
||||
<string name="description_objectives">Learning program</string>
|
||||
<string name="description_loop">Activate or deactivate the implementation triggering the loop.</string>
|
||||
<string name="description_ama">State of the algorithm in 2017</string>
|
||||
<string name="description_smb">Most recent algorithm for advanced users</string>
|
||||
|
@ -92,20 +87,14 @@
|
|||
<string name="loop_constraintsprocessed_label">After processed constraints</string>
|
||||
<string name="loop_tbrsetbypump_label">Temp basal set by pump</string>
|
||||
<string name="noapsselected">NO APS SELECTED OR PROVIDED RESULT</string>
|
||||
<string name="safety">Safety</string>
|
||||
<string name="openapsma_disabled">Plugin is disabled</string>
|
||||
<string name="constraints_violation">Constraints violation</string>
|
||||
<string name="setbasalquestion">Accept new temp basal:</string>
|
||||
<string name="changeyourinput">Change your input!</string>
|
||||
<string name="configbuilder_bgsource">BG Source</string>
|
||||
<string name="configbuilder_bgsource_description">Where should AAPS gain it\'s data from?</string>
|
||||
<string name="apsmode_title">APS Mode</string>
|
||||
<string name="openloop_newsuggestion">New suggestion available</string>
|
||||
<string name="carbssuggestion">Carbs Suggestion</string>
|
||||
<string name="carb_time_label">Carb time</string>
|
||||
<string name="profile_label">Profile</string>
|
||||
<string name="overview_tempbasal_button">TempBasal</string>
|
||||
<string name="overview_extendedbolus_button">Extended Bolus</string>
|
||||
<string name="configbuilder_nightscoutversion_label">Nightscout version:</string>
|
||||
<string name="exported">Preferences exported</string>
|
||||
<string name="ue_exported">User Entries exported</string>
|
||||
|
@ -141,7 +130,6 @@
|
|||
<string name="end_user_license_agreement_i_understand">I UNDERSTAND AND AGREE</string>
|
||||
<string name="save">Save</string>
|
||||
<string name="reloadprofile">Reload profile</string>
|
||||
<string name="quickwizard">QuickWizard</string>
|
||||
<string name="quickwizardsettings">QuickWizard settings</string>
|
||||
<string name="overview_editquickwizard_buttontext">Button text:</string>
|
||||
<string name="overview_editquickwizard_carbs">Carbs:</string>
|
||||
|
@ -149,7 +137,6 @@
|
|||
<string name="overview_editquickwizardlistactivity_add">Add</string>
|
||||
<string name="overview_quickwizard_item_edit_button">Edit</string>
|
||||
<string name="correctionbous">Corr</string>
|
||||
<string name="actions">Actions</string>
|
||||
<string name="ns_upload_only">(DANGEROUS TO DISABLE) NS upload only</string>
|
||||
<string name="ns_upload_only_summary">NS upload only (disabled sync). Not effective on SGV unless a local source like xDrip+ is selected. Not effective on Profiles while NS-Profiles is used.\n!!! WARNING !!! Disabling this option may cause malfunctions and insulin overdose if any of your component (AAPS, NS, xDrip+) is wrong configured. Carefully watch if data displayed by AAPS match the pump state!</string>
|
||||
<string name="pumpNotInitialized">Pump not initialized!</string>
|
||||
|
@ -161,7 +148,6 @@
|
|||
<string name="wear">Wear</string>
|
||||
<string name="resend_all_data">Resend All Data</string>
|
||||
<string name="open_settings_on_wear">Open Settings on Wear</string>
|
||||
<string name="basal_rate">Basal rate</string>
|
||||
<string name="ongoingnotificaction">Ongoing Notification</string>
|
||||
<string name="old_data">OLD DATA</string>
|
||||
<string name="openapsama">OpenAPS AMA</string>
|
||||
|
@ -169,14 +155,12 @@
|
|||
<string name="openapsma_autosensdata_label">Autosens data</string>
|
||||
<string name="openapsma_scriptdebugdata_label">Script debug</string>
|
||||
<string name="openapsama_useautosens">Use Autosens feature</string>
|
||||
<string name="actions_shortname">ACT</string>
|
||||
<string name="configbuilder_shortname">CONF</string>
|
||||
<string name="loop_shortname">LOOP</string>
|
||||
<string name="oaps_shortname">OAPS</string>
|
||||
<string name="dynisf_shortname">DYNISF</string>
|
||||
<string name="overview_shortname">HOME</string>
|
||||
<string name="treatments_shortname">TREAT</string>
|
||||
<string name="objectives_shortname">OBJ</string>
|
||||
<string name="wear_shortname">WEAR</string>
|
||||
<string name="short_tabtitles">Shorten tab titles</string>
|
||||
<string name="always_use_shortavg">Always use short average delta instead of simple delta</string>
|
||||
|
@ -195,22 +179,9 @@
|
|||
<string name="executing">Executing</string>
|
||||
<string name="wear_settings">Wear settings</string>
|
||||
<string name="nosuccess">not successful - please check phone</string>
|
||||
<string name="patientage">Patient type</string>
|
||||
<string name="child">Child</string>
|
||||
<string name="teenage">Teenage</string>
|
||||
<string name="adult">Adult</string>
|
||||
<string name="resistantadult">Insulin resistant adult</string>
|
||||
<string name="pregnant">Pregnancy</string>
|
||||
<string name="patientage_summary">Please select patient type to setup safety limits</string>
|
||||
<string name="patient_name">Patient name</string>
|
||||
<string name="patient_name_summary">Please provide patient name or nickname to differentiate among multiple setups</string>
|
||||
<string name="key_i_understand" translatable="false">I_understand</string>
|
||||
<string name="duration15m">15 mins</string>
|
||||
<string name="duration30m">30 mins</string>
|
||||
<string name="duration1h">1 hour</string>
|
||||
<string name="duration2h">2 hours</string>
|
||||
<string name="duration3h">3 hours</string>
|
||||
<string name="duration10h">10 hours</string>
|
||||
<string name="restartingapp">Exiting application to apply settings.</string>
|
||||
<string name="configbuilder_insulin_description">Which type of insulin are you using?</string>
|
||||
<string name="enablesuperbolus">Enable superbolus in wizard</string>
|
||||
|
@ -224,13 +195,7 @@
|
|||
<string name="devslope_shortname">DEVSLOPE</string>
|
||||
<string name="nav_about">About</string>
|
||||
<string name="smscommunicator_missingphonestatepermission">Missing phone state permission</string>
|
||||
<string name="overview_extendedbolus_cancel_button">Cancel Extended Bolus</string>
|
||||
<string name="doprofileswitch">Do Profile Switch</string>
|
||||
<string name="careportal_sensor_label">Sensor</string>
|
||||
<string name="careportal_insulin_label">Insulin</string>
|
||||
<string name="careportal_pb_label">Pump battery</string>
|
||||
<string name="careportal_age_label">age:</string>
|
||||
<string name="careportal_level_label">level:</string>
|
||||
<string name="ns_alarm_options">Alarm options</string>
|
||||
<string name="key_ns_announcements" translatable="false">ns_announcements</string>
|
||||
<string name="key_ns_alarms" translatable="false">ns_alarms</string>
|
||||
|
@ -264,15 +229,12 @@
|
|||
<string name="key_DynISFAdjust" translatable="false">DynISFAdjust</string>
|
||||
<string name="DynISFAdjust_title" formatted="false">DynamicISF Adjustment Factor %</string>
|
||||
<string name="DynISFAdjust_summary" formatted="false">Adjustment factor for DynamicISF. Set more than 100% for more aggressive correction doses, and less than 100% for less aggressive corrections.</string>
|
||||
<string name="key_use_smb" translatable="false">use_smb</string>
|
||||
<string name="key_use_uam" translatable="false">use_uam</string>
|
||||
<string name="key_smb_enable_carbs_suggestions_threshold" translatable="false">smb_enable_carbs_suggestions_threshold</string>
|
||||
<string name="enableuam">Enable UAM</string>
|
||||
<string name="enablesmb">Enable SMB</string>
|
||||
<string name="enablesmb_summary">Use Super Micro Boluses instead of temp basal for faster action</string>
|
||||
<string name="enableuam_summary">Detection of Unannounced meals</string>
|
||||
<string name="invalid">INVALID</string>
|
||||
<string name="careportal_newnstreatment_percentage_label">Percentage</string>
|
||||
<string name="default_temptargets">Default Temp-Targets</string>
|
||||
<string name="eatingsoon_duration">eatingsoon duration</string>
|
||||
<string name="eatingsoon_target">eatingsoon target</string>
|
||||
|
@ -308,13 +270,6 @@
|
|||
<string name="overview_editquickwizard_usecob">COB calculation</string>
|
||||
<string name="overview_editquickwizard_usetemptarget">Temporary target calculation</string>
|
||||
<string name="overview_editquickwizard_usepercentage">Percentage calculation</string>
|
||||
<string name="loopenabled">Loop enabled</string>
|
||||
<string name="apsselected">APS selected</string>
|
||||
<string name="synchaswritepermission">Synchronization service has write permission</string>
|
||||
<string name="closedmodeenabled">Closed mode enabled</string>
|
||||
<string name="maxiobset">Maximal IOB set properly</string>
|
||||
<string name="hasbgdata">BG available from selected source</string>
|
||||
<string name="extendedbolusdeliveryerror">Extended bolus delivery error</string>
|
||||
<string name="key_enableSMB_always" translatable="false">enableSMB_always</string>
|
||||
<string name="key_enableSMB_with_COB" translatable="false">enableSMB_with_COB</string>
|
||||
<string name="key_enableSMB_with_temptarget" translatable="false">enableSMB_with_temptarget</string>
|
||||
|
@ -342,11 +297,9 @@
|
|||
<string name="carb_increment_button_message">Number of carbs to add when button is pressed</string>
|
||||
<string name="insulin_increment_button_message">Amount of insulin to add when button is pressed</string>
|
||||
<string name="error_starting_cgm">Could not launch CGM application. Make sure it is installed.</string>
|
||||
<string name="overview_cgm">CGM</string>
|
||||
<string name="ignore5m">Ignore 5m</string>
|
||||
<string name="ignore15m">Ignore 15m</string>
|
||||
<string name="ignore30m">Ignore 30m</string>
|
||||
<string name="nav_historybrowser">History browser</string>
|
||||
<string name="wear_notifysmb_title">Notify on SMB</string>
|
||||
<string name="wear_notifysmb_summary">Show SMB on the watch like a standard bolus.</string>
|
||||
<string name="wear_predictions_summary">Show the predictions on the watchface.</string>
|
||||
|
@ -364,34 +317,10 @@
|
|||
<string name="overview_show_cob">Carbs On Board</string>
|
||||
<string name="overview_show_iob">Insulin On Board</string>
|
||||
<string name="overview_show_basals">Basals</string>
|
||||
<string name="closed_loop_disabled_on_dev_branch">Running dev version. Closed loop is disabled.</string>
|
||||
<string name="engineering_mode_enabled">Engineering mode enabled</string>
|
||||
<string name="pumpisnottempbasalcapable">Pump is not temp basal capable</string>
|
||||
<string name="closedmodedisabledinpreferences">Closed loop mode disabled in preferences</string>
|
||||
<string name="autosensdisabledinpreferences">Autosens disabled in preferences</string>
|
||||
<string name="smbdisabledinpreferences">SMB disabled in preferences</string>
|
||||
<string name="uamdisabledinpreferences">UAM disabled in preferences</string>
|
||||
<string name="uamdisabledoref1notselected">UAM disabled because it rely on Oref1 sensitivity plugin</string>
|
||||
<string name="key_openapsma_max_basal" translatable="false">openapsma_max_basal</string>
|
||||
<string name="key_openapsama_current_basal_safety_multiplier" translatable="false">openapsama_current_basal_safety_multiplier</string>
|
||||
<string name="key_openapsama_max_daily_safety_multiplier" translatable="false">openapsama_max_daily_safety_multiplier</string>
|
||||
<string name="maxbasalmultiplier">max basal multiplier</string>
|
||||
<string name="maxdailybasalmultiplier">max daily basal multiplier</string>
|
||||
<string name="key_openapsma_max_iob" translatable="false">openapsma_max_iob</string>
|
||||
<string name="smb_frequency_exceeded">A bolus was delivered within the last 3 minutes, skipping SMB</string>
|
||||
<string name="basal_set_correctly">Basal set correctly</string>
|
||||
<string name="key_treatmentssafety_maxbolus" translatable="false">treatmentssafety_maxbolus</string>
|
||||
<string name="key_lgs_threshold" translatable="false">lgsThreshold</string>
|
||||
<string name="limitingextendedbolus">Limiting extended bolus to %1$.1f U because of %2$s</string>
|
||||
<string name="limitingcarbs">Limiting carbs to %1$d g because of %2$s</string>
|
||||
<string name="limitingiob">Limiting IOB to %1$.1f U because of %2$s</string>
|
||||
<string name="maxvalueinpreferences">max value in preferences</string>
|
||||
<string name="hardlimit">hard limit</string>
|
||||
<string name="key_openapsama_useautosens" translatable="false">openapsama_useautosens</string>
|
||||
<string name="smbalwaysdisabled">SMB always and after carbs disabled because active BG source doesn\'t support advanced filtering</string>
|
||||
<string name="smbnotallowedinopenloopmode">SMB not allowed in open loop mode</string>
|
||||
<string name="iobcobcalculator" translatable="false">IobCobCalculator</string>
|
||||
<string name="key_openapssmb_max_iob" translatable="false">openapsmb_max_iob</string>
|
||||
<string name="openapssmb_maxiob_title">Maximum total IOB OpenAPS can\'t go over [U]</string>
|
||||
<string name="openapssmb_maxiob_summary">This value is called Max IOB in OpenAPS context\nOpenAPS will not add more insulin if current IOB is greater than this value</string>
|
||||
<string name="absorption_cutoff_title">Meal max absorption time [h]</string>
|
||||
|
@ -486,23 +415,15 @@
|
|||
<string name="key_smbmaxminutes" translatable="false">smbmaxminutes</string>
|
||||
<string name="key_uamsmbmaxminutes" translatable="false">uamsmbmaxminutes</string>
|
||||
<string name="deliverpartofboluswizard">Bolus wizard performs calculation but only this part of calculated insulin is delivered. Useful with SMB algorithm.</string>
|
||||
<string name="increasingmaxbasal">Increasing max basal value because setting is lower than your max basal in profile</string>
|
||||
<string name="unitsnosemicolon">Units</string>
|
||||
<string name="objectives_button_unfinish">Clear finished</string>
|
||||
<string name="objectives_button_unstart">Clear started</string>
|
||||
<string name="doyouwantresetstart">Do you want reset objective start? You may lose your progress.</string>
|
||||
<string name="setupwizard_units_prompt">Select units you want to display values in</string>
|
||||
<string name="key_wear_detailediob" translatable="false">wear_detailediob</string>
|
||||
<string name="key_wear_showbgi" translatable="false">wear_showbgi</string>
|
||||
<string name="low_mark_comment">Lower value of in range area (display only)</string>
|
||||
<string name="high_mark_comment">Higher value of in range area (display only)</string>
|
||||
<string name="tools">Tools</string>
|
||||
<string name="show_calculation">Show calcuation</string>
|
||||
<string name="show_removed">Show removed</string>
|
||||
<string name="clearqueueconfirm">Clear queue? All data in queue will be lost!</string>
|
||||
<string name="key_wear_detailed_delta" translatable="false">wear_detailed_delta</string>
|
||||
<string name="ebstopsloop">Use of Extended bolus feature will stop closed loop mode for the time of running extended bolus. Do you really want it?</string>
|
||||
<string name="closed_loop_disabled_with_eb">Closed loop disabled because of running Extended bolus</string>
|
||||
<string name="chartmenu">Chart menu</string>
|
||||
<string name="databroadcaster" translatable="false">Data Broadcaster</string>
|
||||
<string name="loop_smbrequest_time_label">SMB request time</string>
|
||||
|
@ -517,12 +438,6 @@
|
|||
<string name="overview_show_absinsulin">Absolute insulin</string>
|
||||
<string name="master_password_summary">Master password is used for backup encryption and to override security in application. Remember it or store on a safe place.</string>
|
||||
<string name="current_master_password">Current master password</string>
|
||||
<string name="classic_description">Original skin</string>
|
||||
<string name="lowres_description">Low Resolution skin</string>
|
||||
<string name="buttonson_description">Buttons are always displayed on bottom of screen</string>
|
||||
<string name="largedisplay_description">Large display</string>
|
||||
<string name="key_skin" translatable="false">skin</string>
|
||||
<string name="skin">Skin</string>
|
||||
<string name="setupwizard_pump_riley_link_status">RileyLink status:</string>
|
||||
<string name="copytolocalprofile_invalid">Unable to create profile. Profile is invalid.</string>
|
||||
<string name="cta_dont_kill_my_app_info">Don\'t kill my app?</string>
|
||||
|
@ -531,7 +446,6 @@
|
|||
<string name="enablebolusreminder_summary">Use reminder to bolus later with wizard ("post-bolus")</string>
|
||||
<string name="fabric_upload_disabled">Crash logs upload disabled!</string>
|
||||
<string name="graph_menu_divider_header">Graph</string>
|
||||
<string name="chart_menu">Chart menu</string>
|
||||
<string name="clear_filter">Clear filter</string>
|
||||
<string name="cannula">Cannula</string>
|
||||
<string name="common_values">Use values of your largest food you usually eat\n</string>
|
||||
|
@ -541,19 +455,10 @@
|
|||
<string name="privacy_summary">You can provide optional email address if you want to be notified about app crashes. This is not an automated service. You will be contacted by developers in dangerous situations.</string>
|
||||
<string name="data_status">BG data status</string>
|
||||
<string name="remove_bg_readings">Remove BG readings</string>
|
||||
<string name="statuslights_cannula_age">cannula age</string>
|
||||
<string name="statuslights_patch_pump_age">patch pump age</string>
|
||||
<string name="patch_pump">Patch pump</string>
|
||||
<string name="identification">Identification (email, FB or Discord nick etc)</string>
|
||||
<string name="identification_not_set">Identification not set in dev mode</string>
|
||||
<string name="a11y_dialog">dialog</string>
|
||||
<string name="a11y_current_bg">current blood glucose</string>
|
||||
<string name="not_available_full">Not available</string>
|
||||
<string name="a11y_graph">graph</string>
|
||||
<string name="a11y_bg_quality">blood glucose quality</string>
|
||||
<string name="a11y_insulin_label">insulin</string>
|
||||
<string name="a11y_blood_glucose">blood glucose</string>
|
||||
<string name="a11y_bg_outdated">outdated</string>
|
||||
<!-- WEAR OS-->
|
||||
<string name="wear_action_tempt_preset_error">Temptarget unknown preset: %1$s</string>
|
||||
<string name="wear_action_tempt_cancel_message">Cancelling running Temp-Targets?</string>
|
||||
|
@ -577,7 +482,6 @@
|
|||
<string name="loop_status">Loop status</string>
|
||||
<string name="graph_scale">Graph scale</string>
|
||||
<string name="a11y_open_settings">open settings</string>
|
||||
<string name="a11y_set_carb_timer">set carb timer alarm</string>
|
||||
<string name="device_all">All</string>
|
||||
<string name="device_phone">Phone</string>
|
||||
<string name="device_watch">Watch</string>
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
</PreferenceCategory>
|
||||
|
||||
<info.nightscout.androidaps.skins.SkinListPreference
|
||||
<info.nightscout.plugins.skins.SkinListPreference
|
||||
android:key="@string/key_skin"
|
||||
android:title="@string/skin" />
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ import info.nightscout.androidaps.insight.database.InsightDbHelper
|
|||
import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective
|
||||
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin
|
||||
|
@ -25,19 +22,23 @@ import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInf
|
|||
import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage
|
||||
import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.plugins.source.GlimpPlugin
|
||||
import info.nightscout.androidaps.utils.Profiler
|
||||
import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.implementation.constraints.ConstraintsImpl
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.interfaces.constraints.Objectives
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.plugin.PluginType
|
||||
import info.nightscout.interfaces.pump.PumpSync
|
||||
import info.nightscout.interfaces.pump.defs.PumpDescription
|
||||
import info.nightscout.interfaces.utils.HardLimits
|
||||
import info.nightscout.plugins.constraints.objectives.ObjectivesPlugin
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective
|
||||
import info.nightscout.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.plugins.source.GlimpPlugin
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
|
@ -210,7 +211,8 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
fabricPrivacy,
|
||||
dateUtil,
|
||||
repository,
|
||||
glucoseStatusProvider
|
||||
glucoseStatusProvider,
|
||||
sp
|
||||
)
|
||||
safetyPlugin =
|
||||
SafetyPlugin(
|
||||
|
@ -220,10 +222,6 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
sp,
|
||||
rxBus,
|
||||
constraintChecker,
|
||||
openAPSAMAPlugin,
|
||||
openAPSSMBPlugin,
|
||||
openAPSSMBDynamicISFPlugin,
|
||||
sensitivityOref1Plugin,
|
||||
activePlugin,
|
||||
hardLimits,
|
||||
BuildHelperImpl(config, fileListProvider),
|
||||
|
@ -238,6 +236,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
constraintsPluginsList.add(danaRPlugin)
|
||||
constraintsPluginsList.add(danaRSPlugin)
|
||||
constraintsPluginsList.add(insightPlugin)
|
||||
constraintsPluginsList.add(openAPSAMAPlugin)
|
||||
constraintsPluginsList.add(openAPSSMBPlugin)
|
||||
`when`(activePlugin.getSpecificPluginsListByInterface(Constraints::class.java)).thenReturn(constraintsPluginsList)
|
||||
objectivesPlugin.onStart()
|
||||
|
@ -260,7 +259,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
@Test
|
||||
fun isClosedLoopAllowedTest() {
|
||||
`when`(sp.getString(R.string.key_aps_mode, "open")).thenReturn("closed")
|
||||
objectivesPlugin.objectives[ObjectivesPlugin.MAXIOB_ZERO_CL_OBJECTIVE].startedOn = 0
|
||||
objectivesPlugin.objectives[Objectives.MAXIOB_ZERO_CL_OBJECTIVE].startedOn = 0
|
||||
var c: Constraint<Boolean> = constraintChecker.isClosedLoopAllowed()
|
||||
aapsLogger.debug("Reason list: " + c.reasonList.toString())
|
||||
// Assert.assertTrue(c.reasonList[0].toString().contains("Closed loop is disabled")) // Safety & Objectives
|
||||
|
@ -275,7 +274,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
// Safety & Objectives
|
||||
@Test
|
||||
fun isAutosensModeEnabledTest() {
|
||||
objectivesPlugin.objectives[ObjectivesPlugin.AUTOSENS_OBJECTIVE].startedOn = 0
|
||||
objectivesPlugin.objectives[Objectives.AUTOSENS_OBJECTIVE].startedOn = 0
|
||||
`when`(sp.getBoolean(R.string.key_openapsama_useautosens, false)).thenReturn(false)
|
||||
val c = constraintChecker.isAutosensModeEnabled()
|
||||
Assert.assertEquals(true, c.reasonList.size == 2) // Safety & Objectives
|
||||
|
@ -304,7 +303,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
// Safety & Objectives
|
||||
@Test
|
||||
fun isSMBModeEnabledTest() {
|
||||
objectivesPlugin.objectives[ObjectivesPlugin.SMB_OBJECTIVE].startedOn = 0
|
||||
objectivesPlugin.objectives[Objectives.SMB_OBJECTIVE].startedOn = 0
|
||||
`when`(sp.getBoolean(R.string.key_use_smb, false)).thenReturn(false)
|
||||
`when`(sp.getString(R.string.key_aps_mode, "open")).thenReturn("open")
|
||||
// `when`(constraintChecker.isClosedLoopAllowed()).thenReturn(Constraint(true))
|
||||
|
@ -423,7 +422,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
val d = constraintChecker.getMaxIOBAllowed()
|
||||
Assert.assertEquals(1.5, d.value(), 0.01)
|
||||
Assert.assertEquals(d.reasonList.toString(), 2, d.reasonList.size)
|
||||
Assert.assertEquals("Safety: Limiting IOB to 1.5 U because of max value in preferences", d.getMostLimitedReasons(aapsLogger))
|
||||
Assert.assertEquals("OpenAPSAMA: Limiting IOB to 1.5 U because of max value in preferences", d.getMostLimitedReasons(aapsLogger))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -439,6 +438,6 @@ class ConstraintsCheckerTest : TestBaseWithProfile() {
|
|||
val d = constraintChecker.getMaxIOBAllowed()
|
||||
Assert.assertEquals(3.0, d.value(), 0.01)
|
||||
Assert.assertEquals(d.reasonList.toString(), 2, d.reasonList.size)
|
||||
Assert.assertEquals("Safety: Limiting IOB to 3.0 U because of max value in preferences", d.getMostLimitedReasons(aapsLogger))
|
||||
Assert.assertEquals("OpenAPSSMB: Limiting IOB to 3.0 U because of max value in preferences", d.getMostLimitedReasons(aapsLogger))
|
||||
}
|
||||
}
|
|
@ -1,24 +1,26 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.safety
|
||||
package info.nightscout.androidaps.plugins.safety
|
||||
|
||||
import dagger.android.AndroidInjector
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.HardLimitsMock
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.TestBaseWithProfile
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.plugins.source.GlimpPlugin
|
||||
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider
|
||||
import info.nightscout.androidaps.utils.Profiler
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Constants
|
||||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.interfaces.plugin.PluginType
|
||||
import info.nightscout.interfaces.pump.defs.PumpDescription
|
||||
import info.nightscout.interfaces.utils.HardLimits
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import info.nightscout.plugins.source.GlimpPlugin
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
|
@ -30,20 +32,20 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
|
||||
@Mock lateinit var sp: SP
|
||||
@Mock lateinit var constraintChecker: Constraints
|
||||
@Mock lateinit var openAPSAMAPlugin: OpenAPSAMAPlugin
|
||||
@Mock lateinit var openAPSSMBPlugin: OpenAPSSMBPlugin
|
||||
@Mock lateinit var openAPSSMBDynamicISFPlugin: OpenAPSSMBDynamicISFPlugin
|
||||
@Mock lateinit var sensitivityOref1Plugin: SensitivityOref1Plugin
|
||||
@Mock lateinit var activePlugin: ActivePlugin
|
||||
@Mock lateinit var buildHelper: BuildHelper
|
||||
@Mock lateinit var virtualPumpPlugin: VirtualPumpPlugin
|
||||
@Mock lateinit var glimpPlugin: GlimpPlugin
|
||||
@Mock lateinit var profiler: Profiler
|
||||
@Mock lateinit var repository: AppRepository
|
||||
@Mock lateinit var glucoseStatusProvider: GlucoseStatusProvider
|
||||
|
||||
private lateinit var hardLimits: HardLimits
|
||||
private lateinit var safetyPlugin: SafetyPlugin
|
||||
private lateinit var openAPSAMAPlugin: OpenAPSAMAPlugin
|
||||
private lateinit var openAPSSMBPlugin: OpenAPSSMBPlugin
|
||||
|
||||
val injector = HasAndroidInjector { AndroidInjector { } }
|
||||
private val injector = HasAndroidInjector { AndroidInjector { } }
|
||||
private val pumpDescription = PumpDescription()
|
||||
|
||||
@Before
|
||||
|
@ -67,19 +69,21 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
`when`(rh.gs(R.string.smbalwaysdisabled)).thenReturn("SMB always and after carbs disabled because active BG source doesn\\'t support advanced filtering")
|
||||
`when`(rh.gs(R.string.smbnotallowedinopenloopmode)).thenReturn("SMB not allowed in open loop mode")
|
||||
`when`(rh.gs(R.string.key_child)).thenReturn("child")
|
||||
`when`(rh.gs(R.string.lowglucosesuspend)).thenReturn("Low Glucose Suspend")
|
||||
|
||||
`when`(activePlugin.activePump).thenReturn(virtualPumpPlugin)
|
||||
`when`(virtualPumpPlugin.pumpDescription).thenReturn(pumpDescription)
|
||||
`when`(config.APS).thenReturn(true)
|
||||
hardLimits = HardLimitsMock(sp, rh)
|
||||
safetyPlugin = SafetyPlugin(
|
||||
injector, aapsLogger, rh, sp, rxBus, constraintChecker, openAPSAMAPlugin, openAPSSMBPlugin, openAPSSMBDynamicISFPlugin, sensitivityOref1Plugin, activePlugin,
|
||||
hardLimits, buildHelper,
|
||||
iobCobCalculator, config, dateUtil
|
||||
)
|
||||
safetyPlugin = SafetyPlugin(injector, aapsLogger, rh, sp, rxBus, constraintChecker, activePlugin, hardLimits, buildHelper, iobCobCalculator, config, dateUtil)
|
||||
openAPSAMAPlugin = OpenAPSAMAPlugin(injector, aapsLogger, rxBus, constraintChecker, rh, profileFunction, context, activePlugin, iobCobCalculator, hardLimits, profiler, fabricPrivacy,
|
||||
dateUtil, repository, glucoseStatusProvider, sp)
|
||||
openAPSSMBPlugin = OpenAPSSMBPlugin(injector, aapsLogger, rxBus, constraintChecker, rh, profileFunction, context, activePlugin, iobCobCalculator, hardLimits, profiler, sp,
|
||||
dateUtil, repository, glucoseStatusProvider)
|
||||
}
|
||||
|
||||
@Test fun pumpDescriptionShouldLimitLoopInvocation() {
|
||||
@Test
|
||||
fun pumpDescriptionShouldLimitLoopInvocation() {
|
||||
pumpDescription.isTempBasalCapable = false
|
||||
var c = Constraint(true)
|
||||
c = safetyPlugin.isLoopInvocationAllowed(c)
|
||||
|
@ -87,7 +91,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals(false, c.value())
|
||||
}
|
||||
|
||||
@Test fun disabledEngineeringModeShouldLimitClosedLoop() {
|
||||
@Test
|
||||
fun disabledEngineeringModeShouldLimitClosedLoop() {
|
||||
`when`(sp.getString(R.string.key_aps_mode, "open")).thenReturn("closed")
|
||||
`when`(buildHelper.isEngineeringModeOrRelease()).thenReturn(false)
|
||||
var c = Constraint(true)
|
||||
|
@ -96,7 +101,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals(false, c.value())
|
||||
}
|
||||
|
||||
@Test fun setOpenLoopInPreferencesShouldLimitClosedLoop() {
|
||||
@Test
|
||||
fun setOpenLoopInPreferencesShouldLimitClosedLoop() {
|
||||
`when`(sp.getString(R.string.key_aps_mode, "open")).thenReturn("open")
|
||||
var c = Constraint(true)
|
||||
c = safetyPlugin.isClosedLoopAllowed(c)
|
||||
|
@ -104,7 +110,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals(false, c.value())
|
||||
}
|
||||
|
||||
@Test fun notEnabledSMBInPreferencesDisablesSMB() {
|
||||
@Test
|
||||
fun notEnabledSMBInPreferencesDisablesSMB() {
|
||||
`when`(sp.getBoolean(R.string.key_use_smb, false)).thenReturn(false)
|
||||
`when`(constraintChecker.isClosedLoopAllowed(anyObject())).thenReturn(Constraint(true))
|
||||
var c = Constraint(true)
|
||||
|
@ -113,7 +120,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals(false, c.value())
|
||||
}
|
||||
|
||||
@Test fun openLoopPreventsSMB() {
|
||||
@Test
|
||||
fun openLoopPreventsSMB() {
|
||||
`when`(sp.getBoolean(R.string.key_use_smb, false)).thenReturn(true)
|
||||
`when`(constraintChecker.isClosedLoopAllowed(anyObject())).thenReturn(Constraint(false))
|
||||
var c = Constraint(true)
|
||||
|
@ -122,7 +130,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals(false, c.value())
|
||||
}
|
||||
|
||||
@Test fun bgSourceShouldPreventSMBAlways() {
|
||||
@Test
|
||||
fun bgSourceShouldPreventSMBAlways() {
|
||||
`when`(activePlugin.activeBgSource).thenReturn(glimpPlugin)
|
||||
var c = Constraint(true)
|
||||
c = safetyPlugin.isAdvancedFilteringEnabled(c)
|
||||
|
@ -130,7 +139,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals(false, c.value())
|
||||
}
|
||||
|
||||
@Test fun basalRateShouldBeLimited() {
|
||||
@Test
|
||||
fun basalRateShouldBeLimited() {
|
||||
`when`(sp.getDouble(R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
|
||||
`when`(sp.getDouble(R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0)
|
||||
`when`(sp.getDouble(R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0)
|
||||
|
@ -149,7 +159,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals("Safety: Limiting max basal rate to 1.00 U/h because of max value in preferences", c.getMostLimitedReasons(aapsLogger))
|
||||
}
|
||||
|
||||
@Test fun doNotAllowNegativeBasalRate() {
|
||||
@Test
|
||||
fun doNotAllowNegativeBasalRate() {
|
||||
`when`(sp.getString(R.string.key_age, "")).thenReturn("child")
|
||||
val d = Constraint(-0.5)
|
||||
safetyPlugin.applyBasalConstraints(d, validProfile)
|
||||
|
@ -162,7 +173,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
)
|
||||
}
|
||||
|
||||
@Test fun percentBasalRateShouldBeLimited() {
|
||||
@Test
|
||||
fun percentBasalRateShouldBeLimited() {
|
||||
// No limit by default
|
||||
`when`(sp.getDouble(R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
|
||||
`when`(sp.getDouble(R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0)
|
||||
|
@ -185,7 +197,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals("Safety: Limiting max percent rate to 100% because of pump limit", i.getMostLimitedReasons(aapsLogger))
|
||||
}
|
||||
|
||||
@Test fun doNotAllowNegativePercentBasalRate() {
|
||||
@Test
|
||||
fun doNotAllowNegativePercentBasalRate() {
|
||||
`when`(sp.getString(R.string.key_age, "")).thenReturn("child")
|
||||
val i = Constraint(-22)
|
||||
safetyPlugin.applyBasalPercentConstraints(i, validProfile)
|
||||
|
@ -201,7 +214,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals("Safety: Limiting max percent rate to 0% because of pump limit", i.getMostLimitedReasons(aapsLogger))
|
||||
}
|
||||
|
||||
@Test fun bolusAmountShouldBeLimited() {
|
||||
@Test
|
||||
fun bolusAmountShouldBeLimited() {
|
||||
`when`(sp.getDouble(R.string.key_treatmentssafety_maxbolus, 3.0)).thenReturn(3.0)
|
||||
`when`(sp.getString(R.string.key_age, "")).thenReturn("child")
|
||||
var d = Constraint(Constants.REALLYHIGHBOLUS)
|
||||
|
@ -216,7 +230,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals("Safety: Limiting bolus to 3.0 U because of max value in preferences", d.getMostLimitedReasons(aapsLogger))
|
||||
}
|
||||
|
||||
@Test fun doNotAllowNegativeBolusAmount() {
|
||||
@Test
|
||||
fun doNotAllowNegativeBolusAmount() {
|
||||
`when`(sp.getDouble(R.string.key_treatmentssafety_maxbolus, 3.0)).thenReturn(3.0)
|
||||
`when`(sp.getString(R.string.key_age, "")).thenReturn("child")
|
||||
var d = Constraint(-22.0)
|
||||
|
@ -226,7 +241,8 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals("Safety: Limiting bolus to 0.0 U because of it must be positive value", d.getMostLimitedReasons(aapsLogger))
|
||||
}
|
||||
|
||||
@Test fun carbsAmountShouldBeLimited() {
|
||||
@Test
|
||||
fun carbsAmountShouldBeLimited() {
|
||||
// No limit by default
|
||||
`when`(sp.getInt(R.string.key_treatmentssafety_maxcarbs, 48)).thenReturn(48)
|
||||
|
||||
|
@ -242,10 +258,13 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
Assert.assertEquals("Safety: Limiting carbs to 48 g because of max value in preferences", i.getReasons(aapsLogger))
|
||||
}
|
||||
|
||||
@Test fun iobShouldBeLimited() {
|
||||
`when`(openAPSSMBPlugin.isEnabled()).thenReturn(true)
|
||||
`when`(openAPSAMAPlugin.isEnabled()).thenReturn(false)
|
||||
`when`(sp.getString(R.string.key_aps_mode, "open")).thenReturn("closed")
|
||||
@Test
|
||||
fun iobShouldBeLimited() {
|
||||
openAPSAMAPlugin.setPluginEnabled(PluginType.APS, true)
|
||||
openAPSSMBPlugin.setPluginEnabled(PluginType.APS, true)
|
||||
//`when`(openAPSSMBPlugin.isEnabled()).thenReturn(true)
|
||||
//`when`(openAPSAMAPlugin.isEnabled()).thenReturn(false)
|
||||
`when`(sp.getString(R.string.key_aps_mode, "open")).thenReturn("lgs")
|
||||
`when`(sp.getDouble(R.string.key_openapsma_max_iob, 1.5)).thenReturn(1.5)
|
||||
`when`(sp.getDouble(R.string.key_openapssmb_max_iob, 3.0)).thenReturn(3.0)
|
||||
`when`(sp.getString(R.string.key_age, "")).thenReturn("teenage")
|
||||
|
@ -253,8 +272,22 @@ class SafetyPluginTest : TestBaseWithProfile() {
|
|||
// Apply all limits
|
||||
var d = Constraint(Constants.REALLYHIGHIOB)
|
||||
d = safetyPlugin.applyMaxIOBConstraints(d)
|
||||
Assert.assertEquals(3.0, d.value(), 0.01)
|
||||
Assert.assertEquals("Safety: Limiting IOB to 3.0 U because of max value in preferences\nSafety: Limiting IOB to 22.0 U because of hard limit", d.getReasons(aapsLogger))
|
||||
Assert.assertEquals("Safety: Limiting IOB to 3.0 U because of max value in preferences", d.getMostLimitedReasons(aapsLogger))
|
||||
Assert.assertEquals(HardLimits.MAX_IOB_LGS, d.value(), 0.01)
|
||||
Assert.assertEquals("Safety: Limiting IOB to 0.0 U because of Low Glucose Suspend", d.getReasons(aapsLogger))
|
||||
Assert.assertEquals("Safety: Limiting IOB to 0.0 U because of Low Glucose Suspend", d.getMostLimitedReasons(aapsLogger))
|
||||
|
||||
// Apply all limits
|
||||
d = Constraint(Constants.REALLYHIGHIOB)
|
||||
val a = openAPSAMAPlugin.applyMaxIOBConstraints(d)
|
||||
Assert.assertEquals(1.5, a.value(), 0.01)
|
||||
Assert.assertEquals("OpenAPSAMA: Limiting IOB to 1.5 U because of max value in preferences\nOpenAPSAMA: Limiting IOB to 7.0 U because of hard limit", d.getReasons(aapsLogger))
|
||||
Assert.assertEquals("OpenAPSAMA: Limiting IOB to 1.5 U because of max value in preferences", d.getMostLimitedReasons(aapsLogger))
|
||||
|
||||
// Apply all limits
|
||||
d = Constraint(Constants.REALLYHIGHIOB)
|
||||
val s = openAPSSMBPlugin.applyMaxIOBConstraints(d)
|
||||
Assert.assertEquals(3.0, s.value(), 0.01)
|
||||
Assert.assertEquals("OpenAPSSMB: Limiting IOB to 3.0 U because of max value in preferences\nOpenAPSSMB: Limiting IOB to 22.0 U because of hard limit", d.getReasons(aapsLogger))
|
||||
Assert.assertEquals("OpenAPSSMB: Limiting IOB to 3.0 U because of max value in preferences", d.getMostLimitedReasons(aapsLogger))
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package info.nightscout.androidaps.utils
|
||||
|
||||
import info.nightscout.androidaps.TestBase
|
||||
import info.nightscout.plugins.constraints.objectives.SntpClient
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
|
|
|
@ -79,7 +79,7 @@ class ActionStartTempTarget(injector: HasAndroidInjector) : Action(injector) {
|
|||
override fun generateDialog(root: LinearLayout) {
|
||||
val unitResId = if (value.units == GlucoseUnit.MGDL) R.string.mgdl else R.string.mmol
|
||||
LayoutBuilder()
|
||||
.add(LabelWithElement(rh, rh.gs(R.string.careportal_temporarytarget) + "\n[" + rh.gs(unitResId) + "]", "", value))
|
||||
.add(LabelWithElement(rh, rh.gs(R.string.temporary_target) + "\n[" + rh.gs(unitResId) + "]", "", value))
|
||||
.add(LabelWithElement(rh, rh.gs(R.string.duration_min_label), "", duration))
|
||||
.build(root)
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ class TriggerTempTarget(injector: HasAndroidInjector) : Trigger(injector) {
|
|||
return this
|
||||
}
|
||||
|
||||
override fun friendlyName(): Int = R.string.careportal_temporarytarget
|
||||
override fun friendlyName(): Int = R.string.temporary_target
|
||||
|
||||
override fun friendlyDescription(): String =
|
||||
rh.gs(R.string.temptargetcompared, rh.gs(comparator.value.stringRes))
|
||||
|
@ -65,7 +65,7 @@ class TriggerTempTarget(injector: HasAndroidInjector) : Trigger(injector) {
|
|||
|
||||
override fun generateDialog(root: LinearLayout) {
|
||||
LayoutBuilder()
|
||||
.add(StaticLabel(rh, R.string.careportal_temporarytarget, this))
|
||||
.add(StaticLabel(rh, R.string.temporary_target, this))
|
||||
.add(comparator)
|
||||
.build(root)
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ class PumpEnactResultObject(injector: HasAndroidInjector) : PumpEnactResult {
|
|||
isTempCancel -> {
|
||||
ret += "\n${rh.gs(R.string.enacted)}: $enacted"
|
||||
if (comment.isNotEmpty()) ret += "\n${rh.gs(R.string.comment)}: $comment"
|
||||
ret += "\n${rh.gs(R.string.canceltemp)}"
|
||||
ret += "\n${rh.gs(R.string.cancel_temp)}"
|
||||
}
|
||||
|
||||
isPercent -> {
|
||||
|
@ -113,7 +113,7 @@ class PumpEnactResultObject(injector: HasAndroidInjector) : PumpEnactResult {
|
|||
isTempCancel -> {
|
||||
ret += "<br><b>" + rh.gs(R.string.enacted) + "</b>: " + enacted
|
||||
ret += "<br><b>" + rh.gs(R.string.comment) + "</b>: " + comment +
|
||||
"<br>" + rh.gs(R.string.canceltemp)
|
||||
"<br>" + rh.gs(R.string.cancel_temp)
|
||||
}
|
||||
|
||||
isPercent && percent != -1 -> {
|
||||
|
|
|
@ -102,7 +102,7 @@ open class APSResult @Inject constructor(val injector: HasAndroidInjector) {
|
|||
val pump = activePlugin.activePump
|
||||
if (isChangeRequested) {
|
||||
// rate
|
||||
var ret: String = if (rate == 0.0 && duration == 0) "${rh.gs(R.string.canceltemp)} "
|
||||
var ret: String = if (rate == 0.0 && duration == 0) "${rh.gs(R.string.cancel_temp)} "
|
||||
else if (rate == -1.0) "${rh.gs(R.string.let_temp_basal_run)}\n"
|
||||
else if (usePercent) "${rh.gs(R.string.rate)}: ${DecimalFormatter.to2Decimal(percent.toDouble())}% (${DecimalFormatter.to2Decimal(percent * pump.baseBasalRate / 100.0)} U/h) " +
|
||||
"${rh.gs(R.string.duration)}: ${DecimalFormatter.to2Decimal(duration.toDouble())} min "
|
||||
|
@ -127,7 +127,7 @@ open class APSResult @Inject constructor(val injector: HasAndroidInjector) {
|
|||
val pump = activePlugin.activePump
|
||||
if (isChangeRequested) {
|
||||
// rate
|
||||
var ret: String = if (rate == 0.0 && duration == 0) rh.gs(R.string.canceltemp) + "<br>" else if (rate == -1.0) rh.gs(R.string.let_temp_basal_run) + "<br>" else if (usePercent) "<b>" + rh.gs(R.string.rate) + "</b>: " + DecimalFormatter.to2Decimal(percent.toDouble()) + "% " +
|
||||
var ret: String = if (rate == 0.0 && duration == 0) rh.gs(R.string.cancel_temp) + "<br>" else if (rate == -1.0) rh.gs(R.string.let_temp_basal_run) + "<br>" else if (usePercent) "<b>" + rh.gs(R.string.rate) + "</b>: " + DecimalFormatter.to2Decimal(percent.toDouble()) + "% " +
|
||||
"(" + DecimalFormatter.to2Decimal(percent * pump.baseBasalRate / 100.0) + " U/h)<br>" +
|
||||
"<b>" + rh.gs(R.string.duration) + "</b>: " + DecimalFormatter.to2Decimal(duration.toDouble()) + " min<br>" else "<b>" + rh.gs(R.string.rate) + "</b>: " + DecimalFormatter.to2Decimal(rate) + " U/h " +
|
||||
"(" + DecimalFormatter.to2Decimal(rate / pump.baseBasalRate * 100.0) + "%) <br>" +
|
||||
|
|
|
@ -138,16 +138,16 @@ class Translator @Inject internal constructor(
|
|||
TherapyEvent.Type.QUESTION -> rh.gs(R.string.careportal_question)
|
||||
TherapyEvent.Type.EXERCISE -> rh.gs(R.string.careportal_exercise)
|
||||
TherapyEvent.Type.CANNULA_CHANGE -> rh.gs(R.string.careportal_pump_site_change)
|
||||
TherapyEvent.Type.PUMP_BATTERY_CHANGE -> rh.gs(R.string.careportal_pumpbatterychange)
|
||||
TherapyEvent.Type.PUMP_BATTERY_CHANGE -> rh.gs(R.string.pump_battery_change)
|
||||
TherapyEvent.Type.SENSOR_STARTED -> rh.gs(R.string.careportal_cgmsensorstart)
|
||||
TherapyEvent.Type.SENSOR_STOPPED -> rh.gs(R.string.careportal_cgm_sensor_stop)
|
||||
TherapyEvent.Type.SENSOR_CHANGE -> rh.gs(R.string.careportal_cgmsensorinsert)
|
||||
TherapyEvent.Type.SENSOR_CHANGE -> rh.gs(R.string.cgm_sensor_insert)
|
||||
TherapyEvent.Type.INSULIN_CHANGE -> rh.gs(R.string.careportal_insulin_cartridge_change)
|
||||
TherapyEvent.Type.DAD_ALERT -> rh.gs(R.string.careportal_dad_alert)
|
||||
TherapyEvent.Type.TEMPORARY_BASAL_START -> rh.gs(R.string.careportal_tempbasalstart)
|
||||
TherapyEvent.Type.TEMPORARY_BASAL_END -> rh.gs(R.string.careportal_tempbasalend)
|
||||
TherapyEvent.Type.PROFILE_SWITCH -> rh.gs(R.string.careportal_profileswitch)
|
||||
TherapyEvent.Type.TEMPORARY_TARGET -> rh.gs(R.string.careportal_temporarytarget)
|
||||
TherapyEvent.Type.TEMPORARY_TARGET -> rh.gs(R.string.temporary_target)
|
||||
TherapyEvent.Type.TEMPORARY_TARGET_CANCEL -> rh.gs(R.string.careportal_temporarytargetcancel)
|
||||
TherapyEvent.Type.APS_OFFLINE -> rh.gs(R.string.careportal_openapsoffline)
|
||||
TherapyEvent.Type.NS_MBG -> rh.gs(R.string.careportal_mbg)
|
||||
|
|
|
@ -51,7 +51,7 @@ class UserEntryPresentationHelper @Inject constructor(
|
|||
Sources.TTDialog -> R.drawable.ic_temptarget_high
|
||||
Sources.ProfileSwitchDialog -> R.drawable.ic_actions_profileswitch
|
||||
Sources.LoopDialog -> R.drawable.ic_loop_closed
|
||||
Sources.TempBasalDialog -> R.drawable.ic_actions_starttempbasal
|
||||
Sources.TempBasalDialog -> R.drawable.ic_actions_start_temp_basal
|
||||
Sources.CalibrationDialog -> R.drawable.ic_calibration
|
||||
Sources.FillDialog -> R.drawable.ic_cp_pump_cannula
|
||||
Sources.BgCheck -> R.drawable.ic_cp_bgcheck
|
||||
|
|
|
@ -309,7 +309,7 @@
|
|||
<string name="startprofile">Start profile %1$d%% for %2$d min</string>
|
||||
|
||||
<!-- APSResult-->
|
||||
<string name="canceltemp">Cancel temp basal</string>
|
||||
<string name="cancel_temp">Cancel temp basal</string>
|
||||
<string name="let_temp_basal_run">Let temp basal run</string>
|
||||
<string name="rate">Rate</string>
|
||||
<string name="duration">Duration</string>
|
||||
|
@ -335,7 +335,7 @@
|
|||
<string name="careportal_question_message">Question : %1$s</string>
|
||||
<string name="careportal_exercise_message">Exercise : %1$s</string>
|
||||
<string name="careportal_pump_site_change">Pump Site Change</string>
|
||||
<string name="careportal_cgmsensorinsert">CGM Sensor Insert</string>
|
||||
<string name="cgm_sensor_insert">CGM Sensor Insert</string>
|
||||
<string name="careportal_cgmsensorstart">CGM Sensor Start</string>
|
||||
<string name="careportal_cgm_sensor_stop">CGM Sensor Stop</string>
|
||||
<string name="careportal_dad_alert">D.A.D. Alert</string>
|
||||
|
@ -349,8 +349,8 @@
|
|||
<string name="careportal_tempbasalend">Temp Basal End</string>
|
||||
<string name="careportal_carbscorrection">Carbs correction</string>
|
||||
<string name="careportal_openapsoffline">OpenAPS Offline</string>
|
||||
<string name="careportal_pumpbatterychange">Pump Battery Change</string>
|
||||
<string name="careportal_temporarytarget">Temporary target</string>
|
||||
<string name="pump_battery_change">Pump Battery Change</string>
|
||||
<string name="temporary_target">Temporary target</string>
|
||||
<string name="careportal_temporarytargetvalue">Temporary target value</string>
|
||||
<string name="careportal_temporarytargetcancel">Temporary target cancel</string>
|
||||
<string name="boluswizard">Bolus wizard</string>
|
||||
|
|
|
@ -30,7 +30,7 @@ class PumpEnactResultTest : TestBaseWithProfile() {
|
|||
`when`(rh.gs(R.string.configbuilder_insulin)).thenReturn("Insulin")
|
||||
`when`(rh.gs(R.string.smb_shortname)).thenReturn("SMB")
|
||||
`when`(rh.gs(R.string.insulin_unit_shortname)).thenReturn("U")
|
||||
`when`(rh.gs(R.string.canceltemp)).thenReturn("Cancel temp basal")
|
||||
`when`(rh.gs(R.string.cancel_temp)).thenReturn("Cancel temp basal")
|
||||
`when`(rh.gs(R.string.duration)).thenReturn("Duration")
|
||||
`when`(rh.gs(R.string.percent)).thenReturn("Percent")
|
||||
`when`(rh.gs(R.string.absolute)).thenReturn("Absolute")
|
||||
|
|
|
@ -284,4 +284,8 @@ interface Pump {
|
|||
* Pumps with a hardware link can set via config "Battery Change Logging"
|
||||
*/
|
||||
fun isBatteryChangeLoggingEnabled(): Boolean = false
|
||||
/**
|
||||
* Pumps is connect via RileyLink
|
||||
*/
|
||||
fun isUseRileyLinkBatteryLevel(): Boolean = false
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package info.nightscout.interfaces.ui
|
|||
|
||||
import android.content.Context
|
||||
import androidx.annotation.RawRes
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.fragment.app.FragmentManager
|
||||
|
||||
/**
|
||||
|
@ -12,6 +13,7 @@ interface ActivityNames {
|
|||
|
||||
val mainActivityClass: Class<*>
|
||||
val tddStatsActivity: Class<*>
|
||||
val historyBrowseActivity: Class<*>
|
||||
val errorHelperActivity: Class<*>
|
||||
val bolusProgressHelperActivity: Class<*>
|
||||
val singleFragmentActivity: Class<*>
|
||||
|
@ -25,7 +27,11 @@ interface ActivityNames {
|
|||
*/
|
||||
fun runAlarm(ctx: Context, status: String, title: String, @RawRes soundId: Int = 0)
|
||||
fun runWizard(fragmentManager: FragmentManager, carbs: Int, name: String)
|
||||
fun runProfileSwitchDialog(fragmentManager: FragmentManager, profileName: String?)
|
||||
fun runProfileSwitchDialog(fragmentManager: FragmentManager, profileName: String? = null)
|
||||
fun runTempBasalDialog(fragmentManager: FragmentManager)
|
||||
fun runTempTargetDialog(fragmentManager: FragmentManager)
|
||||
fun runExtendedBolusDialog(fragmentManager: FragmentManager)
|
||||
fun runFillDialog(fragmentManager: FragmentManager)
|
||||
|
||||
enum class Mode(val i: Int) {
|
||||
RUNNING_PROFILE(1),
|
||||
|
@ -34,4 +40,15 @@ interface ActivityNames {
|
|||
PROFILE_COMPARE(4)
|
||||
}
|
||||
fun runProfileViewerDialog(fragmentManager: FragmentManager, time: Long, mode: Mode, customProfile: String?= null, customProfileName: String? = null, customProfile2: String? = null)
|
||||
enum class EventType {
|
||||
BGCHECK,
|
||||
SENSOR_INSERT,
|
||||
BATTERY_CHANGE,
|
||||
NOTE,
|
||||
EXERCISE,
|
||||
QUESTION,
|
||||
ANNOUNCEMENT
|
||||
}
|
||||
|
||||
fun runCareDialog(fragmentManager: FragmentManager, options: EventType, @StringRes event: Int)
|
||||
}
|
|
@ -26,6 +26,9 @@ dependencies {
|
|||
implementation project(':interfaces')
|
||||
implementation project(':ns-sdk')
|
||||
|
||||
api "androidx.appcompat:appcompat:$appcompat_version"
|
||||
api "com.google.android.material:material:$material_version"
|
||||
|
||||
// Actions
|
||||
api 'androidx.gridlayout:gridlayout:1.0.0'
|
||||
|
||||
|
@ -48,4 +51,6 @@ dependencies {
|
|||
api 'com.eatthepath:java-otp:0.3.1'
|
||||
api 'com.github.kenglxn.QRGen:android:2.6.0'
|
||||
|
||||
// Overview
|
||||
api 'com.google.android.flexbox:flexbox:3.0.0'
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives
|
||||
package info.nightscout.plugins.constraints.objectives
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Bundle
|
||||
|
@ -16,26 +16,25 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import androidx.recyclerview.widget.LinearSmoothScroller
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.databinding.ObjectivesFragmentBinding
|
||||
import info.nightscout.androidaps.databinding.ObjectivesItemBinding
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.dialogs.NtpProgressDialog
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.activities.ObjectivesExamDialog
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.ExamTask
|
||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate
|
||||
import info.nightscout.androidaps.utils.SntpClient
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.core.fabric.FabricPrivacy
|
||||
import info.nightscout.database.entities.UserEntry.Action
|
||||
import info.nightscout.database.entities.UserEntry.Sources
|
||||
import info.nightscout.database.entities.ValueWithUnit
|
||||
import info.nightscout.interfaces.utils.HtmlHelper
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.constraints.objectives.activities.ObjectivesExamDialog
|
||||
import info.nightscout.plugins.constraints.objectives.dialogs.NtpProgressDialog
|
||||
import info.nightscout.plugins.constraints.objectives.events.EventObjectivesUpdateGui
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective.ExamTask
|
||||
import info.nightscout.plugins.databinding.ObjectivesFragmentBinding
|
||||
import info.nightscout.plugins.databinding.ObjectivesItemBinding
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventNtpStatus
|
||||
import info.nightscout.rx.events.EventSWUpdate
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
|
@ -1,20 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives
|
||||
package info.nightscout.plugins.constraints.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective0
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective1
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective10
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective2
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective3
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective4
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective5
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective6
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective7
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective9
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.interfaces.constraints.Objectives
|
||||
|
@ -27,6 +15,18 @@ import info.nightscout.interfaces.constraints.Objectives.Companion.SMB_OBJECTIVE
|
|||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.plugin.PluginDescription
|
||||
import info.nightscout.interfaces.plugin.PluginType
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective0
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective1
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective10
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective2
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective3
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective4
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective5
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective6
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective7
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective9
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
|
@ -0,0 +1,200 @@
|
|||
package info.nightscout.plugins.constraints.objectives
|
||||
|
||||
import android.os.SystemClock
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import java.net.DatagramPacket
|
||||
import java.net.DatagramSocket
|
||||
import java.net.InetAddress
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
/**
|
||||
* {@hide}
|
||||
*
|
||||
*
|
||||
* Simple SNTP client class for retrieving network time.
|
||||
*
|
||||
*
|
||||
* Sample usage:
|
||||
* <pre>SntpClient client = new SntpClient();
|
||||
* if (client.requestTime("time.foo.com")) {
|
||||
* long now = client.getNtpTime() + SystemClock.elapsedRealtime() - client.getNtpTimeReference();
|
||||
* }
|
||||
</pre> *
|
||||
*/
|
||||
@Singleton
|
||||
class SntpClient @Inject constructor(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val dateUtil: DateUtil
|
||||
) {
|
||||
|
||||
companion object {
|
||||
//private final int REFERENCE_TIME_OFFSET = 16;
|
||||
private const val ORIGINATE_TIME_OFFSET = 24
|
||||
private const val RECEIVE_TIME_OFFSET = 32
|
||||
private const val TRANSMIT_TIME_OFFSET = 40
|
||||
private const val NTP_PACKET_SIZE = 48
|
||||
private const val NTP_PORT = 123
|
||||
private const val NTP_MODE_CLIENT = 3
|
||||
private const val NTP_VERSION = 3
|
||||
|
||||
// Number of seconds between Jan 1, 1900 and Jan 1, 1970
|
||||
// 70 years plus 17 leap days
|
||||
private const val OFFSET_1900_TO_1970 = (365L * 70L + 17L) * 24L * 60L * 60L
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the time computed from the NTP transaction.
|
||||
*
|
||||
* @return time value computed from NTP server response.
|
||||
*/
|
||||
// system time computed from NTP server response
|
||||
private var ntpTime: Long = 0
|
||||
|
||||
/**
|
||||
* Returns the reference clock value (value of SystemClock.elapsedRealtime())
|
||||
* corresponding to the NTP time.
|
||||
*
|
||||
* @return reference clock corresponding to the NTP time.
|
||||
*/
|
||||
// value of SystemClock.elapsedRealtime() corresponding to mNtpTime
|
||||
private var ntpTimeReference: Long = 0
|
||||
|
||||
/**
|
||||
* Returns the round trip time of the NTP transaction
|
||||
*
|
||||
* @return round trip time in milliseconds.
|
||||
*/
|
||||
// round trip time in milliseconds
|
||||
private var roundTripTime: Long = 0
|
||||
|
||||
abstract class Callback : Runnable {
|
||||
|
||||
var networkConnected = false
|
||||
var success = false
|
||||
var time: Long = 0
|
||||
}
|
||||
|
||||
@Synchronized fun ntpTime(callback: Callback, isConnected: Boolean) {
|
||||
callback.networkConnected = isConnected
|
||||
if (callback.networkConnected) {
|
||||
Thread { doNtpTime(callback) }.start()
|
||||
} else {
|
||||
callback.run()
|
||||
}
|
||||
}
|
||||
|
||||
fun doNtpTime(callback: Callback) {
|
||||
aapsLogger.debug("Time detection started")
|
||||
callback.success = requestTime("time.google.com", 5000)
|
||||
callback.time = ntpTime + SystemClock.elapsedRealtime() - ntpTimeReference
|
||||
aapsLogger.debug("Time detection ended: " + callback.success + " " + dateUtil.dateAndTimeString(ntpTime))
|
||||
callback.run()
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an SNTP request to the given host and processes the response.
|
||||
*
|
||||
* @param host host name of the server.
|
||||
* @param timeout network timeout in milliseconds.
|
||||
* @return true if the transaction was successful.
|
||||
*/
|
||||
@Suppress("SameParameterValue")
|
||||
@Synchronized private fun requestTime(host: String, timeout: Int): Boolean {
|
||||
try {
|
||||
val socket = DatagramSocket()
|
||||
socket.soTimeout = timeout
|
||||
val address = InetAddress.getByName(host)
|
||||
val buffer = ByteArray(NTP_PACKET_SIZE)
|
||||
val request = DatagramPacket(buffer, buffer.size, address, NTP_PORT)
|
||||
|
||||
// set mode = 3 (client) and version = 3
|
||||
// mode is in low 3 bits of first byte
|
||||
// version is in bits 3-5 of first byte
|
||||
buffer[0] = (NTP_MODE_CLIENT or (NTP_VERSION shl 3)).toByte()
|
||||
|
||||
// get current time and write it to the request packet
|
||||
val requestTime = System.currentTimeMillis()
|
||||
val requestTicks = SystemClock.elapsedRealtime()
|
||||
writeTimeStamp(buffer, TRANSMIT_TIME_OFFSET, requestTime)
|
||||
socket.send(request)
|
||||
|
||||
// read the response
|
||||
val response = DatagramPacket(buffer, buffer.size)
|
||||
socket.receive(response)
|
||||
val responseTicks = SystemClock.elapsedRealtime()
|
||||
val responseTime = requestTime + (responseTicks - requestTicks)
|
||||
socket.close()
|
||||
|
||||
// extract the results
|
||||
val originateTime = readTimeStamp(buffer, ORIGINATE_TIME_OFFSET)
|
||||
val receiveTime = readTimeStamp(buffer, RECEIVE_TIME_OFFSET)
|
||||
val transmitTime = readTimeStamp(buffer, TRANSMIT_TIME_OFFSET)
|
||||
val roundTripTime = responseTicks - requestTicks - (transmitTime - receiveTime)
|
||||
val clockOffset = (receiveTime - originateTime + (transmitTime - responseTime)) / 2
|
||||
|
||||
// save our results - use the times on this side of the network latency
|
||||
// (response rather than request time)
|
||||
ntpTime = responseTime + clockOffset
|
||||
ntpTimeReference = responseTicks
|
||||
this.roundTripTime = roundTripTime
|
||||
} catch (e: Exception) {
|
||||
aapsLogger.debug("request time failed: $e")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads an unsigned 32 bit big endian number from the given offset in the buffer.
|
||||
*/
|
||||
private fun read32(buffer: ByteArray, offset: Int): Long {
|
||||
val b0 = buffer[offset]
|
||||
val b1 = buffer[offset + 1]
|
||||
val b2 = buffer[offset + 2]
|
||||
val b3 = buffer[offset + 3]
|
||||
|
||||
// convert signed bytes to unsigned values
|
||||
val i0 = if (b0.toInt() and 0x80 == 0x80) (b0.toInt() and 0x7F) + 0x80 else b0.toInt()
|
||||
val i1 = if (b1.toInt() and 0x80 == 0x80) (b1.toInt() and 0x7F) + 0x80 else b1.toInt()
|
||||
val i2 = if (b2.toInt() and 0x80 == 0x80) (b2.toInt() and 0x7F) + 0x80 else b2.toInt()
|
||||
val i3 = if (b3.toInt() and 0x80 == 0x80) (b3.toInt() and 0x7F) + 0x80 else b3.toInt()
|
||||
return (i0.toLong() shl 24) + (i1.toLong() shl 16) + (i2.toLong() shl 8) + i3.toLong()
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the NTP time stamp at the given offset in the buffer and returns
|
||||
* it as a system time (milliseconds since January 1, 1970).
|
||||
*/
|
||||
private fun readTimeStamp(buffer: ByteArray, offset: Int): Long {
|
||||
val seconds = read32(buffer, offset)
|
||||
val fraction = read32(buffer, offset + 4)
|
||||
return (seconds - OFFSET_1900_TO_1970) * 1000 + fraction * 1000L / 0x100000000L
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes system time (milliseconds since January 1, 1970) as an NTP time stamp
|
||||
* at the given offset in the buffer.
|
||||
*/
|
||||
@Suppress("SameParameterValue")
|
||||
private fun writeTimeStamp(buffer: ByteArray, offsetParam: Int, time: Long) {
|
||||
var offset = offsetParam
|
||||
var seconds = time / 1000L
|
||||
val milliseconds = time - seconds * 1000L
|
||||
seconds += OFFSET_1900_TO_1970
|
||||
|
||||
// write seconds in big endian format
|
||||
buffer[offset++] = (seconds shr 24).toByte()
|
||||
buffer[offset++] = (seconds shr 16).toByte()
|
||||
buffer[offset++] = (seconds shr 8).toByte()
|
||||
buffer[offset++] = (seconds shr 0).toByte()
|
||||
val fraction = milliseconds * 0x100000000L / 1000L
|
||||
// write fraction in big endian format
|
||||
buffer[offset++] = (fraction shr 24).toByte()
|
||||
buffer[offset++] = (fraction shr 16).toByte()
|
||||
buffer[offset++] = (fraction shr 8).toByte()
|
||||
// low order bits should be random data
|
||||
buffer[offset] = (Math.random() * 255.0).toInt().toByte()
|
||||
}
|
||||
}
|
|
@ -1,21 +1,21 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.activities
|
||||
package info.nightscout.plugins.constraints.objectives.activities
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import dagger.android.support.DaggerDialogFragment
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.databinding.ObjectivesExamFragmentBinding
|
||||
import info.nightscout.androidaps.utils.ToastUtils
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.constraints.objectives.events.EventObjectivesUpdateGui
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective.ExamTask
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective.Option
|
||||
import info.nightscout.plugins.databinding.ObjectivesExamFragmentBinding
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.ExamTask
|
||||
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.Option
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.shared.utils.T
|
||||
import info.nightscout.androidaps.utils.ToastUtils
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import javax.inject.Inject
|
||||
|
||||
class ObjectivesExamDialog : DaggerDialogFragment() {
|
||||
|
@ -96,8 +96,8 @@ class ObjectivesExamDialog : DaggerDialogFragment() {
|
|||
context?.let { binding.examHints.addView(h.generate(it)) }
|
||||
}
|
||||
// Disabled to
|
||||
binding.examDisabledto.text = rh.gs(R.string.answerdisabledto, dateUtil.timeString(task.disabledTo))
|
||||
binding.examDisabledto.visibility = if (task.isEnabledAnswer()) View.GONE else View.VISIBLE
|
||||
binding.examDisabledTo.text = rh.gs(R.string.answerdisabledto, dateUtil.timeString(task.disabledTo))
|
||||
binding.examDisabledTo.visibility = if (task.isEnabledAnswer()) View.GONE else View.VISIBLE
|
||||
// Buttons
|
||||
binding.examVerify.isEnabled = !task.answered && task.isEnabledAnswer()
|
||||
binding.examVerify.setOnClickListener {
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.dialogs
|
||||
package info.nightscout.plugins.constraints.objectives.dialogs
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.SystemClock
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.events
|
||||
package info.nightscout.plugins.constraints.objectives.events
|
||||
|
||||
import info.nightscout.rx.events.EventUpdateGui
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import android.content.Context
|
||||
import android.text.util.Linkify
|
||||
|
@ -7,7 +7,7 @@ import android.widget.TextView
|
|||
import androidx.annotation.StringRes
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
|
@ -1,13 +1,13 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.androidaps.interfaces.Loop
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin
|
||||
import javax.inject.Inject
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.general.actions.ActionsPlugin
|
||||
import javax.inject.Inject
|
||||
|
||||
class Objective1 @Inject constructor(injector: HasAndroidInjector) : Objective(injector, "usage", R.string.objectives_usage_objective, R.string.objectives_usage_gate) {
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.shared.utils.T
|
||||
|
||||
class Objective10(injector: HasAndroidInjector) : Objective(injector, "auto", R.string.objectives_auto_objective, R.string.objectives_auto_gate) {
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.plugins.R
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
class Objective2(injector: HasAndroidInjector) : Objective(injector, "exam", R.string.objectives_exam_objective, R.string.objectives_exam_gate) {
|
||||
|
@ -113,7 +113,7 @@ class Objective2(injector: HasAndroidInjector) : Objective(injector, "exam", R.s
|
|||
.option(Option(R.string.pumpdisconnect_openloop, false))
|
||||
.hint(Hint(R.string.pumpdisconnect_hint1))
|
||||
)
|
||||
tasks.add(ExamTask(this, R.string.insulin_label, R.string.insulin_ultrarapid, "insulin")
|
||||
tasks.add(ExamTask(this, R.string.insulin_plugins, R.string.insulin_ultrarapid, "insulin")
|
||||
.option(Option(R.string.insulin_novorapid, false))
|
||||
.option(Option(R.string.insulin_humalog, false))
|
||||
.option(Option(R.string.insulin_actrapid, false))
|
|
@ -1,8 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.shared.utils.T
|
||||
import javax.inject.Inject
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.plugins.R
|
||||
|
||||
@Suppress("SpellCheckingInspection")
|
||||
class Objective4(injector: HasAndroidInjector) : Objective(injector, "maxbasal", R.string.objectives_maxbasal_objective, R.string.objectives_maxbasal_gate)
|
|
@ -1,9 +1,9 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.interfaces.constraints.Constraint
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.shared.utils.T
|
||||
import javax.inject.Inject
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.shared.utils.T
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -11,7 +10,6 @@ import javax.inject.Inject
|
|||
class Objective6(injector: HasAndroidInjector) : Objective(injector, "maxiob", R.string.objectives_maxiob_objective, R.string.objectives_maxiob_gate) {
|
||||
|
||||
@Inject lateinit var constraintChecker: Constraints
|
||||
@Inject lateinit var safetyPlugin: SafetyPlugin
|
||||
|
||||
init {
|
||||
tasks.add(MinimumDurationTask(this, T.days(1).msecs()))
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.shared.utils.T
|
||||
|
||||
class Objective7(injector: HasAndroidInjector) : Objective(injector, "autosens", R.string.objectives_autosens_objective, R.string.objectives_autosens_gate) {
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.objectives.objectives
|
||||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.shared.utils.T
|
||||
|
||||
class Objective9(injector: HasAndroidInjector) : Objective(injector, "smb", R.string.objectives_smb_objective, R.string.objectives_smb_gate) {
|
|
@ -0,0 +1,2 @@
|
|||
package info.nightscout.plugins.constraints.objectives.objectives
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.constraints.safety
|
||||
package info.nightscout.plugins.constraints.safety
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.extensions.putDouble
|
||||
import info.nightscout.androidaps.extensions.putInt
|
||||
import info.nightscout.androidaps.extensions.putString
|
||||
|
@ -11,11 +10,7 @@ import info.nightscout.androidaps.extensions.storeString
|
|||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.interfaces.Constraints
|
||||
import info.nightscout.androidaps.interfaces.IobCobCalculator
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin
|
||||
import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin
|
||||
import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin
|
||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||
import info.nightscout.interfaces.BuildHelper
|
||||
import info.nightscout.interfaces.Config
|
||||
|
@ -29,6 +24,7 @@ import info.nightscout.interfaces.profile.Profile
|
|||
import info.nightscout.interfaces.pump.defs.PumpDescription
|
||||
import info.nightscout.interfaces.utils.HardLimits
|
||||
import info.nightscout.interfaces.utils.Round
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
|
@ -47,10 +43,6 @@ class SafetyPlugin @Inject constructor(
|
|||
private val sp: SP,
|
||||
private val rxBus: RxBus,
|
||||
private val constraintChecker: Constraints,
|
||||
private val openAPSAMAPlugin: OpenAPSAMAPlugin,
|
||||
private val openAPSSMBPlugin: OpenAPSSMBPlugin,
|
||||
private val openAPSSMBDynamicISFPlugin: OpenAPSSMBDynamicISFPlugin,
|
||||
private val sensitivityOref1Plugin: SensitivityOref1Plugin,
|
||||
private val activePlugin: ActivePlugin,
|
||||
private val hardLimits: HardLimits,
|
||||
private val buildHelper: BuildHelper,
|
||||
|
@ -110,8 +102,6 @@ class SafetyPlugin @Inject constructor(
|
|||
override fun isUAMEnabled(value: Constraint<Boolean>): Constraint<Boolean> {
|
||||
val enabled = sp.getBoolean(R.string.key_use_uam, false)
|
||||
if (!enabled) value.set(aapsLogger, false, rh.gs(R.string.uamdisabledinpreferences), this)
|
||||
val oref1Enabled = sensitivityOref1Plugin.isEnabled()
|
||||
if (!oref1Enabled) value.set(aapsLogger, false, rh.gs(R.string.uamdisabledoref1notselected), this)
|
||||
return value
|
||||
}
|
||||
|
||||
|
@ -203,12 +193,6 @@ class SafetyPlugin @Inject constructor(
|
|||
|
||||
override fun applyMaxIOBConstraints(maxIob: Constraint<Double>): Constraint<Double> {
|
||||
val apsMode = sp.getString(R.string.key_aps_mode, "open")
|
||||
val maxIobPref: Double = if (openAPSSMBPlugin.isEnabled() || openAPSSMBDynamicISFPlugin.isEnabled()) sp.getDouble(R.string.key_openapssmb_max_iob, 3.0) else sp.getDouble(R.string
|
||||
.key_openapsma_max_iob, 1.5)
|
||||
maxIob.setIfSmaller(aapsLogger, maxIobPref, rh.gs(R.string.limitingiob, maxIobPref, rh.gs(R.string.maxvalueinpreferences)), this)
|
||||
if (openAPSAMAPlugin.isEnabled()) maxIob.setIfSmaller(aapsLogger, hardLimits.maxIobAMA(), rh.gs(R.string.limitingiob, hardLimits.maxIobAMA(), rh.gs(R.string.hardlimit)), this)
|
||||
if (openAPSSMBPlugin.isEnabled()) maxIob.setIfSmaller(aapsLogger, hardLimits.maxIobSMB(), rh.gs(R.string.limitingiob, hardLimits.maxIobSMB(), rh.gs(R.string.hardlimit)), this)
|
||||
if (openAPSSMBDynamicISFPlugin.isEnabled()) maxIob.setIfSmaller(aapsLogger, hardLimits.maxIobSMB(), rh.gs(R.string.limitingiob, hardLimits.maxIobSMB(), rh.gs(R.string.hardlimit)), this)
|
||||
if (apsMode == "lgs") maxIob.setIfSmaller(aapsLogger, HardLimits.MAX_IOB_LGS, rh.gs(R.string.limitingiob, HardLimits.MAX_IOB_LGS, rh.gs(R.string.lowglucosesuspend)), this)
|
||||
return maxIob
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package info.nightscout.plugins.di
|
||||
|
||||
import dagger.Module
|
||||
import dagger.android.ContributesAndroidInjector
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective0
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective1
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective10
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective2
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective3
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective4
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective5
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective6
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective7
|
||||
import info.nightscout.plugins.constraints.objectives.objectives.Objective9
|
||||
|
||||
@Module
|
||||
@Suppress("unused")
|
||||
abstract class ObjectivesModule {
|
||||
|
||||
@ContributesAndroidInjector abstract fun objectiveInjector(): Objective
|
||||
@ContributesAndroidInjector abstract fun objective0Injector(): Objective0
|
||||
@ContributesAndroidInjector abstract fun objective1Injector(): Objective1
|
||||
@ContributesAndroidInjector abstract fun objective2Injector(): Objective2
|
||||
@ContributesAndroidInjector abstract fun objective3Injector(): Objective3
|
||||
@ContributesAndroidInjector abstract fun objective4Injector(): Objective4
|
||||
@ContributesAndroidInjector abstract fun objective5Injector(): Objective5
|
||||
@ContributesAndroidInjector abstract fun objective6Injector(): Objective6
|
||||
@ContributesAndroidInjector abstract fun objective7Injector(): Objective7
|
||||
@ContributesAndroidInjector abstract fun objective9Injector(): Objective9
|
||||
@ContributesAndroidInjector abstract fun objective10Injector(): Objective10
|
||||
|
||||
}
|
|
@ -11,7 +11,9 @@ import dagger.Module
|
|||
ProfileModule::class,
|
||||
SyncModule::class,
|
||||
SourceModule::class,
|
||||
VirtualPumpModule::class
|
||||
VirtualPumpModule::class,
|
||||
ObjectivesModule::class,
|
||||
SkinsModule::class
|
||||
]
|
||||
)
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package info.nightscout.androidaps.di
|
||||
package info.nightscout.plugins.di
|
||||
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.multibindings.IntKey
|
||||
import dagger.multibindings.IntoMap
|
||||
import info.nightscout.androidaps.skins.SkinButtonsOn
|
||||
import info.nightscout.androidaps.skins.SkinClassic
|
||||
import info.nightscout.androidaps.skins.SkinInterface
|
||||
import info.nightscout.androidaps.skins.SkinLargeDisplay
|
||||
import info.nightscout.androidaps.skins.SkinLowRes
|
||||
import info.nightscout.plugins.skins.SkinButtonsOn
|
||||
import info.nightscout.plugins.skins.SkinClassic
|
||||
import info.nightscout.plugins.skins.SkinInterface
|
||||
import info.nightscout.plugins.skins.SkinLargeDisplay
|
||||
import info.nightscout.plugins.skins.SkinLowRes
|
||||
import javax.inject.Qualifier
|
||||
|
||||
@Module
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.general.actions
|
||||
package info.nightscout.plugins.general.actions
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
|
@ -10,12 +10,6 @@ import android.view.ViewGroup
|
|||
import android.widget.LinearLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import dagger.android.support.DaggerFragment
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.activities.HistoryBrowseActivity
|
||||
import info.nightscout.androidaps.databinding.ActionsFragmentBinding
|
||||
import info.nightscout.ui.dialogs.ProfileSwitchDialog
|
||||
import info.nightscout.ui.dialogs.TempBasalDialog
|
||||
import info.nightscout.ui.dialogs.TempTargetDialog
|
||||
import info.nightscout.androidaps.extensions.toStringMedium
|
||||
import info.nightscout.androidaps.extensions.toStringShort
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
|
@ -24,8 +18,6 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator
|
|||
import info.nightscout.androidaps.interfaces.Loop
|
||||
import info.nightscout.androidaps.interfaces.ProfileFunction
|
||||
import info.nightscout.androidaps.logging.UserEntryLogger
|
||||
import info.nightscout.androidaps.plugins.general.overview.StatusLightHandler
|
||||
import info.nightscout.androidaps.skins.SkinProvider
|
||||
import info.nightscout.androidaps.utils.alertDialogs.OKDialog
|
||||
import info.nightscout.androidaps.utils.protection.ProtectionCheck
|
||||
import info.nightscout.androidaps.utils.ui.SingleClickButton
|
||||
|
@ -40,6 +32,10 @@ import info.nightscout.interfaces.Config
|
|||
import info.nightscout.interfaces.pump.actions.CustomAction
|
||||
import info.nightscout.interfaces.queue.Callback
|
||||
import info.nightscout.interfaces.ui.ActivityNames
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.databinding.ActionsFragmentBinding
|
||||
import info.nightscout.plugins.skins.SkinProvider
|
||||
import info.nightscout.plugins.ui.StatusLightHandler
|
||||
import info.nightscout.rx.AapsSchedulers
|
||||
import info.nightscout.rx.bus.RxBus
|
||||
import info.nightscout.rx.events.EventCustomActionsChanged
|
||||
|
@ -52,10 +48,6 @@ import info.nightscout.shared.extensions.toVisibility
|
|||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import info.nightscout.shared.utils.DateUtil
|
||||
import info.nightscout.ui.activities.TDDStatsActivity
|
||||
import info.nightscout.ui.dialogs.CareDialog
|
||||
import info.nightscout.ui.dialogs.ExtendedBolusDialog
|
||||
import info.nightscout.ui.dialogs.FillDialog
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable
|
||||
import io.reactivex.rxjava3.kotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
@ -91,6 +83,7 @@ class ActionsFragment : DaggerFragment() {
|
|||
private lateinit var dm: DisplayMetrics
|
||||
|
||||
private var _binding: ActionsFragmentBinding? = null
|
||||
|
||||
// This property is only valid between onCreateView and onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
|
||||
|
@ -105,7 +98,7 @@ class ActionsFragment : DaggerFragment() {
|
|||
activity?.windowManager?.defaultDisplay?.getMetrics(dm)
|
||||
}
|
||||
_binding = ActionsFragmentBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
@ -118,7 +111,7 @@ class ActionsFragment : DaggerFragment() {
|
|||
protectionCheck.queryProtection(
|
||||
activity,
|
||||
ProtectionCheck.Protection.BOLUS,
|
||||
UIRunnable { ProfileSwitchDialog().show(childFragmentManager, "ProfileSwitchDialog")})
|
||||
UIRunnable { activityNames.runProfileSwitchDialog(childFragmentManager) })
|
||||
}
|
||||
}
|
||||
binding.tempTarget.setOnClickListener {
|
||||
|
@ -126,7 +119,7 @@ class ActionsFragment : DaggerFragment() {
|
|||
protectionCheck.queryProtection(
|
||||
activity,
|
||||
ProtectionCheck.Protection.BOLUS,
|
||||
UIRunnable { TempTargetDialog().show(childFragmentManager, "Actions") })
|
||||
UIRunnable { activityNames.runTempTargetDialog(childFragmentManager) })
|
||||
}
|
||||
}
|
||||
binding.extendedBolus.setOnClickListener {
|
||||
|
@ -135,7 +128,7 @@ class ActionsFragment : DaggerFragment() {
|
|||
OKDialog.showConfirmation(
|
||||
activity, rh.gs(R.string.extended_bolus), rh.gs(R.string.ebstopsloop),
|
||||
Runnable {
|
||||
ExtendedBolusDialog().show(childFragmentManager, "Actions")
|
||||
activityNames.runExtendedBolusDialog(childFragmentManager)
|
||||
}, null
|
||||
)
|
||||
})
|
||||
|
@ -158,7 +151,7 @@ class ActionsFragment : DaggerFragment() {
|
|||
protectionCheck.queryProtection(
|
||||
activity,
|
||||
ProtectionCheck.Protection.BOLUS,
|
||||
UIRunnable { TempBasalDialog().show(childFragmentManager, "Actions") })
|
||||
UIRunnable { activityNames.runTempBasalDialog(childFragmentManager) })
|
||||
}
|
||||
}
|
||||
binding.cancelTempBasal.setOnClickListener {
|
||||
|
@ -175,31 +168,31 @@ class ActionsFragment : DaggerFragment() {
|
|||
}
|
||||
binding.fill.setOnClickListener {
|
||||
activity?.let { activity ->
|
||||
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { FillDialog().show(childFragmentManager, "FillDialog") })
|
||||
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { activityNames.runFillDialog(childFragmentManager) })
|
||||
}
|
||||
}
|
||||
binding.historyBrowser.setOnClickListener { startActivity(Intent(context, HistoryBrowseActivity::class.java)) }
|
||||
binding.tddStats.setOnClickListener { startActivity(Intent(context, TDDStatsActivity::class.java)) }
|
||||
binding.historyBrowser.setOnClickListener { startActivity(Intent(context, activityNames.historyBrowseActivity::class.java)) }
|
||||
binding.tddStats.setOnClickListener { startActivity(Intent(context, activityNames.tddStatsActivity::class.java)) }
|
||||
binding.bgCheck.setOnClickListener {
|
||||
CareDialog().setOptions(CareDialog.EventType.BGCHECK, R.string.careportal_bgcheck).show(childFragmentManager, "Actions")
|
||||
activityNames.runCareDialog(childFragmentManager, ActivityNames.EventType.BGCHECK, R.string.careportal_bgcheck)
|
||||
}
|
||||
binding.cgmSensorInsert.setOnClickListener {
|
||||
CareDialog().setOptions(CareDialog.EventType.SENSOR_INSERT, R.string.careportal_cgmsensorinsert).show(childFragmentManager, "Actions")
|
||||
activityNames.runCareDialog(childFragmentManager, ActivityNames.EventType.SENSOR_INSERT, R.string.cgm_sensor_insert)
|
||||
}
|
||||
binding.pumpBatteryChange.setOnClickListener {
|
||||
CareDialog().setOptions(CareDialog.EventType.BATTERY_CHANGE, R.string.careportal_pumpbatterychange).show(childFragmentManager, "Actions")
|
||||
activityNames.runCareDialog(childFragmentManager, ActivityNames.EventType.BATTERY_CHANGE, R.string.pump_battery_change)
|
||||
}
|
||||
binding.note.setOnClickListener {
|
||||
CareDialog().setOptions(CareDialog.EventType.NOTE, R.string.careportal_note).show(childFragmentManager, "Actions")
|
||||
activityNames.runCareDialog(childFragmentManager, ActivityNames.EventType.NOTE, R.string.careportal_note)
|
||||
}
|
||||
binding.exercise.setOnClickListener {
|
||||
CareDialog().setOptions(CareDialog.EventType.EXERCISE, R.string.careportal_exercise).show(childFragmentManager, "Actions")
|
||||
activityNames.runCareDialog(childFragmentManager, ActivityNames.EventType.EXERCISE, R.string.careportal_exercise)
|
||||
}
|
||||
binding.question.setOnClickListener {
|
||||
CareDialog().setOptions(CareDialog.EventType.QUESTION, R.string.careportal_question).show(childFragmentManager, "Actions")
|
||||
activityNames.runCareDialog(childFragmentManager, ActivityNames.EventType.QUESTION, R.string.careportal_question)
|
||||
}
|
||||
binding.announcement.setOnClickListener {
|
||||
CareDialog().setOptions(CareDialog.EventType.ANNOUNCEMENT, R.string.careportal_announcement).show(childFragmentManager, "Actions")
|
||||
activityNames.runCareDialog(childFragmentManager, ActivityNames.EventType.ANNOUNCEMENT, R.string.careportal_announcement)
|
||||
}
|
||||
|
||||
sp.putBoolean(R.string.key_objectiveuseactions, true)
|
||||
|
@ -301,7 +294,7 @@ class ActionsFragment : DaggerFragment() {
|
|||
|
||||
if (!config.NSCLIENT) {
|
||||
statusLightHandler.updateStatusLights(cannulaAge, insulinAge, reservoirLevel, sensorAge, sensorLevel, pbAge, batteryLevel)
|
||||
sensorLevelLabel.text = if (activeBgSource.sensorBatteryLevel == -1) "" else rh.gs(R.string.careportal_level_label)
|
||||
sensorLevelLabel.text = if (activeBgSource.sensorBatteryLevel == -1) "" else rh.gs(R.string.level_label)
|
||||
} else {
|
||||
statusLightHandler.updateStatusLights(cannulaAge, insulinAge, null, sensorAge, null, pbAge, null)
|
||||
sensorLevelLabel.text = ""
|
|
@ -1,11 +1,11 @@
|
|||
package info.nightscout.androidaps.plugins.general.actions
|
||||
package info.nightscout.plugins.general.actions
|
||||
|
||||
import dagger.android.HasAndroidInjector
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.plugin.PluginBase
|
||||
import info.nightscout.interfaces.plugin.PluginDescription
|
||||
import info.nightscout.interfaces.plugin.PluginType
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.rx.logging.AAPSLogger
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import javax.inject.Inject
|
||||
|
@ -19,13 +19,13 @@ class ActionsPlugin @Inject constructor(
|
|||
config: Config
|
||||
) : PluginBase(
|
||||
PluginDescription()
|
||||
.mainType(PluginType.GENERAL)
|
||||
.fragmentClass(ActionsFragment::class.qualifiedName)
|
||||
.enableByDefault(config.APS || config.PUMPCONTROL)
|
||||
.visibleByDefault(config.APS || config.PUMPCONTROL)
|
||||
.pluginIcon(R.drawable.ic_action)
|
||||
.pluginName(R.string.actions)
|
||||
.shortName(R.string.actions_shortname)
|
||||
.description(R.string.description_actions),
|
||||
.mainType(PluginType.GENERAL)
|
||||
.fragmentClass(ActionsFragment::class.qualifiedName)
|
||||
.enableByDefault(config.APS || config.PUMPCONTROL)
|
||||
.visibleByDefault(config.APS || config.PUMPCONTROL)
|
||||
.pluginIcon(R.drawable.ic_action)
|
||||
.pluginName(R.string.actions)
|
||||
.shortName(R.string.actions_shortname)
|
||||
.description(R.string.description_actions),
|
||||
aapsLogger, rh, injector
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.skins
|
||||
package info.nightscout.plugins.skins
|
||||
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.plugins.R
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
package info.nightscout.androidaps.skins
|
||||
package info.nightscout.plugins.skins
|
||||
|
||||
import android.util.DisplayMetrics
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.databinding.OverviewFragmentBinding
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.databinding.OverviewFragmentBinding
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class SkinClassic @Inject constructor(private val config: Config): SkinInterface {
|
||||
class SkinClassic @Inject constructor(private val config: Config) : SkinInterface {
|
||||
|
||||
override val description: Int get() = R.string.classic_description
|
||||
override val mainGraphHeight: Int get() = 200
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.skins
|
||||
package info.nightscout.plugins.skins
|
||||
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.TypedValue.COMPLEX_UNIT_PX
|
||||
|
@ -6,9 +6,9 @@ import android.view.View
|
|||
import android.widget.LinearLayout
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.databinding.ActionsFragmentBinding
|
||||
import info.nightscout.androidaps.databinding.OverviewFragmentBinding
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.databinding.ActionsFragmentBinding
|
||||
import info.nightscout.plugins.databinding.OverviewFragmentBinding
|
||||
|
||||
interface SkinInterface {
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
package info.nightscout.androidaps.skins
|
||||
package info.nightscout.plugins.skins
|
||||
|
||||
import android.util.DisplayMetrics
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.databinding.OverviewFragmentBinding
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.databinding.OverviewFragmentBinding
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class SkinLargeDisplay @Inject constructor(private val config: Config): SkinInterface {
|
||||
class SkinLargeDisplay @Inject constructor(private val config: Config) : SkinInterface {
|
||||
|
||||
override val description: Int get() = R.string.largedisplay_description
|
||||
override val mainGraphHeight: Int get() = 400
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.skins
|
||||
package info.nightscout.plugins.skins
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
|
@ -1,12 +1,12 @@
|
|||
package info.nightscout.androidaps.skins
|
||||
package info.nightscout.plugins.skins
|
||||
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.View.GONE
|
||||
import android.view.ViewGroup
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.databinding.ActionsFragmentBinding
|
||||
import info.nightscout.androidaps.databinding.OverviewFragmentBinding
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.databinding.ActionsFragmentBinding
|
||||
import info.nightscout.plugins.databinding.OverviewFragmentBinding
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
@ -44,7 +44,7 @@ class SkinLowRes @Inject constructor(private val config: Config) : SkinInterface
|
|||
infoCard.elevation = 0F
|
||||
infoCard.radius = 0F
|
||||
val paramInfo = (infoCard.layoutParams as ViewGroup.MarginLayoutParams).apply {
|
||||
setMargins(0,0,0,0)
|
||||
setMargins(0, 0, 0, 0)
|
||||
}
|
||||
infoCard.layoutParams = paramInfo
|
||||
|
||||
|
@ -52,21 +52,21 @@ class SkinLowRes @Inject constructor(private val config: Config) : SkinInterface
|
|||
statusCard.radius = 0F
|
||||
statusCard.strokeWidth = 1
|
||||
val paramStatus = (statusCard.layoutParams as ViewGroup.MarginLayoutParams).apply {
|
||||
setMargins(0,0,0,0)
|
||||
setMargins(0, 0, 0, 0)
|
||||
}
|
||||
statusCard.layoutParams = paramStatus
|
||||
|
||||
nsclientCard.elevation = 0F
|
||||
nsclientCard.radius = 0F
|
||||
val paramNsClient = (nsclientCard.layoutParams as ViewGroup.MarginLayoutParams).apply {
|
||||
setMargins(0,0,0,0)
|
||||
setMargins(0, 0, 0, 0)
|
||||
}
|
||||
nsclientCard.layoutParams = paramNsClient
|
||||
|
||||
graphCard.elevation = 0F
|
||||
graphCard.radius = 0F
|
||||
val paramGraph = (graphCard.layoutParams as ViewGroup.MarginLayoutParams).apply {
|
||||
setMargins(0,0,0,0)
|
||||
setMargins(0, 0, 0, 0)
|
||||
}
|
||||
graphCard.layoutParams = paramGraph
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.skins
|
||||
package info.nightscout.plugins.skins
|
||||
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.di.SkinsModule
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.di.SkinsModule
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import okhttp3.internal.toImmutableMap
|
||||
import javax.inject.Inject
|
|
@ -1,17 +1,16 @@
|
|||
package info.nightscout.androidaps.plugins.general.overview
|
||||
package info.nightscout.plugins.ui
|
||||
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.StringRes
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.androidaps.interfaces.ActivePlugin
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
|
||||
import info.nightscout.androidaps.utils.DecimalFormatter
|
||||
import info.nightscout.androidaps.utils.WarnColors
|
||||
import info.nightscout.database.entities.TherapyEvent
|
||||
import info.nightscout.database.impl.AppRepository
|
||||
import info.nightscout.database.impl.ValueWrapper
|
||||
import info.nightscout.interfaces.Config
|
||||
import info.nightscout.interfaces.pump.defs.PumpType
|
||||
import info.nightscout.plugins.R
|
||||
import info.nightscout.plugins.sync.nsclient.extensions.age
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
|
@ -77,7 +76,7 @@ class StatusLightHandler @Inject constructor(
|
|||
// The Omnipod Eros does not report its battery level. However, some RileyLink alternatives do.
|
||||
// Depending on the user's configuration, we will either show the battery level reported by the RileyLink or "n/a"
|
||||
// Pump instance check is needed because at startup, the pump can still be VirtualPumpPlugin and that will cause a crash
|
||||
val erosBatteryLinkAvailable = pump.model() == PumpType.OMNIPOD_EROS && pump is OmnipodErosPumpPlugin && pump.isUseRileyLinkBatteryLevel
|
||||
val erosBatteryLinkAvailable = pump.model() == PumpType.OMNIPOD_EROS && pump.isUseRileyLinkBatteryLevel()
|
||||
|
||||
if (pump.model().supportBatteryLevel || erosBatteryLinkAvailable) {
|
||||
handleLevel(careportal_battery_level, R.string.key_statuslights_bat_critical, 26.0, R.string.key_statuslights_bat_warning, 51.0, pump.batteryLevel.toDouble(), "%")
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".plugins.general.actions.ActionsFragment">
|
||||
tools:context=".general.actions.ActionsFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/buttons_layout"
|
||||
|
@ -64,7 +64,7 @@
|
|||
android:drawableTop="@drawable/ic_temptarget_high"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_temporarytarget"
|
||||
android:text="@string/temporary_target"
|
||||
android:textSize="11sp"
|
||||
app:layout_column="1"
|
||||
app:layout_columnWeight="1"
|
||||
|
@ -76,10 +76,10 @@
|
|||
style="@style/GrayButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@drawable/ic_actions_starttempbasal"
|
||||
android:drawableTop="@drawable/ic_actions_start_temp_basal"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/overview_tempbasal_button"
|
||||
android:text="@string/tempbasal_button"
|
||||
android:textSize="11sp"
|
||||
app:layout_column="0"
|
||||
app:layout_columnWeight="1"
|
||||
|
@ -91,10 +91,10 @@
|
|||
style="@style/GrayButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@drawable/ic_cancelbasal"
|
||||
android:drawableTop="@drawable/ic_cancel_basal"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/canceltemp"
|
||||
android:text="@string/cancel_temp"
|
||||
android:textSize="11sp"
|
||||
android:visibility="gone"
|
||||
app:layout_column="0"
|
||||
|
@ -110,7 +110,7 @@
|
|||
android:drawableTop="@drawable/ic_actions_start_extended_bolus"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/overview_extendedbolus_button"
|
||||
android:text="@string/extended_bolus_button"
|
||||
android:textSize="11sp"
|
||||
app:layout_column="1"
|
||||
app:layout_columnWeight="1"
|
||||
|
@ -122,10 +122,10 @@
|
|||
style="@style/GrayButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableTop="@drawable/ic_actions_cancelextbolus"
|
||||
android:drawableTop="@drawable/ic_actions_cancel_extended_bolus"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/overview_extendedbolus_cancel_button"
|
||||
android:text="@string/extended_bolus_cancel_button"
|
||||
android:textSize="11sp"
|
||||
android:visibility="gone"
|
||||
app:layout_column="1"
|
||||
|
@ -153,7 +153,7 @@
|
|||
|
||||
<include
|
||||
android:id="@+id/status"
|
||||
layout="@layout/careportal_stats_fragment"
|
||||
layout="@layout/actions_stats_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" />
|
||||
|
@ -161,7 +161,7 @@
|
|||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/careportal_statuslightbutton"
|
||||
android:id="@+id/careportal_statuslight_button"
|
||||
style="@style/Widget.MaterialComponents.CardView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -226,7 +226,7 @@
|
|||
android:drawableTop="@drawable/ic_cp_cgm_insert"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_cgmsensorinsert"
|
||||
android:text="@string/cgm_sensor_insert"
|
||||
android:textSize="11sp"
|
||||
app:layout_column="0"
|
||||
app:layout_columnWeight="1"
|
||||
|
@ -241,7 +241,7 @@
|
|||
android:drawableTop="@drawable/ic_cp_pump_battery"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_pumpbatterychange"
|
||||
android:text="@string/pump_battery_change"
|
||||
android:textSize="11sp"
|
||||
app:layout_column="1"
|
||||
app:layout_columnWeight="1"
|
||||
|
@ -349,7 +349,7 @@
|
|||
android:drawableTop="@drawable/ic_pump_history"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/nav_historybrowser"
|
||||
android:text="@string/nav_history_browser"
|
||||
android:textSize="11sp"
|
||||
app:layout_column="0"
|
||||
app:layout_columnWeight="1"
|
|
@ -4,7 +4,7 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="0,2,4"
|
||||
tools:context=".plugins.general.actions.ActionsFragment">
|
||||
tools:context="info.nightscout.plugins.general.actions.ActionsFragment">
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -17,7 +17,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:text="@string/careportal_sensor_label"
|
||||
android:text="@string/sensor_label"
|
||||
android:textSize="14sp"
|
||||
app:drawableStartCompat="@drawable/ic_cp_age_sensor" />
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_age_label"
|
||||
android:text="@string/age_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -47,7 +47,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_level_label"
|
||||
android:text="@string/level_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -89,7 +89,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:text="@string/careportal_insulin_label"
|
||||
android:text="@string/insulin_label"
|
||||
android:textSize="14sp"
|
||||
app:drawableStartCompat="@drawable/ic_cp_age_insulin" />
|
||||
|
||||
|
@ -100,7 +100,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_age_label"
|
||||
android:text="@string/age_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -119,7 +119,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_level_label"
|
||||
android:text="@string/level_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -173,7 +173,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_age_label"
|
||||
android:text="@string/age_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -235,7 +235,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:text="@string/careportal_pb_label"
|
||||
android:text="@string/pb_label"
|
||||
android:textSize="14sp"
|
||||
app:drawableStartCompat="@drawable/ic_cp_age_battery" />
|
||||
|
||||
|
@ -246,7 +246,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_age_label"
|
||||
android:text="@string/age_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -265,7 +265,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/careportal_level_label"
|
||||
android:text="@string/level_label"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".plugins.constraints.objectives.activities.ObjectivesExamDialog">
|
||||
tools:context="constraints.objectives.activities.ObjectivesExamDialog">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -40,7 +40,7 @@
|
|||
android:background="?attr/objectivesBackgroundColor"
|
||||
android:orientation="horizontal"
|
||||
android:padding="4dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/exam_disabledto">
|
||||
app:layout_constraintTop_toBottomOf="@+id/exam_disabled_to">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/exam_reset"
|
||||
|
@ -101,7 +101,7 @@
|
|||
tools:text="Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exam_disabledto"
|
||||
android:id="@+id/exam_disabled_to"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
|
@ -127,7 +127,7 @@
|
|||
style="@style/OkCancelButton.Text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/previous_button" />
|
||||
android:text="@string/objectives_previous_button" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
|
@ -140,7 +140,7 @@
|
|||
style="@style/OkCancelButton.Text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/next_button" />
|
||||
android:text="@string/objectives_next_button" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/next_unanswered_button"
|
|
@ -3,7 +3,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".plugins.constraints.objectives.ObjectivesFragment">
|
||||
tools:context=".constraints.objectives.ObjectivesFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
|
@ -5,7 +5,7 @@
|
|||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
tools:context=".plugins.general.overview.OverviewFragment">
|
||||
tools:context="info.nightscout.androidaps.plugins.general.overview.OverviewFragment">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/top_part_scrollbar"
|
|
@ -82,7 +82,7 @@
|
|||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:contentDescription="@string/careportal_sensor_label"
|
||||
android:contentDescription="@string/sensor_label"
|
||||
android:scaleX="1.6"
|
||||
android:scaleY="1.6"
|
||||
app:srcCompat="@drawable/ic_cp_age_sensor" />
|
|
@ -44,4 +44,19 @@
|
|||
<item>YpsoPump</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="ageArray">
|
||||
<item>@string/child</item>
|
||||
<item>@string/teenage</item>
|
||||
<item>@string/adult</item>
|
||||
<item>@string/resistantadult</item>
|
||||
<item>@string/pregnant</item>
|
||||
</string-array>
|
||||
<string-array name="ageValues" translatable="false">
|
||||
<item>@string/key_child</item>
|
||||
<item>@string/key_teenage</item>
|
||||
<item>@string/key_adult</item>
|
||||
<item>@string/key_resistantadult</item>
|
||||
<item>@string/key_pregnant</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
230
plugins/src/main/res/values/exam.xml
Normal file
230
plugins/src/main/res/values/exam.xml
Normal file
|
@ -0,0 +1,230 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="dia_whatmeansdia">What is true about DIA?</string>
|
||||
<string name="dia_label_exam">Duration of Insulin Action (DIA)</string>
|
||||
<string name="dia_profile">You should set the value for DIA in your profile.</string>
|
||||
<string name="dia_minimumis5h">The minimum allowed value is 5 hours.</string>
|
||||
<string name="dia_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html?#insulin</string>
|
||||
<string name="dia_meaningisequaltodiapump">If you are satisfied that the value for DIA that you used in your pump prior to AAPS worked well, there is no need to change this when you start looping.</string>
|
||||
<string name="dia_valuemustbedetermined">You should determine for yourself the appropriate value for DIA.</string>
|
||||
<string name="hypott_label">Hypo Temp-Target</string>
|
||||
<string name="hypott_whenhypott">What is primary reason to set a hypo temp target?</string>
|
||||
<string name="hypott_wrongbasal">To correct for hypos caused by incorrect basal rate settings.</string>
|
||||
<string name="hypott_preventoversmb">To prevent AAPS from overcorrecting for a blood glucose rise caused by the fast acting carbs used to treat a hypo.</string>
|
||||
<string name="hypott_exercise">To correct for a hypo induced as a result of exercise.</string>
|
||||
<string name="hypott_0basal">To prevent blood glucose from going low if there is already a 0% temporary basal rate running.</string>
|
||||
<string name="hypott_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html</string>
|
||||
<string name="offlineprofile_whatprofile">Which profile can be used and configured offline?</string>
|
||||
<string name="offlineprofile_label">Topic: Offline Profile</string>
|
||||
<string name="offlineprofile_nsprofile">NS Profile can be used, but not configured.</string>
|
||||
<string name="offlineprofile_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#profile</string>
|
||||
<string name="pumpdisconnect_label">Reasons for applying "Disconnect pump" in AAPS</string>
|
||||
<string name="pumpdisconnect_whattodo">What should be done when disconnecting the pump?</string>
|
||||
<string name="pumpdisconnect_unnecessary">This is unnecessary as insulin will not be delivered if the pump is physically disconnected.</string>
|
||||
<string name="pumpdisconnect_missinginsulin">It prevents AAPS from accounting for insulin that was not delivered whilst the pump is physically disconnected. </string>
|
||||
<string name="pumpdisconnect_notstop">It will not stop insulin delivery if the pump remains connected.</string>
|
||||
<string name="pumpdisconnect_openloop">It will send AAPS into open loop mode.</string>
|
||||
<string name="pumpdisconnect_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#other-settings</string>
|
||||
<string name="objectives_label">AAPS Settings</string>
|
||||
<string name="objectives2_label">AAPS Settings</string>
|
||||
<string name="objectives_howtosave">What are the best practices for backing up your settings?</string>
|
||||
<string name="objectives_notesettings">You do not need to export your settings provided that you make a note of them.</string>
|
||||
<string name="objectives_afterobjective">Export your settings after you finish completing an objective.</string>
|
||||
<string name="objectives_afterchange">Export your settings after changing any of your settings.</string>
|
||||
<string name="objectives_afterinitialsetup">Export your settings after you finish your initial set-up and have set your Preferences.</string>
|
||||
<string name="objectives2_maintenance">Export your settings locally using the maintenance menu.</string>
|
||||
<string name="objectives2_internalstorage">Your settings file is found in the folder Internal Storage/AAPS/preferences on your phone.</string>
|
||||
<string name="objectives2_cloud">Copy your preferences file to a safe location outside of your phone (e.g. by using a cloud drive, connecting a cable to a computer, email, etc.)</string>
|
||||
<string name="objectives2_easyrestore">If your phone is damaged or lost, there are easy ways to remotely recover your settings without a backup.</string>
|
||||
<string name="objectives_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/ExportImportSettings.html</string>
|
||||
<string name="objectives_hint2">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#what-emergency-equipment-is-recommended-to-take-with-me</string>
|
||||
<string name="noisycgm_label">Noisy CGM Readings</string>
|
||||
<string name="noisycgm_whattodo">What should be done if CGM data is noisy?</string>
|
||||
<string name="noisycgm_nothing">Do nothing - AAPS will deal with it.</string>
|
||||
<string name="noisycgm_pause">Disable the closed loop to avoid possible over or underdosing.</string>
|
||||
<string name="noisycgm_replacesensor">Replace consistently noisy or inaccurate sensors.</string>
|
||||
<string name="noisycgm_checksmoothing">Verify that your CGM app provides smoothed data.</string>
|
||||
<string name="noisycgm_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Smoothing-Blood-Glucose-Data-in-xDrip.html#smoothing-blood-glucose-data</string>
|
||||
<string name="exerciseprofile_label">Exercise and Profiles</string>
|
||||
<string name="exerciseprofile_whattodo">How can you use profiles to best help the system deal with aerobic exercise?</string>
|
||||
<string name="exerciseprofile_switchprofilebelow100">Do a profile switch to less than 100%.</string>
|
||||
<string name="exerciseprofile_switchprofileabove100">Do a profile switch to more than 100%.</string>
|
||||
<string name="exerciseprofile_leaveat100">Leave the profile set to 100%.</string>
|
||||
<string name="exerciseprofile_suspendloop">Suspend the loop.</string>
|
||||
<string name="exerciseprofile_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html#activity-temp-target</string>
|
||||
<string name="exercise_label">Exercise and Temporary Targets</string>
|
||||
<string name="exercise_whattodo">How can you use temporary targets to best help the system deal with aerobic exercise?</string>
|
||||
<string name="exercise_settt">Set an activity blood glucose target starting a suitable time before beginning exercise.</string>
|
||||
<string name="exercise_setfinished">Set an activity blood glucose target after finishing exercise.</string>
|
||||
<string name="exercise_setunchanged">Leave your blood glucose target unchanged.</string>
|
||||
<string name="exercise_15g">Wait until blood glucose drops below your hypo temp target and then eat 15 g of fast acting carbohydrates.</string>
|
||||
<string name="exercise_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html#activity-temp-target</string>
|
||||
<string name="suspendloop_label">Disabled/Suspended loop</string>
|
||||
<string name="suspendloop_doigetinsulin">Do I receive insulin when the loop is disabled/suspended?</string>
|
||||
<string name="suspendloop_yes">Yes, basal insulin continues to be delivered.</string>
|
||||
<string name="suspendloop_no">No, delivery of insulin is stopped.</string>
|
||||
<string name="basaltest_label">Basal, ISF, and I:C Testing</string>
|
||||
<string name="basaltest_when">When should these values be validated?</string>
|
||||
<string name="basaltest_beforeloop">Before starting looping.</string>
|
||||
<string name="basaltest_havingregularhighlow">When experiencing frequent high or low blood glucose.</string>
|
||||
<string name="basaltest_weekly">At least once per week.</string>
|
||||
<string name="basaltest_fixed">Once set and validated, these values should not change over time.</string>
|
||||
<string name="basaltest_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#androidaps-settings</string>
|
||||
<string name="prerequisites_label">Prerequisites</string>
|
||||
<string name="prerequisites_what">What is essential to set up and use AAPS?</string>
|
||||
<string name="prerequisites_determinedcorrectprofile">Validated profile information (Basal, IC, ISF, DIA).</string>
|
||||
<string name="prerequisites_computer">A computer with Android Studio installed and configured.</string>
|
||||
<string name="prerequisites_phone">A supported phone.</string>
|
||||
<string name="prerequisites_pump">A compatible insulin pump if you are planning to run a closed loop.</string>
|
||||
<string name="prerequisites_nightscout">Nightscout, to keep a log of all data and review settings.</string>
|
||||
<string name="prerequisites_tidepoolaccount">A Tidepool account.</string>
|
||||
<string name="prerequisites_googleaccount">A Google account.</string>
|
||||
<string name="prerequisites_githubaccount">A Github account.</string>
|
||||
<string name="prerequisites_beanandroiddeveloper">Experience in programming or editing code.</string>
|
||||
<string name="prerequisites_own670g">A MiniMed 670G pump.</string>
|
||||
<string name="prerequisites_hint1">https://androidaps.readthedocs.io/en/latest/EN/Module/module.html</string>
|
||||
<string name="prerequisites_smartwatch">A Smartwatch.</string>
|
||||
<string name="prerequisites_supportedcgm">A Supported CGM.</string>
|
||||
<string name="prerequisites2_label">Prerequisites</string>
|
||||
<string name="prerequisites2_what">What is essential to set up and use AAPS?</string>
|
||||
<string name="prerequisites2_profile">Validated information to set up a profile (ISF, I:C ratio, basal rates, DIA etc.).</string>
|
||||
<string name="prerequisites2_device">A compatible Android device (e.g. mobile/cell phone, full Android watch, or tablet).</string>
|
||||
<string name="prerequisites2_internet">AAPS requires an internet connection in order to run in closed loop.</string>
|
||||
<string name="prerequisites2_supportedcgm">A supported CGM and appropriate app to receive blood glucose values on the phone/device.</string>
|
||||
<string name="prerequisites2_hint1">https://androidaps.readthedocs.io/en/latest/EN/Module/module.html</string>
|
||||
<string name="update_label">Updating AAPS</string>
|
||||
<string name="whatistrue">Check all correct answers.</string>
|
||||
<string name="update_git">You need to have Git installed and configured on your computer.</string>
|
||||
<string name="update_asap">When updated versions of AAPS are released, the earlier versions may be remotely limited after a specified time.</string>
|
||||
<string name="update_keys">You should save and note the location of your keystore and use the same signing key for updates as for your previous installation.</string>
|
||||
<string name="update_neverupdate">Never update if the system is working well.</string>
|
||||
<string name="update_askfriend">If you have difficulty building the apk, you can install an apk that has been built by a friend.</string>
|
||||
<string name="update_hint1">https://androidaps.readthedocs.io/en/latest/EN/Installing-AndroidAPS/Update-to-new-version.html#update-to-a-new-version-or-branch</string>
|
||||
<string name="troubleshooting_label">Troubleshooting</string>
|
||||
<string name="troubleshooting_wheretoask">Where can you look for help with AAPS?</string>
|
||||
<string name="troubleshooting_fb">You can ask for advice in the AAPS Users Facebook group.</string>
|
||||
<string name="troubleshooting_wiki">You should read (and re-read) the AAPS documentation.</string>
|
||||
<string name="troubleshooting_gitter">You can ask for advice and log technical problems or issues in the AAPS Discord.</string>
|
||||
<string name="troubleshooting_yourendo">You should ask your diabetes clinic/endocrinologist.</string>
|
||||
<string name="troubleshooting_hint1">https://androidaps.readthedocs.io/en/latest/EN/Installing-AndroidAPS/Update-to-new-version.html#troubleshooting</string>
|
||||
<string name="troubleshooting_hint2">https://www.facebook.com/groups/AndroidAPSUsers/</string>
|
||||
<string name="troubleshooting_hint3">https://discord.gg/4fQUWHZ4Mw</string>
|
||||
<string name="insulin_plugins">Insulin Plugins</string>
|
||||
<string name="insulin_ultrarapid">Which insulin should you use with the Ultra-Rapid Oref plugin?</string>
|
||||
<string name="insulin_fiasp">Fiasp®</string>
|
||||
<string name="insulin_novorapid">NovoRapid®/Novolog®</string>
|
||||
<string name="insulin_humalog">Humalog®</string>
|
||||
<string name="insulin_actrapid">Actrapid®/Humalin R®/"regular" human insulin.</string>
|
||||
<string name="insulin_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#insulin</string>
|
||||
<string name="sensitivity_label">Sensitivity Plugins</string>
|
||||
<string name="sensitivity_which">Check all correct answers.</string>
|
||||
<string name="sensitivity_adjust">Sensitivity plugins allow AAPS to adjust for temporary or short-lived changes in insulin sensitivity (for example hormonal changes or issues with absorption at the infusion site).</string>
|
||||
<string name="sensitivity_edit">Sensitivity plugins provide the user with suggested changes to basal rates, I:C ratios and ISF that can be used to edit profile.</string>
|
||||
<string name="sensitivity_cannula">Logging a cannula change will reset Autosens ratio back to 100%.</string>
|
||||
<string name="sensitivity_time">Some of the plugin options have configurable time ranges that can be set by the user.</string>
|
||||
<string name="sensitivity_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html</string>
|
||||
<string name="sensitivity_hint2">https://androidaps.readthedocs.io/en/latest/Usage/Open-APS-features.html?highlight=Autosens#autosens</string>
|
||||
<string name="wrongcarbs_label">Carb Entry Errors</string>
|
||||
<string name="wrongcarbs_whattodo">What should you do if you’ve made an incorrect carb entry?</string>
|
||||
<string name="wrongcarbs_treatmentstab">Delete the incorrect entry in Treatments and enter the correct new carb value.</string>
|
||||
<string name="wrongcarbs_addinsulin">Bolus with insulin using the infusion set prime menu.</string>
|
||||
<string name="wrongcarbs_donothing">Do nothing – AAPS will make the appropriate adjustments.</string>
|
||||
<string name="wrongcarbs_bolus">Bolus with insulin using the Insulin (bolus) button in Overview.</string>
|
||||
<string name="wronginsulin_label">Insulin delivery/entry errors</string>
|
||||
<string name="wronginsulin_whattodo">What should you do if you received less insulin than the pump history suggests e.g. due to an occlusion, a failed cannula or forgetting to reattach the pump after a shower? </string>
|
||||
<string name="wronginsulin_careportal">Delete insulin data from Nightscout Careportal to remove it from the pump history.</string>
|
||||
<string name="wronginsulin_compare">Compare values in AAPS and pump history (if pump supports this).</string>
|
||||
<string name="wronginsulin_prime">Bolus a proportion of your calculated ‘missed’ insulin by either syringe/pen or using a prime.</string>
|
||||
<string name="wronginsulin_donothing">Do nothing and allow AAPS to correct any resulting high blood glucose level.</string>
|
||||
<string name="cob_label">Carbs on Board (COB)</string>
|
||||
<string name="cob_question">How changing ISF value affects COB calculation?</string>
|
||||
<string name="cob_longer">Increasing ISF will take absorbing carbs a longer time</string>
|
||||
<string name="cob_shorter">Increasing ISF will take absorbing carbs a shorter time</string>
|
||||
<string name="cob_no_effect">Increasing ISF will not affect calculated carbs absorption</string>
|
||||
<string name="cob2_question">How changing IC value affects COB calculation?</string>
|
||||
<string name="cob2_longer">Increasing IC will take absorbing carbs a longer time</string>
|
||||
<string name="cob2_shorter">Increasing IC will take absorbing carbs a shorter time</string>
|
||||
<string name="cob2_no_effect">Increasing IC will not affect calculated carbs absorption</string>
|
||||
<string name="cob3_question">How changing profile percentage affects COB calculation?</string>
|
||||
<string name="cob3_longer">Setting profile to 150% will take absorbing carbs a longer time</string>
|
||||
<string name="cob3_shorter">Setting profile to 150% will take absorbing carbs a shorter time</string>
|
||||
<string name="cob3_no_effect">Setting profile to 150% will not affect calculated carbs absorption</string>
|
||||
<string name="iob_label">Insulin on Board (IOB)</string>
|
||||
<string name="iob_value">IOB value is affected by issued temporary basals.</string>
|
||||
<string name="iob_hightemp">High temp basal will not be given when your blood sugar is below target.</string>
|
||||
<string name="iob_negiob">Negative IOB for a substantial period in the absence of exercise suggests your profile is too strong and less insulin is needed in your settings.</string>
|
||||
<string name="iob_posiob">Positive IOB for a substantial period suggests insulin resistance or unannounced meals.</string>
|
||||
<string name="breadgrams_label">Carb entry and boluses</string>
|
||||
<string name="breadgrams_grams">Only grams should be used for estimating and recording carbohydrates consumed.</string>
|
||||
<string name="breadgrams_exchange">Carbohydrates consumed can be recorded using an appropriate exchange system (e.g. DAFNE "CHO" exchanges or European "Bread Units").</string>
|
||||
<string name="breadgrams_decay">AAPS uses a dynamic model to estimate carb “decay” and calculate COB.</string>
|
||||
<string name="breadgrams_calc">If blood glucose levels are outside acceptable values (too low or too high) the bolus calculator can be used to provide suggestions for carb or insulin corrections.</string>
|
||||
<string name="breadgrams_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#insulin-to-carb-ratio-ic-g-u</string>
|
||||
<string name="extendedcarbs_label">e-carbs</string>
|
||||
<string name="extendedcarbs_handling">What could you use e-carbs (extended carbs) for?</string>
|
||||
<string name="extendedcarbs_future">To schedule carbs in the future, possibly distributed over an interval (similar to an extended bolus distributing insulin over an interval).</string>
|
||||
<string name="extendedcarbs_free">For logging \'free\' exercise carbs you want to hide from AAPS.</string>
|
||||
<string name="extendedcarbs_fat">e-carbs (distributed in the future) can assist AAPS in dealing with high fat/protein meals.</string>
|
||||
<string name="extendedcarbs_rescue">For logging rescue carbs you use to treat low blood glucose. </string>
|
||||
<string name="extendedcarbs_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Extended-Carbs.html</string>
|
||||
<string name="nsclient_label">Remote Monitoring</string>
|
||||
<string name="nsclient_howcanyou">How can you monitor AAPS (for example for your child) remotely?</string>
|
||||
<string name="nsclient_nightscout">AAPSClient app, Nightscout app and Nightscout webpage all allow you to follow AAPS remotely.</string>
|
||||
<string name="nsclient_dexcomfollow">Other apps (e.g. Dexcom follow, xDrip running in follow mode) allow you to follow some parameters (e.g. blood glucose/sensor values) remotely, but use different algorithms so may have inaccurate IOB or COB values.</string>
|
||||
<string name="nsclient_data">To follow AAPS remotely, both devices must have internet access (e.g. via Wi-Fi or mobile/cellular network data).</string>
|
||||
<string name="nsclient_fullcontrol">AAPSClient used as a remote follower will both monitor and provide full control of AAPS.</string>
|
||||
<string name="nsclient_hint1">https://androidaps.readthedocs.io/en/latest/EN/Children/Children.html</string>
|
||||
<string name="isf_label_exam">Insulin Sensitivity Factor (ISF)</string>
|
||||
<string name="isf_increasingvalue">Raising ISF values will lead to more insulin delivery to cover a specific amount of carbs.</string>
|
||||
<string name="isf_decreasingvalue">Reducing ISF values lead to more insulin delivery to correct for an above target blood glucose.</string>
|
||||
<string name="isf_noeffect">Raising or lowering ISF has no effect on insulin delivery when blood glucose levels are below target.</string>
|
||||
<string name="isf_preferences">ISF should be entered in your AAPS Preferences.</string>
|
||||
<string name="isf_profile">Changing the ISF value in your profile is enough to apply the change.</string>
|
||||
<string name="isf_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#insulin-sensitivity-factor-isf-mmol-l-u-or-mg-dl-u</string>
|
||||
<string name="isf_hint2">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html</string>
|
||||
<string name="ic_multiple">You can use more than one value for I:C ratio in your profile.</string>
|
||||
<string name="ic_isf">If you change your ISF in your profile you should always change your I:C ratio too.</string>
|
||||
<string name="ic_label_exam">Insulin to Carbohydrate Ratio (I:C ratio)</string>
|
||||
<string name="ic_increasingvalue">Higher I:C ratios lead to less insulin delivered for a given amount of carbs.</string>
|
||||
<string name="ic_decreasingvalue">Lower I:C ratios lead to less insulin delivered for a given amount of carbs.</string>
|
||||
<string name="ic_noeffect">If you have 0 COB, changing the IC ratio will lead to a different amount of insulin to correct a given BG value.</string>
|
||||
<string name="ic_different">IC will be different if you count bread (exchange) unit as 10g or 12g.</string>
|
||||
<string name="ic_meaning">IC meaning is: How many bread (exchange) units are covered by 1U of insulin.</string>
|
||||
<string name="ic_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#carbohydrate-to-insulin-ratio-cr-g-u</string>
|
||||
<string name="profileswitch_label">Profile Switching</string>
|
||||
<string name="profileswitch_pctwillchange"> When specifying a 90% profile switch, which answers are true?</string>
|
||||
<string name="profileswitch_basallower">Basal rates will be 10% lower.</string>
|
||||
<string name="profileswitch_isfhigher">ISF will be 10% higher.</string>
|
||||
<string name="profileswitch_iclower">The value of the I:C ratio will be a 10% lower number.</string>
|
||||
<string name="profileswitch_unchanged">ISF and I:C ratios will be unchanged.</string>
|
||||
<string name="profileswitch_hint1" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#profile-switch</string>
|
||||
<string name="profileswitch2_label">Profile Switching</string>
|
||||
<string name="profileswitch2_pctwillchange"> When specifying a 120% profile switch, which answers are true?</string>
|
||||
<string name="profileswitch2_bghigher">Target blood glucose will be 20% higher.</string>
|
||||
<string name="profileswitch2_basalhigher">Basal rates will be 20% higher.</string>
|
||||
<string name="profileswitch2_bgunchanged">Target blood glucose will be unchanged.</string>
|
||||
<string name="profileswitch2_isfhigher">ISF will be 20% higher.</string>
|
||||
<string name="profileswitchtime_label">Profile Switching</string>
|
||||
<string name="profileswitchtime_iwant">If you get up 2 hours earlier than usual, how should you notify AAPS of the change in your schedule?</string>
|
||||
<string name="profileswitchtime_2">Initiate a profile switch with a timeshift of 2</string>
|
||||
<string name="profileswitchtime__2">Initiate a profile switch with a timeshift of -2</string>
|
||||
<string name="profileswitchtime_tt">Set an eating soon temporary target.</string>
|
||||
<string name="profileswitchtime_100">Do a profile switch to more than 100%. </string>
|
||||
<string name="profileswitchtime_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#timeshift</string>
|
||||
<string name="profileswitch4_label">Changes to profiles</string>
|
||||
<string name="profileswitch4_rates">Basal rates, ISF, I:C ratios, etc., should be set in profiles.</string>
|
||||
<string name="profileswitch4_internet">Activating changes to your Nightscout Profile requires your AAPS phone to have an internet connection.</string>
|
||||
<string name="profileswitch4_sufficient">Editing profiles to change values is sufficient to enact any changes made.</string>
|
||||
<string name="profileswitch4_multi">Multiple profiles can be set up and selected to accommodate changing circumstances (e.g. hormonal changes, shift working, weekdays/weekend lifestyle).</string>
|
||||
<string name="basalhelp_hint1">https://androidaps.readthedocs.io/en/latest/EN/Module/module.html#good-individual-dosage-algorithm-for-your-diabetes-therapy</string>
|
||||
<string name="basalhelp_label">Help with basal rates</string>
|
||||
<string name="basalhelp_where">Where to go for help with basalrate etc.</string>
|
||||
<string name="basalhelp_diabetesteam">Your diabetes team</string>
|
||||
<string name="basalhelp_google">Google</string>
|
||||
<string name="basalhelp_facebook">Facebook</string>
|
||||
<string name="blank"></string>
|
||||
<string name="other_medication_label">Other Medication. Please read the statement below and then check the box to accept the declaration.</string>
|
||||
<string name="other_medication_text">AAPS reduces basal rates or suspends insulin delivery to raise blood sugar. Drugs in the class SGLT2 inhibitors (gliflozins) can prevent increases in blood glucose and therefore can produce a dangerous insulin deficiency leading to DKA.
|
||||
\nCommon brand names are: Invokana®, Forxiga®, Jardiance®, Steglatro®, Suglat®, Apleway®, Deberza®, Synjardy®, Vokanamet®, Xigduo®.\n\nI hereby promise that I will not take such drugs when using AAPS or will deactivate the loop before using such drugs.</string>
|
||||
|
||||
</resources>
|
62
plugins/src/main/res/values/objectives.xml
Normal file
62
plugins/src/main/res/values/objectives.xml
Normal file
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="key_objectiveuseactions" translatable="false">ObjectivesActionsUsed</string>
|
||||
<string name="key_objectiveuseloop" translatable="false">ObjectivesLoopUsed</string>
|
||||
<string name="key_objectiveusescale" translatable="false">ObjectivesScaleUsed</string>
|
||||
<string name="key_objectives_request_code" translatable="false">objectives_request_code</string>
|
||||
<string name="key_ObjectivesmanualEnacts" translatable="false">ObjectivesmanualEnacts</string>
|
||||
|
||||
<string name="objectives_button_start">Start</string>
|
||||
<string name="objectives_button_verify">Verify</string>
|
||||
<string name="nth_objective">%1$d. Objective</string>
|
||||
<string name="objectivenotstarted">Objective %1$d not started</string>
|
||||
<string name="objectivenotfinished">Objective %1$d not finished</string>
|
||||
<string name="objectives_0_objective">Setting up visualization and monitoring, and analyzing basals and ratios</string>
|
||||
<string name="objectives_0_gate">Verify that BG is available in Nightscout, and pump insulin data is being uploaded</string>
|
||||
<string name="objectives_openloop_objective">Starting on an open loop</string>
|
||||
<string name="objectives_openloop_gate">Run in Open Loop mode for a few days and manually enact lots of temp basals. Set up and use temporary and default temporary targets (e.g. for activity or hypo treatment carbs)</string>
|
||||
<string name="objectives_maxbasal_objective">Understanding your open loop, including its temp basal recommendations</string>
|
||||
<string name="objectives_maxbasal_gate">Based on that experience, decide what max basal should be, and set it on the pump and preferences</string>
|
||||
<string name="objectives_maxiobzero_objective">Starting to close the loop with Low Glucose Suspend</string>
|
||||
<string name="objectives_maxiobzero_gate">Run in closed loop with max IOB = 0 for a few days without too many LGS events</string>
|
||||
<string name="objectives_maxiob_objective">Tuning the closed loop, raising max IOB above 0 and gradually lowering BG targets</string>
|
||||
<string name="objectives_maxiob_gate">Run for a few days, and at least one night with no low BG alarms, before dropping BG</string>
|
||||
<string name="objectives_autosens_objective">Adjust basals and ratios if needed, and then enable auto-sens</string>
|
||||
<string name="objectives_autosens_gate">1 week successful daytime looping with regular carb entry</string>
|
||||
<string name="objectives_smb_objective">Enabling additional features for daytime use, such as SMB</string>
|
||||
<string name="objectives_auto_objective">Enabling automation</string>
|
||||
<string name="objectives_smb_gate">You must read the wiki and rise maxIOB to get SMBs working fine! A good start is maxIOB=average mealbolus + 3 x max daily basal</string>
|
||||
<string name="objectives_auto_gate">Read the docs on how automation works. Set up your first simple rules. Instead of action let AAPS display only notification. When you are sure automation is triggered at the right time replace notification by real action. (https://androidaps.readthedocs.io/en/latest/EN/Usage/Automation.html)</string>
|
||||
<string name="objectives_bgavailableinns">BG available in NS</string>
|
||||
<string name="objectives_pumpstatusavailableinns">Pump status available in NS</string>
|
||||
<string name="objectives_manualenacts">Manual enacts</string>
|
||||
<string name="accomplished">Accomplished: %1$s</string>
|
||||
<string name="objectives_usage_objective">Learn how to control AAPS</string>
|
||||
<string name="objectives_usage_gate">Perform different actions in AAPS</string>
|
||||
<string name="objectives_useprofileswitch">Set profile 90% for 10 min (Long-press profile name on Overview)</string>
|
||||
<string name="objectives_usedisconnectpump">Simulate shower. Disconnect pump for 1h (Long-press on Open Loop)</string>
|
||||
<string name="objectives_usereconnectpump">... and reconnect back the same way</string>
|
||||
<string name="objectives_usetemptarget">Create custom temporary target with 10 min duration (Long-press on your current target)</string>
|
||||
<string name="objectives_useactions">In Config Builder enable Actions plugin, make it visible and display its content from top menu</string>
|
||||
<string name="objectives_useloop">Display content of Loop plugin</string>
|
||||
<string name="objectives_usescale">Use scale function by long-pressing BG chart</string>
|
||||
<string name="objectives_button_enter">Enter</string>
|
||||
<string name="enter_code_obtained_from_developers_to_bypass_the_rest_of_objectives">If you have at least 3 months of closed loop experience with other systems you might qualify for a code to skip objectives. See https://androidaps.readthedocs.io/en/latest/EN/Usage/Objectives.html#skip-objectives for details.</string>
|
||||
<string name="codeaccepted">Code accepted</string>
|
||||
<string name="codeinvalid">Code invalid</string>
|
||||
<string name="objectives_exam_objective">Prove your knowledge</string>
|
||||
<string name="objectives_exam_gate">Study the questions. You are given four possible answers for each question. There may be more than one correct answer. Please check all those that are correct and select VERIFY.</string>
|
||||
<string name="answerdisabledto">Answering disabled until: %1$s</string>
|
||||
<string name="wronganswer">Wrong answer!</string>
|
||||
<string name="unfinshed_button">Next unfinished</string>
|
||||
<string name="requestcode">Request code: %1$s</string>
|
||||
<string name="objectives_hint">(check all correct answers)</string>
|
||||
<string name="disconnectpump_hint" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#what-to-do-when-taking-a-shower-or-bath</string>
|
||||
<string name="usetemptarget_hint" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/Screenshots.html#the-homescreen</string>
|
||||
<string name="useaction_hint" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/Screenshots.html#config-builder</string>
|
||||
<string name="usescale_hint" formatted="false">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/Screenshots.html#the-homescreen</string>
|
||||
<string name="notconnected">Not connected to the internet</string>
|
||||
<string name="failedretrievetime">Failed retrieve time</string>
|
||||
<string name="requirementnotmet">Objective requirements not met</string>
|
||||
|
||||
</resources>
|
|
@ -234,9 +234,89 @@
|
|||
<string name="phone_checker" translatable="false">PhoneChecker</string>
|
||||
|
||||
<!-- Objectives -->
|
||||
<string name="key_objectives_bg_is_available_in_ns" translatable="false">ObjectivesbgIsAvailableInNS</string>
|
||||
<string name="key_objectives_pump_status_is_available_in_ns" translatable="false">ObjectivespumpStatusIsAvailableInNS</string>
|
||||
|
||||
<string name="completed_well_done">Completed, well done!</string>
|
||||
<string name="not_completed_yet">Not completed yet</string>
|
||||
<string name="time_elapsed">Time elapsed</string>
|
||||
<string name="maxiobset">Maximal IOB set properly</string>
|
||||
<string name="hasbgdata">BG available from selected source</string>
|
||||
<string name="synchaswritepermission">Synchronization service has write permission</string>
|
||||
<string name="loopenabled">Loop enabled</string>
|
||||
<string name="apsselected">APS selected</string>
|
||||
<string name="closedmodeenabled">Closed mode enabled</string>
|
||||
<string name="objectives_shortname">OBJ</string>
|
||||
<string name="description_objectives">Learning program</string>
|
||||
<string name="doyouwantresetstart">Do you want reset objective start? You may lose your progress.</string>
|
||||
<string name="objectives_next_button">Next</string>
|
||||
<string name="objectives_previous_button">Prev</string>
|
||||
<string name="objectives_button_unfinish">Clear finished</string>
|
||||
<string name="objectives_button_unstart">Clear started</string>
|
||||
|
||||
<!-- Actions -->
|
||||
<string name="actions">Actions</string>
|
||||
<string name="description_actions">Some buttons to quickly access common features</string>
|
||||
<string name="actions_shortname">ACT</string>
|
||||
<string name="tempbasal_button">TempBasal</string>
|
||||
<string name="extended_bolus_button">Extended Bolus</string>
|
||||
<string name="extended_bolus_cancel_button">Cancel Extended Bolus</string>
|
||||
<string name="tools">Tools</string>
|
||||
<string name="nav_history_browser">History browser</string>
|
||||
<string name="sensor_label">Sensor</string>
|
||||
<string name="age_label">age:</string>
|
||||
<string name="level_label">level:</string>
|
||||
<string name="insulin_label">Insulin</string>
|
||||
<string name="pb_label">Pump battery</string>
|
||||
<string name="cannula">Cannula</string>
|
||||
<string name="ebstopsloop">Use of Extended bolus feature will stop closed loop mode for the time of running extended bolus. Do you really want it?</string>
|
||||
<string name="extendedbolusdeliveryerror">Extended bolus delivery error</string>
|
||||
<string name="statuslights_cannula_age">cannula age</string>
|
||||
<string name="statuslights_patch_pump_age">patch pump age</string>
|
||||
<string name="patch_pump">Patch pump</string>
|
||||
|
||||
<!-- Safety -->
|
||||
<string name="key_openapsama_useautosens" translatable="false">openapsama_useautosens</string>
|
||||
<string name="key_use_smb" translatable="false">use_smb</string>
|
||||
<string name="key_use_uam" translatable="false">use_uam</string>
|
||||
<string name="key_openapsma_max_basal" translatable="false">openapsma_max_basal</string>
|
||||
<string name="key_openapsama_current_basal_safety_multiplier" translatable="false">openapsama_current_basal_safety_multiplier</string>
|
||||
<string name="key_openapsama_max_daily_safety_multiplier" translatable="false">openapsama_max_daily_safety_multiplier</string>
|
||||
<string name="key_treatmentssafety_maxbolus" translatable="false">treatmentssafety_maxbolus</string>
|
||||
<string name="key_lgs_threshold" translatable="false">lgsThreshold</string>
|
||||
<string name="key_openapssmb_max_iob" translatable="false">openapsmb_max_iob</string>
|
||||
|
||||
<string name="limitingextendedbolus">Limiting extended bolus to %1$.1f U because of %2$s</string>
|
||||
<string name="limitingcarbs">Limiting carbs to %1$d g because of %2$s</string>
|
||||
<string name="limitingiob">Limiting IOB to %1$.1f U because of %2$s</string>
|
||||
|
||||
<string name="maxbasalmultiplier">max basal multiplier</string>
|
||||
<string name="maxdailybasalmultiplier">max daily basal multiplier</string>
|
||||
<string name="key_openapsma_max_iob" translatable="false">openapsma_max_iob</string>
|
||||
<string name="safety" translatable="false">Safety</string>
|
||||
<string name="pumpisnottempbasalcapable">Pump is not temp basal capable</string>
|
||||
<string name="closedmodedisabledinpreferences">Closed loop mode disabled in preferences</string>
|
||||
<string name="autosensdisabledinpreferences">Autosens disabled in preferences</string>
|
||||
<string name="smbdisabledinpreferences">SMB disabled in preferences</string>
|
||||
<string name="uamdisabledinpreferences">UAM disabled in preferences</string>
|
||||
<string name="uamdisabledoref1notselected">UAM disabled because it rely on Oref1 sensitivity plugin</string>
|
||||
<string name="closed_loop_disabled_on_dev_branch">Running dev version. Closed loop is disabled.</string>
|
||||
<string name="closed_loop_disabled_with_eb">Closed loop disabled because of running Extended bolus</string>
|
||||
<string name="smbalwaysdisabled">SMB always and after carbs disabled because active BG source doesn\'t support advanced filtering</string>
|
||||
<string name="smbnotallowedinopenloopmode">SMB not allowed in open loop mode</string>
|
||||
<string name="increasingmaxbasal">Increasing max basal value because setting is lower than your max basal in profile</string>
|
||||
<string name="maxvalueinpreferences">max value in preferences</string>
|
||||
<string name="hardlimit">hard limit</string>
|
||||
<string name="treatmentssafety_title">Treatments safety</string>
|
||||
<string name="patientage_summary">Please select patient type to setup safety limits</string>
|
||||
<string name="child">Child</string>
|
||||
<string name="teenage">Teenage</string>
|
||||
<string name="adult">Adult</string>
|
||||
<string name="resistantadult">Insulin resistant adult</string>
|
||||
<string name="pregnant">Pregnancy</string>
|
||||
<string name="treatmentssafety_maxbolus_title">Max allowed bolus [U]</string>
|
||||
<string name="treatmentssafety_maxcarbs_title">Max allowed carbs [g]</string>
|
||||
<string name="patientage">Patient type</string>
|
||||
|
||||
<!-- Overview -->
|
||||
<string name="key_statuslights_copy_ns" translatable="false">statuslights_copy_ns</string>
|
||||
|
@ -276,6 +356,16 @@
|
|||
<string name="statuslights_bat_critical">Threshold critical pump battery level [%]</string>
|
||||
<string name="statuslights">Status lights</string>
|
||||
<string name="statuslights_copy_ns">Copy settings from NS</string>
|
||||
<string name="a11y_graph">graph</string>
|
||||
<string name="a11y_insulin_label">insulin</string>
|
||||
<string name="chart_menu">Chart menu</string>
|
||||
<string name="a11y_bg_quality">blood glucose quality</string>
|
||||
<string name="a11y_blood_glucose">blood glucose</string>
|
||||
<string name="a11y_bg_outdated">outdated</string>
|
||||
<string name="apsmode_title">APS Mode</string>
|
||||
<string name="setbasalquestion">Accept new temp basal:</string>
|
||||
<string name="overview_cgm">CGM</string>
|
||||
<string name="quickwizard">QuickWizard</string>
|
||||
|
||||
<!-- NSClient -->
|
||||
<string name="key_ns_client_autoscroll" translatable="false">ns_client_autoscroll</string>
|
||||
|
@ -483,8 +573,13 @@
|
|||
<string name="uploader_short">UPLD</string>
|
||||
<string name="ns_malfunction">NSClient malfunction. Consider NS and NSClient restart.</string>
|
||||
|
||||
<!-- Objectives -->
|
||||
<string name="key_objectives_bg_is_available_in_ns" translatable="false">ObjectivesbgIsAvailableInNS</string>
|
||||
<string name="key_objectives_pump_status_is_available_in_ns" translatable="false">ObjectivespumpStatusIsAvailableInNS</string>
|
||||
<!-- Skins -->
|
||||
<string name="key_skin" translatable="false">skin</string>
|
||||
|
||||
<string name="classic_description">Original skin</string>
|
||||
<string name="lowres_description">Low Resolution skin</string>
|
||||
<string name="buttonson_description">Buttons are always displayed on bottom of screen</string>
|
||||
<string name="largedisplay_description">Large display</string>
|
||||
<string name="skin">Skin</string>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,84 @@
|
|||
package info.nightscout.androidaps
|
||||
|
||||
import info.nightscout.core.main.R
|
||||
import info.nightscout.interfaces.utils.HardLimits
|
||||
import info.nightscout.shared.interfaces.ResourceHelper
|
||||
import info.nightscout.shared.sharedPreferences.SP
|
||||
import javax.inject.Inject
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
class HardLimitsMock @Inject constructor(
|
||||
private val sp: SP,
|
||||
private val rh: ResourceHelper
|
||||
) : HardLimits {
|
||||
|
||||
companion object {
|
||||
|
||||
private const val CHILD = 0
|
||||
private const val TEENAGE = 1
|
||||
private const val ADULT = 2
|
||||
private const val RESISTANT_ADULT = 3
|
||||
private const val PREGNANT = 4
|
||||
private val MAX_BOLUS = doubleArrayOf(5.0, 10.0, 17.0, 25.0, 60.0)
|
||||
|
||||
// Very Hard Limits Ranges
|
||||
// First value is the Lowest and second value is the Highest a Limit can define
|
||||
val VERY_HARD_LIMIT_MIN_BG = doubleArrayOf(80.0, 180.0)
|
||||
val VERY_HARD_LIMIT_MAX_BG = doubleArrayOf(90.0, 200.0)
|
||||
val VERY_HARD_LIMIT_TARGET_BG = doubleArrayOf(80.0, 200.0)
|
||||
|
||||
// Very Hard Limits Ranges for Temp Targets
|
||||
val VERY_HARD_LIMIT_TEMP_MIN_BG = intArrayOf(72, 180)
|
||||
val VERY_HARD_LIMIT_TEMP_MAX_BG = intArrayOf(72, 270)
|
||||
val VERY_HARD_LIMIT_TEMP_TARGET_BG = intArrayOf(72, 200)
|
||||
val MIN_DIA = doubleArrayOf(5.0, 5.0, 5.0, 5.0, 5.0)
|
||||
val MAX_DIA = doubleArrayOf(9.0, 9.0, 9.0, 9.0, 10.0)
|
||||
val MIN_IC = doubleArrayOf(2.0, 2.0, 2.0, 2.0, 0.3)
|
||||
val MAX_IC = doubleArrayOf(100.0, 100.0, 100.0, 100.0, 100.0)
|
||||
const val MIN_ISF = 2.0 // mgdl
|
||||
const val MAX_ISF = 1000.0 // mgdl
|
||||
val MAX_IOB_AMA = doubleArrayOf(3.0, 5.0, 7.0, 12.0, 25.0)
|
||||
val MAX_IOB_SMB = doubleArrayOf(7.0, 13.0, 22.0, 30.0, 70.0)
|
||||
val MAX_BASAL = doubleArrayOf(2.0, 5.0, 10.0, 12.0, 25.0)
|
||||
|
||||
//LGS Hard limits
|
||||
//No IOB at all
|
||||
const val MAX_IOB_LGS = 0.0
|
||||
|
||||
}
|
||||
|
||||
private fun loadAge(): Int = when (sp.getString(R.string.key_age, "")) {
|
||||
rh.gs(R.string.key_child) -> CHILD
|
||||
rh.gs(R.string.key_teenage) -> TEENAGE
|
||||
rh.gs(R.string.key_adult) -> ADULT
|
||||
rh.gs(R.string.key_resistantadult) -> RESISTANT_ADULT
|
||||
rh.gs(R.string.key_pregnant) -> PREGNANT
|
||||
else -> ADULT
|
||||
}
|
||||
|
||||
override fun maxBolus(): Double = MAX_BOLUS[loadAge()]
|
||||
override fun maxIobAMA(): Double = MAX_IOB_AMA[loadAge()]
|
||||
override fun maxIobSMB(): Double = MAX_IOB_SMB[loadAge()]
|
||||
override fun maxBasal(): Double = MAX_BASAL[loadAge()]
|
||||
override fun minDia(): Double = MIN_DIA[loadAge()]
|
||||
override fun maxDia(): Double = MAX_DIA[loadAge()]
|
||||
override fun minIC(): Double = MIN_IC[loadAge()]
|
||||
override fun maxIC(): Double = MAX_IC[loadAge()]
|
||||
|
||||
// safety checks
|
||||
override fun checkHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Boolean =
|
||||
value == verifyHardLimits(value, valueName, lowLimit, highLimit)
|
||||
|
||||
override fun isInRange(value: Double, lowLimit: Double, highLimit: Double): Boolean =
|
||||
value in lowLimit..highLimit
|
||||
|
||||
override fun verifyHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Double {
|
||||
var newValue = value
|
||||
if (newValue < lowLimit || newValue > highLimit) {
|
||||
newValue = max(newValue, lowLimit)
|
||||
newValue = min(newValue, highLimit)
|
||||
}
|
||||
return newValue
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue