From 8dc346e4c8f1a98b89d1117942e156f06babbee8 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 4 Dec 2022 17:07:47 +0100 Subject: [PATCH] rename --- .../info/nightscout/plugins/aps/OpenAPSFragment.kt | 8 ++++---- ...enAPSUpdateResultGui.kt => EventResetOpenAPSGui.kt} | 2 +- .../plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt | 10 +++++----- .../plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) rename plugins/aps/src/main/java/info/nightscout/plugins/aps/events/{EventOpenAPSUpdateResultGui.kt => EventResetOpenAPSGui.kt} (56%) diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/OpenAPSFragment.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/OpenAPSFragment.kt index f0453a78bb..5bc4c7d367 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/OpenAPSFragment.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/OpenAPSFragment.kt @@ -17,7 +17,7 @@ import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.plugins.aps.databinding.OpenapsFragmentBinding import info.nightscout.plugins.aps.events.EventOpenAPSUpdateGui -import info.nightscout.plugins.aps.events.EventOpenAPSUpdateResultGui +import info.nightscout.plugins.aps.events.EventResetOpenAPSGui import info.nightscout.plugins.aps.utils.JSONFormatter import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -97,10 +97,10 @@ class OpenAPSFragment : DaggerFragment(), MenuProvider { updateGUI() }, fabricPrivacy::logException) disposable += rxBus - .toObservable(EventOpenAPSUpdateResultGui::class.java) + .toObservable(EventResetOpenAPSGui::class.java) .observeOn(aapsSchedulers.main) .subscribe({ - updateResultGUI(it.text) + resetGUI(it.text) }, fabricPrivacy::logException) updateGUI() @@ -156,7 +156,7 @@ class OpenAPSFragment : DaggerFragment(), MenuProvider { } @Synchronized - private fun updateResultGUI(text: String) { + private fun resetGUI(text: String) { if (_binding == null) return binding.result.text = text binding.glucosestatus.text = "" diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventOpenAPSUpdateResultGui.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventResetOpenAPSGui.kt similarity index 56% rename from plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventOpenAPSUpdateResultGui.kt rename to plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventResetOpenAPSGui.kt index e423d34b42..da52c3d99f 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventOpenAPSUpdateResultGui.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventResetOpenAPSGui.kt @@ -2,4 +2,4 @@ package info.nightscout.plugins.aps.events import info.nightscout.rx.events.EventUpdateGui -class EventOpenAPSUpdateResultGui(val text: String) : EventUpdateGui() +class EventResetOpenAPSGui(val text: String) : EventUpdateGui() diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index 4618730d84..c76ee7d1ae 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -27,7 +27,7 @@ import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.aps.OpenAPSFragment import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.events.EventOpenAPSUpdateGui -import info.nightscout.plugins.aps.events.EventOpenAPSUpdateResultGui +import info.nightscout.plugins.aps.events.EventResetOpenAPSGui import info.nightscout.plugins.aps.utils.ScriptReader import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger @@ -100,17 +100,17 @@ class OpenAPSAMAPlugin @Inject constructor( val profile = profileFunction.getProfile() val pump = activePlugin.activePump if (profile == null) { - rxBus.send(EventOpenAPSUpdateResultGui(rh.gs(info.nightscout.core.ui.R.string.no_profile_set))) + rxBus.send(EventResetOpenAPSGui(rh.gs(info.nightscout.core.ui.R.string.no_profile_set))) aapsLogger.debug(LTag.APS, rh.gs(info.nightscout.core.ui.R.string.no_profile_set)) return } if (!isEnabled()) { - rxBus.send(EventOpenAPSUpdateResultGui(rh.gs(R.string.openapsma_disabled))) + rxBus.send(EventResetOpenAPSGui(rh.gs(R.string.openapsma_disabled))) aapsLogger.debug(LTag.APS, rh.gs(R.string.openapsma_disabled)) return } if (glucoseStatus == null) { - rxBus.send(EventOpenAPSUpdateResultGui(rh.gs(R.string.openapsma_no_glucose_data))) + rxBus.send(EventResetOpenAPSGui(rh.gs(R.string.openapsma_no_glucose_data))) aapsLogger.debug(LTag.APS, rh.gs(R.string.openapsma_no_glucose_data)) return } @@ -167,7 +167,7 @@ class OpenAPSAMAPlugin @Inject constructor( if (constraintChecker.isAutosensModeEnabled().value()) { val autosensData = iobCobCalculator.getLastAutosensDataWithWaitForCalculationFinish("OpenAPSPlugin") if (autosensData == null) { - rxBus.send(EventOpenAPSUpdateResultGui(rh.gs(R.string.openaps_no_as_data))) + rxBus.send(EventResetOpenAPSGui(rh.gs(R.string.openaps_no_as_data))) return } lastAutosensResult = autosensData.autosensResult diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index 131c60a46e..b60afe4e66 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -104,17 +104,17 @@ class OpenAPSSMBPlugin @Inject constructor( val profile = profileFunction.getProfile() val pump = activePlugin.activePump if (profile == null) { - rxBus.send(info.nightscout.plugins.aps.events.EventOpenAPSUpdateResultGui(rh.gs(info.nightscout.core.ui.R.string.no_profile_set))) + rxBus.send(info.nightscout.plugins.aps.events.EventResetOpenAPSGui(rh.gs(info.nightscout.core.ui.R.string.no_profile_set))) aapsLogger.debug(LTag.APS, rh.gs(info.nightscout.core.ui.R.string.no_profile_set)) return } if (!isEnabled()) { - rxBus.send(info.nightscout.plugins.aps.events.EventOpenAPSUpdateResultGui(rh.gs(R.string.openapsma_disabled))) + rxBus.send(info.nightscout.plugins.aps.events.EventResetOpenAPSGui(rh.gs(R.string.openapsma_disabled))) aapsLogger.debug(LTag.APS, rh.gs(R.string.openapsma_disabled)) return } if (glucoseStatus == null) { - rxBus.send(info.nightscout.plugins.aps.events.EventOpenAPSUpdateResultGui(rh.gs(R.string.openapsma_no_glucose_data))) + rxBus.send(info.nightscout.plugins.aps.events.EventResetOpenAPSGui(rh.gs(R.string.openapsma_no_glucose_data))) aapsLogger.debug(LTag.APS, rh.gs(R.string.openapsma_no_glucose_data)) return } @@ -169,7 +169,7 @@ class OpenAPSSMBPlugin @Inject constructor( if (constraintChecker.isAutosensModeEnabled().value()) { val autosensData = iobCobCalculator.getLastAutosensDataWithWaitForCalculationFinish("OpenAPSPlugin") if (autosensData == null) { - rxBus.send(info.nightscout.plugins.aps.events.EventOpenAPSUpdateResultGui(rh.gs(R.string.openaps_no_as_data))) + rxBus.send(info.nightscout.plugins.aps.events.EventResetOpenAPSGui(rh.gs(R.string.openaps_no_as_data))) return } lastAutosensResult = autosensData.autosensResult