diff --git a/core/utils/src/main/res/values/keys.xml b/core/utils/src/main/res/values/keys.xml
index b98cdfe2c0..8493fae85b 100644
--- a/core/utils/src/main/res/values/keys.xml
+++ b/core/utils/src/main/res/values/keys.xml
@@ -155,5 +155,6 @@
virtualpump_uploadstatus
openapsama_useautosens
used_autosens_on_main_phone
+ openapsma_max_basal
\ No newline at end of file
diff --git a/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt
index c1c289b315..3d63cab18b 100644
--- a/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt
+++ b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt
@@ -247,7 +247,7 @@ class OpenAPSAMAPlugin @Inject constructor(
override fun applyBasalConstraints(absoluteRate: Constraint, profile: Profile): Constraint {
if (isEnabled()) {
- var maxBasal = sp.getDouble(R.string.key_openapsma_max_basal, 1.0)
+ var maxBasal = sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 1.0)
if (maxBasal < profile.getMaxDailyBasal()) {
maxBasal = profile.getMaxDailyBasal()
absoluteRate.addReason(rh.gs(R.string.increasing_max_basal), this)
diff --git a/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt
index 8671217cea..a8e3bd68cd 100644
--- a/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt
+++ b/plugins/aps/src/main/kotlin/app/aaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt
@@ -313,7 +313,7 @@ open class OpenAPSSMBPlugin @Inject constructor(
override fun applyBasalConstraints(absoluteRate: Constraint, profile: Profile): Constraint {
if (isEnabled()) {
- var maxBasal = sp.getDouble(R.string.key_openapsma_max_basal, 1.0)
+ var maxBasal = sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 1.0)
if (maxBasal < profile.getMaxDailyBasal()) {
maxBasal = profile.getMaxDailyBasal()
absoluteRate.addReason(rh.gs(R.string.increasing_max_basal), this)
diff --git a/plugins/aps/src/main/res/values/strings.xml b/plugins/aps/src/main/res/values/strings.xml
index 62774fbfc0..6dd6a65a33 100644
--- a/plugins/aps/src/main/res/values/strings.xml
+++ b/plugins/aps/src/main/res/values/strings.xml
@@ -22,7 +22,6 @@
lgsThreshold
DynISFAdjust
dynisf_adjust_sensitivity
- openapsma_max_basal
Adjust sensitivity and BG
DynamicISF Adjustment Factor %
diff --git a/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective4.kt b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective4.kt
index bf4991b645..36ae040e1a 100644
--- a/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective4.kt
+++ b/plugins/constraints/src/main/kotlin/app/aaps/plugins/constraints/objectives/objectives/Objective4.kt
@@ -21,9 +21,9 @@ class Objective4(injector: HasAndroidInjector) : Objective(injector, "maxbasal",
object : Task(this, R.string.objectives_maxbasal_gate) {
override fun isCompleted(): Boolean {
val profile = profileFunction.getProfile() ?: return false
- val maxBasalSet = (activePlugin.activeAPS as PluginConstraints).applyBasalConstraints(ConstraintObject(Double.MAX_VALUE, aapsLogger), profile)
+ val maxBasalSet = sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 0.0)
val maxDailyBasal = profile.getMaxDailyBasal()
- return maxBasalSet.value() > 2.8 * maxDailyBasal
+ return maxBasalSet > 2.8 * maxDailyBasal
}
}.learned(Learned(R.string.objectives_maxbasal_learned))
)
diff --git a/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImplTest.kt b/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImplTest.kt
index 9d9ce076bc..932a6d89c0 100644
--- a/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImplTest.kt
+++ b/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/ConstraintsCheckerImplTest.kt
@@ -316,7 +316,7 @@ class ConstraintsCheckerImplTest : TestBaseWithProfile() {
// insightPlugin.setStatusResult(result);
// No limit by default
- `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
+ `when`(sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0)
`when`(sp.getString(app.aaps.core.utils.R.string.key_age, "")).thenReturn("child")
@@ -343,7 +343,7 @@ class ConstraintsCheckerImplTest : TestBaseWithProfile() {
// insightPlugin.setStatusResult(result);
// No limit by default
- `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
+ `when`(sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0)
`when`(sp.getString(app.aaps.core.utils.R.string.key_age, "")).thenReturn("child")
diff --git a/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/safety/SafetyPluginTest.kt b/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/safety/SafetyPluginTest.kt
index d990ba7893..3a78c2115d 100644
--- a/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/safety/SafetyPluginTest.kt
+++ b/plugins/constraints/src/test/kotlin/app/aaps/plugins/constraints/safety/SafetyPluginTest.kt
@@ -138,7 +138,7 @@ class SafetyPluginTest : TestBaseWithProfile() {
@Test
fun basalRateShouldBeLimited() {
- `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
+ `when`(sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0)
`when`(sp.getString(app.aaps.core.utils.R.string.key_age, "")).thenReturn("child")
@@ -167,7 +167,7 @@ class SafetyPluginTest : TestBaseWithProfile() {
@Test
fun percentBasalRateShouldBeLimited() {
// No limit by default
- `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
+ `when`(sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0)
`when`(sp.getString(app.aaps.core.utils.R.string.key_age, "")).thenReturn("child")
@@ -190,7 +190,7 @@ Safety: Limiting max basal rate to 500.00 U/h because of pump limit
@Test
fun percentBasalShouldBeLimitedBySMB() {
// No limit by default
- `when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
+ `when`(sp.getDouble(app.aaps.core.utils.R.string.key_openapsma_max_basal, 1.0)).thenReturn(1.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_current_basal_safety_multiplier, 4.0)).thenReturn(4.0)
`when`(sp.getDouble(app.aaps.plugins.aps.R.string.key_openapsama_max_daily_safety_multiplier, 3.0)).thenReturn(3.0)
`when`(sp.getString(app.aaps.core.utils.R.string.key_age, "")).thenReturn("child")