diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt index b595da0409..afc7f59b97 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -400,7 +400,7 @@ open class VirtualPumpPlugin @Inject constructor( aapsLogger.debug(LTag.PUMP, "Pump in configuration: $pumpType, PumpType object: $pumpTypeNew") if (this.pumpType == pumpTypeNew) return aapsLogger.debug(LTag.PUMP, "New pump configuration found ($pumpTypeNew), changing from previous (${this.pumpType})") - pumpDescription.setPumpDescription(pumpTypeNew) + pumpDescription.fillFor(pumpTypeNew) this.pumpType = pumpTypeNew } diff --git a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 1f17b035cc..b98ac52f15 100644 --- a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -160,7 +160,7 @@ public class ComboPlugin extends PumpPluginBase implements Pump, Constraints { this.pumpSync = pumpSync; this.dateUtil = dateUtil; - pumpDescription.setPumpDescription(PumpType.ACCU_CHEK_COMBO); + pumpDescription.fillFor(PumpType.ACCU_CHEK_COMBO); } @Override protected void onStart() { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.kt index 0aec8d7484..136e899a2c 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType class PumpDescription() { constructor(pumpType: PumpType) : this() { - setPumpDescription(pumpType) + fillFor(pumpType) } var pumpType = PumpType.GENERIC_AAPS @@ -69,7 +69,7 @@ class PumpDescription() { hasCustomUnreachableAlertCheck = false } - fun setPumpDescription(pumpType: PumpType) { + fun fillFor(pumpType: PumpType) { resetSettings() this.pumpType = pumpType val pumpCapability = pumpType.pumpCapability ?: return diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt b/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt index cf3b151d4d..7b5cb9c382 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt @@ -82,7 +82,7 @@ class RunningConfiguration @Inject constructor( if (configuration.has("pump")) { val pumpType = JsonHelper.safeGetString(configuration, "pump", PumpType.GENERIC_AAPS.description) sp.putString(R.string.key_virtualpump_type, pumpType) - activePlugin.activePump.pumpDescription.setPumpDescription(PumpType.getByDescription(pumpType)) + activePlugin.activePump.pumpDescription.fillFor(PumpType.getByDescription(pumpType)) aapsLogger.debug(LTag.CORE, "Changing pump type to $pumpType") } diff --git a/core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt b/core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt index 392c7f9791..397619d21a 100644 --- a/core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt @@ -10,7 +10,7 @@ class PumpDescriptionTest { @Test fun setPumpDescription() { val pumpDescription = PumpDescription() - pumpDescription.setPumpDescription(PumpType.ACCU_CHEK_COMBO) + pumpDescription.fillFor(PumpType.ACCU_CHEK_COMBO) Assert.assertEquals(pumpDescription.bolusStep, PumpType.ACCU_CHEK_COMBO.bolusSize, 0.1) Assert.assertEquals(pumpDescription.basalMinimumRate, PumpType.ACCU_CHEK_COMBO.baseBasalStep, 0.1) Assert.assertEquals(pumpDescription.basalStep, PumpType.ACCU_CHEK_COMBO.baseBasalStep, 0.1) diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt b/core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt index 40a6cd3c20..aa3b7944b3 100644 --- a/core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt @@ -51,7 +51,7 @@ class APSResultTest : TestBaseWithProfile() { // BASAL RATE IN TEST PROFILE IS 1U/h // **** PERCENT pump **** - testPumpPlugin.pumpDescription.setPumpDescription(PumpType.CELLNOVO) // % based + testPumpPlugin.pumpDescription.fillFor(PumpType.CELLNOVO) // % based apsResult.usePercent(true) // closed loop mode return original request @@ -109,7 +109,7 @@ class APSResultTest : TestBaseWithProfile() { Assert.assertEquals(true, apsResult.isChangeRequested) // **** ABSOLUTE pump **** - testPumpPlugin.pumpDescription.setPumpDescription(PumpType.MEDTRONIC_515_715) // U/h based + testPumpPlugin.pumpDescription.fillFor(PumpType.MEDTRONIC_515_715) // U/h based apsResult.usePercent(false) // open loop diff --git a/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index 0f9669df39..16616efe46 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -60,7 +60,7 @@ class DanaRKoreanPlugin @Inject constructor( init { pluginDescription.description(R.string.description_pump_dana_r_korean) useExtendedBoluses = sp.getBoolean(R.string.key_danar_useextended, false) - pumpDescription.setPumpDescription(PumpType.DANA_R_KOREAN) + pumpDescription.fillFor(PumpType.DANA_R_KOREAN) } override fun onStart() { diff --git a/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index 34309dd182..86685217ee 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -85,7 +85,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin { getPluginDescription().description(R.string.description_pump_dana_r_v2); useExtendedBoluses = false; - pumpDescription.setPumpDescription(PumpType.DANA_RV2); + pumpDescription.fillFor(PumpType.DANA_RV2); } @Override diff --git a/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index 6aaa1f2bf2..17f831893a 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -74,7 +74,7 @@ public class DanaRPlugin extends AbstractDanaRPlugin { this.fabricPrivacy = fabricPrivacy; useExtendedBoluses = sp.getBoolean(R.string.key_danar_useextended, false); - pumpDescription.setPumpDescription(PumpType.DANA_R); + pumpDescription.fillFor(PumpType.DANA_R); } @Override diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 2ba8ced252..c211d2380e 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -242,7 +242,7 @@ public class LocalInsightPlugin extends PumpPluginBase implements Pump, Constrai this.pumpSync = pumpSync; pumpDescription = new PumpDescription(); - pumpDescription.setPumpDescription(PumpType.ACCU_CHEK_INSIGHT_BLUETOOTH); + pumpDescription.fillFor(PumpType.ACCU_CHEK_INSIGHT_BLUETOOTH); } public TBROverNotificationBlock getTBROverNotificationBlock() { diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java index 47077d5135..d785153d49 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.java @@ -99,7 +99,7 @@ public abstract class PumpPluginAbstract extends PumpPluginBase implements Pump, this.sp = sp; this.commandQueue = commandQueue; - pumpDescription.setPumpDescription(pumpType); + pumpDescription.fillFor(pumpType); this.pumpType = pumpType; this.dateUtil = dateUtil; this.aapsSchedulers = aapsSchedulers; @@ -457,7 +457,7 @@ public abstract class PumpPluginAbstract extends PumpPluginBase implements Pump, public void setPumpType(PumpType pumpType) { this.pumpType = pumpType; - this.pumpDescription.setPumpDescription(pumpType); + this.pumpDescription.fillFor(pumpType); }