chill objectives

This commit is contained in:
Casper V. Kristensen 2024-03-16 16:09:21 +01:00
parent 1c19a8fe9a
commit a0812664d9
9 changed files with 10 additions and 22 deletions

View file

@ -149,7 +149,7 @@ abstract class Objective(injector: HasAndroidInjector, spName: String, @StringRe
override fun isCompleted(): Boolean = answered
fun isEnabledAnswer(): Boolean = disabledTo < dateUtil.now()
fun isEnabledAnswer(): Boolean = true
fun option(option: Option): ExamTask {
options.add(option)
@ -187,4 +187,4 @@ abstract class Objective(injector: HasAndroidInjector, spName: String, @StringRe
}
inner class Learned internal constructor(@StringRes var learned: Int)
}
}

View file

@ -22,11 +22,6 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R
val tidepoolPlugin get() = activePlugin.getSpecificPluginsListByInterface(Tidepool::class.java).firstOrNull() as Tidepool?
init {
tasks.add(object : Task(this, R.string.objectives_bgavailableinns) {
override fun isCompleted(): Boolean {
return sp.getBoolean(app.aaps.core.utils.R.string.key_objectives_bg_is_available_in_ns, false) || tidepoolPlugin?.hasWritePermission == true
}
})
tasks.add(object : Task(this, R.string.synchaswritepermission) {
override fun isCompleted(): Boolean {
return activePlugin.firstActiveSync?.hasWritePermission == true || tidepoolPlugin?.hasWritePermission == true
@ -41,13 +36,6 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R
return !virtualPumpPlugin.isEnabled()
}
})
tasks.add(
object : Task(this, R.string.objectives_pumpstatusavailableinns) {
override fun isCompleted(): Boolean {
return sp.getBoolean(app.aaps.core.utils.R.string.key_objectives_pump_status_is_available_in_ns, false) || tidepoolPlugin?.hasWritePermission == true
}
}.learned(Learned(R.string.objectives_0_learned))
)
tasks.add(object : Task(this, R.string.hasbgdata) {
override fun isCompleted(): Boolean {
return iobCobCalculator.ads.lastBg() != null
@ -70,4 +58,4 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R
}
})
}
}
}

View file

@ -8,7 +8,7 @@ class Objective10(injector: HasAndroidInjector) : Objective(injector, "auto", R.
init {
tasks.add(
MinimumDurationTask(this, T.days(28).msecs())
MinimumDurationTask(this, T.mins(28).msecs())
.learned(Learned(R.string.objectives_autosens_learned))
)
}

View file

@ -8,7 +8,7 @@ class Objective11(injector: HasAndroidInjector) : Objective(injector, "dyn_isf",
init {
tasks.add(
MinimumDurationTask(this, T.days(28).msecs())
MinimumDurationTask(this, T.mins(28).msecs())
.learned(Learned(R.string.objectives_dyn_isf_learned))
)
}

View file

@ -12,7 +12,7 @@ class Objective3 @Inject constructor(injector: HasAndroidInjector) : Objective(i
@Inject lateinit var activePlugin: ActivePlugin
init {
tasks.add(MinimumDurationTask(this, T.days(7).msecs()))
tasks.add(MinimumDurationTask(this, T.mins(7).msecs()))
tasks.add(
object : Task(this, R.string.objectives_manualenacts) {
override fun isCompleted(): Boolean {

View file

@ -15,7 +15,7 @@ class Objective5(injector: HasAndroidInjector) : Objective(injector, "maxiobzero
@Inject lateinit var aapsLogger: AAPSLogger
init {
tasks.add(MinimumDurationTask(this, T.days(5).msecs()))
tasks.add(MinimumDurationTask(this, T.mins(5).msecs()))
tasks.add(
object : Task(this, R.string.closedmodeenabled) {
override fun isCompleted(): Boolean {

View file

@ -13,7 +13,7 @@ class Objective6(injector: HasAndroidInjector) : Objective(injector, "maxiob", R
@Inject lateinit var constraintChecker: ConstraintsChecker
init {
tasks.add(MinimumDurationTask(this, T.days(1).msecs()))
tasks.add(MinimumDurationTask(this, T.mins(1).msecs()))
tasks.add(
object : Task(this, R.string.closedmodeenabled) {
override fun isCompleted(): Boolean = ApsMode.fromString(sp.getString(app.aaps.core.utils.R.string.key_aps_mode, ApsMode.OPEN.name)) == ApsMode.CLOSED

View file

@ -8,7 +8,7 @@ class Objective7(injector: HasAndroidInjector) : Objective(injector, "autosens",
init {
tasks.add(
MinimumDurationTask(this, T.days(7).msecs())
MinimumDurationTask(this, T.mins(7).msecs())
.learned(Learned(R.string.objectives_autosens_learned))
)
}

View file

@ -8,7 +8,7 @@ class Objective9(injector: HasAndroidInjector) : Objective(injector, "smb", R.st
init {
tasks.add(
MinimumDurationTask(this, T.days(28).msecs())
MinimumDurationTask(this, T.mins(28).msecs())
.learned(Learned(R.string.objectives_smb_learned))
)
}