From 0de7413427a238fc3819327fd3acd8f1b603b942 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 1 Sep 2019 09:59:34 +0200 Subject: [PATCH 01/14] use constants in objectives --- .../objectives/ObjectivesPlugin.java | 31 ++++++++++++------- .../androidaps/setupwizard/SWDefinition.java | 4 +-- .../interfaces/ConstraintsCheckerTest.java | 8 ++--- .../objectives/ObjectivesPluginTest.java | 12 +++---- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java index 1d18cd14b4..9cc553dfd0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java @@ -42,6 +42,13 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface public boolean pumpStatusIsAvailableInNS = false; public Integer manualEnacts = 0; + public static final int FIRST_OBJECTIVE = 0; + public static final int CLOSED_LOOP_OBJECTIVE = 3; + public static final int MAXIOB_ZERO_OBJECTIVE = 3; + public static final int AUTOSENS_OBJECTIVE = 5; + public static final int AMA_OBJECTIVE = 6; + public static final int SMB_OBJECTIVE = 7; + public static ObjectivesPlugin getPlugin() { if (objectivesPlugin == null) { objectivesPlugin = new ObjectivesPlugin(); @@ -121,43 +128,43 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface **/ @Override public Constraint isLoopInvocationAllowed(Constraint value) { - if (!objectives.get(0).isStarted()) - value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 1), this); + if (!objectives.get(FIRST_OBJECTIVE).isStarted()) + value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), FIRST_OBJECTIVE + 1), this); return value; } @Override public Constraint isClosedLoopAllowed(Constraint value) { - if (!objectives.get(3).isStarted()) - value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 4), this); + if (!objectives.get(CLOSED_LOOP_OBJECTIVE).isStarted()) + value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), CLOSED_LOOP_OBJECTIVE + 1), this); return value; } @Override public Constraint isAutosensModeEnabled(Constraint value) { - if (!objectives.get(5).isStarted()) - value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 6), this); + if (!objectives.get(AUTOSENS_OBJECTIVE).isStarted()) + value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), AUTOSENS_OBJECTIVE + 1), this); return value; } @Override public Constraint isAMAModeEnabled(Constraint value) { - if (!objectives.get(6).isStarted()) - value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 7), this); + if (!objectives.get(AMA_OBJECTIVE).isStarted()) + value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), AMA_OBJECTIVE + 1), this); return value; } @Override public Constraint isSMBModeEnabled(Constraint value) { - if (!objectives.get(7).isStarted()) - value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 8), this); + if (!objectives.get(SMB_OBJECTIVE).isStarted()) + value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), SMB_OBJECTIVE + 1), this); return value; } @Override public Constraint applyMaxIOBConstraints(Constraint maxIob) { - if (objectives.get(3).isStarted() && !objectives.get(3).isAccomplished()) - maxIob.set(0d, String.format(MainApp.gs(R.string.objectivenotfinished), 4), this); + if (objectives.get(MAXIOB_ZERO_OBJECTIVE).isStarted() && !objectives.get(MAXIOB_ZERO_OBJECTIVE).isAccomplished()) + maxIob.set(0d, String.format(MainApp.gs(R.string.objectivenotfinished), MAXIOB_ZERO_OBJECTIVE + 1), this); return maxIob; } diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java index cbc0af6491..065f56e803 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java @@ -425,8 +425,8 @@ public class SWDefinition { .add(new SWBreak()) .add(new SWFragment(this) .add(new ObjectivesFragment())) - .validator(() -> ObjectivesPlugin.getPlugin().objectives.get(0).isStarted()) - .visibility(() -> !ObjectivesPlugin.getPlugin().objectives.get(0).isStarted() && Config.APS); + .validator(() -> ObjectivesPlugin.getPlugin().objectives.get(ObjectivesPlugin.FIRST_OBJECTIVE).isStarted()) + .visibility(() -> !ObjectivesPlugin.getPlugin().objectives.get(ObjectivesPlugin.FIRST_OBJECTIVE).isStarted() && Config.APS); private void SWDefinitionFull() { // List all the screens here diff --git a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java index edfd30180a..a0e595cd97 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java @@ -75,7 +75,7 @@ public class ConstraintsCheckerTest { @Test public void isClosedLoopAllowedTest() throws Exception { when(SP.getString(R.string.key_aps_mode, "open")).thenReturn("closed"); - objectivesPlugin.objectives.get(3).setStartedOn(null); + objectivesPlugin.objectives.get(ObjectivesPlugin.CLOSED_LOOP_OBJECTIVE).setStartedOn(null); Constraint c = constraintChecker.isClosedLoopAllowed(); Assert.assertEquals(true, c.getReasonList().size() == 2); // Safety & Objectives @@ -91,7 +91,7 @@ public class ConstraintsCheckerTest { @Test public void isAutosensModeEnabledTest() throws Exception { - objectivesPlugin.objectives.get(5).setStartedOn(null); + objectivesPlugin.objectives.get(ObjectivesPlugin.AUTOSENS_OBJECTIVE).setStartedOn(null); when(SP.getBoolean(R.string.key_openapsama_useautosens, false)).thenReturn(false); Constraint c = constraintChecker.isAutosensModeEnabled(); @@ -102,7 +102,7 @@ public class ConstraintsCheckerTest { @Test public void isAMAModeEnabledTest() throws Exception { - objectivesPlugin.objectives.get(6).setStartedOn(null); + objectivesPlugin.objectives.get(ObjectivesPlugin.AMA_OBJECTIVE).setStartedOn(null); Constraint c = constraintChecker.isAMAModeEnabled(); Assert.assertEquals(true, c.getReasonList().size() == 1); // Objectives @@ -130,7 +130,7 @@ public class ConstraintsCheckerTest { @Test public void isSMBModeEnabledTest() throws Exception { - objectivesPlugin.objectives.get(7).setStartedOn(null); + objectivesPlugin.objectives.get(ObjectivesPlugin.SMB_OBJECTIVE).setStartedOn(null); when(SP.getBoolean(R.string.key_use_smb, false)).thenReturn(false); when(MainApp.getConstraintChecker().isClosedLoopAllowed()).thenReturn(new Constraint<>(true)); diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.java index 913b8fdda0..a6bbd98122 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.java @@ -28,18 +28,18 @@ public class ObjectivesPluginTest { @Test public void notStartedObjectivesShouldLimitLoopInvocation() throws Exception { - objectivesPlugin.objectives.get(0).setStartedOn(null); + objectivesPlugin.objectives.get(ObjectivesPlugin.FIRST_OBJECTIVE).setStartedOn(null); Constraint c = new Constraint<>(true); c = objectivesPlugin.isLoopInvocationAllowed(c); Assert.assertEquals("Objectives: Objective 1 not started", c.getReasons()); Assert.assertEquals(Boolean.FALSE, c.value()); - objectivesPlugin.objectives.get(0).setStartedOn(new Date()); + objectivesPlugin.objectives.get(ObjectivesPlugin.FIRST_OBJECTIVE).setStartedOn(new Date()); } @Test public void notStartedObjective4ShouldLimitClosedLoop() throws Exception { - objectivesPlugin.objectives.get(3).setStartedOn(null); + objectivesPlugin.objectives.get(ObjectivesPlugin.CLOSED_LOOP_OBJECTIVE).setStartedOn(null); Constraint c = new Constraint<>(true); c = objectivesPlugin.isClosedLoopAllowed(c); @@ -49,7 +49,7 @@ public class ObjectivesPluginTest { @Test public void notStartedObjective6ShouldLimitAutosensMode() throws Exception { - objectivesPlugin.objectives.get(5).setStartedOn(null); + objectivesPlugin.objectives.get(ObjectivesPlugin.AUTOSENS_OBJECTIVE).setStartedOn(null); Constraint c = new Constraint<>(true); c = objectivesPlugin.isAutosensModeEnabled(c); @@ -59,7 +59,7 @@ public class ObjectivesPluginTest { @Test public void notStartedObjective7ShouldLimitAMAMode() throws Exception { - objectivesPlugin.objectives.get(6).setStartedOn(null); + objectivesPlugin.objectives.get(ObjectivesPlugin.AMA_OBJECTIVE).setStartedOn(null); Constraint c = new Constraint<>(true); c = objectivesPlugin.isAMAModeEnabled(c); @@ -69,7 +69,7 @@ public class ObjectivesPluginTest { @Test public void notStartedObjective8ShouldLimitSMBMode() throws Exception { - objectivesPlugin.objectives.get(7).setStartedOn(null); + objectivesPlugin.objectives.get(ObjectivesPlugin.SMB_OBJECTIVE).setStartedOn(null); Constraint c = new Constraint<>(true); c = objectivesPlugin.isSMBModeEnabled(c); From 3274f372ef8be22bb8026800a12f6a825b168ab6 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 1 Sep 2019 10:33:17 +0200 Subject: [PATCH 02/14] show accomplished --- .../constraints/objectives/ObjectivesFragment.java | 8 ++++++++ .../constraints/objectives/objectives/Objective.java | 4 ++++ app/src/main/res/layout/objectives_item.xml | 9 +++++++++ app/src/main/res/values/strings.xml | 1 + 4 files changed, 22 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java index 7600c017c2..fa6e35ed34 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java @@ -24,6 +24,7 @@ import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.plugins.common.SubscriberFragment; import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective; +import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; public class ObjectivesFragment extends SubscriberFragment { @@ -133,6 +134,7 @@ public class ObjectivesFragment extends SubscriberFragment { holder.gate.setTextColor(0xFFFFFFFF); holder.verify.setVisibility(View.GONE); holder.progress.setVisibility(View.GONE); + holder.accomplished.setVisibility(View.GONE); if (position == 0 || ObjectivesPlugin.getPlugin().getObjectives().get(position - 1).isAccomplished()) holder.start.setVisibility(View.VISIBLE); else holder.start.setVisibility(View.GONE); @@ -141,11 +143,13 @@ public class ObjectivesFragment extends SubscriberFragment { holder.verify.setVisibility(View.GONE); holder.progress.setVisibility(View.GONE); holder.start.setVisibility(View.GONE); + holder.accomplished.setVisibility(View.VISIBLE); } else if (objective.isStarted()) { holder.gate.setTextColor(0xFFFFFFFF); holder.verify.setVisibility(View.VISIBLE); holder.verify.setEnabled(objective.isCompleted() || enableFake.isChecked()); holder.start.setVisibility(View.GONE); + holder.accomplished.setVisibility(View.GONE); if(objective.isRevertable()) { holder.revert.setVisibility(View.VISIBLE); } @@ -161,6 +165,8 @@ public class ObjectivesFragment extends SubscriberFragment { holder.progress.addView(textView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); } } + holder.accomplished.setText(MainApp.gs(R.string.accomplished, DateUtil.dateAndTimeString(objective.getAccomplishedOn()))); + holder.accomplished.setTextColor(0xFFC1C1C1); holder.verify.setOnClickListener((view) -> { objective.setAccomplishedOn(new Date()); notifyDataSetChanged(); @@ -198,6 +204,7 @@ public class ObjectivesFragment extends SubscriberFragment { public TextView title; public TextView objective; public TextView gate; + public TextView accomplished; public LinearLayout progress; public Button verify; public Button start; @@ -213,6 +220,7 @@ public class ObjectivesFragment extends SubscriberFragment { verify = itemView.findViewById(R.id.objective_verify); start = itemView.findViewById(R.id.objective_start); revert = itemView.findViewById(R.id.objective_back); + accomplished = itemView.findViewById(R.id.objective_accomplished); } } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java index 55aba1b49f..936e028104 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java @@ -76,6 +76,10 @@ public abstract class Objective { SP.putLong("Objectives" + number + "accomplished", accomplishedOn == null ? 0 : accomplishedOn.getTime()); } + public Date getAccomplishedOn() { + return accomplishedOn; + } + protected void setupTasks(List tasks) { } diff --git a/app/src/main/res/layout/objectives_item.xml b/app/src/main/res/layout/objectives_item.xml index 7a7f461433..d11992b13f 100644 --- a/app/src/main/res/layout/objectives_item.xml +++ b/app/src/main/res/layout/objectives_item.xml @@ -71,6 +71,15 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/objectives_button_back" /> + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7af0131011..b19dbe0022 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1605,6 +1605,7 @@ Bolus wizard performs calculation but only this part of calculated insulin is delivered. Useful with SMB algorithm. Loading ... Snooze + Accomplished: %1$s %1$d day From 80efc9369c5a74e8c5c8e6b5b6056f2652bae03d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 1 Sep 2019 13:43:11 +0200 Subject: [PATCH 03/14] new objective Using AAPS --- .../info/nightscout/androidaps/MainApp.java | 15 ++-- .../plugins/aps/loop/LoopFragment.kt | 6 +- .../configBuilder/ProfileFunctions.java | 3 + .../objectives/ObjectivesFragment.java | 50 +++++------ .../objectives/ObjectivesPlugin.java | 27 +++--- .../objectives/objectives/Objective.java | 31 +++---- .../objectives/objectives/Objective0.java | 84 ++++++++++++++++++ .../objectives/objectives/Objective1.java | 55 ++++-------- .../objectives/objectives/Objective2.java | 2 +- .../objectives/objectives/Objective3.java | 3 +- .../objectives/objectives/Objective4.java | 3 +- .../objectives/objectives/Objective5.java | 3 +- .../objectives/objectives/Objective6.java | 3 +- .../objectives/objectives/Objective7.java | 3 +- .../objectives/objectives/Objective8.java | 3 +- .../general/actions/ActionsFragment.java | 87 ++++++++----------- .../general/actions/ActionsPlugin.java | 23 ----- .../plugins/general/actions/ActionsPlugin.kt | 13 +++ .../Dialogs/NewNSTreatmentDialog.java | 2 + .../general/overview/OverviewFragment.java | 3 + app/src/main/res/values-af-rZA/strings.xml | 26 +++--- app/src/main/res/values-bg-rBG/strings.xml | 26 +++--- app/src/main/res/values-cs-rCZ/strings.xml | 26 +++--- app/src/main/res/values-de-rDE/strings.xml | 26 +++--- app/src/main/res/values-el-rGR/strings.xml | 26 +++--- app/src/main/res/values-es-rES/strings.xml | 26 +++--- app/src/main/res/values-fr-rFR/strings.xml | 26 +++--- app/src/main/res/values-it-rIT/strings.xml | 26 +++--- app/src/main/res/values-ko-rKR/strings.xml | 26 +++--- app/src/main/res/values-lt-rLT/strings.xml | 26 +++--- app/src/main/res/values-nl-rNL/strings.xml | 26 +++--- app/src/main/res/values-pl-rPL/strings.xml | 26 +++--- app/src/main/res/values-pt-rBR/strings.xml | 26 +++--- app/src/main/res/values-pt-rPT/strings.xml | 26 +++--- app/src/main/res/values-ro-rRO/strings.xml | 26 +++--- app/src/main/res/values-ru-rRU/strings.xml | 26 +++--- app/src/main/res/values-sk-rSK/strings.xml | 26 +++--- app/src/main/res/values-sv-rSE/strings.xml | 26 +++--- app/src/main/res/values-tr-rTR/strings.xml | 26 +++--- app/src/main/res/values-zh-rCN/strings.xml | 26 +++--- app/src/main/res/values/strings.xml | 42 ++++++--- 41 files changed, 521 insertions(+), 460 deletions(-) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.java delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.java create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index f2edd23882..7e0918c155 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -1,14 +1,10 @@ package info.nightscout.androidaps; import android.app.Application; -import android.bluetooth.BluetoothAdapter; import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; import android.os.SystemClock; -import android.util.Log; import androidx.annotation.Nullable; import androidx.annotation.PluralsRes; @@ -44,7 +40,7 @@ import info.nightscout.androidaps.plugins.constraints.dstHelper.DstHelperPlugin; import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin; import info.nightscout.androidaps.plugins.constraints.storage.StorageConstraintPlugin; -import info.nightscout.androidaps.plugins.general.actions.ActionsFragment; +import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin; import info.nightscout.androidaps.plugins.general.automation.AutomationPlugin; import info.nightscout.androidaps.plugins.general.careportal.CareportalPlugin; import info.nightscout.androidaps.plugins.general.food.FoodPlugin; @@ -70,8 +66,6 @@ import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin; import info.nightscout.androidaps.plugins.profile.ns.NSProfilePlugin; import info.nightscout.androidaps.plugins.profile.simple.SimpleProfilePlugin; import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin; -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.danaR.DanaRPlugin; import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin; @@ -177,7 +171,7 @@ public class MainApp extends Application { // Register all tabs in app here pluginsList.add(OverviewPlugin.getPlugin()); pluginsList.add(IobCobCalculatorPlugin.getPlugin()); - if (Config.ACTION) pluginsList.add(ActionsFragment.getPlugin()); + if (Config.ACTION) pluginsList.add(ActionsPlugin.INSTANCE); pluginsList.add(InsulinOrefRapidActingPlugin.getPlugin()); pluginsList.add(InsulinOrefUltraRapidActingPlugin.getPlugin()); pluginsList.add(InsulinOrefFreePeakPlugin.getPlugin()); @@ -192,7 +186,8 @@ public class MainApp extends Application { if (Config.PUMPDRIVERS) pluginsList.add(LocalInsightPlugin.getPlugin()); pluginsList.add(CareportalPlugin.getPlugin()); if (Config.PUMPDRIVERS) pluginsList.add(ComboPlugin.getPlugin()); - if (Config.PUMPDRIVERS && engineeringMode) pluginsList.add(MedtronicPumpPlugin.getPlugin()); + if (Config.PUMPDRIVERS && engineeringMode) + pluginsList.add(MedtronicPumpPlugin.getPlugin()); if (Config.MDI) pluginsList.add(MDIPlugin.getPlugin()); pluginsList.add(VirtualPumpPlugin.getPlugin()); if (Config.APS) pluginsList.add(LoopPlugin.getPlugin()); @@ -453,7 +448,7 @@ public class MainApp extends Application { unregisterReceiver(btReceiver); } - if (timeDateOrTZChangeReceiver!=null) { + if (timeDateOrTZChangeReceiver != null) { unregisterReceiver(timeDateOrTZChangeReceiver); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt index 2ab594c2a2..b7549fcfed 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt @@ -12,10 +12,7 @@ import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui import info.nightscout.androidaps.plugins.bus.RxBus -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.HtmlHelper -import info.nightscout.androidaps.utils.plusAssign +import info.nightscout.androidaps.utils.* import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.CompositeDisposable import kotlinx.android.synthetic.main.loop_fragment.* @@ -61,6 +58,7 @@ class LoopFragment : Fragment() { }) updateGUI() + SP.putBoolean(R.string.key_objectiveuseloop, true) } @Synchronized diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctions.java b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctions.java index 7c92cd98b3..0e38758e86 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctions.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctions.java @@ -27,6 +27,7 @@ import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperAc import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; import info.nightscout.androidaps.queue.Callback; import info.nightscout.androidaps.utils.FabricPrivacy; +import info.nightscout.androidaps.utils.SP; public class ProfileFunctions { private static Logger log = LoggerFactory.getLogger(L.PROFILE); @@ -159,6 +160,8 @@ public class ProfileFunctions { public static void doProfileSwitch(final ProfileStore profileStore, final String profileName, final int duration, final int percentage, final int timeshift) { ProfileSwitch profileSwitch = prepareProfileSwitch(profileStore, profileName, duration, percentage, timeshift, System.currentTimeMillis()); TreatmentsPlugin.getPlugin().addToHistoryProfileSwitch(profileSwitch); + if (percentage == 90 && duration == 10) + SP.putBoolean(R.string.key_objectiveuseprofileswitch, true); } public static void doProfileSwitch(final int duration, final int percentage, final int timeshift) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java index fa6e35ed34..293d052a27 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java @@ -4,11 +4,6 @@ import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.os.Looper; -import androidx.annotation.NonNull; -import androidx.cardview.widget.CardView; -import androidx.recyclerview.widget.LinearLayoutManager; -import androidx.recyclerview.widget.LinearSmoothScroller; -import androidx.recyclerview.widget.RecyclerView; import android.text.Html; import android.view.LayoutInflater; import android.view.View; @@ -18,7 +13,11 @@ import android.widget.CheckBox; import android.widget.LinearLayout; import android.widget.TextView; -import java.util.Date; +import androidx.annotation.NonNull; +import androidx.cardview.widget.CardView; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.LinearSmoothScroller; +import androidx.recyclerview.widget.RecyclerView; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; @@ -28,11 +27,11 @@ import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; public class ObjectivesFragment extends SubscriberFragment { - RecyclerView recyclerView; - CheckBox enableFake; - TextView reset; - ObjectivesAdapter objectivesAdapter = new ObjectivesAdapter(); - Handler handler = new Handler(Looper.getMainLooper()); + private RecyclerView recyclerView; + private CheckBox enableFake; + private TextView reset; + private ObjectivesAdapter objectivesAdapter = new ObjectivesAdapter(); + private Handler handler = new Handler(Looper.getMainLooper()); private Runnable objectiveUpdater = new Runnable() { @Override @@ -43,7 +42,7 @@ public class ObjectivesFragment extends SubscriberFragment { }; @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { try { View view = inflater.inflate(R.layout.objectives_fragment, container, false); @@ -80,7 +79,7 @@ public class ObjectivesFragment extends SubscriberFragment { handler.removeCallbacks(objectiveUpdater); for (Objective objective : ObjectivesPlugin.getPlugin().getObjectives()) { if (objective.isStarted() && !objective.isAccomplished()) { - long timeTillNextMinute = (System.currentTimeMillis() - objective.getStartedOn().getTime()) % (60 * 1000); + long timeTillNextMinute = (System.currentTimeMillis() - objective.getStartedOn()) % (60 * 1000); handler.postDelayed(objectiveUpdater, timeTillNextMinute); break; } @@ -150,7 +149,7 @@ public class ObjectivesFragment extends SubscriberFragment { holder.verify.setEnabled(objective.isCompleted() || enableFake.isChecked()); holder.start.setVisibility(View.GONE); holder.accomplished.setVisibility(View.GONE); - if(objective.isRevertable()) { + if (objective.isRevertable()) { holder.revert.setVisibility(View.VISIBLE); } holder.progress.setVisibility(View.VISIBLE); @@ -168,23 +167,23 @@ public class ObjectivesFragment extends SubscriberFragment { holder.accomplished.setText(MainApp.gs(R.string.accomplished, DateUtil.dateAndTimeString(objective.getAccomplishedOn()))); holder.accomplished.setTextColor(0xFFC1C1C1); holder.verify.setOnClickListener((view) -> { - objective.setAccomplishedOn(new Date()); + objective.setAccomplishedOn(DateUtil.now()); notifyDataSetChanged(); scrollToCurrentObjective(); startUpdateTimer(); }); holder.start.setOnClickListener((view) -> { - objective.setStartedOn(new Date()); + objective.setStartedOn(DateUtil.now()); notifyDataSetChanged(); scrollToCurrentObjective(); startUpdateTimer(); }); holder.revert.setOnClickListener((view) -> { - objective.setAccomplishedOn(null); - objective.setStartedOn(null); + objective.setAccomplishedOn(0); + objective.setStartedOn(0); if (position > 0) { Objective prevObj = ObjectivesPlugin.getPlugin().getObjectives().get(position - 1); - prevObj.setAccomplishedOn(null); + prevObj.setAccomplishedOn(0); } notifyDataSetChanged(); scrollToCurrentObjective(); @@ -192,7 +191,6 @@ public class ObjectivesFragment extends SubscriberFragment { } - @Override public int getItemCount() { return ObjectivesPlugin.getPlugin().getObjectives().size(); @@ -200,17 +198,17 @@ public class ObjectivesFragment extends SubscriberFragment { public class ViewHolder extends RecyclerView.ViewHolder { - public CardView cardView; + CardView cardView; public TextView title; public TextView objective; - public TextView gate; - public TextView accomplished; + TextView gate; + TextView accomplished; public LinearLayout progress; - public Button verify; + Button verify; public Button start; - public Button revert; + Button revert; - public ViewHolder(View itemView) { + ViewHolder(View itemView) { super(itemView); cardView = (CardView) itemView; title = itemView.findViewById(R.id.objective_title); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java index 9cc553dfd0..f7f566ec3d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java @@ -19,6 +19,7 @@ import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesSaved; import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective; +import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective0; import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective1; import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective2; import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective3; @@ -43,11 +44,14 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface public Integer manualEnacts = 0; public static final int FIRST_OBJECTIVE = 0; - public static final int CLOSED_LOOP_OBJECTIVE = 3; - public static final int MAXIOB_ZERO_OBJECTIVE = 3; - public static final int AUTOSENS_OBJECTIVE = 5; - public static final int AMA_OBJECTIVE = 6; - public static final int SMB_OBJECTIVE = 7; + public static final int USAGE_OBJECTIVE = 1; + public static final int OPENLOOP_OBJECTIVE = 2; + public static final int MAXBASAL_OBJECTIVE = 3; + public static final int MAXIOB_ZERO_CL_OBJECTIVE = 4; + public static final int MAXIOB_OBJECTIVE = 5; + public static final int AUTOSENS_OBJECTIVE = 6; + public static final int AMA_OBJECTIVE = 7; + public static final int SMB_OBJECTIVE = 8; public static ObjectivesPlugin getPlugin() { if (objectivesPlugin == null) { @@ -77,6 +81,7 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface } private void setupObjectives() { + objectives.add(new Objective0()); objectives.add(new Objective1()); objectives.add(new Objective2()); objectives.add(new Objective3()); @@ -89,8 +94,8 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface public void reset() { for (Objective objective : objectives) { - objective.setStartedOn(null); - objective.setAccomplishedOn(null); + objective.setStartedOn(0); + objective.setAccomplishedOn(0); } bgIsAvailableInNS = false; pumpStatusIsAvailableInNS = false; @@ -135,8 +140,8 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface @Override public Constraint isClosedLoopAllowed(Constraint value) { - if (!objectives.get(CLOSED_LOOP_OBJECTIVE).isStarted()) - value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), CLOSED_LOOP_OBJECTIVE + 1), this); + if (!objectives.get(MAXIOB_ZERO_CL_OBJECTIVE).isStarted()) + value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), MAXIOB_ZERO_CL_OBJECTIVE + 1), this); return value; } @@ -163,8 +168,8 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface @Override public Constraint applyMaxIOBConstraints(Constraint maxIob) { - if (objectives.get(MAXIOB_ZERO_OBJECTIVE).isStarted() && !objectives.get(MAXIOB_ZERO_OBJECTIVE).isAccomplished()) - maxIob.set(0d, String.format(MainApp.gs(R.string.objectivenotfinished), MAXIOB_ZERO_OBJECTIVE + 1), this); + if (objectives.get(MAXIOB_ZERO_CL_OBJECTIVE).isStarted() && !objectives.get(MAXIOB_ZERO_CL_OBJECTIVE).isAccomplished()) + maxIob.set(0d, String.format(MainApp.gs(R.string.objectivenotfinished), MAXIOB_ZERO_CL_OBJECTIVE + 1), this); return maxIob; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java index 936e028104..b39301d766 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java @@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives; import androidx.annotation.StringRes; import java.util.ArrayList; -import java.util.Date; import java.util.List; import info.nightscout.androidaps.MainApp; @@ -18,18 +17,16 @@ public abstract class Objective { private int objective; @StringRes private int gate; - private Date startedOn; - private Date accomplishedOn; + private long startedOn; + private long accomplishedOn; private List tasks = new ArrayList<>(); public Objective(int number, @StringRes int objective, @StringRes int gate) { this.number = number; this.objective = objective; this.gate = gate; - startedOn = new Date(SP.getLong("Objectives" + number + "started", 0L)); - if (startedOn.getTime() == 0L) startedOn = null; - accomplishedOn = new Date(SP.getLong("Objectives" + number + "accomplished", 0L)); - if (accomplishedOn.getTime() == 0L) accomplishedOn = null; + startedOn = SP.getLong("Objectives" + number + "started", 0L); + accomplishedOn = SP.getLong("Objectives" + number + "accomplished", 0L); setupTasks(tasks); for (Task task : tasks) task.objective = this; } @@ -47,14 +44,14 @@ public abstract class Objective { } public boolean isAccomplished() { - return accomplishedOn != null; + return accomplishedOn != 0; } public boolean isStarted() { - return startedOn != null; + return startedOn != 0; } - public Date getStartedOn() { + public long getStartedOn() { return startedOn; } @@ -66,17 +63,17 @@ public abstract class Objective { return gate; } - public void setStartedOn(Date startedOn) { + public void setStartedOn(long startedOn) { this.startedOn = startedOn; - SP.putLong("Objectives" + number + "started", startedOn == null ? 0 : startedOn.getTime()); + SP.putLong("Objectives" + number + "started", startedOn); } - public void setAccomplishedOn(Date accomplishedOn) { + public void setAccomplishedOn(long accomplishedOn) { this.accomplishedOn = accomplishedOn; - SP.putLong("Objectives" + number + "accomplished", accomplishedOn == null ? 0 : accomplishedOn.getTime()); + SP.putLong("Objectives" + number + "accomplished", accomplishedOn); } - public Date getAccomplishedOn() { + public long getAccomplishedOn() { return accomplishedOn; } @@ -127,12 +124,12 @@ public abstract class Objective { @Override public boolean isCompleted() { - return getObjective().isStarted() && System.currentTimeMillis() - getObjective().getStartedOn().getTime() >= minimumDuration; + return getObjective().isStarted() && System.currentTimeMillis() - getObjective().getStartedOn() >= minimumDuration; } @Override public String getProgress() { - return getDurationText(System.currentTimeMillis() - getObjective().getStartedOn().getTime()) + return getDurationText(System.currentTimeMillis() - getObjective().getStartedOn()) + " / " + getDurationText(minimumDuration); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.java new file mode 100644 index 0000000000..f59079f0c0 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.java @@ -0,0 +1,84 @@ +package info.nightscout.androidaps.plugins.constraints.objectives.objectives; + +import java.util.List; + +import info.nightscout.androidaps.R; +import info.nightscout.androidaps.db.DatabaseHelper; +import info.nightscout.androidaps.interfaces.APSInterface; +import info.nightscout.androidaps.interfaces.PluginBase; +import info.nightscout.androidaps.interfaces.PluginType; +import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; +import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; +import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin; +import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin; +import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin; +import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; +import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.androidaps.utils.SP; + +public class Objective0 extends Objective { + + public Objective0() { + super(ObjectivesPlugin.FIRST_OBJECTIVE, R.string.objectives_0_objective, R.string.objectives_0_gate); + } + + @Override + protected void setupTasks(List tasks) { + tasks.add(new Task(R.string.objectives_bgavailableinns) { + @Override + public boolean isCompleted() { + return ObjectivesPlugin.getPlugin().bgIsAvailableInNS; + } + }); + tasks.add(new Task(R.string.nsclienthaswritepermission) { + @Override + public boolean isCompleted() { + return NSClientPlugin.getPlugin().hasWritePermission(); + } + }); + tasks.add(new Task(R.string.virtualpump_uploadstatus_title) { + @Override + public boolean isCompleted() { + return SP.getBoolean("virtualpump_uploadstatus", false); + } + + @Override + public boolean shouldBeIgnored() { + return !VirtualPumpPlugin.getPlugin().isEnabled(PluginType.PUMP); + } + }); + tasks.add(new Task(R.string.objectives_pumpstatusavailableinns) { + @Override + public boolean isCompleted() { + return ObjectivesPlugin.getPlugin().pumpStatusIsAvailableInNS; + } + }); + tasks.add(new Task(R.string.hasbgdata) { + @Override + public boolean isCompleted() { + return DatabaseHelper.lastBg() != null; + } + }); + tasks.add(new Task(R.string.loopenabled) { + @Override + public boolean isCompleted() { + return LoopPlugin.getPlugin().isEnabled(PluginType.LOOP); + } + }); + tasks.add(new Task(R.string.apsselected) { + @Override + public boolean isCompleted() { + APSInterface usedAPS = ConfigBuilderPlugin.getPlugin().getActiveAPS(); + if (usedAPS != null && ((PluginBase) usedAPS).isEnabled(PluginType.APS)) + return true; + return false; + } + }); + tasks.add(new Task(R.string.activate_profile) { + @Override + public boolean isCompleted() { + return TreatmentsPlugin.getPlugin().getProfileSwitchFromHistory(DateUtil.now()) != null; + } + }); + } +} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective1.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective1.java index 65a716abab..a6fd4cca52 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective1.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective1.java @@ -3,81 +3,60 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives; import java.util.List; import info.nightscout.androidaps.R; -import info.nightscout.androidaps.db.DatabaseHelper; -import info.nightscout.androidaps.interfaces.APSInterface; -import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginType; -import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; -import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin; -import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin; -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin; -import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; -import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin; import info.nightscout.androidaps.utils.SP; public class Objective1 extends Objective { + public Objective1() { - super(0, R.string.objectives_0_objective, R.string.objectives_0_gate); + super(ObjectivesPlugin.USAGE_OBJECTIVE, R.string.objectives_usage_objective, R.string.objectives_usage_gate); } @Override protected void setupTasks(List tasks) { - tasks.add(new Task(R.string.objectives_bgavailableinns) { + tasks.add(new Task(R.string.objectives_useprofileswitch) { @Override public boolean isCompleted() { - return ObjectivesPlugin.getPlugin().bgIsAvailableInNS; + return SP.getBoolean(R.string.key_objectiveuseprofileswitch, false); } }); - tasks.add(new Task(R.string.nsclienthaswritepermission) { + tasks.add(new Task(R.string.objectives_usedisconnectpump) { @Override public boolean isCompleted() { - return NSClientPlugin.getPlugin().hasWritePermission(); + return SP.getBoolean(R.string.key_objectiveusedisconnect, false); } }); - tasks.add(new Task(R.string.virtualpump_uploadstatus_title) { + tasks.add(new Task(R.string.objectives_usereconnectpump) { @Override public boolean isCompleted() { - return SP.getBoolean("virtualpump_uploadstatus", false); - } - - @Override - public boolean shouldBeIgnored() { - return !VirtualPumpPlugin.getPlugin().isEnabled(PluginType.PUMP); + return SP.getBoolean(R.string.key_objectiveusereconnect, false); } }); - tasks.add(new Task(R.string.objectives_pumpstatusavailableinns) { + tasks.add(new Task(R.string.objectives_usetemptarget) { @Override public boolean isCompleted() { - return ObjectivesPlugin.getPlugin().pumpStatusIsAvailableInNS; + return SP.getBoolean(R.string.key_objectiveusetemptarget, false); } }); - tasks.add(new Task(R.string.hasbgdata) { + tasks.add(new Task(R.string.objectives_useactions) { @Override public boolean isCompleted() { - return DatabaseHelper.lastBg() != null; + return SP.getBoolean(R.string.key_objectiveuseactions, false) && ActionsPlugin.INSTANCE.isEnabled(PluginType.GENERAL) && ActionsPlugin.INSTANCE.isFragmentVisible(); } }); - tasks.add(new Task(R.string.loopenabled) { + tasks.add(new Task(R.string.objectives_useloop) { @Override public boolean isCompleted() { - return LoopPlugin.getPlugin().isEnabled(PluginType.LOOP); + return SP.getBoolean(R.string.key_objectiveuseloop, false); } }); - tasks.add(new Task(R.string.apsselected) { + tasks.add(new Task(R.string.objectives_usescale) { @Override public boolean isCompleted() { - APSInterface usedAPS = ConfigBuilderPlugin.getPlugin().getActiveAPS(); - if (usedAPS != null && ((PluginBase) usedAPS).isEnabled(PluginType.APS)) - return true; - return false; - } - }); - tasks.add(new Task(R.string.activate_profile) { - @Override - public boolean isCompleted() { - return TreatmentsPlugin.getPlugin().getProfileSwitchFromHistory(DateUtil.now()) != null; + return SP.getBoolean(R.string.key_objectiveusescale, false); } }); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java index 6f97bfdd95..3ced0e6e91 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java @@ -12,7 +12,7 @@ public class Objective2 extends Objective { public final int MANUAL_ENACTS_NEEDED = 20; public Objective2() { - super(1, R.string.objectives_1_objective, R.string.objectives_1_gate); + super(ObjectivesPlugin.OPENLOOP_OBJECTIVE, R.string.objectives_openloop_objective, R.string.objectives_openloop_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.java index 4924d9434c..b75450e772 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.java @@ -1,10 +1,11 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; public class Objective3 extends Objective { public Objective3() { - super(2, R.string.objectives_2_objective, R.string.objectives_2_gate); + super(ObjectivesPlugin.MAXBASAL_OBJECTIVE, R.string.objectives_maxbasal_objective, R.string.objectives_maxbasal_gate); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective4.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective4.java index 1bbb4ef7c2..0576b7f3c1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective4.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective4.java @@ -4,13 +4,14 @@ import java.util.List; import info.nightscout.androidaps.R; import info.nightscout.androidaps.interfaces.Constraint; +import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin; import info.nightscout.androidaps.utils.T; public class Objective4 extends Objective { public Objective4() { - super(3, R.string.objectives_3_objective, R.string.objectives_3_gate); + super(ObjectivesPlugin.MAXIOB_ZERO_CL_OBJECTIVE, R.string.objectives_maxiobzero_objective, R.string.objectives_maxiobzero_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.java index b04062655a..005b9a28e4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.java @@ -4,12 +4,13 @@ import java.util.List; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; import info.nightscout.androidaps.utils.T; public class Objective5 extends Objective { public Objective5() { - super(4, R.string.objectives_4_objective, R.string.objectives_4_gate); + super(ObjectivesPlugin.MAXIOB_OBJECTIVE, R.string.objectives_maxiob_objective, R.string.objectives_maxiob_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.java index 284dfa3ab0..64e9658cc8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.java @@ -3,12 +3,13 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives; import java.util.List; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; import info.nightscout.androidaps.utils.T; public class Objective6 extends Objective { public Objective6() { - super(5, R.string.objectives_5_objective, R.string.objectives_5_gate); + super(ObjectivesPlugin.AUTOSENS_OBJECTIVE, R.string.objectives_autosens_objective, R.string.objectives_autosens_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.java index f90411ecfb..7d66bbf6ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.java @@ -3,12 +3,13 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives; import java.util.List; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; import info.nightscout.androidaps.utils.T; public class Objective7 extends Objective { public Objective7() { - super(6, R.string.objectives_6_objective, 0); + super(ObjectivesPlugin.AMA_OBJECTIVE, R.string.objectives_ama_objective, 0); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective8.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective8.java index 7148f5e5ad..9e79f6050e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective8.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective8.java @@ -3,12 +3,13 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives; import java.util.List; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; import info.nightscout.androidaps.utils.T; public class Objective8 extends Objective { public Objective8() { - super(7, R.string.objectives_7_objective, R.string.objectives_7_gate); + super(ObjectivesPlugin.SMB_OBJECTIVE, R.string.objectives_smb_objective, R.string.objectives_smb_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.java index 7248a49f0f..579700be4c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.java @@ -5,13 +5,13 @@ import android.app.Activity; import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Bundle; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; +import androidx.fragment.app.FragmentManager; + import com.squareup.otto.Subscribe; import java.util.ArrayList; @@ -43,31 +43,21 @@ import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment; import info.nightscout.androidaps.plugins.general.careportal.Dialogs.NewNSTreatmentDialog; import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow; import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; -import info.nightscout.androidaps.utils.FabricPrivacy; +import info.nightscout.androidaps.utils.SP; import info.nightscout.androidaps.utils.SingleClickButton; - -/** - * A simple {@link Fragment} subclass. - */ public class ActionsFragment extends SubscriberFragment implements View.OnClickListener { - static ActionsPlugin actionsPlugin = new ActionsPlugin(); - - static public ActionsPlugin getPlugin() { - return actionsPlugin; - } - - View actionsFragmentView; - SingleClickButton profileSwitch; - SingleClickButton tempTarget; - SingleClickButton extendedBolus; - SingleClickButton extendedBolusCancel; - SingleClickButton tempBasal; - SingleClickButton tempBasalCancel; - SingleClickButton fill; - SingleClickButton tddStats; - SingleClickButton history; + private View actionsFragmentView; + private SingleClickButton profileSwitch; + private SingleClickButton tempTarget; + private SingleClickButton extendedBolus; + private SingleClickButton extendedBolusCancel; + private SingleClickButton tempBasal; + private SingleClickButton tempBasalCancel; + private SingleClickButton fill; + private SingleClickButton tddStats; + private SingleClickButton history; private Map pumpCustomActions = new HashMap<>(); private List pumpCustomButtons = new ArrayList<>(); @@ -80,38 +70,33 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - try { - View view = inflater.inflate(R.layout.actions_fragment, container, false); + View view = inflater.inflate(R.layout.actions_fragment, container, false); - profileSwitch = (SingleClickButton) view.findViewById(R.id.actions_profileswitch); - tempTarget = (SingleClickButton) view.findViewById(R.id.actions_temptarget); - extendedBolus = (SingleClickButton) view.findViewById(R.id.actions_extendedbolus); - extendedBolusCancel = (SingleClickButton) view.findViewById(R.id.actions_extendedbolus_cancel); - tempBasal = (SingleClickButton) view.findViewById(R.id.actions_settempbasal); - tempBasalCancel = (SingleClickButton) view.findViewById(R.id.actions_canceltempbasal); - fill = (SingleClickButton) view.findViewById(R.id.actions_fill); - tddStats = view.findViewById(R.id.actions_tddstats); - history = view.findViewById(R.id.actions_historybrowser); + profileSwitch = view.findViewById(R.id.actions_profileswitch); + tempTarget = view.findViewById(R.id.actions_temptarget); + extendedBolus = view.findViewById(R.id.actions_extendedbolus); + extendedBolusCancel = view.findViewById(R.id.actions_extendedbolus_cancel); + tempBasal = view.findViewById(R.id.actions_settempbasal); + tempBasalCancel = view.findViewById(R.id.actions_canceltempbasal); + fill = view.findViewById(R.id.actions_fill); + tddStats = view.findViewById(R.id.actions_tddstats); + history = view.findViewById(R.id.actions_historybrowser); - profileSwitch.setOnClickListener(this); - tempTarget.setOnClickListener(this); - extendedBolus.setOnClickListener(this); - extendedBolusCancel.setOnClickListener(this); - tempBasal.setOnClickListener(this); - tempBasalCancel.setOnClickListener(this); - fill.setOnClickListener(this); - history.setOnClickListener(this); - tddStats.setOnClickListener(this); + profileSwitch.setOnClickListener(this); + tempTarget.setOnClickListener(this); + extendedBolus.setOnClickListener(this); + extendedBolusCancel.setOnClickListener(this); + tempBasal.setOnClickListener(this); + tempBasalCancel.setOnClickListener(this); + fill.setOnClickListener(this); + history.setOnClickListener(this); + tddStats.setOnClickListener(this); - actionsFragmentView = view; + actionsFragmentView = view; - updateGUI(); - return view; - } catch (Exception e) { - FabricPrivacy.logException(e); - } - - return null; + updateGUI(); + SP.putBoolean(R.string.key_objectiveuseactions, true); + return view; } @Subscribe diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.java deleted file mode 100644 index 5d47206e5c..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.java +++ /dev/null @@ -1,23 +0,0 @@ -package info.nightscout.androidaps.plugins.general.actions; - -import info.nightscout.androidaps.R; -import info.nightscout.androidaps.interfaces.PluginBase; -import info.nightscout.androidaps.interfaces.PluginDescription; -import info.nightscout.androidaps.interfaces.PluginType; - -/** - * Created by mike on 05.11.2016. - */ - -public class ActionsPlugin extends PluginBase { - - public ActionsPlugin() { - super(new PluginDescription() - .mainType(PluginType.GENERAL) - .fragmentClass(ActionsFragment.class.getName()) - .pluginName(R.string.actions) - .shortName(R.string.actions_shortname) - .description(R.string.description_actions) - ); - } -} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt new file mode 100644 index 0000000000..086c75a157 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt @@ -0,0 +1,13 @@ +package info.nightscout.androidaps.plugins.general.actions + +import info.nightscout.androidaps.R +import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.androidaps.interfaces.PluginDescription +import info.nightscout.androidaps.interfaces.PluginType + +object ActionsPlugin : PluginBase(PluginDescription() + .mainType(PluginType.GENERAL) + .fragmentClass(ActionsFragment::class.java.name) + .pluginName(R.string.actions) + .shortName(R.string.actions_shortname) + .description(R.string.description_actions)) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/careportal/Dialogs/NewNSTreatmentDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/careportal/Dialogs/NewNSTreatmentDialog.java index 3489180d9d..7c50cdc7e5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/careportal/Dialogs/NewNSTreatmentDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/careportal/Dialogs/NewNSTreatmentDialog.java @@ -741,6 +741,8 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick } TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); } + if (duration == 10) + SP.putBoolean(R.string.key_objectiveusetemptarget, true); } else { if (JsonHelper.safeGetString(data, "eventType").equals(CareportalEvent.PROFILESWITCH)) { ProfileSwitch profileSwitch = ProfileFunctions.prepareProfileSwitch( diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java index 41c0611ce4..233e8a3990 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java @@ -334,6 +334,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, rangeToDisplay = rangeToDisplay > 24 ? 6 : rangeToDisplay; SP.putInt(R.string.key_rangetodisplay, rangeToDisplay); updateGUI("rangeChange"); + SP.putBoolean(R.string.key_objectiveusescale, true); return false; }); @@ -592,6 +593,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, } } }); + SP.putBoolean(R.string.key_objectiveusereconnect, true); NSUpload.uploadOpenAPSOffline(0); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.suspendloopfor1h))) { @@ -620,6 +622,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, return true; } else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor1h))) { LoopPlugin.getPlugin().disconnectPump(60, profile); + SP.putBoolean(R.string.key_objectiveusedisconnect, true); updateGUI("suspendmenu"); return true; } else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor2h))) { diff --git a/app/src/main/res/values-af-rZA/strings.xml b/app/src/main/res/values-af-rZA/strings.xml index bf05f8bf8e..218137bd17 100644 --- a/app/src/main/res/values-af-rZA/strings.xml +++ b/app/src/main/res/values-af-rZA/strings.xml @@ -317,19 +317,19 @@ Gaan %1$.2fU lewer Opstel van visualisering en monitering, en ontleed basale en verhoudings Verifieer dat BG beskikbaar is in Nightscout, en dat pomp insulien data opgelaai word - Begin op \'n oop lus - Loop in oop lus modus vir \'n paar dae en boots met hand met baie tydelike basale. Stel tydelike gebruik en verstek tydelike teikens (bv. vir aktiwiteit of hipo behandeling koolhidrate) - Verstaan jou oop lus, insluitend sy tydelike basale aanbevelings - Gebaseer op daardie ervaring, besluit watter maks basale moet gebruik word, en stel dit op die pomp en voorkeure - Begin toe die lus met lae glukose opgeskort - Loop in geslote lus met max IAB = 0 vir \'n paar dae sonder te veel LGS gebeure - Verstel die geslote lus, verhoog maks IAB bo 0 en geleidelik verlaag BG doelwitte - Lus vir \'n paar dae, en ten minste een nag met geen lae BG alarms, voor BG val - Pas basale en verhoudings aan as nodig, en dan aktiveer auto-sens - 1 week suksesvolle dagtyd lus met gereelde karb toevoegings - Skakel bykomende nutsfunskies aan vir bedagse gebruik, soos bv advanced meal assist - Skakel bykomende nutsfunskies aan vir bedags gebruik, soos bv. SMB - Jy moet asb die wiki lees en verhoog maksIAB om SMBs te laat werk! \'n Goeie begin is maksIAB = gemiddelde ete bolus + 3 x maks daaglikse basale + Begin op \'n oop lus + Loop in oop lus modus vir \'n paar dae en boots met hand met baie tydelike basale. Stel tydelike gebruik en verstek tydelike teikens (bv. vir aktiwiteit of hipo behandeling koolhidrate) + Verstaan jou oop lus, insluitend sy tydelike basale aanbevelings + Gebaseer op daardie ervaring, besluit watter maks basale moet gebruik word, en stel dit op die pomp en voorkeure + Begin toe die lus met lae glukose opgeskort + Loop in geslote lus met max IAB = 0 vir \'n paar dae sonder te veel LGS gebeure + Verstel die geslote lus, verhoog maks IAB bo 0 en geleidelik verlaag BG doelwitte + Lus vir \'n paar dae, en ten minste een nag met geen lae BG alarms, voor BG val + Pas basale en verhoudings aan as nodig, en dan aktiveer auto-sens + 1 week suksesvolle dagtyd lus met gereelde karb toevoegings + Skakel bykomende nutsfunskies aan vir bedagse gebruik, soos bv advanced meal assist + Skakel bykomende nutsfunskies aan vir bedags gebruik, soos bv. SMB + Jy moet asb die wiki lees en verhoog maksIAB om SMBs te laat werk! \'n Goeie begin is maksIAB = gemiddelde ete bolus + 3 x maks daaglikse basale Die toegelate limiet is bereik Geen profiel gekies Loop is gedeaktiveer diff --git a/app/src/main/res/values-bg-rBG/strings.xml b/app/src/main/res/values-bg-rBG/strings.xml index 26807a290d..f27b5de8d4 100644 --- a/app/src/main/res/values-bg-rBG/strings.xml +++ b/app/src/main/res/values-bg-rBG/strings.xml @@ -318,19 +318,19 @@ Ще стартира %1$.2fЕ болус Настройка на визуализацията и наблюдението, а също и анализиране на базалните нужди и коефициенти Потвърждаване, че КЗ е достъпна в Найтскаут и данните за помпата се качват там - Стартиране в режим Отворен кръг (Open loop) - Работа в режим \"Отворен кръг\" за няколко дни и ръчно въвеждане на много временни базали. Настройте и използвайте временни и стандартни временни цели (напр. за активни или хипо-третирани въглехидрати) - Опитайте се да разбирате по-добре вашият APS в режим \"Отворен кръг\", включително препоръчваните временни базали - Определяне на макс. лимит на базалния инсулин и настройване в помпата и програмата - Стартиране на \"Затворен кръг\" с изключване на базал при ниска КЗ - Стартиране на \"Затворен кръг\" с макс. IOB=0 без твърде много събития тип ниска КЗ - Настройване на \"Затворен кръг\" чрез повишаване на максималният IOB над 0 и понижаване на целевите нива на КЗ - Прекарайте няколко дни по този начин, като поне една нощ нямате аларма за ниска КЗ. - Настройване на базалния инсулин и коефициенти ако е необходимо и активиране на auto-sens - Една седмица успешно дневно използване с редовно въвеждане на въглехидрати - Активиране на допълнителни функции за дневно използване, включително и advanced meal assist (АМА) - Добавяне на допълнителни функции за използване през деня, като SMB - Вие трябва да прочетете wiki и увеличите maxIOB за да може SMB да работи добре! Добро начало е maxIOB = средния болус за хранене + 3 x най-големия базал от профила + Стартиране в режим Отворен кръг (Open loop) + Работа в режим \"Отворен кръг\" за няколко дни и ръчно въвеждане на много временни базали. Настройте и използвайте временни и стандартни временни цели (напр. за активни или хипо-третирани въглехидрати) + Опитайте се да разбирате по-добре вашият APS в режим \"Отворен кръг\", включително препоръчваните временни базали + Определяне на макс. лимит на базалния инсулин и настройване в помпата и програмата + Стартиране на \"Затворен кръг\" с изключване на базал при ниска КЗ + Стартиране на \"Затворен кръг\" с макс. IOB=0 без твърде много събития тип ниска КЗ + Настройване на \"Затворен кръг\" чрез повишаване на максималният IOB над 0 и понижаване на целевите нива на КЗ + Прекарайте няколко дни по този начин, като поне една нощ нямате аларма за ниска КЗ. + Настройване на базалния инсулин и коефициенти ако е необходимо и активиране на auto-sens + Една седмица успешно дневно използване с редовно въвеждане на въглехидрати + Активиране на допълнителни функции за дневно използване, включително и advanced meal assist (АМА) + Добавяне на допълнителни функции за използване през деня, като SMB + Вие трябва да прочетете wiki и увеличите maxIOB за да може SMB да работи добре! Добро начало е maxIOB = средния болус за хранене + 3 x най-големия базал от профила Достигнахте лимита Няма избран профил APS е деактивиран diff --git a/app/src/main/res/values-cs-rCZ/strings.xml b/app/src/main/res/values-cs-rCZ/strings.xml index 477eaa0681..2f92358a64 100644 --- a/app/src/main/res/values-cs-rCZ/strings.xml +++ b/app/src/main/res/values-cs-rCZ/strings.xml @@ -319,19 +319,19 @@ Podávání %1$.2fU inzulínu Nastavit vizualizaci a monitoring, analyzovat bazály a koeficienty Zkontrolovat, zda jsou glykémie a údaje z pumpy viditelné v Nightscoutu - Začít s otevřenou smyčkou - Provozovat několik dní otevřenou smyčku a ručně potvrzovat doporučené dočasné bazály. Nastavovat a používat dočasné cíle (např. pro sport nebo hypo) - Porozumět otevřené smyčce a doporučeným dočasným bazálům - Na základě předchozích zkušeností rozhodnout, jaký je třeba maximální bazál a nastavit ho v pumpě a v aplikaci - Začít uzavřenou smyčku pouze s hlídáním nízké glykémie - Spustit uzavřenou smyčku s max IOB = 0 na několik dní s minimem nutných korekcí na nízkou glykémii - Zapnout uzavřenou smyčku, zvyšovat max IOB nad 0 a snižovat cílovou glykémii - Provozovat smyčku několik dní s alespoň jednou nocí bez alarmů na nízkou glykémii - Upravit bazály a koeficienty, když bude potřeba a povolit automatickou detekci citlivosti na inzulín - Jeden týden úspěšného používání s běžným příjmem sacharidů - Povolit další funkce pro běžné používání jako AMA - Povolit další funkce pro běžné používání jako SMB - Přečíst si dokumentaci a zvýšit maximání IOB, aby mohlo SMB fungovat. Pro začátek se dá použít velikost běžného bolusu + 3x maximální denní bazál + Začít s otevřenou smyčkou + Provozovat několik dní otevřenou smyčku a ručně potvrzovat doporučené dočasné bazály. Nastavovat a používat dočasné cíle (např. pro sport nebo hypo) + Porozumět otevřené smyčce a doporučeným dočasným bazálům + Na základě předchozích zkušeností rozhodnout, jaký je třeba maximální bazál a nastavit ho v pumpě a v aplikaci + Začít uzavřenou smyčku pouze s hlídáním nízké glykémie + Spustit uzavřenou smyčku s max IOB = 0 na několik dní s minimem nutných korekcí na nízkou glykémii + Zapnout uzavřenou smyčku, zvyšovat max IOB nad 0 a snižovat cílovou glykémii + Provozovat smyčku několik dní s alespoň jednou nocí bez alarmů na nízkou glykémii + Upravit bazály a koeficienty, když bude potřeba a povolit automatickou detekci citlivosti na inzulín + Jeden týden úspěšného používání s běžným příjmem sacharidů + Povolit další funkce pro běžné používání jako AMA + Povolit další funkce pro běžné používání jako SMB + Přečíst si dokumentaci a zvýšit maximání IOB, aby mohlo SMB fungovat. Pro začátek se dá použít velikost běžného bolusu + 3x maximální denní bazál Dosaženo limitu Není vybrán žádný profil Smyčka byla zakázána diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index 70cce91c14..c15f283b5c 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -319,19 +319,19 @@ Werde %1$.2fU abgeben Konfiguriere die Anzeige und das Monitoring (Nightscout) und analysiere Basal-Raten und Faktoren Verifiziere, dass BZ- und Pumpen-Insulin-Daten erfolgreich zu Nightscout hochgeladen werden. - Starte den Open Loop Modus - Erprobe den Open Loop Modus für ein paar Tage und setze manuell temporäre Basal-Raten. Richte temporäre Ziele ein und nutze sie (z.B. für Bewegung, unterstützend zur Hypobehandlung). - Verstehe den Open Loop und die TBR-Empfehlungen - Entscheide anhand von dieser Erfahrung, wie hoch max Basal sein sollte, und übernehme den Wert in die Pumpen- und AAPS-Einstellungen. - Starte den Closed Loop Modus mit Abschaltung bei niedrigen Werten - Erprobe den Closed Loop Modus mit max IOB = 0 für ein paar Tage, ohne zu viele Unterzuckerungen zu haben. - Stelle den Closed Loop fein ein, erhöhe max IOB über 0 und setze den Zielbereich langsam herunter. - Verwende es ein paar Tage und zumindest eine Nacht ohne Niedrig-Alarme (UZ), bevor du den BZ-Zielbereich senkst. - Passe, falls notwendig, Basal und Faktoren an und aktiviere dann die Autosens-Funktion. - Loope eine Woche erfolgreich am Tag mit regelmäßiger Kohlenhydrat-Eingabe. - Aktiviere zusätzliche Funktionen wie z. B. den Mahlzeitenassistenten - Aktiviere zusätzliche Funktionen wie z. B. SMB - Lies das Wiki und hebe maxIOB an, damit SMB funktioniert. Ein guter Startwert ist + Starte den Open Loop Modus + Erprobe den Open Loop Modus für ein paar Tage und setze manuell temporäre Basal-Raten. Richte temporäre Ziele ein und nutze sie (z.B. für Bewegung, unterstützend zur Hypobehandlung). + Verstehe den Open Loop und die TBR-Empfehlungen + Entscheide anhand von dieser Erfahrung, wie hoch max Basal sein sollte, und übernehme den Wert in die Pumpen- und AAPS-Einstellungen. + Starte den Closed Loop Modus mit Abschaltung bei niedrigen Werten + Erprobe den Closed Loop Modus mit max IOB = 0 für ein paar Tage, ohne zu viele Unterzuckerungen zu haben. + Stelle den Closed Loop fein ein, erhöhe max IOB über 0 und setze den Zielbereich langsam herunter. + Verwende es ein paar Tage und zumindest eine Nacht ohne Niedrig-Alarme (UZ), bevor du den BZ-Zielbereich senkst. + Passe, falls notwendig, Basal und Faktoren an und aktiviere dann die Autosens-Funktion. + Loope eine Woche erfolgreich am Tag mit regelmäßiger Kohlenhydrat-Eingabe. + Aktiviere zusätzliche Funktionen wie z. B. den Mahlzeitenassistenten + Aktiviere zusätzliche Funktionen wie z. B. SMB + Lies das Wiki und hebe maxIOB an, damit SMB funktioniert. Ein guter Startwert ist maxIOB = durchschnittlicher Essensbolus + 3 x maximale Basalrate Limit erreicht Kein Profil ausgewählt diff --git a/app/src/main/res/values-el-rGR/strings.xml b/app/src/main/res/values-el-rGR/strings.xml index 5dabec879a..90ca7efad6 100644 --- a/app/src/main/res/values-el-rGR/strings.xml +++ b/app/src/main/res/values-el-rGR/strings.xml @@ -317,19 +317,19 @@ Προς έγχυση %1$.2fU Δημιουργία παρακολούθησης και ανάλυση βασικού ρυθμού και αναλογιών Επιβεβαιώστε ότι η BG φαίνεται στο Nightscout και τα δεδομένα της αντλίας φορτώθηκαν - Ξεκινήστε σε ανοιχτό κύκλωμα - Εκτελέστε σε ανοιχτό κύκλωμα για μερικές ημέρες και χειροκίνητα κάντε πολλές παρεμβάσεις με προσωρινό ρυθμό. Ρυθμίστε και χρησιμοποιήστε προσωρινούς στόχους (π.χ. για αθλήματα ή υπογλυκαιμία) - Κατανοήστε το ανοιχτό κύκλωμα, περιλαμβάνοντας τις προτάσεις για Προσωρινό ρυθμό - Βάση της εμπειρίας σας, αποφασίστε ποιο είναι το μέγιστο βασικής δόσης και αποθηκεύστε το στην αντλία και στις Επιλογές - Ξεκινήστε να κλείσετε το κύκλωμα με Σταμάτημα Χαμηλής Γλυκόζης (Low Glucose Suspend) - Εκτελέστε σε κλειστό κύκλωμα με μέγιστο IOB = 0 για μερικές ημέρες χωρίς πολλά LGS - υπογλυκαιμίες - Ρυθμίζοντας το κλειστό κύκλωμα, αυξήστε το μέγιστο IOB πάνω από 0 και σταδιακά μειώστε τους στόχους BG - Τρέξτε το για λίγες ημέρες, και τουλάχιστον μία νύχτα χωρίς χαμηλό συναγερμό BG, πριν χαμηλώσετε τα όρια - Ρυθμίστε τον βασικό ρυθμό και τις αναλογίες αν χρειάζεται, και μετά ενεργοποιήστε το auto-sens - 1 επιτυχής εβδομάδα ημερήσιου κυκλώματος με κανονική εισαγωγή υδατανθράκων - Ενεργοποιώντας επιπρόσθετα χαρακτηριστικά για χρήση κατά την ημέρα, όπως τον Προχωρημένο Βοηθό Γεύματος - Ενεργοποιήστε άλλες λειτουργίες για χρήση κατά την ημέρα, όπως SMB - Πρέπει να διαβάσετε τον οδηγό wiki και να αυξήσετε το ανώτατο όριο του IOB για να μπορέσει να λειτουργήσει σωστά η SMB! Μια καλή αρχή είναι μέγιστο IOB= μέσο bolus γεύματος + 3 x το μέγιστο ημερήσιο βασικού ρυθμού + Ξεκινήστε σε ανοιχτό κύκλωμα + Εκτελέστε σε ανοιχτό κύκλωμα για μερικές ημέρες και χειροκίνητα κάντε πολλές παρεμβάσεις με προσωρινό ρυθμό. Ρυθμίστε και χρησιμοποιήστε προσωρινούς στόχους (π.χ. για αθλήματα ή υπογλυκαιμία) + Κατανοήστε το ανοιχτό κύκλωμα, περιλαμβάνοντας τις προτάσεις για Προσωρινό ρυθμό + Βάση της εμπειρίας σας, αποφασίστε ποιο είναι το μέγιστο βασικής δόσης και αποθηκεύστε το στην αντλία και στις Επιλογές + Ξεκινήστε να κλείσετε το κύκλωμα με Σταμάτημα Χαμηλής Γλυκόζης (Low Glucose Suspend) + Εκτελέστε σε κλειστό κύκλωμα με μέγιστο IOB = 0 για μερικές ημέρες χωρίς πολλά LGS - υπογλυκαιμίες + Ρυθμίζοντας το κλειστό κύκλωμα, αυξήστε το μέγιστο IOB πάνω από 0 και σταδιακά μειώστε τους στόχους BG + Τρέξτε το για λίγες ημέρες, και τουλάχιστον μία νύχτα χωρίς χαμηλό συναγερμό BG, πριν χαμηλώσετε τα όρια + Ρυθμίστε τον βασικό ρυθμό και τις αναλογίες αν χρειάζεται, και μετά ενεργοποιήστε το auto-sens + 1 επιτυχής εβδομάδα ημερήσιου κυκλώματος με κανονική εισαγωγή υδατανθράκων + Ενεργοποιώντας επιπρόσθετα χαρακτηριστικά για χρήση κατά την ημέρα, όπως τον Προχωρημένο Βοηθό Γεύματος + Ενεργοποιήστε άλλες λειτουργίες για χρήση κατά την ημέρα, όπως SMB + Πρέπει να διαβάσετε τον οδηγό wiki και να αυξήσετε το ανώτατο όριο του IOB για να μπορέσει να λειτουργήσει σωστά η SMB! Μια καλή αρχή είναι μέγιστο IOB= μέσο bolus γεύματος + 3 x το μέγιστο ημερήσιο βασικού ρυθμού Φτάσατε το επιτρεπτό όριο Δεν επηλέχθηκε προφίλ Το κύκλωμα απενεργοποιήθηκε diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index a17a6edf20..cbb0669f0e 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -317,19 +317,19 @@ Se van a infundir %1$.2fU Configuración de visualización y monitorización, y análisis de basales y ratios Comprobar que los datos de BG están disponibles en Nightscout, y que los datos de la bomba de insulina se están subiendo - Empezar con lazo abierto - Ejecutar en modo de lazo abierto durante unos días, y aceptar manualmente las basales temporales. Configure y use objetivos temporales y predeterminados (por ejemplo, para actividad o carbohidratos para hipoglucemia) - Entender el lazo abierto, incluidas las recomendaciones de basales temporales - Sobre la base de esa experiencia, decidir valores de máximo basal, y ajustar la bomba y preferencias - Iniciando el lazo cerrado con suspensión con baja glucosa - Ejecutar en lazo cerrado con max IOB=0 durante unos días sin demasiados valores bajos de glucosa - Ajuste del lazo cerrado, aumentando máximo IOB por encima de 0 y bajando gradualmente objetivos BG - Funcionando unos cuantos días, y al menos una noche sin alarmas de glucosa baja, antes de bajar valor de glucosa - Ajustar los basales y ratios, si es necesario, y luego activar auto-sens - Una semana con éxito en lazo cerrado durante el día con entrada regular de carbohidratos - Habilitar funciones adicionales para su uso durante el día, como asistente de comida avanzado - Habilitar funciones adicionales para uso durante el día como SMB - ¡Debes leer el wiki y subir maxIOB para que SMB funcione bien! Para comenzar un buen valor sería maxIOB = bolo de comida medio + 3 x máximo basal diario + Empezar con lazo abierto + Ejecutar en modo de lazo abierto durante unos días, y aceptar manualmente las basales temporales. Configure y use objetivos temporales y predeterminados (por ejemplo, para actividad o carbohidratos para hipoglucemia) + Entender el lazo abierto, incluidas las recomendaciones de basales temporales + Sobre la base de esa experiencia, decidir valores de máximo basal, y ajustar la bomba y preferencias + Iniciando el lazo cerrado con suspensión con baja glucosa + Ejecutar en lazo cerrado con max IOB=0 durante unos días sin demasiados valores bajos de glucosa + Ajuste del lazo cerrado, aumentando máximo IOB por encima de 0 y bajando gradualmente objetivos BG + Funcionando unos cuantos días, y al menos una noche sin alarmas de glucosa baja, antes de bajar valor de glucosa + Ajustar los basales y ratios, si es necesario, y luego activar auto-sens + Una semana con éxito en lazo cerrado durante el día con entrada regular de carbohidratos + Habilitar funciones adicionales para su uso durante el día, como asistente de comida avanzado + Habilitar funciones adicionales para uso durante el día como SMB + ¡Debes leer el wiki y subir maxIOB para que SMB funcione bien! Para comenzar un buen valor sería maxIOB = bolo de comida medio + 3 x máximo basal diario Alcanzado el límite permitido Sin perfil seleccionado Lazo se ha desactivado diff --git a/app/src/main/res/values-fr-rFR/strings.xml b/app/src/main/res/values-fr-rFR/strings.xml index 631627aa97..3e40a6aa1b 100644 --- a/app/src/main/res/values-fr-rFR/strings.xml +++ b/app/src/main/res/values-fr-rFR/strings.xml @@ -320,19 +320,19 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S %1$.2fU vont être injectées Paramétrer la visualisation et la surveillance des données, analyser les débits de basal et les ratios Vérifiez que la Glycémie est disponible sur Nightscout et que les données d’insuline ont été téléchargées de la pompe - Commencez par la configuration Boucle Ouverte - Utiliser le système Boucle Ouverte pour quelques jours, et activer manuellement de nombreux débits de basal temporaires. Définir et utiliser des objectifs temporaires (ex : activités ou utilisation de glucides pour traiter des hypos) - Comprendre votre système Boucle Ouverte, y compris ses recommandations de débit de Basal temporaire - Partant de ce constat, décidez quel est le débit de base maximum à choisir, et entrez le dans la pompe et les préférences - Commencez par utiliser la Boucle Fermée avec le système Arrêt Glycémie Basse - Utiliser la Boucle Fermée avec max IA = 0 pour quelques jours sans avoir trop d’événements AGB Arrêt Glycémie Basse (LGS Low Glucose Suspend) - Ajustez votre système Boucle Fermée, augmentez la fonction « max IOB » au delà de 0 et diminuez progressivement vos cibles glycémiques - Utiliser pendant quelques jours, et au moins une nuit sans les alarmes d’hypoglycémie, avant la baisse de G - Ajustez si besoin les débits de base et les ratios, activez ensuite « Autosens » - Une semaine réussie avec des journées en Boucle Fermée, avec des entrées normales des glucides - Activer d’autres fonctionnalités pour l’utilisation dans la journée, tel que Assistance Repas Avancée (AMA Advanced Meal Assist) - Activer des fonctionnalités supplémentaires pour l\'utilisation dans la journée, telles que la fonction SMB - Vous devez lire le wiki et augmenter les max IA pour faire fonctionner SMB ! Un bon début est max IA = moyenne bolus repas + 3 fois max daily basal + Commencez par la configuration Boucle Ouverte + Utiliser le système Boucle Ouverte pour quelques jours, et activer manuellement de nombreux débits de basal temporaires. Définir et utiliser des objectifs temporaires (ex : activités ou utilisation de glucides pour traiter des hypos) + Comprendre votre système Boucle Ouverte, y compris ses recommandations de débit de Basal temporaire + Partant de ce constat, décidez quel est le débit de base maximum à choisir, et entrez le dans la pompe et les préférences + Commencez par utiliser la Boucle Fermée avec le système Arrêt Glycémie Basse + Utiliser la Boucle Fermée avec max IA = 0 pour quelques jours sans avoir trop d’événements AGB Arrêt Glycémie Basse (LGS Low Glucose Suspend) + Ajustez votre système Boucle Fermée, augmentez la fonction « max IOB » au delà de 0 et diminuez progressivement vos cibles glycémiques + Utiliser pendant quelques jours, et au moins une nuit sans les alarmes d’hypoglycémie, avant la baisse de G + Ajustez si besoin les débits de base et les ratios, activez ensuite « Autosens » + Une semaine réussie avec des journées en Boucle Fermée, avec des entrées normales des glucides + Activer d’autres fonctionnalités pour l’utilisation dans la journée, tel que Assistance Repas Avancée (AMA Advanced Meal Assist) + Activer des fonctionnalités supplémentaires pour l\'utilisation dans la journée, telles que la fonction SMB + Vous devez lire le wiki et augmenter les max IA pour faire fonctionner SMB ! Un bon début est max IA = moyenne bolus repas + 3 fois max daily basal Vous avez atteint la limite maximale Aucun profil séléctionné La Boucle été désactivée diff --git a/app/src/main/res/values-it-rIT/strings.xml b/app/src/main/res/values-it-rIT/strings.xml index 550ad10ccf..0cbe55b872 100644 --- a/app/src/main/res/values-it-rIT/strings.xml +++ b/app/src/main/res/values-it-rIT/strings.xml @@ -318,19 +318,19 @@ Sto per erogare %1$.2fU Configurazione della visualizzazione e del monitoraggio, analisi basali e rapporti Verificare che la Glicemia sia disponibile su Nightscout e che i dati sull\'insulina del micro siano in fase di caricamento - Partenza con Loop Aperto - Esegui l\'applicazione in modalità Loop Aperto per alcuni giorni e accetta manualmente le basali temporanee. Imposta e utilizza i target temporanei, anche quelli predefiniti (ad esempio, per l\'attività fisica o il trattamento dell\'ipoglicemia con carboidrati) - Comprendi il tuo Loop Aperto, incluse le relative raccomandazioni sulle basali temporanee - Sulla base di tale esperienza, decidi quale deve essere il valore max della basale e impostalo sul microinfusore e nelle preferenze - Iniziare a chiudere il Loop con Low Glucose Suspend - Esegui l\'applicazione in Loop Chiuso con max IOB = 0 per pochi giorni senza troppi eventi LGS - Regola il Loop Chiuso, aumentando max IOB al di sopra di 0 e abbassando gradualmente i target glicemici - Esegui l\'applicazione per alcuni giorni e almeno una notte senza allarmi glicemia, prima di abbassare il target glicemico - Regola le basali e i rapporti se necessario, quindi attiva auto-sens - 1 settimana di looping diurno con dichiarazione regolare dei carboidrati, eseguito con successo - Abilita funzioni aggiuntive per l\'uso diurno, ad esempio AMA (advanced meal assist - assistenza avanzata del pasto) - Abilita funzioni aggiuntive per l\'uso diurno, come SMB - È necessario leggere il wiki e aumentare maxIOB affinché le azioni di SMB funzionino adeguatamente! Un buon inizio è maxIOB = media bolo posto + 3 x max basale giornaliera + Partenza con Loop Aperto + Esegui l\'applicazione in modalità Loop Aperto per alcuni giorni e accetta manualmente le basali temporanee. Imposta e utilizza i target temporanei, anche quelli predefiniti (ad esempio, per l\'attività fisica o il trattamento dell\'ipoglicemia con carboidrati) + Comprendi il tuo Loop Aperto, incluse le relative raccomandazioni sulle basali temporanee + Sulla base di tale esperienza, decidi quale deve essere il valore max della basale e impostalo sul microinfusore e nelle preferenze + Iniziare a chiudere il Loop con Low Glucose Suspend + Esegui l\'applicazione in Loop Chiuso con max IOB = 0 per pochi giorni senza troppi eventi LGS + Regola il Loop Chiuso, aumentando max IOB al di sopra di 0 e abbassando gradualmente i target glicemici + Esegui l\'applicazione per alcuni giorni e almeno una notte senza allarmi glicemia, prima di abbassare il target glicemico + Regola le basali e i rapporti se necessario, quindi attiva auto-sens + 1 settimana di looping diurno con dichiarazione regolare dei carboidrati, eseguito con successo + Abilita funzioni aggiuntive per l\'uso diurno, ad esempio AMA (advanced meal assist - assistenza avanzata del pasto) + Abilita funzioni aggiuntive per l\'uso diurno, come SMB + È necessario leggere il wiki e aumentare maxIOB affinché le azioni di SMB funzionino adeguatamente! Un buon inizio è maxIOB = media bolo posto + 3 x max basale giornaliera Hai raggiunto il limite consentito Nessun profilo selezionato Disattivazione Loop corretta diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index f481d2bfce..f122aa4420 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -319,19 +319,19 @@ %1$.2fU을 주입합니다 표시설정과 모니터설정을 완료하고, Basal과 비율을 분석한다. 나이트스카우트에서 혈당 데이터가 잘 들어오는지, 펌프데이터가 업로드 되는지 확인한다. - Open Loop를 시작한다. - Open Loop 모드에서 몇일간 사용하여보고, 임시Basal을 여러번 수동으로 주입해 본다. 임시목표와 기본임시목표(\'식사직전\', \'활동\',\'저혈당\' 임시목표)를 설정하고 사용해 본다. - 임시Basal 추천기능을 포함해서, Open Loop에 대해 이해한다. - 이 경험을 토대로, 최대 Basal을 결정하고 이를 펌프와 설정에 입력한다. - Closed Loop를 시작하고 저혈당인슐린 중지 기능을 사용해본다. - 최대 IOB = 0 인 상태로 Closed Loop를 몇일동안 실행시켜 본다. 저혈당 인슐린일시중지가 많이 발생하지 않도록 한다. - Closed Loop를 조정하여 최대 IOB를 0 이상으로 올려서 서서히 혈당 목표치를 낮춘다. - 혈당을 낮추기 전에 몇일간 사용해보되 최소한 하루는 저혈당 혈당 알람이 발생하지 않도록 해본다. - 필요하면 Basal과 비율을 조절하고, auto-sens를 활성화한다. - 평소의 탄수화물을 입력하면서 1주일동안 낮시간대에 loop를 성공적으로 사용해본다. - AMA(Advanced Meal Assist)같은 낮시간대를 위한 추가적인 기능들을 실행하여 본다. - 낮시간대에 SMB(Super Micro Bolus)같은 추가기능을 활성화해 사용해본다. - SMB가 잘 작동하게 하기위해서 wiki를 반드시 읽은다음 maxIOB를 올려주세요. maxIOB=평균 식사 Bolus + 3 x 최대하루 Basal이면 괜찮은 시작값입니다. + Open Loop를 시작한다. + Open Loop 모드에서 몇일간 사용하여보고, 임시Basal을 여러번 수동으로 주입해 본다. 임시목표와 기본임시목표(\'식사직전\', \'활동\',\'저혈당\' 임시목표)를 설정하고 사용해 본다. + 임시Basal 추천기능을 포함해서, Open Loop에 대해 이해한다. + 이 경험을 토대로, 최대 Basal을 결정하고 이를 펌프와 설정에 입력한다. + Closed Loop를 시작하고 저혈당인슐린 중지 기능을 사용해본다. + 최대 IOB = 0 인 상태로 Closed Loop를 몇일동안 실행시켜 본다. 저혈당 인슐린일시중지가 많이 발생하지 않도록 한다. + Closed Loop를 조정하여 최대 IOB를 0 이상으로 올려서 서서히 혈당 목표치를 낮춘다. + 혈당을 낮추기 전에 몇일간 사용해보되 최소한 하루는 저혈당 혈당 알람이 발생하지 않도록 해본다. + 필요하면 Basal과 비율을 조절하고, auto-sens를 활성화한다. + 평소의 탄수화물을 입력하면서 1주일동안 낮시간대에 loop를 성공적으로 사용해본다. + AMA(Advanced Meal Assist)같은 낮시간대를 위한 추가적인 기능들을 실행하여 본다. + 낮시간대에 SMB(Super Micro Bolus)같은 추가기능을 활성화해 사용해본다. + SMB가 잘 작동하게 하기위해서 wiki를 반드시 읽은다음 maxIOB를 올려주세요. maxIOB=평균 식사 Bolus + 3 x 최대하루 Basal이면 괜찮은 시작값입니다. 허용된 제한값에 도달하였습니다 프로파일이 선택되지 않았습니다 Loop가 중지되었습니다. diff --git a/app/src/main/res/values-lt-rLT/strings.xml b/app/src/main/res/values-lt-rLT/strings.xml index 9bb6c69d77..8b7a5dd029 100644 --- a/app/src/main/res/values-lt-rLT/strings.xml +++ b/app/src/main/res/values-lt-rLT/strings.xml @@ -317,19 +317,19 @@ Bus suleista %1$.2fvv Nustatymai vizualizacijai, monitoringui ir bazės verčių bei koeficientų analizei Įsitikinkite, kad gliukozės duomenys rodomi Nightscout, o pompos insulino duomenys yra įkelti - Aktyvuojamas atviras ciklas - Keletą dienų praleiskite atvirojo ciklo (Open Loop) režime, rankiniu būdu tvirtindami kuo daugiau siūlomų bazės pakeitimų. Nustatykite ir naudokite laikinus bei numatytuosiuos tikslus (pvz.: fiziniam aktyvumui ir hipo korekcijai angliavandeniais) - Perpraskite atvirojo ciklo veikimą bei laikinos bazės rekomendacijas - Remdamiesi šia patirtimi, nuspręskite, koks turėtų būti maksimalus bazės dydis bei įveskite jį pompoje ir programos Nustatymuose - Pradėkite uždaro ciklo (Closed Loop) režimą su pompos stabdymu esant žemai gliukozei - Keletą dienų praleiskite uždaro ciklo režime su kuo mažiau hipoglikemijų, kai IK = 0 - Koreguokite savo uždarąjį ciklą po truputį didindami maks IK ir mažindami tikslinę gliukozės vertę - Praleiskite keletą dienų ir bent vieną naktį be hipoglikemijos aliarmų - Jei reikia, paderinkite valandines bazės vertes bei pagrindinius parametrus ir įgalinkite Autosens funkciją. - 1 savaitę praleiskite sėkmingai naudodami uždarąjį ciklą dienos metu ir įvesdami visus valgomus angliavandenius. - Dienos metu aktyvuokite papildomas funkcijas, tokias kaip pažangioji maisto skaičiuoklė (AMA Advanced Meal Assist) - Dienos metu aktyvuokite papildomas funkcijas, tokias kaip SMB (Super Mikro Bolusas). - Norėdami, kad SMB veiktų gerai, turite perskaityti dokumentaciją ir padidinti max IK! Pradžiai patartina skaičiuoti taip: maxIK=(didžiausia valandinė bazė x 3) + vidutinis bolusas. + Aktyvuojamas atviras ciklas + Keletą dienų praleiskite atvirojo ciklo (Open Loop) režime, rankiniu būdu tvirtindami kuo daugiau siūlomų bazės pakeitimų. Nustatykite ir naudokite laikinus bei numatytuosiuos tikslus (pvz.: fiziniam aktyvumui ir hipo korekcijai angliavandeniais) + Perpraskite atvirojo ciklo veikimą bei laikinos bazės rekomendacijas + Remdamiesi šia patirtimi, nuspręskite, koks turėtų būti maksimalus bazės dydis bei įveskite jį pompoje ir programos Nustatymuose + Pradėkite uždaro ciklo (Closed Loop) režimą su pompos stabdymu esant žemai gliukozei + Keletą dienų praleiskite uždaro ciklo režime su kuo mažiau hipoglikemijų, kai IK = 0 + Koreguokite savo uždarąjį ciklą po truputį didindami maks IK ir mažindami tikslinę gliukozės vertę + Praleiskite keletą dienų ir bent vieną naktį be hipoglikemijos aliarmų + Jei reikia, paderinkite valandines bazės vertes bei pagrindinius parametrus ir įgalinkite Autosens funkciją. + 1 savaitę praleiskite sėkmingai naudodami uždarąjį ciklą dienos metu ir įvesdami visus valgomus angliavandenius. + Dienos metu aktyvuokite papildomas funkcijas, tokias kaip pažangioji maisto skaičiuoklė (AMA Advanced Meal Assist) + Dienos metu aktyvuokite papildomas funkcijas, tokias kaip SMB (Super Mikro Bolusas). + Norėdami, kad SMB veiktų gerai, turite perskaityti dokumentaciją ir padidinti max IK! Pradžiai patartina skaičiuoti taip: maxIK=(didžiausia valandinė bazė x 3) + vidutinis bolusas. Pasiekėte leistiną ribą Nepasirinktas profilis Ciklas buvo išjungtas diff --git a/app/src/main/res/values-nl-rNL/strings.xml b/app/src/main/res/values-nl-rNL/strings.xml index c4290d7067..b533055e4a 100644 --- a/app/src/main/res/values-nl-rNL/strings.xml +++ b/app/src/main/res/values-nl-rNL/strings.xml @@ -319,20 +319,20 @@ Er worden %1$.2fE toegediend Opzetten van visualisatie en monitoring en analyzeren van basaal en ratio\'s Controleren van beschikbaarheid BG en insuline pomp data op Nightscout - Starten met de Open Loop modus - In Open Loop modus werken voor enkele dagen en handmatig meermaals tijdelijke basaal instellen. + Starten met de Open Loop modus + In Open Loop modus werken voor enkele dagen en handmatig meermaals tijdelijke basaal instellen. Stel in en gebruik tijdelijk en standaard tijdelijke streefdoelen (bv. bij sporten of koolhydraten inname bij hypo) - De Open Loop begrijpen, inclusief de voorgestelde tijdelijke basaalstanden - Gebaseerd op deze ervaringen beslissen wat het maximale basaal mag zijn en dit in de pomp instellen - Starten met closed Loop met bescherming tegen lage BG - In closed Loop werken met een max. IOB = 0 gedurende enkele dagen met een beperkt aantal lage BG - Inregelen van de closed loop, verhoog de max IOB boven 0 en laat gelijdelijk het streef BG dalen - Verhoog max. IOB en test enkele dagen als ook minstens 1 nacht zonder een laag BG alarm voordat je jouw streef BG verlaagt - Pas het basaal en de ratios aan indien nodig, activeer hierna de auto-sens optie - Gedurende 1 week succesvol closed loop met invoer van koolhydraten - Activeren van extra functies overdag zoals AMA - Activeren van extra functies overdag zoals SMB - Lees de wiki en verhoog maxIOB om SMB goed werkend te krijgen. Een goed begin is maxIOB=gemiddelde maaltijdbolus + 3 x max dagelijkse basaal + De Open Loop begrijpen, inclusief de voorgestelde tijdelijke basaalstanden + Gebaseerd op deze ervaringen beslissen wat het maximale basaal mag zijn en dit in de pomp instellen + Starten met closed Loop met bescherming tegen lage BG + In closed Loop werken met een max. IOB = 0 gedurende enkele dagen met een beperkt aantal lage BG + Inregelen van de closed loop, verhoog de max IOB boven 0 en laat gelijdelijk het streef BG dalen + Verhoog max. IOB en test enkele dagen als ook minstens 1 nacht zonder een laag BG alarm voordat je jouw streef BG verlaagt + Pas het basaal en de ratios aan indien nodig, activeer hierna de auto-sens optie + Gedurende 1 week succesvol closed loop met invoer van koolhydraten + Activeren van extra functies overdag zoals AMA + Activeren van extra functies overdag zoals SMB + Lees de wiki en verhoog maxIOB om SMB goed werkend te krijgen. Een goed begin is maxIOB=gemiddelde maaltijdbolus + 3 x max dagelijkse basaal Limiet bereikt Geen profiel geselecteerd Loop was uitgeschakeld diff --git a/app/src/main/res/values-pl-rPL/strings.xml b/app/src/main/res/values-pl-rPL/strings.xml index 2089344350..dd5b411768 100644 --- a/app/src/main/res/values-pl-rPL/strings.xml +++ b/app/src/main/res/values-pl-rPL/strings.xml @@ -319,19 +319,19 @@ Zamierzam dostarczyć %1$.2fU Konfiguracja wizualizacji i monitorowania, analiza dawek i wartości bazowych Sprawdź czy BG (pomiary cukru) są dostępne w Nightscout, i dane pompy insulinowej są ładowane - Uruchamiam otwartą pętle (OpenLoop) - Używaj Otwartą pętle (OpenLoop) przez kilka dni, i ręcznie wykonaj wiele dawek bazowych tymczasowych (np. podczas aktywności fizycznej lub leczenia hipoglikemii węglowodanami) - Zrozumienie działania otwartej pętli, wraz z jej rekomendacjami dawek tymczasowych - Na podstawie tych doświadczeń zdecyduj jaka maksymalna baza powinna być ustawiona, i wprowadź ją w pompie i w ustawieniach AAPS - Rozpoczęcie zamknięcia pętli z zawieszeniem podawania bazy przy niskim poziomie cukru - Używaj zamkniętej pętli (Closed Loop) z max IOB (maksymalną dawką aktywnej insuliny) = 0 bez zbyt wielu incydentów niedocukrzeń - Dostrajanie zamkniętej pętli, podniesienie wartości max IOB powyżej 0 i stopniowe obniżanie docelowego poziomu cukru (BG target) - Używaj pętli przez kilka dni i przynajmniej jedną noc bez żadnego alarmu niskiego poziomu, przed obniżeniem docelowego poziomu cukru (BG target) - Dostosuj bazę i wartości parametrów, i wtedy uruchom funkcję autosens - 1 tydzień sukcesu w działaniu pętli w ciągu dnia z regularnym wprowadzaniem spożywanych węglowodanów (węglow.) - Uruchomienie do użytku dziennego dodatkowych funkcji, jak AMA (zaawansowany asystent posiłku) - Uruchomienie do użytku dziennego dodatkowych funkcji, jak SMB (Super Mikro Bolusy) - Musisz przeczytać wiki i zwiększyć maxIOB, aby SMB działało dobrze! Dobrym początkiem jest max10 = średni bolus + 3 x maks. dzienna dawka bazowa + Uruchamiam otwartą pętle (OpenLoop) + Używaj Otwartą pętle (OpenLoop) przez kilka dni, i ręcznie wykonaj wiele dawek bazowych tymczasowych (np. podczas aktywności fizycznej lub leczenia hipoglikemii węglowodanami) + Zrozumienie działania otwartej pętli, wraz z jej rekomendacjami dawek tymczasowych + Na podstawie tych doświadczeń zdecyduj jaka maksymalna baza powinna być ustawiona, i wprowadź ją w pompie i w ustawieniach AAPS + Rozpoczęcie zamknięcia pętli z zawieszeniem podawania bazy przy niskim poziomie cukru + Używaj zamkniętej pętli (Closed Loop) z max IOB (maksymalną dawką aktywnej insuliny) = 0 bez zbyt wielu incydentów niedocukrzeń + Dostrajanie zamkniętej pętli, podniesienie wartości max IOB powyżej 0 i stopniowe obniżanie docelowego poziomu cukru (BG target) + Używaj pętli przez kilka dni i przynajmniej jedną noc bez żadnego alarmu niskiego poziomu, przed obniżeniem docelowego poziomu cukru (BG target) + Dostosuj bazę i wartości parametrów, i wtedy uruchom funkcję autosens + 1 tydzień sukcesu w działaniu pętli w ciągu dnia z regularnym wprowadzaniem spożywanych węglowodanów (węglow.) + Uruchomienie do użytku dziennego dodatkowych funkcji, jak AMA (zaawansowany asystent posiłku) + Uruchomienie do użytku dziennego dodatkowych funkcji, jak SMB (Super Mikro Bolusy) + Musisz przeczytać wiki i zwiększyć maxIOB, aby SMB działało dobrze! Dobrym początkiem jest max10 = średni bolus + 3 x maks. dzienna dawka bazowa Osiągnąłeś dozwolony limit Nie wybrano profilu Pętla (Loop) została wyłączona diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 36298223bd..d5aa5f93cd 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -318,19 +318,19 @@ Vão ser administradas %1$.2fU Configuração da visualização e monitoramento, e análise de rácios e basals Verificar se a BG está disponível no Nightscout, e se os dados de insulina da bomba estão a ser carregados - A iniciar um open loop - Execute no Modo de Loop aberto por alguns dias e execute manualmente muitos basais de temp. Configure e use alvos temporários e padrão (por exemplo, para atividades ou tratamento hipos com carboidratos) - Compreender o seu open loop, incluindo as suas recomendações de basais temporárias - Com base nessa experiência, decidir qual deve ser a basal máxima e configurá-la na bomba e nas preferências - Começar o close loop com Suspensão por Glicose Baixa. - Utilizar em close loop com IOB máx = 0 por alguns dias sem muitas situações de Suspensão por Baixa Glicose - Ajustar o close loop, levantar a IOB máxima acima de 0 e reduzir gradualmente os alvos de valor glicémico - Utilizar por alguns dias e pelo menos uma noite sem alarmes de valores glicémicos baixos, antes de baixar os valores - Ajustar as basals e os rácios se necessário e em seguida habilitar o auto-sens - 1 semana de looping durante o dia com sucesso com entrada de hidratos de carbono regular - Ativando recursos adicionais para uso durante o dia, como assistente avançado de refeição - Ativando recursos adicionais para uso durante o dia, como SMB - Deverá ler a wiki e aumentar a IOB máx para que os SMBs funcionem devidamente! Inicialmente poderá considerar maxIOB= média dos bolus + 3 x a basal máxima + A iniciar um open loop + Execute no Modo de Loop aberto por alguns dias e execute manualmente muitos basais de temp. Configure e use alvos temporários e padrão (por exemplo, para atividades ou tratamento hipos com carboidratos) + Compreender o seu open loop, incluindo as suas recomendações de basais temporárias + Com base nessa experiência, decidir qual deve ser a basal máxima e configurá-la na bomba e nas preferências + Começar o close loop com Suspensão por Glicose Baixa. + Utilizar em close loop com IOB máx = 0 por alguns dias sem muitas situações de Suspensão por Baixa Glicose + Ajustar o close loop, levantar a IOB máxima acima de 0 e reduzir gradualmente os alvos de valor glicémico + Utilizar por alguns dias e pelo menos uma noite sem alarmes de valores glicémicos baixos, antes de baixar os valores + Ajustar as basals e os rácios se necessário e em seguida habilitar o auto-sens + 1 semana de looping durante o dia com sucesso com entrada de hidratos de carbono regular + Ativando recursos adicionais para uso durante o dia, como assistente avançado de refeição + Ativando recursos adicionais para uso durante o dia, como SMB + Deverá ler a wiki e aumentar a IOB máx para que os SMBs funcionem devidamente! Inicialmente poderá considerar maxIOB= média dos bolus + 3 x a basal máxima Atingiu o limite autorizado Nenhum perfil selecionado Loop foi desativado diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index b7373f49ce..8397635e0d 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -319,19 +319,19 @@ Vão ser administradas %1$.2fU Configuração da visualização e monitoramento, e análise de rácios e basals Verificar se a BG está disponível no Nightscout, e se os dados de insulina da bomba estão a ser carregados - A iniciar um open loop - Utilizar em modo de open loop por alguns dias e dar manualmente muitas basais temporárias. Configurar e usar alvos temporários e alvos padrão temporários (por exemplo, para atividade ou tratamentos de hipo com Hcs) - Compreender o seu open loop, incluindo as suas recomendações de basais temporárias - Com base nessa experiência, decidir qual deve ser a basal máxima e configurá-la na bomba e nas preferências - Começar o close loop com Suspensão por Glicose Baixa. - Utilizar em close loop com IOB máx = 0 por alguns dias sem muitas situações de Suspensão por Baixa Glicose - Ajustar o close loop, levantar a IOB máxima acima de 0 e reduzir gradualmente os alvos de valor glicémico - Utilizar por alguns dias e pelo menos uma noite sem alarmes de valores glicémicos baixos, antes de baixar os valores - Ajustar as basals e os rácios se necessário e em seguida habilitar o auto-sens - 1 semana de looping durante o dia com sucesso com entrada de hidratos de carbono regular - Ativando recursos adicionais para uso durante o dia, como assistente avançado de refeição - Ativando recursos adicionais para uso durante o dia, como SMB - Deverá ler a wiki e aumentar a IOB máx para que os SMBs funcionem devidamente! Inicialmente poderá considerar maxIOB= média dos bolus + 3 x a basal máxima + A iniciar um open loop + Utilizar em modo de open loop por alguns dias e dar manualmente muitas basais temporárias. Configurar e usar alvos temporários e alvos padrão temporários (por exemplo, para atividade ou tratamentos de hipo com Hcs) + Compreender o seu open loop, incluindo as suas recomendações de basais temporárias + Com base nessa experiência, decidir qual deve ser a basal máxima e configurá-la na bomba e nas preferências + Começar o close loop com Suspensão por Glicose Baixa. + Utilizar em close loop com IOB máx = 0 por alguns dias sem muitas situações de Suspensão por Baixa Glicose + Ajustar o close loop, levantar a IOB máxima acima de 0 e reduzir gradualmente os alvos de valor glicémico + Utilizar por alguns dias e pelo menos uma noite sem alarmes de valores glicémicos baixos, antes de baixar os valores + Ajustar as basals e os rácios se necessário e em seguida habilitar o auto-sens + 1 semana de looping durante o dia com sucesso com entrada de hidratos de carbono regular + Ativando recursos adicionais para uso durante o dia, como assistente avançado de refeição + Ativando recursos adicionais para uso durante o dia, como SMB + Deverá ler a wiki e aumentar a IOB máx para que os SMBs funcionem devidamente! Inicialmente poderá considerar maxIOB= média dos bolus + 3 x a basal máxima Atingiu o limite autorizado Nenhum perfil seleccionado Loop foi desactivado diff --git a/app/src/main/res/values-ro-rRO/strings.xml b/app/src/main/res/values-ro-rRO/strings.xml index 3192b9c1b7..a082e820dc 100644 --- a/app/src/main/res/values-ro-rRO/strings.xml +++ b/app/src/main/res/values-ro-rRO/strings.xml @@ -319,19 +319,19 @@ Se va livra un bolus de %1$.2fU Se stabilesc vizualizările și monitorizarea și se analizează bazalele și valorile ratelor Verificați că vedeți glicemia în Nightscout și că datele despre insulină date de pompă sunt înregistrate în site - Pornire în mod buclă deschisă - Rulați în modul Buclă Deschisă pentru câteva zile și faceți manual bazalele temporare sugerate. Setează și folosește ținte temporare implicite (ex.: pentru activități sau carbohidrați de tratare a hipo) - Trebuie să fie înțeleasă modalitatea de funcționare a buclei deschise, inclusiv recomandările de bazală temporară - Pe baza acestei experiențe, decideți care va fi bazala maximă și setați această valoare în pompă și în preferințe - Se începe etapa de buclă închisă cu Suspendarea Insulinei la Valori Glicemie Mici (Low Glucose Suspend = LGS) - Folosiți sistemul în mod buclă închisă cu IOB maxim = 0 pentru câteva zile fără prea multe evenimente LGS - Acordați fin performanța buclei închise, prin mărirea valorii max IOB peste 0 și micșorarea graduală a țintelor glicemice - Folosiți pentru câteva zile și cel puțin o noapte fără a avea alarme de hipoglicemie, înainte de scăderea glicemiei - Ajustați bazalele și ratele dacă este cazul și apoi activați autosens - O săptămână de folosire cu succes a sistemului cu buclă închisă cu introducerea normală de carbohidrați - Folosirea instrumentelor adiționale pentru timpul zilei, cum ar fi asistența avansată pentru mese - Se activează opțiuni pentru uzul în timpul zilei, cum ar fi SMB - Trebuie sa citiți wiki și măriți maxIOB pentru a obține SMB corect! Un start bun este maxIOB=media bolusurilor + 3x maxima bazalei din zi + Pornire în mod buclă deschisă + Rulați în modul Buclă Deschisă pentru câteva zile și faceți manual bazalele temporare sugerate. Setează și folosește ținte temporare implicite (ex.: pentru activități sau carbohidrați de tratare a hipo) + Trebuie să fie înțeleasă modalitatea de funcționare a buclei deschise, inclusiv recomandările de bazală temporară + Pe baza acestei experiențe, decideți care va fi bazala maximă și setați această valoare în pompă și în preferințe + Se începe etapa de buclă închisă cu Suspendarea Insulinei la Valori Glicemie Mici (Low Glucose Suspend = LGS) + Folosiți sistemul în mod buclă închisă cu IOB maxim = 0 pentru câteva zile fără prea multe evenimente LGS + Acordați fin performanța buclei închise, prin mărirea valorii max IOB peste 0 și micșorarea graduală a țintelor glicemice + Folosiți pentru câteva zile și cel puțin o noapte fără a avea alarme de hipoglicemie, înainte de scăderea glicemiei + Ajustați bazalele și ratele dacă este cazul și apoi activați autosens + O săptămână de folosire cu succes a sistemului cu buclă închisă cu introducerea normală de carbohidrați + Folosirea instrumentelor adiționale pentru timpul zilei, cum ar fi asistența avansată pentru mese + Se activează opțiuni pentru uzul în timpul zilei, cum ar fi SMB + Trebuie sa citiți wiki și măriți maxIOB pentru a obține SMB corect! Un start bun este maxIOB=media bolusurilor + 3x maxima bazalei din zi Ați atins limita permisă Niciun profil selectat Bucla a fost dezactivată diff --git a/app/src/main/res/values-ru-rRU/strings.xml b/app/src/main/res/values-ru-rRU/strings.xml index 4c44552007..a02cbfe998 100644 --- a/app/src/main/res/values-ru-rRU/strings.xml +++ b/app/src/main/res/values-ru-rRU/strings.xml @@ -319,19 +319,19 @@ Начинается подача болюса %1$.2fед. настройка визуализации и мониторинга, анализ базала и коэффициентов убедитесь что СК и данные помпы передаются в NS - старт незамкнутого цикла - Работа в режиме незамкнутого цикла и ручной подстройки величины временного базала. Установите и применяйте временные цели и временные цели по умолчанию (напр. углеводы при нагрузке или купировании гипо) - анализ вашего незамкнутого цикла включая рекомендации по врем базалу - на основе полученного опыта определите макс величину базала и введите ее в помпу и настройки - закольцовывание цикла с Low Glucose Suspend (приостановка на низких СК) - работа в замкнутом цикле с макс IOB = 0 несколько дней избегая событий типа Low Suspend - настройка замкнутого цикла с поднятием макс величины IOB выше 0 и постепенным понижением целевых СК - работа несколько дней и по кр мере одну ночь без срабатывания оповещений о низком СК - при необходимости настройка базала и коэффициентов с последующей активацией auto-sens - 1 неделя успешной дневной работы с регулярным введением углеводов - активация таких доп функций для дневного времени как калькулятор advanced meal assist - Активация таких доп функций для дневного времени как супер микро болюс SMB - Прочтите wiki и увеличьте maxIOB чтобы супер микро болюс SMB заработал как надо! Хорошее начало – maxIOB = средний болюс на еду + троекратный максимальный базал суток + старт незамкнутого цикла + Работа в режиме незамкнутого цикла и ручной подстройки величины временного базала. Установите и применяйте временные цели и временные цели по умолчанию (напр. углеводы при нагрузке или купировании гипо) + анализ вашего незамкнутого цикла включая рекомендации по врем базалу + на основе полученного опыта определите макс величину базала и введите ее в помпу и настройки + закольцовывание цикла с Low Glucose Suspend (приостановка на низких СК) + работа в замкнутом цикле с макс IOB = 0 несколько дней избегая событий типа Low Suspend + настройка замкнутого цикла с поднятием макс величины IOB выше 0 и постепенным понижением целевых СК + работа несколько дней и по кр мере одну ночь без срабатывания оповещений о низком СК + при необходимости настройка базала и коэффициентов с последующей активацией auto-sens + 1 неделя успешной дневной работы с регулярным введением углеводов + активация таких доп функций для дневного времени как калькулятор advanced meal assist + Активация таких доп функций для дневного времени как супер микро болюс SMB + Прочтите wiki и увеличьте maxIOB чтобы супер микро болюс SMB заработал как надо! Хорошее начало – maxIOB = средний болюс на еду + троекратный максимальный базал суток разрешенный предел достигнут профиль не выбран зцикл был деактивирован diff --git a/app/src/main/res/values-sk-rSK/strings.xml b/app/src/main/res/values-sk-rSK/strings.xml index 4c48889b37..939d05599b 100644 --- a/app/src/main/res/values-sk-rSK/strings.xml +++ b/app/src/main/res/values-sk-rSK/strings.xml @@ -318,19 +318,19 @@ Podávanie %1$.2fJ inzulínu Nastavenie vizualizácie a monitoringu (Nightscout), analyzovať bazály a prevody Skontrolovať, či sú glykémie a údaje z pumpy viditeľné v Nightscoute - Začať s otvoreným okruhom - Niekoľko dní prevádzkovať otvorený okruh a ručne potvrdzovať doporučené dočasné bazály. Nastavovať a používať dočasné ciele (napr. pre šport, alebo hypo) - Porozumieť otvorenému okruhu a doporučeným dočasným bazálom - Na základe predchádzajúcich skúseností rozhodnúť, aký vysoký má byť maximálny bazál a nastaviť ho v pumpe a v aplikácii - Začať s uzavretým okruhom iba s vypínaním pri nízkej glykémii - Spustiť uzavretý okruh s max IOB = 0 na niekoľko dní s minimom nutných korekcií na nízku glykémiu - Ladenie uzavretého okruhu, zvyšovať max IOB nad 0 a postupne znižovať cieľovú glykémiu - Používať niekoľko dní s aspoň jednou nocou bez alarmov na nízku glykémiu, predtým ako znížiš cieľovú glykémiu - Ak je to potrebné, prispôsob bazály a prevody a potom aktivuj automatickú detekciu citlivosti - Jeden týždeň úspešne používaj uzavretý okruh so zadávaním bežného príjmu sacharidov cez deň - Aktivuj ďalšie prídavné funkcie pre bežné používanie, ako napr. AMA (pokročilý asistent jedál) - Aktivuj ďalšie prídavné funkcie pre bežné používanie, ako napr. SMB (Super Micro Bolusy) - Prečítať si dokumentáciu a zvýšiť maximálne IOB, aby mohlo správne fungovať SMB! Pre začiatok sa dá použiť veľkosť bežného bolusu + 3x maximálny denný bazál + Začať s otvoreným okruhom + Niekoľko dní prevádzkovať otvorený okruh a ručne potvrdzovať doporučené dočasné bazály. Nastavovať a používať dočasné ciele (napr. pre šport, alebo hypo) + Porozumieť otvorenému okruhu a doporučeným dočasným bazálom + Na základe predchádzajúcich skúseností rozhodnúť, aký vysoký má byť maximálny bazál a nastaviť ho v pumpe a v aplikácii + Začať s uzavretým okruhom iba s vypínaním pri nízkej glykémii + Spustiť uzavretý okruh s max IOB = 0 na niekoľko dní s minimom nutných korekcií na nízku glykémiu + Ladenie uzavretého okruhu, zvyšovať max IOB nad 0 a postupne znižovať cieľovú glykémiu + Používať niekoľko dní s aspoň jednou nocou bez alarmov na nízku glykémiu, predtým ako znížiš cieľovú glykémiu + Ak je to potrebné, prispôsob bazály a prevody a potom aktivuj automatickú detekciu citlivosti + Jeden týždeň úspešne používaj uzavretý okruh so zadávaním bežného príjmu sacharidov cez deň + Aktivuj ďalšie prídavné funkcie pre bežné používanie, ako napr. AMA (pokročilý asistent jedál) + Aktivuj ďalšie prídavné funkcie pre bežné používanie, ako napr. SMB (Super Micro Bolusy) + Prečítať si dokumentáciu a zvýšiť maximálne IOB, aby mohlo správne fungovať SMB! Pre začiatok sa dá použiť veľkosť bežného bolusu + 3x maximálny denný bazál Dosiahnutý limit Nebol vybraný žiadny profil Uzavretý okruh bol deaktivovaný diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml index d144f753db..cec99c78fc 100644 --- a/app/src/main/res/values-sv-rSE/strings.xml +++ b/app/src/main/res/values-sv-rSE/strings.xml @@ -319,19 +319,19 @@ Eversense-appen. Kommer att leverera %1$.2f enheter Ställer in utseende och övervakning för att sedan kunna analysera basaler och kvoter Kontrollera att BG syns i Nightscout och att insulindata från pumpen laddas upp - Starta med open loop - Starta med open loop och använd det några dagar. Försök att ge många föreslagna temp basaler. Sätt upp och använd standardmålvärden (Träning, Äta snart och Hypo) - Förstå din open loop och hur den föreslår temp basaler - Utifrån vad du nu lärt dig, besluta vilken max basal du vill ha. Ställ in det både i inställningarna i APS och i din pump - Börja använda closed loop med aktiverad funktion att stänga av vid lågt BG - Aktivera closed loop med max IOB=0 i några dagar till dess systemet inte stänger av pga lågt BG för många gånger - Finjustering av closed loop, gradvis ökande IOB och minskande målvärde för BG - Kör några dagar och åtminstone en natt utan larm för lågt BG innan du sänker målvärdet för BG. - Justera basaler och kvoter om det behövs. Aktivera sedan autosens - 1 veckas lyckad looping dagtid, där alla måltider lagts in - Aktiverar extra funktioner som kan användas dagtid, såsom avancerad måltidsassistans, AMA - Aktiverar ytterligare funktioner för användning dagtid, t ex SMB - Du måste läsa på wikin och öka max IOB för att få SMB att fungera bra. En bra start är att sätta max IOB till din genomsnittliga måltidsbolus plus 3 gånger den högsta basalen du har under ett dygn + Starta med open loop + Starta med open loop och använd det några dagar. Försök att ge många föreslagna temp basaler. Sätt upp och använd standardmålvärden (Träning, Äta snart och Hypo) + Förstå din open loop och hur den föreslår temp basaler + Utifrån vad du nu lärt dig, besluta vilken max basal du vill ha. Ställ in det både i inställningarna i APS och i din pump + Börja använda closed loop med aktiverad funktion att stänga av vid lågt BG + Aktivera closed loop med max IOB=0 i några dagar till dess systemet inte stänger av pga lågt BG för många gånger + Finjustering av closed loop, gradvis ökande IOB och minskande målvärde för BG + Kör några dagar och åtminstone en natt utan larm för lågt BG innan du sänker målvärdet för BG. + Justera basaler och kvoter om det behövs. Aktivera sedan autosens + 1 veckas lyckad looping dagtid, där alla måltider lagts in + Aktiverar extra funktioner som kan användas dagtid, såsom avancerad måltidsassistans, AMA + Aktiverar ytterligare funktioner för användning dagtid, t ex SMB + Du måste läsa på wikin och öka max IOB för att få SMB att fungera bra. En bra start är att sätta max IOB till din genomsnittliga måltidsbolus plus 3 gånger den högsta basalen du har under ett dygn Du har nått din tillåtna gräns Ingen profil vald Loop stängdes av diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index 7e3b17017d..a54171f2dc 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -306,19 +306,19 @@ Pompa bekleniyor Nightscout üzerinden izlemeyi ve görselleştirmeyi yapılandırın ve bazal oranlarını ve faktörleri düzenleyin Nightscout\'ta KŞ\'nin bulunduğunu ve insülin verilerinin yüklenmekte olduğunu doğrulayın - Açık Döngü modu başlatılıyor - Birkaç gün boyunca Açık Döngü modunda çalıştırın ve birçok geçici bazalı el yordamı ile girin. Geçici ve varsayılan geçici hedefleri düzenleyin ve kullanın (örn. egzersiz ve hipo-tedaviyi desteklemek için) - Geçici bazal tavsiyeleri de dahil olmak üzere Açık Döngü anlamak - Bu deneyime dayanarak, max bazalın ne olması gerektiğine karar vermeli ve bunu pompa ve tercihlere koymalısınız - Kapalı Döngü, (LGS) Düşük Kan Şekerinde Duraklatma modunda başlatılıyor - Çok sayıda LGS (düşük KŞ) olmadan birkaç gün boyunca maksimum IOB = 0 (Aktif insülin) Kapalı Döngü\'de deneyin - Kapalı Döngü\'de ince ayarlar, maksimum (IOB) Aktif İnsülinin 0\'ın üzerine yükseltme ve yavaş yavaş KŞ hedeflerini aşağıya çekme - KŞ hedefini azaltmadan önce birkaç gün ve en az bir gece düşük KŞ (Hipo) alarmı olmadan deneyin - Gerekirse, bazal ve oranları ayarlayın ve sonra auto-sens\'i etkinleştirin - Bir hafta boyunca düzenli Karbonhidrad girdileri yaparak gün boyunca Kapalı Döngüyü çalıştırın - Gelişmiş yemek asistanı gibi gündüz kullanımı için ek özelliklerin etkinleştirilmesi - SMB (Super Micro Bolus) gibi gündüz kullanımı için ek özelliklerin etkinleştirilmesi - (Super Micro Bolus) SMB\'lerın iyi çalışabilmesi için wiki\'yi okumalısınız ve maxIOB\'u yükseltmelisiniz! İyi bir başlangıç için maxIOB = ortalama yemek bolusu + 3 x max günlük bazaldır + Açık Döngü modu başlatılıyor + Birkaç gün boyunca Açık Döngü modunda çalıştırın ve birçok geçici bazalı el yordamı ile girin. Geçici ve varsayılan geçici hedefleri düzenleyin ve kullanın (örn. egzersiz ve hipo-tedaviyi desteklemek için) + Geçici bazal tavsiyeleri de dahil olmak üzere Açık Döngü anlamak + Bu deneyime dayanarak, max bazalın ne olması gerektiğine karar vermeli ve bunu pompa ve tercihlere koymalısınız + Kapalı Döngü, (LGS) Düşük Kan Şekerinde Duraklatma modunda başlatılıyor + Çok sayıda LGS (düşük KŞ) olmadan birkaç gün boyunca maksimum IOB = 0 (Aktif insülin) Kapalı Döngü\'de deneyin + Kapalı Döngü\'de ince ayarlar, maksimum (IOB) Aktif İnsülinin 0\'ın üzerine yükseltme ve yavaş yavaş KŞ hedeflerini aşağıya çekme + KŞ hedefini azaltmadan önce birkaç gün ve en az bir gece düşük KŞ (Hipo) alarmı olmadan deneyin + Gerekirse, bazal ve oranları ayarlayın ve sonra auto-sens\'i etkinleştirin + Bir hafta boyunca düzenli Karbonhidrad girdileri yaparak gün boyunca Kapalı Döngüyü çalıştırın + Gelişmiş yemek asistanı gibi gündüz kullanımı için ek özelliklerin etkinleştirilmesi + SMB (Super Micro Bolus) gibi gündüz kullanımı için ek özelliklerin etkinleştirilmesi + (Super Micro Bolus) SMB\'lerın iyi çalışabilmesi için wiki\'yi okumalısınız ve maxIOB\'u yükseltmelisiniz! İyi bir başlangıç için maxIOB = ortalama yemek bolusu + 3 x max günlük bazaldır İzin verilen sınıra ulaştınız Profil seçilmedi Döngü devre dışı bırakıldı diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index a7f198603b..876695eff9 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -317,19 +317,19 @@ 将要输注 %1$.2fU 设置可视化和监视, 并分析基础率和比率 验证 Nightscout 中的血糖是否可用, 并且正在上传泵的胰岛素数据 - 开始开环 - 在开环模式下运行几天,并在手机上手动制定很多次临时基础率。设置和使用临时目标和默认的临时目标 (例如, 用于活动或处理碳水化合物) - 了解你的开环,包括它的临时基础率建议 - 基于以上的经验,决定适合自己的最大基础率,在泵和本软件的参数选项上设置 - 开始闭环模式,低血糖自动暂停 - 在闭环模式下运行,设置最大IOB = 0 运行几天确保没有太多的低血糖事件 - 优化闭环,逐渐增加最大IOB,并逐渐降低目标血糖值 - 运行几天,至少一个晚上没有低血糖报警,然后才可以继续调低目标血糖 - 如果需要的话,调整基础率和比值,然后再启用auto-sense - 一个星期成功的白天闭环,常规的碳水化合物摄入 - 启用额外的功能以供白天使用,例如用餐助手(meal assist) - 启用额外的功能以供白天使用, 例如微型大剂量 SMB - 为了让微型大剂量工作的更好,你必须读指南,提高最大IOB的值。 建议是最大IOB值=餐时大剂量的平均值+3倍 的每日基础率中的最大值 + 开始开环 + 在开环模式下运行几天,并在手机上手动制定很多次临时基础率。设置和使用临时目标和默认的临时目标 (例如, 用于活动或处理碳水化合物) + 了解你的开环,包括它的临时基础率建议 + 基于以上的经验,决定适合自己的最大基础率,在泵和本软件的参数选项上设置 + 开始闭环模式,低血糖自动暂停 + 在闭环模式下运行,设置最大IOB = 0 运行几天确保没有太多的低血糖事件 + 优化闭环,逐渐增加最大IOB,并逐渐降低目标血糖值 + 运行几天,至少一个晚上没有低血糖报警,然后才可以继续调低目标血糖 + 如果需要的话,调整基础率和比值,然后再启用auto-sense + 一个星期成功的白天闭环,常规的碳水化合物摄入 + 启用额外的功能以供白天使用,例如用餐助手(meal assist) + 启用额外的功能以供白天使用, 例如微型大剂量 SMB + 为了让微型大剂量工作的更好,你必须读指南,提高最大IOB的值。 建议是最大IOB值=餐时大剂量的平均值+3倍 的每日基础率中的最大值 你达到了允许的极限 没有选定配置文件 闭环已经被禁用 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b19dbe0022..d7dab0fd47 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -350,19 +350,19 @@ Going to deliver %1$.2fU Setting up visualization and monitoring, and analyzing basals and ratios Verify that BG is available in Nightscout, and pump insulin data is being uploaded - Starting on an open loop - Run in Open Loop mode for a few days and manually enact lots of temp basals. Set up and use temporary and default temporary targets (e.g. for activity or hypo treatment carbs) - Understanding your open loop, including its temp basal recommendations - Based on that experience, decide what max basal should be, and set it on the pump and preferences - Starting to close the loop with Low Glucose Suspend - Run in closed loop with max IOB = 0 for a few days without too many LGS events - Tuning the closed loop, raising max IOB above 0 and gradually lowering BG targets - Run for a few days, and at least one night with no low BG alarms, before dropping BG - Adjust basals and ratios if needed, and then enable auto-sens - 1 week successful daytime looping with regular carb entry - Enabling additional features for daytime use, such as advanced meal assist - Enabling additional features for daytime use, such as SMB - You must read the wiki and rise maxIOB to get SMBs working fine! A good start is maxIOB=average mealbolus + 3 x max daily basal + Starting on an open loop + Run in Open Loop mode for a few days and manually enact lots of temp basals. Set up and use temporary and default temporary targets (e.g. for activity or hypo treatment carbs) + Understanding your open loop, including its temp basal recommendations + Based on that experience, decide what max basal should be, and set it on the pump and preferences + Starting to close the loop with Low Glucose Suspend + Run in closed loop with max IOB = 0 for a few days without too many LGS events + Tuning the closed loop, raising max IOB above 0 and gradually lowering BG targets + Run for a few days, and at least one night with no low BG alarms, before dropping BG + Adjust basals and ratios if needed, and then enable auto-sens + 1 week successful daytime looping with regular carb entry + Enabling additional features for daytime use, such as advanced meal assist + Enabling additional features for daytime use, such as SMB + You must read the wiki and rise maxIOB to get SMBs working fine! A good start is maxIOB=average mealbolus + 3 x max daily basal You reached allowed limit No profile selected Loop has been disabled @@ -1606,6 +1606,22 @@ Loading ... Snooze Accomplished: %1$s + Learn how to control AndroidAPS + Perform different actions in AndroidAPS + Set profile 90% for 10 min (Long-press profile name on Overview) + ObjectivesProfileSwitchUsed + ObjectivesDisconnectUsed + ObjectivesReconnectUsed + ObjectivesTempTargetUsed + ObjectivesActionsUsed + ObjectivesLoopUsed + ObjectivesScaleUsed + Simulate shower. Disconnect pump for 1h (Long-press on Open Loop) + ... and reconnect back the same way + Create custom temporary target with 10 min duration (Long-press on your current target) + In Config Builder enable Actions plugin, make it visible and display its content from top menu + Display content of Loop plugin + Use scale function by long-pressing BG chart %1$d day From 12a2d789c1771a09026f07f16b2153eb2fba57fb Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 1 Sep 2019 21:27:56 +0200 Subject: [PATCH 04/14] convert objectives --- .../objectives/ObjectivesPlugin.java | 20 +++++++++++++++++++ .../objectives/objectives/Objective.java | 14 ++++++------- .../objectives/objectives/Objective0.java | 2 +- .../objectives/objectives/Objective1.java | 2 +- .../objectives/objectives/Objective2.java | 2 +- .../objectives/objectives/Objective3.java | 2 +- .../objectives/objectives/Objective4.java | 2 +- .../objectives/objectives/Objective5.java | 2 +- .../objectives/objectives/Objective6.java | 2 +- .../objectives/objectives/Objective7.java | 2 +- .../objectives/objectives/Objective8.java | 2 +- 11 files changed, 36 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java index f7f566ec3d..42fd12b822 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java @@ -70,6 +70,7 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface .shortName(R.string.objectives_shortname) .description(R.string.description_objectives) ); + convertSP(); setupObjectives(); loadProgress(); } @@ -80,6 +81,25 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface return pump == null || pump.getPumpDescription().isTempBasalCapable; } + // convert 2.3 SP version + private void convertSP() { + doConvertSP(0, "config"); + doConvertSP(1, "openloop"); + doConvertSP(2, "maxbasal"); + doConvertSP(3, "maxiobzero"); + doConvertSP(4, "maxiob"); + doConvertSP(5, "autosens"); + doConvertSP(6, "ama"); + doConvertSP(7, "smb"); + } + + private void doConvertSP(int number, String name) { + if (!SP.contains("Objectives_" + name + "_started")) { + SP.putLong("Objectives_" + name + "_started", SP.getLong("Objectives" + number + "accomplished", 0L)); + SP.putLong("Objectives_" + name + "_accomplished", SP.getLong("Objectives" + number + "accomplished", 0L)); + } + } + private void setupObjectives() { objectives.add(new Objective0()); objectives.add(new Objective1()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java index b39301d766..70179a82bc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java @@ -12,7 +12,7 @@ import info.nightscout.androidaps.utils.T; public abstract class Objective { - private int number; + String spName; @StringRes private int objective; @StringRes @@ -21,12 +21,12 @@ public abstract class Objective { private long accomplishedOn; private List tasks = new ArrayList<>(); - public Objective(int number, @StringRes int objective, @StringRes int gate) { - this.number = number; + public Objective(String spName, @StringRes int objective, @StringRes int gate) { + this.spName = spName; this.objective = objective; this.gate = gate; - startedOn = SP.getLong("Objectives" + number + "started", 0L); - accomplishedOn = SP.getLong("Objectives" + number + "accomplished", 0L); + startedOn = SP.getLong("Objectives_" + spName + "_started", 0L); + accomplishedOn = SP.getLong("Objectives_" + spName + "_accomplished", 0L); setupTasks(tasks); for (Task task : tasks) task.objective = this; } @@ -65,12 +65,12 @@ public abstract class Objective { public void setStartedOn(long startedOn) { this.startedOn = startedOn; - SP.putLong("Objectives" + number + "started", startedOn); + SP.putLong("Objectives_" + spName + "_started", startedOn); } public void setAccomplishedOn(long accomplishedOn) { this.accomplishedOn = accomplishedOn; - SP.putLong("Objectives" + number + "accomplished", accomplishedOn); + SP.putLong("Objectives_" + spName + "_accomplished", accomplishedOn); } public long getAccomplishedOn() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.java index f59079f0c0..607635a32b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.java @@ -19,7 +19,7 @@ import info.nightscout.androidaps.utils.SP; public class Objective0 extends Objective { public Objective0() { - super(ObjectivesPlugin.FIRST_OBJECTIVE, R.string.objectives_0_objective, R.string.objectives_0_gate); + super("config", R.string.objectives_0_objective, R.string.objectives_0_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective1.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective1.java index a6fd4cca52..22ff17331e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective1.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective1.java @@ -12,7 +12,7 @@ public class Objective1 extends Objective { public Objective1() { - super(ObjectivesPlugin.USAGE_OBJECTIVE, R.string.objectives_usage_objective, R.string.objectives_usage_gate); + super("usage", R.string.objectives_usage_objective, R.string.objectives_usage_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java index 3ced0e6e91..646d8ea458 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java @@ -12,7 +12,7 @@ public class Objective2 extends Objective { public final int MANUAL_ENACTS_NEEDED = 20; public Objective2() { - super(ObjectivesPlugin.OPENLOOP_OBJECTIVE, R.string.objectives_openloop_objective, R.string.objectives_openloop_gate); + super("openloop", R.string.objectives_openloop_objective, R.string.objectives_openloop_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.java index b75450e772..4439f70d60 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.java @@ -6,6 +6,6 @@ import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugi public class Objective3 extends Objective { public Objective3() { - super(ObjectivesPlugin.MAXBASAL_OBJECTIVE, R.string.objectives_maxbasal_objective, R.string.objectives_maxbasal_gate); + super("maxbasal", R.string.objectives_maxbasal_objective, R.string.objectives_maxbasal_gate); } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective4.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective4.java index 0576b7f3c1..a5f3c8790e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective4.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective4.java @@ -11,7 +11,7 @@ import info.nightscout.androidaps.utils.T; public class Objective4 extends Objective { public Objective4() { - super(ObjectivesPlugin.MAXIOB_ZERO_CL_OBJECTIVE, R.string.objectives_maxiobzero_objective, R.string.objectives_maxiobzero_gate); + super("maxiobzero", R.string.objectives_maxiobzero_objective, R.string.objectives_maxiobzero_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.java index 005b9a28e4..9a6474a2fd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.java @@ -10,7 +10,7 @@ import info.nightscout.androidaps.utils.T; public class Objective5 extends Objective { public Objective5() { - super(ObjectivesPlugin.MAXIOB_OBJECTIVE, R.string.objectives_maxiob_objective, R.string.objectives_maxiob_gate); + super("maxiob", R.string.objectives_maxiob_objective, R.string.objectives_maxiob_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.java index 64e9658cc8..bbb016b6dc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.java @@ -9,7 +9,7 @@ import info.nightscout.androidaps.utils.T; public class Objective6 extends Objective { public Objective6() { - super(ObjectivesPlugin.AUTOSENS_OBJECTIVE, R.string.objectives_autosens_objective, R.string.objectives_autosens_gate); + super("autosens", R.string.objectives_autosens_objective, R.string.objectives_autosens_gate); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.java index 7d66bbf6ae..3c68668e4b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.java @@ -9,7 +9,7 @@ import info.nightscout.androidaps.utils.T; public class Objective7 extends Objective { public Objective7() { - super(ObjectivesPlugin.AMA_OBJECTIVE, R.string.objectives_ama_objective, 0); + super("ama", R.string.objectives_ama_objective, 0); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective8.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective8.java index 9e79f6050e..53d1862786 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective8.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective8.java @@ -9,7 +9,7 @@ import info.nightscout.androidaps.utils.T; public class Objective8 extends Objective { public Objective8() { - super(ObjectivesPlugin.SMB_OBJECTIVE, R.string.objectives_smb_objective, R.string.objectives_smb_gate); + super("smb", R.string.objectives_smb_objective, R.string.objectives_smb_gate); } @Override From 99893a3ab19ed374d846b5bb26315e5549a3be1f Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 2 Sep 2019 08:42:25 +0200 Subject: [PATCH 05/14] allow bypass objectives --- .../objectives/ObjectivesFragment.java | 17 +++++++++++ .../objectives/ObjectivesPlugin.java | 27 ++++++++++++++++++ .../objectives/objectives/Objective.java | 7 +++-- .../objectives/objectives/Objective2.java | 6 ++++ app/src/main/res/layout/objectives_item.xml | 28 ++++++++++++++++++- app/src/main/res/values/strings.xml | 3 ++ 6 files changed, 85 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java index 293d052a27..c9399edbc3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.java @@ -10,6 +10,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.CheckBox; +import android.widget.EditText; import android.widget.LinearLayout; import android.widget.TextView; @@ -188,6 +189,18 @@ public class ObjectivesFragment extends SubscriberFragment { notifyDataSetChanged(); scrollToCurrentObjective(); }); + if (objective.hasSpecialInput) { + holder.enterButton.setVisibility(View.VISIBLE); + holder.input.setVisibility(View.VISIBLE); + holder.enterButton.setOnClickListener((view) -> { + String input = holder.input.getText().toString(); + objective.specialAction(input); + notifyDataSetChanged(); + }); + } else { + holder.enterButton.setVisibility(View.GONE); + holder.input.setVisibility(View.GONE); + } } @@ -207,6 +220,8 @@ public class ObjectivesFragment extends SubscriberFragment { Button verify; public Button start; Button revert; + EditText input; + Button enterButton; ViewHolder(View itemView) { super(itemView); @@ -219,6 +234,8 @@ public class ObjectivesFragment extends SubscriberFragment { start = itemView.findViewById(R.id.objective_start); revert = itemView.findViewById(R.id.objective_back); accomplished = itemView.findViewById(R.id.objective_accomplished); + input = itemView.findViewById(R.id.objective_input); + enterButton = itemView.findViewById(R.id.objective_enterbutton); } } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java index 42fd12b822..30267425c9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.java @@ -1,11 +1,15 @@ package info.nightscout.androidaps.plugins.constraints.objectives; +import com.google.common.base.Charsets; +import com.google.common.hash.Hashing; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; +import info.nightscout.androidaps.BuildConfig; import info.nightscout.androidaps.Config; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; @@ -28,6 +32,7 @@ import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Obje import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective6; import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective7; import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective8; +import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.SP; /** @@ -148,6 +153,28 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface return objectives; } + public void completeObjectives(String request) { + String url = SP.getString(R.string.key_nsclientinternal_url, "").toLowerCase(); + if (!url.endsWith("\"")) url = url + "\""; + String hashNS = Hashing.sha1().hashString(url + BuildConfig.APPLICATION_ID, Charsets.UTF_8).toString(); + if (request.equalsIgnoreCase(hashNS.substring(0, 9))) { + SP.putLong("Objectives_" + "openloop" + "_started", DateUtil.now()); + SP.putLong("Objectives_" + "openloop" + "_accomplished", DateUtil.now()); + SP.putLong("Objectives_" + "maxbasal" + "_started", DateUtil.now()); + SP.putLong("Objectives_" + "maxbasal" + "_accomplished", DateUtil.now()); + SP.putLong("Objectives_" + "maxiobzero" + "_started", DateUtil.now()); + SP.putLong("Objectives_" + "maxiobzero" + "_accomplished", DateUtil.now()); + SP.putLong("Objectives_" + "maxiob" + "_started", DateUtil.now()); + SP.putLong("Objectives_" + "maxiob" + "_accomplished", DateUtil.now()); + SP.putLong("Objectives_" + "autosens" + "_started", DateUtil.now()); + SP.putLong("Objectives_" + "autosens" + "_accomplished", DateUtil.now()); + SP.putLong("Objectives_" + "ama" + "_started", DateUtil.now()); + SP.putLong("Objectives_" + "ama" + "_accomplished", DateUtil.now()); + SP.putLong("Objectives_" + "smb" + "_started", DateUtil.now()); + SP.putLong("Objectives_" + "smb" + "_accomplished", DateUtil.now()); + } + } + /** * Constraints interface **/ diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java index 70179a82bc..5a32e35c4f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.java @@ -12,7 +12,7 @@ import info.nightscout.androidaps.utils.T; public abstract class Objective { - String spName; + private String spName; @StringRes private int objective; @StringRes @@ -20,6 +20,7 @@ public abstract class Objective { private long startedOn; private long accomplishedOn; private List tasks = new ArrayList<>(); + public boolean hasSpecialInput = false; public Objective(String spName, @StringRes int objective, @StringRes int gate) { this.spName = spName; @@ -85,6 +86,8 @@ public abstract class Objective { return tasks; } + public void specialAction(String input) {} + public abstract class Task { @StringRes private int task; @@ -117,7 +120,7 @@ public abstract class Objective { private long minimumDuration; - public MinimumDurationTask(long minimumDuration) { + MinimumDurationTask(long minimumDuration) { super(R.string.time_elapsed); this.minimumDuration = minimumDuration; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java index 646d8ea458..4096fd9d42 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective2.java @@ -13,6 +13,7 @@ public class Objective2 extends Objective { public Objective2() { super("openloop", R.string.objectives_openloop_objective, R.string.objectives_openloop_gate); + hasSpecialInput = true; } @Override @@ -33,4 +34,9 @@ public class Objective2 extends Objective { } }); } + + @Override + public void specialAction(String input) { + ObjectivesPlugin.getPlugin().completeObjectives(input); + } } diff --git a/app/src/main/res/layout/objectives_item.xml b/app/src/main/res/layout/objectives_item.xml index d11992b13f..e7a3901c59 100644 --- a/app/src/main/res/layout/objectives_item.xml +++ b/app/src/main/res/layout/objectives_item.xml @@ -49,7 +49,33 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" - android:orientation="vertical" /> + android:orientation="vertical" > + + + + + + + +