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 override fun isCompleted(): Boolean = answered
fun isEnabledAnswer(): Boolean = disabledTo < dateUtil.now() fun isEnabledAnswer(): Boolean = true
fun option(option: Option): ExamTask { fun option(option: Option): ExamTask {
options.add(option) options.add(option)
@ -187,4 +187,4 @@ abstract class Objective(injector: HasAndroidInjector, spName: String, @StringRe
} }
inner class Learned internal constructor(@StringRes var learned: Int) 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? val tidepoolPlugin get() = activePlugin.getSpecificPluginsListByInterface(Tidepool::class.java).firstOrNull() as Tidepool?
init { 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) { tasks.add(object : Task(this, R.string.synchaswritepermission) {
override fun isCompleted(): Boolean { override fun isCompleted(): Boolean {
return activePlugin.firstActiveSync?.hasWritePermission == true || tidepoolPlugin?.hasWritePermission == true return activePlugin.firstActiveSync?.hasWritePermission == true || tidepoolPlugin?.hasWritePermission == true
@ -41,13 +36,6 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R
return !virtualPumpPlugin.isEnabled() 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) { tasks.add(object : Task(this, R.string.hasbgdata) {
override fun isCompleted(): Boolean { override fun isCompleted(): Boolean {
return iobCobCalculator.ads.lastBg() != null 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 { init {
tasks.add( tasks.add(
MinimumDurationTask(this, T.days(28).msecs()) MinimumDurationTask(this, T.mins(28).msecs())
.learned(Learned(R.string.objectives_autosens_learned)) .learned(Learned(R.string.objectives_autosens_learned))
) )
} }

View file

@ -8,7 +8,7 @@ class Objective11(injector: HasAndroidInjector) : Objective(injector, "dyn_isf",
init { init {
tasks.add( tasks.add(
MinimumDurationTask(this, T.days(28).msecs()) MinimumDurationTask(this, T.mins(28).msecs())
.learned(Learned(R.string.objectives_dyn_isf_learned)) .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 @Inject lateinit var activePlugin: ActivePlugin
init { init {
tasks.add(MinimumDurationTask(this, T.days(7).msecs())) tasks.add(MinimumDurationTask(this, T.mins(7).msecs()))
tasks.add( tasks.add(
object : Task(this, R.string.objectives_manualenacts) { object : Task(this, R.string.objectives_manualenacts) {
override fun isCompleted(): Boolean { override fun isCompleted(): Boolean {

View file

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

View file

@ -13,7 +13,7 @@ class Objective6(injector: HasAndroidInjector) : Objective(injector, "maxiob", R
@Inject lateinit var constraintChecker: ConstraintsChecker @Inject lateinit var constraintChecker: ConstraintsChecker
init { init {
tasks.add(MinimumDurationTask(this, T.days(1).msecs())) tasks.add(MinimumDurationTask(this, T.mins(1).msecs()))
tasks.add( tasks.add(
object : Task(this, R.string.closedmodeenabled) { 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 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 { init {
tasks.add( tasks.add(
MinimumDurationTask(this, T.days(7).msecs()) MinimumDurationTask(this, T.mins(7).msecs())
.learned(Learned(R.string.objectives_autosens_learned)) .learned(Learned(R.string.objectives_autosens_learned))
) )
} }

View file

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