From cb4b4b5e21d4fa1414f35111f93d0f9d76fb3e3d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 7 Nov 2021 19:54:15 +0100 Subject: [PATCH] add missing pump types, hide buttons in Action tab, fix configuration sync --- .../androidaps/plugins/general/actions/ActionsFragment.kt | 4 ++-- app/src/main/res/values/arrays.xml | 8 ++++++-- .../plugins/configBuilder/RunningConfiguration.kt | 4 +++- .../androidaps/plugins/pump/common/defs/PumpType.kt | 4 ++-- .../info/nightscout/androidaps/danars/DanaRSPlugin.kt | 3 ++- .../androidaps/danars/comm/DanaRSPacketHistory.kt | 1 - 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index eef25cb442..182b041aed 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -274,7 +274,7 @@ class ActionsFragment : DaggerFragment() { pump.isInitialized() && !pump.isSuspended()).toVisibility() - if (!pump.pumpDescription.isExtendedBolusCapable || !pump.isInitialized() || pump.isSuspended() || pump.isFakingTempsByExtendedBoluses) { + if (!pump.pumpDescription.isExtendedBolusCapable || !pump.isInitialized() || pump.isSuspended() || pump.isFakingTempsByExtendedBoluses || config.NSCLIENT) { extendedBolus?.visibility = View.GONE extendedBolusCancel?.visibility = View.GONE } else { @@ -290,7 +290,7 @@ class ActionsFragment : DaggerFragment() { } } - if (!pump.pumpDescription.isTempBasalCapable || !pump.isInitialized() || pump.isSuspended()) { + if (!pump.pumpDescription.isTempBasalCapable || !pump.isInitialized() || pump.isSuspended() || config.NSCLIENT) { setTempBasal?.visibility = View.GONE cancelTempBasal?.visibility = View.GONE } else { diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 015695e7c0..0453fe87bb 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -92,9 +92,10 @@ Generic AAPS - Accu-Chek Spirit Accu-Chek Combo + Accu-Chek Spirit Accu-Chek Insight + Accu-Chek Solo Animas Ping Animas Vibe Cellnovo @@ -102,13 +103,16 @@ DanaR Korean DanaRS DanaRv2 - Insulet Omnipod + DanaI + Diaconn G8 Medtronic 512/712 Medtronic 515/715 Medtronic 522/722 Medtronic 523/723 (Revel) Medtronic 554/754 (Veo) Medtronic 640G + Omnipod Dash + Omnipod Eros Tandem t:slim Tandem t:flex Tandem t:slim G4 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 fa4208f8ab..0b4a573681 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 @@ -34,11 +34,13 @@ class RunningConfiguration @Inject constructor( // called in AAPS mode only fun configuration(): JSONObject { val json = JSONObject() + val pumpInterface = activePlugin.activePump + + if (!pumpInterface.isInitialized()) return json if (counter++ % every == 0) try { val insulinInterface = activePlugin.activeInsulin val sensitivityInterface = activePlugin.activeSensitivity - val pumpInterface = activePlugin.activePump val overviewInterface = activePlugin.activeOverview val safetyInterface = activePlugin.activeSafety diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt index 7665621d9f..8783644cde 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt @@ -297,9 +297,9 @@ enum class PumpType { source = Sources.MDI), //Diaconn Pump - DIACONN_G8(description = "DiaconnG8", + DIACONN_G8(description = "Diaconn G8", manufacturer = ManufacturerType.G2e, - model = "Diaconn G8", + model = "DiaconnG8", bolusSize = 0.01, specialBolusSize = null, extendedBolusSettings = DoseSettings(0.05, 10, 5 * 60, 0.05), diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index ec916d0f11..bf7c6c01bc 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -81,7 +81,8 @@ class DanaRSPlugin @Inject constructor( private var danaRSService: DanaRSService? = null private var mDeviceAddress = "" var mDeviceName = "" - override val pumpDescription = PumpDescription(PumpType.DANA_RS) + override val pumpDescription + get() = PumpDescription(danaPump.pumpType()) override fun updatePreferenceSummary(pref: Preference) { super.updatePreferenceSummary(pref) diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt index ce51734317..40e630c545 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt @@ -9,7 +9,6 @@ import info.nightscout.androidaps.events.EventDanaRSyncStatus import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBus -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.utils.T import org.joda.time.DateTime import java.util.*