Merge branch 'dev' into TriggerTOD

This commit is contained in:
Roumen Georgiev 2019-09-10 10:30:20 +03:00 committed by GitHub
commit d525c3f220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 2121 additions and 1048 deletions

View file

@ -1,14 +1,10 @@
package info.nightscout.androidaps; package info.nightscout.androidaps;
import android.app.Application; import android.app.Application;
import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.res.Resources; import android.content.res.Resources;
import android.os.SystemClock; import android.os.SystemClock;
import android.util.Log;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.PluralsRes; 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.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin; import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin;
import info.nightscout.androidaps.plugins.constraints.storage.StorageConstraintPlugin; 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.automation.AutomationPlugin;
import info.nightscout.androidaps.plugins.general.careportal.CareportalPlugin; import info.nightscout.androidaps.plugins.general.careportal.CareportalPlugin;
import info.nightscout.androidaps.plugins.general.food.FoodPlugin; 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.ns.NSProfilePlugin;
import info.nightscout.androidaps.plugins.profile.simple.SimpleProfilePlugin; import info.nightscout.androidaps.plugins.profile.simple.SimpleProfilePlugin;
import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin; 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.danaR.DanaRPlugin;
import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.plugins.pump.danaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin; import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin;
@ -177,7 +171,7 @@ public class MainApp extends Application {
// Register all tabs in app here // Register all tabs in app here
pluginsList.add(OverviewPlugin.getPlugin()); pluginsList.add(OverviewPlugin.getPlugin());
pluginsList.add(IobCobCalculatorPlugin.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(InsulinOrefRapidActingPlugin.getPlugin());
pluginsList.add(InsulinOrefUltraRapidActingPlugin.getPlugin()); pluginsList.add(InsulinOrefUltraRapidActingPlugin.getPlugin());
pluginsList.add(InsulinOrefFreePeakPlugin.getPlugin()); pluginsList.add(InsulinOrefFreePeakPlugin.getPlugin());
@ -208,7 +202,7 @@ public class MainApp extends Application {
if (Config.SAFETY) pluginsList.add(VersionCheckerPlugin.INSTANCE); if (Config.SAFETY) pluginsList.add(VersionCheckerPlugin.INSTANCE);
if (Config.SAFETY) pluginsList.add(StorageConstraintPlugin.getPlugin()); if (Config.SAFETY) pluginsList.add(StorageConstraintPlugin.getPlugin());
if (Config.SAFETY) pluginsList.add(SignatureVerifier.getPlugin()); if (Config.SAFETY) pluginsList.add(SignatureVerifier.getPlugin());
if (Config.APS) pluginsList.add(ObjectivesPlugin.getPlugin()); if (Config.APS) pluginsList.add(ObjectivesPlugin.INSTANCE);
pluginsList.add(SourceXdripPlugin.getPlugin()); pluginsList.add(SourceXdripPlugin.getPlugin());
pluginsList.add(SourceNSClientPlugin.getPlugin()); pluginsList.add(SourceNSClientPlugin.getPlugin());
pluginsList.add(SourceMM640gPlugin.getPlugin()); pluginsList.add(SourceMM640gPlugin.getPlugin());

View file

@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.TimeZone; import java.util.TimeZone;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
@ -227,8 +228,10 @@ public class Profile {
for (int index = 0; index < basal_v.size(); index++) { for (int index = 0; index < basal_v.size(); index++) {
long secondsFromMidnight = basal_v.keyAt(index); long secondsFromMidnight = basal_v.keyAt(index);
if (notify && secondsFromMidnight % 3600 != 0) { if (notify && secondsFromMidnight % 3600 != 0) {
Notification notification = new Notification(Notification.BASAL_PROFILE_NOT_ALIGNED_TO_HOURS, String.format(MainApp.gs(R.string.basalprofilenotaligned), from), Notification.NORMAL); if (Config.APS) {
MainApp.bus().post(new EventNewNotification(notification)); Notification notification = new Notification(Notification.BASAL_PROFILE_NOT_ALIGNED_TO_HOURS, String.format(MainApp.gs(R.string.basalprofilenotaligned), from), Notification.NORMAL);
MainApp.bus().post(new EventNewNotification(notification));
}
} }
} }
} }

View file

@ -93,12 +93,22 @@ public class CareportalEvent implements DataPointWithLabelInterface, Interval {
return (System.currentTimeMillis() - date) / (60 * 60 * 1000.0); return (System.currentTimeMillis() - date) / (60 * 60 * 1000.0);
} }
public String age() { public String age(boolean useShortText) {
Map<TimeUnit, Long> diff = computeDiff(date, System.currentTimeMillis()); Map<TimeUnit, Long> diff = computeDiff(date, System.currentTimeMillis());
if (OverviewFragment.shorttextmode)
return diff.get(TimeUnit.DAYS) + "d" + diff.get(TimeUnit.HOURS) + "h"; String days = " " + MainApp.gs(R.string.days) + " ";
else String hours = " " + MainApp.gs(R.string.hours) + " ";
return diff.get(TimeUnit.DAYS) + " " + MainApp.gs(R.string.days) + " " + diff.get(TimeUnit.HOURS) + " " + MainApp.gs(R.string.hours);
if (useShortText) {
days = "d";
hours = "h";
}
return diff.get(TimeUnit.DAYS) + days + diff.get(TimeUnit.HOURS) + hours;
}
public String age() {
return age(OverviewFragment.shorttextmode);
} }
public boolean isOlderThan(double hours) { public boolean isOlderThan(double hours) {

View file

@ -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.EventLoopSetLastRunGui
import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui
import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.*
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.androidaps.utils.plusAssign
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import kotlinx.android.synthetic.main.loop_fragment.* import kotlinx.android.synthetic.main.loop_fragment.*
@ -61,6 +58,7 @@ class LoopFragment : Fragment() {
}) })
updateGUI() updateGUI()
SP.putBoolean(R.string.key_objectiveuseloop, true)
} }
@Synchronized @Synchronized

View file

@ -51,7 +51,6 @@ import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotifi
import info.nightscout.androidaps.plugins.bus.RxBus; import info.nightscout.androidaps.plugins.bus.RxBus;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions; import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload; import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.wear.ActionStringHandler; import info.nightscout.androidaps.plugins.general.wear.ActionStringHandler;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventAutosensCalculationFinished;
@ -471,11 +470,7 @@ public class LoopPlugin extends PluginBase {
lastRun.lastEnact = new Date(); lastRun.lastEnact = new Date();
lastRun.lastOpenModeAccept = new Date(); lastRun.lastOpenModeAccept = new Date();
NSUpload.uploadDeviceStatus(); NSUpload.uploadDeviceStatus();
ObjectivesPlugin objectivesPlugin = MainApp.getSpecificPlugin(ObjectivesPlugin.class); SP.incInt(R.string.key_ObjectivesmanualEnacts);
if (objectivesPlugin != null) {
ObjectivesPlugin.getPlugin().manualEnacts++;
ObjectivesPlugin.getPlugin().saveProgress();
}
} }
MainApp.bus().post(new EventAcceptOpenLoopChange()); MainApp.bus().post(new EventAcceptOpenLoopChange());
} }

View file

@ -27,6 +27,7 @@ import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperAc
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.queue.Callback; import info.nightscout.androidaps.queue.Callback;
import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.SP;
public class ProfileFunctions { public class ProfileFunctions {
private static Logger log = LoggerFactory.getLogger(L.PROFILE); private static Logger log = LoggerFactory.getLogger(L.PROFILE);
@ -101,7 +102,8 @@ public class ProfileFunctions {
} }
public boolean isProfileValid(String from) { public boolean isProfileValid(String from) {
return getProfile() != null && getProfile().isValid(from); Profile profile = getProfile();
return profile != null && profile.isValid(from);
} }
@Nullable @Nullable
@ -159,6 +161,8 @@ public class ProfileFunctions {
public static void doProfileSwitch(final ProfileStore profileStore, final String profileName, final int duration, final int percentage, final int timeshift) { 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()); ProfileSwitch profileSwitch = prepareProfileSwitch(profileStore, profileName, duration, percentage, timeshift, System.currentTimeMillis());
TreatmentsPlugin.getPlugin().addToHistoryProfileSwitch(profileSwitch); 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) { public static void doProfileSwitch(final int duration, final int percentage, final int timeshift) {

View file

@ -1,229 +0,0 @@
package info.nightscout.androidaps.plugins.constraints.objectives;
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;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.Date;
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.FabricPrivacy;
public class ObjectivesFragment extends SubscriberFragment {
RecyclerView recyclerView;
CheckBox enableFake;
TextView reset;
ObjectivesAdapter objectivesAdapter = new ObjectivesAdapter();
Handler handler = new Handler(Looper.getMainLooper());
private Runnable objectiveUpdater = new Runnable() {
@Override
public void run() {
handler.postDelayed(this, 60 * 1000);
updateGUI();
}
};
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
try {
View view = inflater.inflate(R.layout.objectives_fragment, container, false);
recyclerView = view.findViewById(R.id.objectives_recyclerview);
recyclerView.setLayoutManager(new LinearLayoutManager(view.getContext()));
recyclerView.setAdapter(objectivesAdapter);
enableFake = view.findViewById(R.id.objectives_fake);
reset = view.findViewById(R.id.objectives_reset);
enableFake.setOnClickListener(v -> updateGUI());
reset.setOnClickListener(v -> {
ObjectivesPlugin.getPlugin().reset();
ObjectivesPlugin.getPlugin().saveProgress();
recyclerView.getAdapter().notifyDataSetChanged();
scrollToCurrentObjective();
});
scrollToCurrentObjective();
startUpdateTimer();
return view;
} catch (Exception e) {
FabricPrivacy.logException(e);
}
return null;
}
@Override
public synchronized void onDestroyView() {
super.onDestroyView();
handler.removeCallbacks(objectiveUpdater);
}
private void startUpdateTimer() {
handler.removeCallbacks(objectiveUpdater);
for (Objective objective : ObjectivesPlugin.getPlugin().getObjectives()) {
if (objective.isStarted() && !objective.isAccomplished()) {
long timeTillNextMinute = (System.currentTimeMillis() - objective.getStartedOn().getTime()) % (60 * 1000);
handler.postDelayed(objectiveUpdater, timeTillNextMinute);
break;
}
}
}
private void scrollToCurrentObjective() {
for (int i = 0; i < ObjectivesPlugin.getPlugin().getObjectives().size(); i++) {
Objective objective = ObjectivesPlugin.getPlugin().getObjectives().get(i);
if (!objective.isStarted() || !objective.isAccomplished()) {
RecyclerView.SmoothScroller smoothScroller = new LinearSmoothScroller(getContext()) {
@Override
protected int getVerticalSnapPreference() {
return LinearSmoothScroller.SNAP_TO_START;
}
@Override
protected int calculateTimeForScrolling(int dx) {
return super.calculateTimeForScrolling(dx) * 4;
}
};
smoothScroller.setTargetPosition(i);
recyclerView.getLayoutManager().startSmoothScroll(smoothScroller);
break;
}
}
}
private class ObjectivesAdapter extends RecyclerView.Adapter<ObjectivesAdapter.ViewHolder> {
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.objectives_item, parent, false));
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
Objective objective = ObjectivesPlugin.getPlugin().getObjectives().get(position);
holder.title.setText(MainApp.gs(R.string.nth_objective, position + 1));
holder.revert.setVisibility(View.INVISIBLE);
if (objective.getObjective() != 0) {
holder.objective.setVisibility(View.VISIBLE);
holder.objective.setText(MainApp.gs(objective.getObjective()));
} else holder.objective.setVisibility(View.GONE);
if (objective.getGate() != 0) {
holder.gate.setVisibility(View.VISIBLE);
holder.gate.setText(MainApp.gs(objective.getGate()));
} else holder.gate.setVisibility(View.GONE);
if (!objective.isStarted()) {
holder.gate.setTextColor(0xFFFFFFFF);
holder.verify.setVisibility(View.GONE);
holder.progress.setVisibility(View.GONE);
if (position == 0 || ObjectivesPlugin.getPlugin().getObjectives().get(position - 1).isAccomplished())
holder.start.setVisibility(View.VISIBLE);
else holder.start.setVisibility(View.GONE);
} else if (objective.isAccomplished()) {
holder.gate.setTextColor(0xFF4CAF50);
holder.verify.setVisibility(View.GONE);
holder.progress.setVisibility(View.GONE);
holder.start.setVisibility(View.GONE);
} 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);
if(objective.isRevertable()) {
holder.revert.setVisibility(View.VISIBLE);
}
holder.progress.setVisibility(View.VISIBLE);
holder.progress.removeAllViews();
for (Objective.Task task : objective.getTasks()) {
if (task.shouldBeIgnored()) continue;
TextView textView = new TextView(holder.progress.getContext());
textView.setTextColor(0xFFFFFFFF);
String basicHTML = "%2$s: <font color=\"%1$s\"><b>%3$s</b></font>";
String formattedHTML = String.format(basicHTML, task.isCompleted() ? "#4CAF50" : "#FF9800", MainApp.gs(task.getTask()), task.getProgress());
textView.setText(Html.fromHtml(formattedHTML));
holder.progress.addView(textView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
}
}
holder.verify.setOnClickListener((view) -> {
objective.setAccomplishedOn(new Date());
notifyDataSetChanged();
scrollToCurrentObjective();
startUpdateTimer();
});
holder.start.setOnClickListener((view) -> {
objective.setStartedOn(new Date());
notifyDataSetChanged();
scrollToCurrentObjective();
startUpdateTimer();
});
holder.revert.setOnClickListener((view) -> {
objective.setAccomplishedOn(null);
objective.setStartedOn(null);
if (position > 0) {
Objective prevObj = ObjectivesPlugin.getPlugin().getObjectives().get(position - 1);
prevObj.setAccomplishedOn(null);
}
notifyDataSetChanged();
scrollToCurrentObjective();
});
}
@Override
public int getItemCount() {
return ObjectivesPlugin.getPlugin().getObjectives().size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
public CardView cardView;
public TextView title;
public TextView objective;
public TextView gate;
public LinearLayout progress;
public Button verify;
public Button start;
public Button revert;
public ViewHolder(View itemView) {
super(itemView);
cardView = (CardView) itemView;
title = itemView.findViewById(R.id.objective_title);
objective = itemView.findViewById(R.id.objective_objective);
gate = itemView.findViewById(R.id.objective_gate);
progress = itemView.findViewById(R.id.objective_progress);
verify = itemView.findViewById(R.id.objective_verify);
start = itemView.findViewById(R.id.objective_start);
revert = itemView.findViewById(R.id.objective_back);
}
}
}
@Override
public void updateGUI() {
Activity activity = getActivity();
if (activity != null)
activity.runOnUiThread(() -> {
objectivesAdapter.notifyDataSetChanged();
});
}
}

View file

@ -0,0 +1,268 @@
package info.nightscout.androidaps.plugins.constraints.objectives
import android.graphics.Color
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.TextView
import androidx.fragment.app.Fragment
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
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.constraints.objectives.activities.ObjectivesExamDialog
import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.ExamTask
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.HtmlHelper
import info.nightscout.androidaps.utils.SP
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import kotlinx.android.synthetic.main.objectives_fragment.*
class ObjectivesFragment : Fragment() {
private val objectivesAdapter = ObjectivesAdapter()
private val handler = Handler(Looper.getMainLooper())
private var disposable: CompositeDisposable = CompositeDisposable()
private val objectiveUpdater = object : Runnable {
override fun run() {
handler.postDelayed(this, (60 * 1000).toLong())
updateGUI()
}
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.objectives_fragment, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
objectives_recyclerview.layoutManager = LinearLayoutManager(view.context)
objectives_recyclerview.adapter = objectivesAdapter
objectives_fake.setOnClickListener { updateGUI() }
objectives_reset.setOnClickListener {
ObjectivesPlugin.reset()
objectives_recyclerview.adapter?.notifyDataSetChanged()
scrollToCurrentObjective()
}
scrollToCurrentObjective()
startUpdateTimer()
}
@Synchronized
override fun onResume() {
super.onResume()
disposable.add(RxBus
.toObservable(EventObjectivesUpdateGui::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
objectives_recyclerview.adapter?.notifyDataSetChanged()
}, {
FabricPrivacy.logException(it)
})
)
}
@Synchronized
override fun onPause() {
super.onPause()
disposable.clear()
}
@Synchronized
override fun onDestroyView() {
super.onDestroyView()
handler.removeCallbacks(objectiveUpdater)
}
private fun startUpdateTimer() {
handler.removeCallbacks(objectiveUpdater)
for (objective in ObjectivesPlugin.objectives) {
if (objective.isStarted && !objective.isAccomplished) {
val timeTillNextMinute = (System.currentTimeMillis() - objective.startedOn) % (60 * 1000)
handler.postDelayed(objectiveUpdater, timeTillNextMinute)
break
}
}
}
private fun scrollToCurrentObjective() {
for (i in 0 until ObjectivesPlugin.objectives.size) {
val objective = ObjectivesPlugin.objectives[i]
if (!objective.isStarted || !objective.isAccomplished) {
val smoothScroller = object : LinearSmoothScroller(context!!) {
override fun getVerticalSnapPreference(): Int {
return SNAP_TO_START
}
override fun calculateTimeForScrolling(dx: Int): Int {
return super.calculateTimeForScrolling(dx) * 4
}
}
smoothScroller.targetPosition = i
objectives_recyclerview.layoutManager?.startSmoothScroll(smoothScroller)
break
}
}
}
private inner class ObjectivesAdapter : RecyclerView.Adapter<ObjectivesAdapter.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.objectives_item, parent, false))
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val objective = ObjectivesPlugin.objectives[position]
holder.title.text = MainApp.gs(R.string.nth_objective, position + 1)
holder.revert.visibility = View.GONE
if (objective.objective != 0) {
holder.objective.visibility = View.VISIBLE
holder.objective.text = MainApp.gs(objective.objective)
} else
holder.objective.visibility = View.GONE
if (objective.gate != 0) {
holder.gate.visibility = View.VISIBLE
holder.gate.text = MainApp.gs(objective.gate)
} else
holder.gate.visibility = View.GONE
if (!objective.isStarted) {
holder.gate.setTextColor(-0x1)
holder.verify.visibility = View.GONE
holder.progress.visibility = View.GONE
holder.accomplished.visibility = View.GONE
if (position == 0 || ObjectivesPlugin.objectives[position - 1].isAccomplished)
holder.start.visibility = View.VISIBLE
else
holder.start.visibility = View.GONE
} else if (objective.isAccomplished) {
holder.gate.setTextColor(-0xb350b0)
holder.verify.visibility = View.GONE
holder.progress.visibility = View.GONE
holder.start.visibility = View.GONE
holder.accomplished.visibility = View.VISIBLE
} else if (objective.isStarted) {
holder.gate.setTextColor(-0x1)
holder.verify.visibility = View.VISIBLE
holder.verify.isEnabled = objective.isCompleted || objectives_fake.isChecked
holder.start.visibility = View.GONE
holder.accomplished.visibility = View.GONE
if (objective.isRevertable) {
holder.revert.visibility = View.VISIBLE
}
holder.progress.visibility = View.VISIBLE
holder.progress.removeAllViews()
for (task in objective.tasks) {
if (task.shouldBeIgnored()) continue
val name = TextView(holder.progress.context)
name.text = MainApp.gs(task.task) + ":"
name.setTextColor(-0x1)
holder.progress.addView(name, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)
val state = TextView(holder.progress.context)
state.setTextColor(-0x1)
val basicHTML = "<font color=\"%1\$s\"><b>%2\$s</b></font>"
val formattedHTML = String.format(basicHTML, if (task.isCompleted) "#4CAF50" else "#FF9800", task.progress)
state.text = HtmlHelper.fromHtml(formattedHTML)
state.gravity = Gravity.END
holder.progress.addView(state, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)
if (task is ExamTask) {
state.setOnClickListener {
val dialog = ObjectivesExamDialog()
val bundle = Bundle()
val position = objective.tasks.indexOf(task)
bundle.putInt("currentTask", position)
dialog.arguments = bundle
ObjectivesExamDialog.objective = objective
fragmentManager?.let { dialog.show(it, "ObjectivesFragment") }
}
}
val separator = View(holder.progress.context)
separator.setBackgroundColor(Color.DKGRAY)
holder.progress.addView(separator, LinearLayout.LayoutParams.MATCH_PARENT, 2)
}
}
holder.accomplished.text = MainApp.gs(R.string.accomplished, DateUtil.dateAndTimeString(objective.accomplishedOn))
holder.accomplished.setTextColor(-0x3e3e3f)
holder.verify.setOnClickListener {
objective.accomplishedOn = DateUtil.now()
notifyDataSetChanged()
scrollToCurrentObjective()
startUpdateTimer()
}
holder.start.setOnClickListener {
objective.startedOn = DateUtil.now()
notifyDataSetChanged()
scrollToCurrentObjective()
startUpdateTimer()
}
holder.revert.setOnClickListener {
objective.accomplishedOn = 0
objective.startedOn = 0
if (position > 0) {
val prevObj = ObjectivesPlugin.objectives[position - 1]
prevObj.accomplishedOn = 0
}
notifyDataSetChanged()
scrollToCurrentObjective()
}
if (objective.hasSpecialInput && !objective.isAccomplished && objective.isStarted) {
// generate random request code if none exists
val request = SP.getString(R.string.key_objectives_request_code, String.format("%1$05d", (Math.random() * 99999).toInt()))
SP.putString(R.string.key_objectives_request_code, request)
holder.requestCode.text = MainApp.gs(R.string.requestcode, request)
holder.requestCode.visibility = View.VISIBLE
holder.enterButton.visibility = View.VISIBLE
holder.input.visibility = View.VISIBLE
holder.inputHint.visibility = View.VISIBLE
holder.enterButton.setOnClickListener {
val input = holder.input.text.toString()
objective.specialAction(activity, input)
notifyDataSetChanged()
}
} else {
holder.enterButton.visibility = View.GONE
holder.input.visibility = View.GONE
holder.inputHint.visibility = View.GONE
holder.requestCode.visibility = View.GONE
}
}
override fun getItemCount(): Int {
return ObjectivesPlugin.objectives.size
}
inner class ViewHolder internal constructor(itemView: View) : RecyclerView.ViewHolder(itemView) {
val title: TextView = itemView.findViewById(R.id.objective_title)
val objective: TextView = itemView.findViewById(R.id.objective_objective)
val gate: TextView = itemView.findViewById(R.id.objective_gate)
val accomplished: TextView = itemView.findViewById(R.id.objective_accomplished)
val progress: LinearLayout = itemView.findViewById(R.id.objective_progress)
val verify: Button = itemView.findViewById(R.id.objective_verify)
val start: Button = itemView.findViewById(R.id.objective_start)
val revert: Button = itemView.findViewById(R.id.objective_back)
val inputHint: TextView = itemView.findViewById(R.id.objective_inputhint)
val input: EditText = itemView.findViewById(R.id.objective_input)
val enterButton: Button = itemView.findViewById(R.id.objective_enterbutton)
val requestCode: TextView = itemView.findViewById(R.id.objective_requestcode)
}
}
fun updateGUI() {
activity?.runOnUiThread { objectivesAdapter.notifyDataSetChanged() }
}
}

View file

@ -1,164 +0,0 @@
package info.nightscout.androidaps.plugins.constraints.objectives;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
import info.nightscout.androidaps.Config;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.interfaces.ConstraintsInterface;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.PumpInterface;
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.Objective1;
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective2;
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective3;
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective4;
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective5;
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.SP;
/**
* Created by mike on 05.08.2016.
*/
public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface {
private static Logger log = LoggerFactory.getLogger(L.CONSTRAINTS);
private static ObjectivesPlugin objectivesPlugin;
public List<Objective> objectives = new ArrayList<>();
public boolean bgIsAvailableInNS = false;
public boolean pumpStatusIsAvailableInNS = false;
public Integer manualEnacts = 0;
public static ObjectivesPlugin getPlugin() {
if (objectivesPlugin == null) {
objectivesPlugin = new ObjectivesPlugin();
}
return objectivesPlugin;
}
private ObjectivesPlugin() {
super(new PluginDescription()
.mainType(PluginType.CONSTRAINTS)
.fragmentClass(ObjectivesFragment.class.getName())
.alwaysEnabled(!Config.NSCLIENT)
.showInList(!Config.NSCLIENT)
.pluginName(R.string.objectives)
.shortName(R.string.objectives_shortname)
.description(R.string.description_objectives)
);
setupObjectives();
loadProgress();
}
@Override
public boolean specialEnableCondition() {
PumpInterface pump = ConfigBuilderPlugin.getPlugin().getActivePump();
return pump == null || pump.getPumpDescription().isTempBasalCapable;
}
private void setupObjectives() {
objectives.add(new Objective1());
objectives.add(new Objective2());
objectives.add(new Objective3());
objectives.add(new Objective4());
objectives.add(new Objective5());
objectives.add(new Objective6());
objectives.add(new Objective7());
objectives.add(new Objective8());
}
public void reset() {
for (Objective objective : objectives) {
objective.setStartedOn(null);
objective.setAccomplishedOn(null);
}
bgIsAvailableInNS = false;
pumpStatusIsAvailableInNS = false;
manualEnacts = 0;
saveProgress();
}
public void saveProgress() {
SP.putBoolean("Objectives" + "bgIsAvailableInNS", bgIsAvailableInNS);
SP.putBoolean("Objectives" + "pumpStatusIsAvailableInNS", pumpStatusIsAvailableInNS);
SP.putString("Objectives" + "manualEnacts", Integer.toString(manualEnacts));
if (L.isEnabled(L.CONSTRAINTS))
log.debug("Objectives stored");
MainApp.bus().post(new EventObjectivesSaved());
}
private void loadProgress() {
bgIsAvailableInNS = SP.getBoolean("Objectives" + "bgIsAvailableInNS", false);
pumpStatusIsAvailableInNS = SP.getBoolean("Objectives" + "pumpStatusIsAvailableInNS", false);
try {
manualEnacts = SP.getInt("Objectives" + "manualEnacts", 0);
} catch (Exception e) {
log.error("Unhandled exception", e);
}
if (L.isEnabled(L.CONSTRAINTS))
log.debug("Objectives loaded");
}
public List<Objective> getObjectives() {
return objectives;
}
/**
* Constraints interface
**/
@Override
public Constraint<Boolean> isLoopInvocationAllowed(Constraint<Boolean> value) {
if (!objectives.get(0).isStarted())
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 1), this);
return value;
}
@Override
public Constraint<Boolean> isClosedLoopAllowed(Constraint<Boolean> value) {
if (!objectives.get(3).isStarted())
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 4), this);
return value;
}
@Override
public Constraint<Boolean> isAutosensModeEnabled(Constraint<Boolean> value) {
if (!objectives.get(5).isStarted())
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 6), this);
return value;
}
@Override
public Constraint<Boolean> isAMAModeEnabled(Constraint<Boolean> value) {
if (!objectives.get(6).isStarted())
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 7), this);
return value;
}
@Override
public Constraint<Boolean> isSMBModeEnabled(Constraint<Boolean> value) {
if (!objectives.get(7).isStarted())
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), 8), this);
return value;
}
@Override
public Constraint<Double> applyMaxIOBConstraints(Constraint<Double> maxIob) {
if (objectives.get(3).isStarted() && !objectives.get(3).isAccomplished())
maxIob.set(0d, String.format(MainApp.gs(R.string.objectivenotfinished), 4), this);
return maxIob;
}
}

View file

@ -0,0 +1,170 @@
package info.nightscout.androidaps.plugins.constraints.objectives
import android.app.Activity
import com.google.common.base.Charsets
import com.google.common.hash.Hashing
import info.nightscout.androidaps.BuildConfig
import info.nightscout.androidaps.Config
import info.nightscout.androidaps.MainApp
import info.nightscout.androidaps.R
import info.nightscout.androidaps.interfaces.*
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.*
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.OKDialog
import info.nightscout.androidaps.utils.SP
import java.util.*
/**
* Created by mike on 05.08.2016.
*/
object ObjectivesPlugin : PluginBase(PluginDescription()
.mainType(PluginType.CONSTRAINTS)
.fragmentClass(ObjectivesFragment::class.qualifiedName)
.alwaysEnabled(!Config.NSCLIENT)
.showInList(!Config.NSCLIENT)
.pluginName(R.string.objectives)
.shortName(R.string.objectives_shortname)
.description(R.string.description_objectives)), ConstraintsInterface {
var objectives: MutableList<Objective> = ArrayList()
val FIRST_OBJECTIVE = 0
val USAGE_OBJECTIVE = 1
val EXAM_OBJECTIVE = 2
val OPENLOOP_OBJECTIVE = 3
val MAXBASAL_OBJECTIVE = 4
val MAXIOB_ZERO_CL_OBJECTIVE = 5
val MAXIOB_OBJECTIVE = 6
val AUTOSENS_OBJECTIVE = 7
val AMA_OBJECTIVE = 8
val SMB_OBJECTIVE = 9
init {
convertSP()
setupObjectives()
}
override fun specialEnableCondition(): Boolean {
val pump = ConfigBuilderPlugin.getPlugin().activePump
return pump == null || pump.pumpDescription.isTempBasalCapable
}
// convert 2.3 SP version
private fun 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 fun doConvertSP(number: Int, name: String) {
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))
}
// TODO: we can remove Objectives1accomplished sometimes later
}
private fun setupObjectives() {
objectives.clear()
objectives.add(Objective0())
objectives.add(Objective1())
objectives.add(Objective2())
objectives.add(Objective3())
objectives.add(Objective4())
objectives.add(Objective5())
objectives.add(Objective6())
objectives.add(Objective7())
objectives.add(Objective8())
objectives.add(Objective9())
}
fun reset() {
for (objective in objectives) {
objective.startedOn = 0
objective.accomplishedOn = 0
}
SP.putBoolean(R.string.key_ObjectivesbgIsAvailableInNS, false)
SP.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, false)
SP.putInt(R.string.key_ObjectivesmanualEnacts, 0)
SP.putBoolean(R.string.key_objectiveuseprofileswitch, false)
SP.putBoolean(R.string.key_objectiveusedisconnect, false)
SP.putBoolean(R.string.key_objectiveusereconnect, false)
SP.putBoolean(R.string.key_objectiveusetemptarget, false)
SP.putBoolean(R.string.key_objectiveuseactions, false)
SP.putBoolean(R.string.key_objectiveuseloop, false)
SP.putBoolean(R.string.key_objectiveusescale, false)
}
fun completeObjectives(activity: Activity, request: String) {
val requestCode = SP.getString(R.string.key_objectives_request_code, "")
var url = SP.getString(R.string.key_nsclientinternal_url, "").toLowerCase()
if (!url.endsWith("\"")) url = "$url/"
val hashNS = Hashing.sha1().hashString(url + BuildConfig.APPLICATION_ID + "/" + requestCode, Charsets.UTF_8).toString()
if (request.equals(hashNS.substring(0, 10), ignoreCase = true)) {
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())
setupObjectives()
OKDialog.show(activity, "", MainApp.gs(R.string.codeaccepted), null)
} else {
OKDialog.show(activity, "", MainApp.gs(R.string.codeinvalid), null)
}
}
/**
* Constraints interface
*/
override fun isLoopInvocationAllowed(value: Constraint<Boolean>): Constraint<Boolean> {
if (!objectives[FIRST_OBJECTIVE].isStarted)
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), FIRST_OBJECTIVE + 1), this)
return value
}
override fun isClosedLoopAllowed(value: Constraint<Boolean>): Constraint<Boolean> {
if (!objectives[MAXIOB_ZERO_CL_OBJECTIVE].isStarted)
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), MAXIOB_ZERO_CL_OBJECTIVE + 1), this)
return value
}
override fun isAutosensModeEnabled(value: Constraint<Boolean>): Constraint<Boolean> {
if (!objectives[AUTOSENS_OBJECTIVE].isStarted)
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), AUTOSENS_OBJECTIVE + 1), this)
return value
}
override fun isAMAModeEnabled(value: Constraint<Boolean>): Constraint<Boolean> {
if (!objectives[AMA_OBJECTIVE].isStarted)
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), AMA_OBJECTIVE + 1), this)
return value
}
override fun isSMBModeEnabled(value: Constraint<Boolean>): Constraint<Boolean> {
if (!objectives[SMB_OBJECTIVE].isStarted)
value.set(false, String.format(MainApp.gs(R.string.objectivenotstarted), SMB_OBJECTIVE + 1), this)
return value
}
override fun applyMaxIOBConstraints(maxIob: Constraint<Double>): Constraint<Double> {
if (objectives[MAXIOB_ZERO_CL_OBJECTIVE].isStarted && !objectives[MAXIOB_ZERO_CL_OBJECTIVE].isAccomplished)
maxIob.set(0.0, String.format(MainApp.gs(R.string.objectivenotfinished), MAXIOB_ZERO_CL_OBJECTIVE + 1), this)
return maxIob
}
}

View file

@ -0,0 +1,132 @@
package info.nightscout.androidaps.plugins.constraints.objectives.activities
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import info.nightscout.androidaps.MainApp
import info.nightscout.androidaps.R
import info.nightscout.androidaps.plugins.bus.RxBus
import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective
import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.*
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.OKDialog
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.ToastUtils
import kotlinx.android.synthetic.main.objectives_exam_fragment.*
class ObjectivesExamDialog : DialogFragment() {
companion object {
var objective: Objective? = null
}
var currentTask = 0
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
// load data from bundle
(savedInstanceState ?: arguments)?.let { bundle ->
currentTask = bundle.getInt("currentTask", 0)
}
return inflater.inflate(R.layout.objectives_exam_fragment, container, false)
}
override fun onStart() {
super.onStart()
dialog.setCanceledOnTouchOutside(false)
dialog.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
override fun onResume() {
super.onResume()
updateGui()
}
override fun onSaveInstanceState(bundle: Bundle) {
super.onSaveInstanceState(bundle)
bundle.putInt("currentTask", currentTask)
}
fun updateGui() {
objective?.let { objective ->
val task: ExamTask = objective.tasks[currentTask] as ExamTask
objectives_exam_name.setText(task.task)
objectives_exam_question.setText(task.question)
// Options
objectives_exam_options.removeAllViews()
for (o in task.options) {
val option: Option = o as Option;
val cb = option.generate(context)
if (task.answered) {
cb.isEnabled = false
if (option.isCorrect)
cb.isChecked = true
}
objectives_exam_options.addView(cb)
}
// Hints
objectives_exam_hints.removeAllViews()
for (h in task.hints) {
val hint: Hint = h as Hint;
objectives_exam_hints.addView(hint.generate(context))
}
// Disabled to
objectives_exam_disabledto.text = MainApp.gs(R.string.answerdisabledto, DateUtil.timeString(task.disabledTo))
objectives_exam_disabledto.visibility = if (task.isEnabledAnswer) View.GONE else View.VISIBLE
// Buttons
objectives_exam_verify.isEnabled = !task.answered && task.isEnabledAnswer
objectives_exam_verify.setOnClickListener {
var result = true
for (o in task.options) {
val option: Option = o as Option;
result = result && option.evaluate()
}
task.setAnswered(result);
if (!result) {
task.disabledTo = DateUtil.now() + T.hours(1).msecs()
ToastUtils.showToastInUiThread(context, R.string.wronganswer)
} else task.disabledTo = 0
updateGui()
RxBus.send(EventObjectivesUpdateGui())
}
close.setOnClickListener { dismiss() }
objectives_exam_reset.setOnClickListener {
task.answered = false
//task.disabledTo = 0
updateGui()
RxBus.send(EventObjectivesUpdateGui())
}
objectives_back_button.isEnabled = currentTask != 0
objectives_back_button.setOnClickListener {
currentTask--
updateGui()
}
objectives_next_button.isEnabled = currentTask != objective.tasks.size - 1
objectives_next_button.setOnClickListener {
currentTask++
updateGui()
}
objectives_next_unanswered_button.isEnabled = !objective.isCompleted
objectives_next_unanswered_button.setOnClickListener {
for (i in (currentTask + 1)..(objective.tasks.size - 1)) {
if (!objective.tasks[i].isCompleted) {
currentTask = i
updateGui()
return@setOnClickListener
}
}
for (i in 0..currentTask) {
if (!objective.tasks[i].isCompleted) {
currentTask = i
updateGui()
return@setOnClickListener
}
}
}
}
}
}

View file

@ -1,6 +0,0 @@
package info.nightscout.androidaps.plugins.constraints.objectives.events;
import info.nightscout.androidaps.events.Event;
public class EventObjectivesSaved extends Event {
}

View file

@ -0,0 +1,5 @@
package info.nightscout.androidaps.plugins.constraints.objectives.events
import info.nightscout.androidaps.events.EventUpdateGui
class EventObjectivesUpdateGui : EventUpdateGui()

View file

@ -1,35 +1,41 @@
package info.nightscout.androidaps.plugins.constraints.objectives.objectives; package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.text.util.Linkify;
import android.widget.CheckBox;
import android.widget.TextView;
import androidx.annotation.StringRes; import androidx.annotation.StringRes;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.SP; import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.T; import info.nightscout.androidaps.utils.T;
public abstract class Objective { public abstract class Objective {
private int number; private String spName;
@StringRes @StringRes
private int objective; private int objective;
@StringRes @StringRes
private int gate; private int gate;
private Date startedOn; private long startedOn;
private Date accomplishedOn; private long accomplishedOn;
private List<Task> tasks = new ArrayList<>(); List<Task> tasks = new ArrayList<>();
public boolean hasSpecialInput = false;
public Objective(int number, @StringRes int objective, @StringRes int gate) { public Objective(String spName, @StringRes int objective, @StringRes int gate) {
this.number = number; this.spName = spName;
this.objective = objective; this.objective = objective;
this.gate = gate; this.gate = gate;
startedOn = new Date(SP.getLong("Objectives" + number + "started", 0L)); startedOn = SP.getLong("Objectives_" + spName + "_started", 0L);
if (startedOn.getTime() == 0L) startedOn = null; accomplishedOn = SP.getLong("Objectives_" + spName + "_accomplished", 0L);
accomplishedOn = new Date(SP.getLong("Objectives" + number + "accomplished", 0L));
if (accomplishedOn.getTime() == 0L) accomplishedOn = null;
setupTasks(tasks); setupTasks(tasks);
for (Task task : tasks) task.objective = this; for (Task task : tasks) task.objective = this;
} }
@ -47,14 +53,14 @@ public abstract class Objective {
} }
public boolean isAccomplished() { public boolean isAccomplished() {
return accomplishedOn != null; return accomplishedOn != 0;
} }
public boolean isStarted() { public boolean isStarted() {
return startedOn != null; return startedOn != 0;
} }
public Date getStartedOn() { public long getStartedOn() {
return startedOn; return startedOn;
} }
@ -66,14 +72,18 @@ public abstract class Objective {
return gate; return gate;
} }
public void setStartedOn(Date startedOn) { public void setStartedOn(long startedOn) {
this.startedOn = startedOn; this.startedOn = startedOn;
SP.putLong("Objectives" + number + "started", startedOn == null ? 0 : startedOn.getTime()); SP.putLong("Objectives_" + spName + "_started", startedOn);
} }
public void setAccomplishedOn(Date accomplishedOn) { public void setAccomplishedOn(long accomplishedOn) {
this.accomplishedOn = accomplishedOn; this.accomplishedOn = accomplishedOn;
SP.putLong("Objectives" + number + "accomplished", accomplishedOn == null ? 0 : accomplishedOn.getTime()); SP.putLong("Objectives_" + spName + "_accomplished", accomplishedOn);
}
public long getAccomplishedOn() {
return accomplishedOn;
} }
protected void setupTasks(List<Task> tasks) { protected void setupTasks(List<Task> tasks) {
@ -84,6 +94,8 @@ public abstract class Objective {
return tasks; return tasks;
} }
public void specialAction(Activity activity, String input) {}
public abstract class Task { public abstract class Task {
@StringRes @StringRes
private int task; private int task;
@ -93,7 +105,7 @@ public abstract class Objective {
this.task = task; this.task = task;
} }
public int getTask() { public @StringRes int getTask() {
return task; return task;
} }
@ -116,19 +128,19 @@ public abstract class Objective {
private long minimumDuration; private long minimumDuration;
public MinimumDurationTask(long minimumDuration) { MinimumDurationTask(long minimumDuration) {
super(R.string.time_elapsed); super(R.string.time_elapsed);
this.minimumDuration = minimumDuration; this.minimumDuration = minimumDuration;
} }
@Override @Override
public boolean isCompleted() { public boolean isCompleted() {
return getObjective().isStarted() && System.currentTimeMillis() - getObjective().getStartedOn().getTime() >= minimumDuration; return getObjective().isStarted() && System.currentTimeMillis() - getObjective().getStartedOn() >= minimumDuration;
} }
@Override @Override
public String getProgress() { public String getProgress() {
return getDurationText(System.currentTimeMillis() - getObjective().getStartedOn().getTime()) return getDurationText(System.currentTimeMillis() - getObjective().getStartedOn())
+ " / " + getDurationText(minimumDuration); + " / " + getDurationText(minimumDuration);
} }
@ -142,4 +154,117 @@ public abstract class Objective {
} }
} }
public class ExamTask extends Task {
@StringRes
int question;
List hints = new ArrayList<>();
List options = new ArrayList<>();
private String spIdentifier;
private boolean answered;
private long disabledTo;
ExamTask(@StringRes int task, @StringRes int question, String spIdentifier) {
super(task);
this.question = question;
this.spIdentifier = spIdentifier;
answered = SP.getBoolean("ExamTask_" + spIdentifier, false);
disabledTo = SP.getLong("DisabledTo_" + spIdentifier, 0L);
}
public void setDisabledTo(long newState) {
disabledTo = newState;
SP.putLong("DisabledTo_" + spIdentifier, disabledTo);
}
public long getDisabledTo() {
return disabledTo;
}
public boolean isEnabledAnswer() {
return disabledTo < DateUtil.now();
}
public void setAnswered(boolean newState) {
answered = newState;
SP.putBoolean("ExamTask_" + spIdentifier, answered);
}
public boolean getAnswered() {
return answered;
}
ExamTask option(Option option) {
options.add(option);
return this;
}
ExamTask hint(Hint hint) {
hints.add(hint);
return this;
}
public @StringRes int getQuestion() {
return question;
}
public List getOptions() {
return options;
}
public List getHints() {
return hints;
}
@Override
public boolean isCompleted() {
return answered;
}
}
public class Option {
@StringRes int option;
boolean isCorrect;
CheckBox cb; // TODO: change it, this will block releasing memeory
Option(@StringRes int option, boolean isCorrect) {
this.option = option;
this.isCorrect = isCorrect;
}
public boolean isCorrect() {
return isCorrect;
}
public CheckBox generate(Context context) {
cb = new CheckBox(context);
cb.setText(option);
return cb;
}
public boolean evaluate() {
boolean selection = cb.isChecked();
if (selection && isCorrect) return true;
if (!selection && !isCorrect) return true;
return false;
}
}
public class Hint {
@StringRes int hint;
Hint(@StringRes int hint) {
this.hint = hint;
}
public TextView generate(Context context) {
TextView textView = new TextView(context);
textView.setText(hint);
textView.setAutoLinkMask(Linkify.WEB_URLS);
textView.setLinksClickable(true);
textView.setLinkTextColor(Color.YELLOW);
Linkify.addLinks(textView, Linkify.WEB_URLS);
return textView;
}
}
} }

View file

@ -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("config", R.string.objectives_0_objective, R.string.objectives_0_gate);
}
@Override
protected void setupTasks(List<Task> tasks) {
tasks.add(new Task(R.string.objectives_bgavailableinns) {
@Override
public boolean isCompleted() {
return SP.getBoolean(R.string.key_ObjectivesbgIsAvailableInNS, false);
}
});
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 SP.getBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, false);
}
});
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;
}
});
}
}

View file

@ -3,81 +3,60 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.R; 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.interfaces.PluginType;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin; import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin;
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; import info.nightscout.androidaps.utils.SP;
public class Objective1 extends Objective { public class Objective1 extends Objective {
public Objective1() { public Objective1() {
super(0, R.string.objectives_0_objective, R.string.objectives_0_gate); super("usage", R.string.objectives_usage_objective, R.string.objectives_usage_gate);
} }
@Override @Override
protected void setupTasks(List<Task> tasks) { protected void setupTasks(List<Task> tasks) {
tasks.add(new Task(R.string.objectives_bgavailableinns) { tasks.add(new Task(R.string.objectives_useprofileswitch) {
@Override @Override
public boolean isCompleted() { 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 @Override
public boolean isCompleted() { 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 @Override
public boolean isCompleted() { public boolean isCompleted() {
return SP.getBoolean("virtualpump_uploadstatus", false); return SP.getBoolean(R.string.key_objectiveusereconnect, false);
}
@Override
public boolean shouldBeIgnored() {
return !VirtualPumpPlugin.getPlugin().isEnabled(PluginType.PUMP);
} }
}); });
tasks.add(new Task(R.string.objectives_pumpstatusavailableinns) { tasks.add(new Task(R.string.objectives_usetemptarget) {
@Override @Override
public boolean isCompleted() { 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 @Override
public boolean isCompleted() { 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 @Override
public boolean isCompleted() { 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 @Override
public boolean isCompleted() { public boolean isCompleted() {
APSInterface usedAPS = ConfigBuilderPlugin.getPlugin().getActiveAPS(); return SP.getBoolean(R.string.key_objectiveusescale, false);
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;
} }
}); });
} }

View file

@ -1,36 +1,199 @@
package info.nightscout.androidaps.plugins.constraints.objectives.objectives; package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import java.util.Collections;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.utils.T;
public class Objective2 extends Objective { public class Objective2 extends Objective {
public final int MANUAL_ENACTS_NEEDED = 20;
public Objective2() { public Objective2() {
super(1, R.string.objectives_1_objective, R.string.objectives_1_gate); super("exam", R.string.objectives_exam_objective, R.string.objectives_exam_gate);
for (Task task : tasks) {
if (!task.isCompleted()) setAccomplishedOn(0);
}
} }
@Override @Override
protected void setupTasks(List<Task> tasks) { protected void setupTasks(List<Task> tasks) {
tasks.add(new MinimumDurationTask(T.days(7).msecs())); tasks.add(new ExamTask(R.string.dia_meaningofdia, R.string.dia_whatmeansdia,"dia")
tasks.add(new Task(R.string.objectives_manualenacts) { .option(new Option(R.string.dia_minimumis3h, false))
@Override .option(new Option(R.string.dia_minimumis5h, true))
public boolean isCompleted() { .option(new Option(R.string.dia_meaningisequaltodiapump, false))
return ObjectivesPlugin.getPlugin().manualEnacts >= MANUAL_ENACTS_NEEDED; .option(new Option(R.string.dia_valuemustbedetermined, true))
} .hint(new Hint(R.string.dia_hint1))
);
tasks.add(new ExamTask(R.string.hypott, R.string.hypott_whenhypott,"hypott")
.option(new Option(R.string.hypott_goinglow, false))
.option(new Option(R.string.hypott_havinglow, false))
.option(new Option(R.string.hypott_preventoversmb, true))
.hint(new Hint(R.string.hypott_hint1))
);
tasks.add(new ExamTask(R.string.offlineprofile, R.string.offlineprofile_whatprofile,"offlineprofile")
.option(new Option(R.string.localprofile, true))
.option(new Option(R.string.nsprofile, false))
.option(new Option(R.string.offlineprofile_nsprofile, true))
.hint(new Hint(R.string.offlineprofile_hint1))
);
tasks.add(new ExamTask(R.string.pumpdisconnect, R.string.pumpdisconnect_whattodo,"pumpdisconnect")
.option(new Option(R.string.pumpdisconnect_letknow, true))
.option(new Option(R.string.pumpdisconnect_dontchnage, false))
.hint(new Hint(R.string.pumpdisconnect_hint1))
);
tasks.add(new ExamTask(R.string.objectives, R.string.objectives_howtosave,"objectives")
.option(new Option(R.string.objectives_writetopaper, false))
.option(new Option(R.string.objectives_exportsettings, true))
.option(new Option(R.string.objectives_storeelsewhere, true))
.option(new Option(R.string.objectives_doexportonstart, false))
.option(new Option(R.string.objectives_doexportafterchange, true))
.option(new Option(R.string.objectives_doexportafterfirtssettings, true))
.hint(new Hint(R.string.objectives_hint1))
.hint(new Hint(R.string.objectives_hint2))
);
tasks.add(new ExamTask(R.string.noisycgm, R.string.noisycgm_whattodo,"noisycgm")
.option(new Option(R.string.nothing, false))
.option(new Option(R.string.disconnectpumpfor1h, false))
.option(new Option(R.string.noisycgm_pause, true))
.option(new Option(R.string.noisycgm_replacesensor, true))
.option(new Option(R.string.noisycgm_turnoffcgmreceiver, false))
.option(new Option(R.string.noisycgm_checksmoothing, true))
.hint(new Hint(R.string.noisycgm_hint1))
);
tasks.add(new ExamTask(R.string.exercise, R.string.exercise_whattodo,"exercise")
.option(new Option(R.string.nothing, false))
.option(new Option(R.string.exercise_setactivitytt, true))
.option(new Option(R.string.exercise_switchprofilebelow100, true))
.option(new Option(R.string.exercise_switchprofileabove100, false))
.option(new Option(R.string.exercise_stoploop, false))
.option(new Option(R.string.exercise_doitbeforestart, true))
.option(new Option(R.string.exercise_doitafterstart, false))
.hint(new Hint(R.string.exercise_hint1))
);
tasks.add(new ExamTask(R.string.suspendloop, R.string.suspendloop_doigetinsulin,"suspendloop")
.option(new Option(R.string.suspendloop_yes, true))
.option(new Option(R.string.suspendloop_no, false))
.hint(new Hint(R.string.exercise_hint1))
);
tasks.add(new ExamTask(R.string.basaltest, R.string.basaltest_when,"basaltest")
.option(new Option(R.string.basaltest_beforeloop, true))
.option(new Option(R.string.basaltest_havingregularhypo, true))
.option(new Option(R.string.basaltest_havingregularhyper, true))
.hint(new Hint(R.string.basaltest_hint1))
);
tasks.add(new ExamTask(R.string.prerequisites, R.string.prerequisites_what, "prerequisites")
.option(new Option(R.string.prerequisites_determinedcorrectprofile, true))
.option(new Option(R.string.prerequisites_computer, true))
.option(new Option(R.string.prerequisites_phone, true))
.option(new Option(R.string.prerequisites_car, false))
.option(new Option(R.string.prerequisites_nightscout, true))
.option(new Option(R.string.prerequisites_tidepoolaccount, false))
.option(new Option(R.string.prerequisites_googleaccount, false))
.option(new Option(R.string.prerequisites_githubaccount, false))
.option(new Option(R.string.prerequisites_beanandroiddeveloper, false))
.option(new Option(R.string.prerequisites_own670g, false))
.option(new Option(R.string.prerequisites_smartwatch, false))
.option(new Option(R.string.prerequisites_supportedcgm, true))
.hint(new Hint(R.string.prerequisites_hint1))
);
tasks.add(new ExamTask(R.string.update_update, R.string.whatistrue,"update")
.option(new Option(R.string.update_git, true))
.option(new Option(R.string.update_asap, true))
.option(new Option(R.string.update_keys, true))
.option(new Option(R.string.update_neverupdate, false))
.option(new Option(R.string.update_askfriend, false))
.hint(new Hint(R.string.update_hint1))
);
tasks.add(new ExamTask(R.string.troubleshooting, R.string.troubleshooting_wheretoask,"troubleshooting")
.option(new Option(R.string.troubleshooting_fb, true))
.option(new Option(R.string.troubleshooting_wiki, true))
.option(new Option(R.string.troubleshooting_gitter, true))
.option(new Option(R.string.troubleshooting_googlesupport, false))
.option(new Option(R.string.troubleshooting_yourendo, false))
.hint(new Hint(R.string.troubleshooting_hint1))
.hint(new Hint(R.string.troubleshooting_hint2))
.hint(new Hint(R.string.troubleshooting_hint3))
);
tasks.add(new ExamTask(R.string.insulin, R.string.insulin_ultrarapid,"insulin")
.option(new Option(R.string.insulin_fiasp, true))
.option(new Option(R.string.insulin_novorapid, false))
.option(new Option(R.string.insulin_humalog, false))
.option(new Option(R.string.insulin_actrapid, false))
.hint(new Hint(R.string.insulin_hint1))
);
tasks.add(new ExamTask(R.string.sensitivity, R.string.sensitivity_which,"sensitivity")
.option(new Option(R.string.sensitivityweightedaverage, true))
.option(new Option(R.string.sensitivityoref0, false))
.option(new Option(R.string.sensitivityoref1, false))
.option(new Option(R.string.sensitivityaaps, true))
.hint(new Hint(R.string.sensitivity_hint1))
);
tasks.add(new ExamTask(R.string.sensitivity, R.string.sensitivityuam_which,"sensitivityuam")
.option(new Option(R.string.sensitivityweightedaverage, false))
.option(new Option(R.string.sensitivityoref0, false))
.option(new Option(R.string.sensitivityoref1, true))
.option(new Option(R.string.sensitivityaaps, false))
.hint(new Hint(R.string.sensitivity_hint1))
);
tasks.add(new ExamTask(R.string.wrongcarbs, R.string.wrongcarbs_whattodo,"wrongcarbs")
.option(new Option(R.string.disableloop, false))
.option(new Option(R.string.wrongcarbs_treatmentstab, true))
.hint(new Hint(R.string.sensitivity_hint1))
);
tasks.add(new ExamTask(R.string.extendedcarbs, R.string.extendedcarbs_handling,"extendedcarbs")
.option(new Option(R.string.extendedcarbs_useextendedcarbs, true))
.option(new Option(R.string.extendedcarbs_add, false))
.option(new Option(R.string.extendedcarbs_useextendedbolus, false))
.hint(new Hint(R.string.sensitivity_hint1))
);
tasks.add(new ExamTask(R.string.nsclient_monitoring, R.string.nsclient_howcanyou,"nsclient")
.option(new Option(R.string.nightscout, true))
.option(new Option(R.string.nsclientinternal, true))
.option(new Option(R.string.dexcomfollow, true))
.option(new Option(R.string.dexcomfollowxdrip, false))
.option(new Option(R.string.xdripfollower, true))
.option(new Option(R.string.looponiphone, false))
.option(new Option(R.string.spikeiphone, true))
.hint(new Hint(R.string.sensitivity_hint1))
);
tasks.add(new ExamTask(R.string.nsprofileview_isf_label, R.string.whatistrue,"isf")
.option(new Option(R.string.isf_increasingvalue, true))
.option(new Option(R.string.isf_decreasingvalue, false))
.option(new Option(R.string.isf_noeffect, false))
.option(new Option(R.string.isf_preferences, false))
.option(new Option(R.string.isf_profile, false))
.hint(new Hint(R.string.isf_hint1))
.hint(new Hint(R.string.isf_hint2))
);
tasks.add(new ExamTask(R.string.nsprofileview_ic_label, R.string.whatistrue,"ic")
.option(new Option(R.string.ic_increasingvalue, true))
.option(new Option(R.string.ic_decreasingvalue, false))
.option(new Option(R.string.ic_noeffect, false))
.option(new Option(R.string.ic_different, false))
.option(new Option(R.string.ic_meaning, false))
.hint(new Hint(R.string.ic_hint1))
);
tasks.add(new ExamTask(R.string.profileswitch, R.string.profileswitch_pctwillchange,"profileswitch")
.option(new Option(R.string.profileswitch_basalhigher, false))
.option(new Option(R.string.profileswitch_basallower, true))
.option(new Option(R.string.profileswitch_ichigher, true))
.option(new Option(R.string.profileswitch_iclower, false))
.option(new Option(R.string.profileswitch_isfhigher, true))
.option(new Option(R.string.profileswitch_isflower, false))
.option(new Option(R.string.profileswitch_overall, true))
.option(new Option(R.string.profileswitch_targethigher, false))
.option(new Option(R.string.profileswitch_targetlower, false))
.option(new Option(R.string.profileswitch_targetbottom, false))
.hint(new Hint(R.string.profileswitch_hint1))
);
@Override for (Task task : tasks)
public String getProgress() { Collections.shuffle(((ExamTask)task).options);
if (ObjectivesPlugin.getPlugin().manualEnacts >= MANUAL_ENACTS_NEEDED)
return MainApp.gs(R.string.completed_well_done);
else
return ObjectivesPlugin.getPlugin().manualEnacts + " / " + MANUAL_ENACTS_NEEDED;
}
});
} }
@Override
public boolean isRevertable() {
return true;
}
} }

View file

@ -1,10 +1,45 @@
package info.nightscout.androidaps.plugins.constraints.objectives.objectives; package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import android.app.Activity;
import java.util.List;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.T;
public class Objective3 extends Objective { public class Objective3 extends Objective {
public final int MANUAL_ENACTS_NEEDED = 20;
public Objective3() { public Objective3() {
super(2, R.string.objectives_2_objective, R.string.objectives_2_gate); super("openloop", R.string.objectives_openloop_objective, R.string.objectives_openloop_gate);
hasSpecialInput = true;
}
@Override
protected void setupTasks(List<Task> tasks) {
tasks.add(new MinimumDurationTask(T.days(7).msecs()));
tasks.add(new Task(R.string.objectives_manualenacts) {
@Override
public boolean isCompleted() {
return SP.getInt(R.string.key_ObjectivesmanualEnacts, 0) >= MANUAL_ENACTS_NEEDED;
}
@Override
public String getProgress() {
if (SP.getInt(R.string.key_ObjectivesmanualEnacts, 0) >= MANUAL_ENACTS_NEEDED)
return MainApp.gs(R.string.completed_well_done);
else
return SP.getInt(R.string.key_ObjectivesmanualEnacts, 0) + " / " + MANUAL_ENACTS_NEEDED;
}
});
}
@Override
public void specialAction(Activity activity, String input) {
ObjectivesPlugin.INSTANCE.completeObjectives(activity, input);
} }
} }

View file

@ -1,33 +1,10 @@
package info.nightscout.androidaps.plugins.constraints.objectives.objectives; package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import java.util.List;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin;
import info.nightscout.androidaps.utils.T;
public class Objective4 extends Objective { public class Objective4 extends Objective {
public Objective4() { public Objective4() {
super(3, R.string.objectives_3_objective, R.string.objectives_3_gate); super("maxbasal", R.string.objectives_maxbasal_objective, R.string.objectives_maxbasal_gate);
}
@Override
protected void setupTasks(List<Task> tasks) {
tasks.add(new MinimumDurationTask(T.days(5).msecs()));
tasks.add(new Task(R.string.closedmodeenabled) {
@Override
public boolean isCompleted() {
Constraint<Boolean> closedLoopEnabled = new Constraint<>(true);
SafetyPlugin.getPlugin().isClosedLoopAllowed(closedLoopEnabled);
return closedLoopEnabled.value();
}
});
}
@Override
public boolean isRevertable() {
return true;
} }
} }

View file

@ -2,25 +2,32 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin;
import info.nightscout.androidaps.utils.T; import info.nightscout.androidaps.utils.T;
public class Objective5 extends Objective { public class Objective5 extends Objective {
public Objective5() { public Objective5() {
super(4, R.string.objectives_4_objective, R.string.objectives_4_gate); super("maxiobzero", R.string.objectives_maxiobzero_objective, R.string.objectives_maxiobzero_gate);
} }
@Override @Override
protected void setupTasks(List<Task> tasks) { protected void setupTasks(List<Task> tasks) {
tasks.add(new MinimumDurationTask(T.days(1).msecs())); tasks.add(new MinimumDurationTask(T.days(5).msecs()));
tasks.add(new Task(R.string.maxiobset) { tasks.add(new Task(R.string.closedmodeenabled) {
@Override @Override
public boolean isCompleted() { public boolean isCompleted() {
double maxIOB = MainApp.getConstraintChecker().getMaxIOBAllowed().value(); Constraint<Boolean> closedLoopEnabled = new Constraint<>(true);
return maxIOB > 0; SafetyPlugin.getPlugin().isClosedLoopAllowed(closedLoopEnabled);
return closedLoopEnabled.value();
} }
}); });
} }
@Override
public boolean isRevertable() {
return true;
}
} }

View file

@ -2,17 +2,25 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.utils.T; import info.nightscout.androidaps.utils.T;
public class Objective6 extends Objective { public class Objective6 extends Objective {
public Objective6() { public Objective6() {
super(5, R.string.objectives_5_objective, R.string.objectives_5_gate); super("maxiob", R.string.objectives_maxiob_objective, R.string.objectives_maxiob_gate);
} }
@Override @Override
protected void setupTasks(List<Task> tasks) { protected void setupTasks(List<Task> tasks) {
tasks.add(new MinimumDurationTask(T.days(7).msecs())); tasks.add(new MinimumDurationTask(T.days(1).msecs()));
tasks.add(new Task(R.string.maxiobset) {
@Override
public boolean isCompleted() {
double maxIOB = MainApp.getConstraintChecker().getMaxIOBAllowed().value();
return maxIOB > 0;
}
});
} }
} }

View file

@ -3,16 +3,17 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.utils.T; import info.nightscout.androidaps.utils.T;
public class Objective7 extends Objective { public class Objective7 extends Objective {
public Objective7() { public Objective7() {
super(6, R.string.objectives_6_objective, 0); super("autosens", R.string.objectives_autosens_objective, R.string.objectives_autosens_gate);
} }
@Override @Override
protected void setupTasks(List<Task> tasks) { protected void setupTasks(List<Task> tasks) {
tasks.add(new MinimumDurationTask(T.days(28).msecs())); tasks.add(new MinimumDurationTask(T.days(7).msecs()));
} }
} }

View file

@ -3,12 +3,13 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import java.util.List; import java.util.List;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.utils.T; import info.nightscout.androidaps.utils.T;
public class Objective8 extends Objective { public class Objective8 extends Objective {
public Objective8() { public Objective8() {
super(7, R.string.objectives_7_objective, R.string.objectives_7_gate); super("ama", R.string.objectives_ama_objective, 0);
} }
@Override @Override

View file

@ -0,0 +1,18 @@
package info.nightscout.androidaps.plugins.constraints.objectives.objectives;
import java.util.List;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.utils.T;
public class Objective9 extends Objective {
public Objective9() {
super("smb", R.string.objectives_smb_objective, R.string.objectives_smb_gate);
}
@Override
protected void setupTasks(List<Task> tasks) {
tasks.add(new MinimumDurationTask(T.days(28).msecs()));
}
}

View file

@ -5,13 +5,13 @@ import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import androidx.fragment.app.FragmentManager;
import com.squareup.otto.Subscribe; import com.squareup.otto.Subscribe;
import java.util.ArrayList; 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.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow; import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; 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; import info.nightscout.androidaps.utils.SingleClickButton;
/**
* A simple {@link Fragment} subclass.
*/
public class ActionsFragment extends SubscriberFragment implements View.OnClickListener { public class ActionsFragment extends SubscriberFragment implements View.OnClickListener {
static ActionsPlugin actionsPlugin = new ActionsPlugin(); private View actionsFragmentView;
private SingleClickButton profileSwitch;
static public ActionsPlugin getPlugin() { private SingleClickButton tempTarget;
return actionsPlugin; private SingleClickButton extendedBolus;
} private SingleClickButton extendedBolusCancel;
private SingleClickButton tempBasal;
View actionsFragmentView; private SingleClickButton tempBasalCancel;
SingleClickButton profileSwitch; private SingleClickButton fill;
SingleClickButton tempTarget; private SingleClickButton tddStats;
SingleClickButton extendedBolus; private SingleClickButton history;
SingleClickButton extendedBolusCancel;
SingleClickButton tempBasal;
SingleClickButton tempBasalCancel;
SingleClickButton fill;
SingleClickButton tddStats;
SingleClickButton history;
private Map<String, CustomAction> pumpCustomActions = new HashMap<>(); private Map<String, CustomAction> pumpCustomActions = new HashMap<>();
private List<SingleClickButton> pumpCustomButtons = new ArrayList<>(); private List<SingleClickButton> pumpCustomButtons = new ArrayList<>();
@ -80,38 +70,33 @@ public class ActionsFragment extends SubscriberFragment implements View.OnClickL
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { 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); profileSwitch = view.findViewById(R.id.actions_profileswitch);
tempTarget = (SingleClickButton) view.findViewById(R.id.actions_temptarget); tempTarget = view.findViewById(R.id.actions_temptarget);
extendedBolus = (SingleClickButton) view.findViewById(R.id.actions_extendedbolus); extendedBolus = view.findViewById(R.id.actions_extendedbolus);
extendedBolusCancel = (SingleClickButton) view.findViewById(R.id.actions_extendedbolus_cancel); extendedBolusCancel = view.findViewById(R.id.actions_extendedbolus_cancel);
tempBasal = (SingleClickButton) view.findViewById(R.id.actions_settempbasal); tempBasal = view.findViewById(R.id.actions_settempbasal);
tempBasalCancel = (SingleClickButton) view.findViewById(R.id.actions_canceltempbasal); tempBasalCancel = view.findViewById(R.id.actions_canceltempbasal);
fill = (SingleClickButton) view.findViewById(R.id.actions_fill); fill = view.findViewById(R.id.actions_fill);
tddStats = view.findViewById(R.id.actions_tddstats); tddStats = view.findViewById(R.id.actions_tddstats);
history = view.findViewById(R.id.actions_historybrowser); history = view.findViewById(R.id.actions_historybrowser);
profileSwitch.setOnClickListener(this); profileSwitch.setOnClickListener(this);
tempTarget.setOnClickListener(this); tempTarget.setOnClickListener(this);
extendedBolus.setOnClickListener(this); extendedBolus.setOnClickListener(this);
extendedBolusCancel.setOnClickListener(this); extendedBolusCancel.setOnClickListener(this);
tempBasal.setOnClickListener(this); tempBasal.setOnClickListener(this);
tempBasalCancel.setOnClickListener(this); tempBasalCancel.setOnClickListener(this);
fill.setOnClickListener(this); fill.setOnClickListener(this);
history.setOnClickListener(this); history.setOnClickListener(this);
tddStats.setOnClickListener(this); tddStats.setOnClickListener(this);
actionsFragmentView = view; actionsFragmentView = view;
updateGUI(); updateGUI();
return view; SP.putBoolean(R.string.key_objectiveuseactions, true);
} catch (Exception e) { return view;
FabricPrivacy.logException(e);
}
return null;
} }
@Subscribe @Subscribe

View file

@ -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)
);
}
}

View file

@ -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))

View file

@ -84,14 +84,13 @@ class EventListAdapter extends RecyclerView.Adapter<EventListAdapter.ViewHolder>
// enabled event // enabled event
holder.enabled.setOnCheckedChangeListener((buttonView, isChecked) -> { holder.enabled.setOnCheckedChangeListener((buttonView, isChecked) -> {
event.setEnabled(isChecked); event.setEnabled(isChecked);
notifyDataSetChanged();
RxBus.INSTANCE.send(new EventAutomationDataChanged()); RxBus.INSTANCE.send(new EventAutomationDataChanged());
}); });
// remove event // remove event
holder.iconTrash.setOnClickListener(v -> { holder.iconTrash.setOnClickListener(v -> {
mEventList.remove(event); mEventList.remove(event);
notifyDataSetChanged(); RxBus.INSTANCE.send(new EventAutomationDataChanged());
}); });
// edit event // edit event

View file

@ -71,7 +71,7 @@ public class ActionStartTempTarget extends Action {
int unitResId = value.getUnits().equals(Constants.MGDL) ? R.string.mgdl : R.string.mmol; int unitResId = value.getUnits().equals(Constants.MGDL) ? R.string.mgdl : R.string.mmol;
new LayoutBuilder() new LayoutBuilder()
.add(new LabelWithElement(MainApp.gs(R.string.careportal_temporarytarget), MainApp.gs(unitResId), value)) .add(new LabelWithElement(MainApp.gs(R.string.careportal_temporarytarget) + " [" + MainApp.gs(unitResId) + "]", "", value))
.add(new LabelWithElement(MainApp.gs(R.string.careportal_newnstreatment_duration_min_label), "", duration)) .add(new LabelWithElement(MainApp.gs(R.string.careportal_newnstreatment_duration_min_label), "", duration))
.build(root); .build(root);
} }

View file

@ -25,8 +25,8 @@ public class InputDouble extends Element {
}; };
private double value; private double value;
double minValue; private double minValue;
double maxValue; private double maxValue;
private double step; private double step;
private DecimalFormat decimalFormat; private DecimalFormat decimalFormat;

View file

@ -20,6 +20,11 @@ public class InputDuration extends Element {
this.value = value; this.value = value;
} }
public InputDuration(InputDuration another) {
unit = another.unit;
value = another.value;
}
@Override @Override
public void addToLayout(LinearLayout root) { public void addToLayout(LinearLayout root) {
NumberPicker numberPicker = new NumberPicker(root.getContext(), null); NumberPicker numberPicker = new NumberPicker(root.getContext(), null);

View file

@ -1,5 +1,7 @@
package info.nightscout.androidaps.plugins.general.automation.elements; package info.nightscout.androidaps.plugins.general.automation.elements;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import java.text.DecimalFormat; import java.text.DecimalFormat;
@ -17,13 +19,29 @@ public class InputTempTarget extends Element {
private double step; private double step;
private DecimalFormat decimalFormat; private DecimalFormat decimalFormat;
private final TextWatcher textWatcher = new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
value = Math.max(minValue, value);
value = Math.min(maxValue, value);
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
};
public InputTempTarget() { public InputTempTarget() {
super(); super();
setUnits(ProfileFunctions.getInstance().getProfileUnits()); setUnits(ProfileFunctions.getInstance().getProfileUnits());
if (getUnits().equals(Constants.MMOL)) if (getUnits().equals(Constants.MMOL))
value = Constants.MIN_TT_MMOL; value = 6;
else else
value = Constants.MIN_TT_MGDL; value = 110;
} }
public InputTempTarget(InputTempTarget another) { public InputTempTarget(InputTempTarget another) {
@ -36,7 +54,7 @@ public class InputTempTarget extends Element {
@Override @Override
public void addToLayout(LinearLayout root) { public void addToLayout(LinearLayout root) {
NumberPicker numberPicker = new NumberPicker(root.getContext(), null); NumberPicker numberPicker = new NumberPicker(root.getContext(), null);
numberPicker.setParams(value, minValue, maxValue, step, decimalFormat, true, null, null); numberPicker.setParams(value, minValue, maxValue, step, decimalFormat, true, null, textWatcher);
numberPicker.setOnValueChangedListener(value -> this.value = value); numberPicker.setOnValueChangedListener(value -> this.value = value);
root.addView(numberPicker); root.addView(numberPicker);
} }

View file

@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.general.automation.elements;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TableLayout;
import android.widget.TextView; import android.widget.TextView;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
@ -37,6 +38,10 @@ public class LabelWithElement extends Element {
textViewPre.setTypeface(textViewPre.getTypeface(), Typeface.BOLD); textViewPre.setTypeface(textViewPre.getTypeface(), Typeface.BOLD);
layout.addView(textViewPre); layout.addView(textViewPre);
TextView spacer = new TextView(root.getContext());
spacer.setLayoutParams(new TableLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, 1f));
layout.addView(spacer);
// add element to layout // add element to layout
element.addToLayout(layout); element.addToLayout(layout);

View file

@ -11,8 +11,6 @@ import org.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.text.DecimalFormat;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.logging.L;
@ -28,9 +26,7 @@ import info.nightscout.androidaps.utils.T;
public class TriggerBolusAgo extends Trigger { public class TriggerBolusAgo extends Trigger {
private static Logger log = LoggerFactory.getLogger(L.AUTOMATION); private static Logger log = LoggerFactory.getLogger(L.AUTOMATION);
private final double step = 1; private InputDuration minutesAgo = new InputDuration(0, InputDuration.TimeUnit.MINUTES);
private DecimalFormat decimalFormat = new DecimalFormat("1");
public InputDuration minutesAgo = new InputDuration(0, InputDuration.TimeUnit.MINUTES);
private Comparator comparator = new Comparator(); private Comparator comparator = new Comparator();
public TriggerBolusAgo() { public TriggerBolusAgo() {
@ -39,7 +35,7 @@ public class TriggerBolusAgo extends Trigger {
private TriggerBolusAgo(TriggerBolusAgo triggerBolusAgo) { private TriggerBolusAgo(TriggerBolusAgo triggerBolusAgo) {
super(); super();
minutesAgo = new InputDuration(triggerBolusAgo.minutesAgo.getMinutes(), InputDuration.TimeUnit.MINUTES); minutesAgo = new InputDuration(triggerBolusAgo.minutesAgo);
lastRun = triggerBolusAgo.lastRun; lastRun = triggerBolusAgo.lastRun;
comparator = new Comparator(triggerBolusAgo.comparator); comparator = new Comparator(triggerBolusAgo.comparator);
} }

View file

@ -32,10 +32,8 @@ import info.nightscout.androidaps.utils.T;
public class TriggerCOB extends Trigger { public class TriggerCOB extends Trigger {
private static Logger log = LoggerFactory.getLogger(L.AUTOMATION); private static Logger log = LoggerFactory.getLogger(L.AUTOMATION);
private final int minValue = 0; private final int minValue = 0;
private final int maxValue = (int) (SP.getInt(R.string.key_treatmentssafety_maxcarbs, 48)); private final int maxValue = SP.getInt(R.string.key_treatmentssafety_maxcarbs, 48);
private final double step = 1; private InputDouble value = new InputDouble(0, (double) minValue, (double) maxValue, 1, new DecimalFormat("1"));
private DecimalFormat decimalFormat = new DecimalFormat("1");
private InputDouble value = new InputDouble(0, (double) minValue, (double) maxValue, step, decimalFormat);
private Comparator comparator = new Comparator(); private Comparator comparator = new Comparator();
public TriggerCOB() { public TriggerCOB() {

View file

@ -51,10 +51,11 @@ public class TriggerDelta extends Trigger {
private TriggerDelta(TriggerDelta triggerDelta) { private TriggerDelta(TriggerDelta triggerDelta) {
super(); super();
this.units = ProfileFunctions.getInstance().getProfileUnits();
initializer();
value = triggerDelta.value;
lastRun = triggerDelta.lastRun; lastRun = triggerDelta.lastRun;
this.units = triggerDelta.units;
deltaType = triggerDelta.deltaType;
value = new InputDelta(triggerDelta.value);
comparator = new Comparator(triggerDelta.comparator);
} }
public double getValue() { public double getValue() {
@ -68,7 +69,7 @@ public class TriggerDelta extends Trigger {
if (units.equals(Constants.MMOL)) if (units.equals(Constants.MMOL))
value = new InputDelta(0, -MMOL_MAX, MMOL_MAX, 0.1d, new DecimalFormat("0.1"), DeltaType.DELTA); value = new InputDelta(0, -MMOL_MAX, MMOL_MAX, 0.1d, new DecimalFormat("0.1"), DeltaType.DELTA);
else else
value = new InputDelta(0, -MGDL_MAX, MGDL_MAX, 0.1d, new DecimalFormat("1"), DeltaType.DELTA); value = new InputDelta(0, -MGDL_MAX, MGDL_MAX, 1d, new DecimalFormat("1"), DeltaType.DELTA);
} }

View file

@ -51,10 +51,11 @@ public class TriggerLocation extends Trigger {
private TriggerLocation(TriggerLocation triggerLocation) { private TriggerLocation(TriggerLocation triggerLocation) {
super(); super();
latitude = new InputDouble(triggerLocation.latitude.getValue(), -90d, +90d, 0.00001d, new DecimalFormat("0.00000")); latitude = new InputDouble(triggerLocation.latitude);
longitude = new InputDouble(triggerLocation.longitude.getValue(), -180d, +180d, 0.00001d, new DecimalFormat("0.00000")); longitude = new InputDouble(triggerLocation.longitude);
distance = new InputDouble(200d, 0, 100000, 10d, new DecimalFormat("0")); distance = new InputDouble(triggerLocation.distance);
lastRun = triggerLocation.lastRun; lastRun = triggerLocation.lastRun;
name = triggerLocation.name;
} }
@Override @Override

View file

@ -65,7 +65,7 @@ public class TriggerWifiSsid extends Trigger {
return true; return true;
} }
boolean doRun = eventNetworkChange.wifiConnected && comparator.getValue().check(eventNetworkChange.ssid, getValue()); boolean doRun = eventNetworkChange.wifiConnected && comparator.getValue().check(eventNetworkChange.getSsid(), getValue());
if (doRun) { if (doRun) {
if (L.isEnabled(L.AUTOMATION)) if (L.isEnabled(L.AUTOMATION))
log.debug("Ready for execution: " + friendlyDescription()); log.debug("Ready for execution: " + friendlyDescription());

View file

@ -22,12 +22,16 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.ProfileStore; import info.nightscout.androidaps.data.ProfileStore;
import info.nightscout.androidaps.db.CareportalEvent; import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.events.EventCareportalEventChange; import info.nightscout.androidaps.events.EventCareportalEventChange;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.general.careportal.Dialogs.NewNSTreatmentDialog; import info.nightscout.androidaps.plugins.general.careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.common.SubscriberFragment; import info.nightscout.androidaps.plugins.common.SubscriberFragment;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus; import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus;
import info.nightscout.androidaps.plugins.general.overview.OverviewFragment; import info.nightscout.androidaps.plugins.general.overview.OverviewFragment;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.SetWarnColor;
public class CareportalFragment extends SubscriberFragment implements View.OnClickListener { public class CareportalFragment extends SubscriberFragment implements View.OnClickListener {
private static Logger log = LoggerFactory.getLogger(CareportalFragment.class); private static Logger log = LoggerFactory.getLogger(CareportalFragment.class);
@ -91,15 +95,15 @@ public class CareportalFragment extends SubscriberFragment implements View.OnCli
view.findViewById(R.id.careportal_openapsoffline).setOnClickListener(this); view.findViewById(R.id.careportal_openapsoffline).setOnClickListener(this);
view.findViewById(R.id.careportal_temporarytarget).setOnClickListener(this); view.findViewById(R.id.careportal_temporarytarget).setOnClickListener(this);
iage = (TextView) view.findViewById(R.id.careportal_insulinage); iage = view.findViewById(R.id.careportal_insulinage);
cage = (TextView) view.findViewById(R.id.careportal_canulaage); cage = view.findViewById(R.id.careportal_canulaage);
sage = (TextView) view.findViewById(R.id.careportal_sensorage); sage = view.findViewById(R.id.careportal_sensorage);
pbage = (TextView) view.findViewById(R.id.careportal_pbage); pbage = view.findViewById(R.id.careportal_pbage);
statsLayout = view.findViewById(R.id.careportal_stats); statsLayout = view.findViewById(R.id.careportal_stats);
noProfileView = view.findViewById(R.id.profileview_noprofile); noProfileView = view.findViewById(R.id.profileview_noprofile);
butonsLayout = (LinearLayout) view.findViewById(R.id.careportal_buttons); butonsLayout = view.findViewById(R.id.careportal_buttons);
ProfileStore profileStore = ConfigBuilderPlugin.getPlugin().getActiveProfileInterface() != null ? ConfigBuilderPlugin.getPlugin().getActiveProfileInterface().getProfile() : null; ProfileStore profileStore = ConfigBuilderPlugin.getPlugin().getActiveProfileInterface() != null ? ConfigBuilderPlugin.getPlugin().getActiveProfileInterface().getProfile() : null;
if (profileStore == null) { if (profileStore == null) {
@ -249,13 +253,17 @@ public class CareportalFragment extends SubscriberFragment implements View.OnCli
} }
private static TextView handleAge(final TextView age, String eventType, double warnThreshold, double urgentThreshold) { private static TextView handleAge(final TextView age, String eventType, double warnThreshold, double urgentThreshold) {
String notavailable = OverviewFragment.shorttextmode ? "-" : MainApp.gs(R.string.notavailable); return handleAge(age, "", eventType, warnThreshold, urgentThreshold, OverviewFragment.shorttextmode);
}
public static TextView handleAge(final TextView age, String prefix, String eventType, double warnThreshold, double urgentThreshold, boolean useShortText) {
String notavailable = useShortText ? "-" : MainApp.gs(R.string.notavailable);
if (age != null) { if (age != null) {
CareportalEvent careportalEvent = MainApp.getDbHelper().getLastCareportalEvent(eventType); CareportalEvent careportalEvent = MainApp.getDbHelper().getLastCareportalEvent(eventType);
if (careportalEvent != null) { if (careportalEvent != null) {
age.setTextColor(CareportalFragment.determineTextColor(careportalEvent, warnThreshold, urgentThreshold)); age.setTextColor(CareportalFragment.determineTextColor(careportalEvent, warnThreshold, urgentThreshold));
age.setText(careportalEvent.age()); age.setText(prefix + careportalEvent.age(useShortText));
} else { } else {
age.setText(notavailable); age.setText(notavailable);
} }

View file

@ -741,6 +741,8 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
} }
TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget); TreatmentsPlugin.getPlugin().addToHistoryTempTarget(tempTarget);
} }
if (duration == 10)
SP.putBoolean(R.string.key_objectiveusetemptarget, true);
} else { } else {
if (JsonHelper.safeGetString(data, "eventType").equals(CareportalEvent.PROFILESWITCH)) { if (JsonHelper.safeGetString(data, "eventType").equals(CareportalEvent.PROFILESWITCH)) {
ProfileSwitch profileSwitch = ProfileFunctions.prepareProfileSwitch( ProfileSwitch profileSwitch = ProfileFunctions.prepareProfileSwitch(

View file

@ -17,10 +17,9 @@ import java.util.Map;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.plugins.aps.loop.APSResult;
import info.nightscout.androidaps.logging.BundleLogger; import info.nightscout.androidaps.logging.BundleLogger;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.aps.loop.APSResult;
import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.Round; import info.nightscout.androidaps.utils.Round;
import info.nightscout.androidaps.utils.SP; import info.nightscout.androidaps.utils.SP;
@ -108,8 +107,7 @@ public class NSDeviceStatus {
setData(devicestatusJson); setData(devicestatusJson);
if (devicestatusJson.has("pump")) { if (devicestatusJson.has("pump")) {
// Objectives 0 // Objectives 0
ObjectivesPlugin.getPlugin().pumpStatusIsAvailableInNS = true; SP.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, true);
ObjectivesPlugin.getPlugin().saveProgress();
} }
} }
if (bundle.containsKey("devicestatuses")) { if (bundle.containsKey("devicestatuses")) {
@ -120,8 +118,7 @@ public class NSDeviceStatus {
setData(devicestatusJson); setData(devicestatusJson);
if (devicestatusJson.has("pump")) { if (devicestatusJson.has("pump")) {
// Objectives 0 // Objectives 0
ObjectivesPlugin.getPlugin().pumpStatusIsAvailableInNS = true; SP.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, true);
ObjectivesPlugin.getPlugin().saveProgress();
} }
} }
} }

View file

@ -4,8 +4,6 @@ import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.NotificationManager; import android.app.NotificationManager;
import androidx.arch.core.util.Function;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@ -60,7 +58,6 @@ import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.QuickWizardEntry; import info.nightscout.androidaps.data.QuickWizardEntry;
import info.nightscout.androidaps.db.BgReading; import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.db.DatabaseHelper;
import info.nightscout.androidaps.db.ExtendedBolus; import info.nightscout.androidaps.db.ExtendedBolus;
import info.nightscout.androidaps.db.Source; import info.nightscout.androidaps.db.Source;
@ -92,7 +89,6 @@ import info.nightscout.androidaps.plugins.general.careportal.Dialogs.NewNSTreatm
import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow; import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload; import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus; import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus;
import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity; import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity;
import info.nightscout.androidaps.plugins.general.overview.dialogs.CalibrationDialog; import info.nightscout.androidaps.plugins.general.overview.dialogs.CalibrationDialog;
import info.nightscout.androidaps.plugins.general.overview.dialogs.NewCarbsDialog; import info.nightscout.androidaps.plugins.general.overview.dialogs.NewCarbsDialog;
@ -258,17 +254,17 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
apsModeView = (TextView) view.findViewById(R.id.overview_apsmode); apsModeView = (TextView) view.findViewById(R.id.overview_apsmode);
tempTargetView = (TextView) view.findViewById(R.id.overview_temptarget); tempTargetView = (TextView) view.findViewById(R.id.overview_temptarget);
iage = (TextView) view.findViewById(R.id.careportal_insulinage); iage = view.findViewById(R.id.careportal_insulinage);
cage = (TextView) view.findViewById(R.id.careportal_canulaage); cage = view.findViewById(R.id.careportal_canulaage);
sage = (TextView) view.findViewById(R.id.careportal_sensorage); sage = view.findViewById(R.id.careportal_sensorage);
pbage = (TextView) view.findViewById(R.id.careportal_pbage); pbage = view.findViewById(R.id.careportal_pbage);
iageView = (TextView) view.findViewById(R.id.overview_insulinage); iageView = view.findViewById(R.id.overview_insulinage);
cageView = (TextView) view.findViewById(R.id.overview_canulaage); cageView = view.findViewById(R.id.overview_canulaage);
reservoirView = (TextView) view.findViewById(R.id.overview_reservoirlevel); reservoirView = view.findViewById(R.id.overview_reservoirlevel);
sageView = (TextView) view.findViewById(R.id.overview_sensorage); sageView = view.findViewById(R.id.overview_sensorage);
batteryView = (TextView) view.findViewById(R.id.overview_batterylevel); batteryView = view.findViewById(R.id.overview_batterylevel);
statuslightsLayout = (LinearLayout) view.findViewById(R.id.overview_statuslights); statuslightsLayout = view.findViewById(R.id.overview_statuslights);
bgGraph = (GraphView) view.findViewById(R.id.overview_bggraph); bgGraph = (GraphView) view.findViewById(R.id.overview_bggraph);
iobGraph = (GraphView) view.findViewById(R.id.overview_iobgraph); iobGraph = (GraphView) view.findViewById(R.id.overview_iobgraph);
@ -334,6 +330,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
rangeToDisplay = rangeToDisplay > 24 ? 6 : rangeToDisplay; rangeToDisplay = rangeToDisplay > 24 ? 6 : rangeToDisplay;
SP.putInt(R.string.key_rangetodisplay, rangeToDisplay); SP.putInt(R.string.key_rangetodisplay, rangeToDisplay);
updateGUI("rangeChange"); updateGUI("rangeChange");
SP.putBoolean(R.string.key_objectiveusescale, true);
return false; return false;
}); });
@ -592,6 +589,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
} }
}); });
SP.putBoolean(R.string.key_objectiveusereconnect, true);
NSUpload.uploadOpenAPSOffline(0); NSUpload.uploadOpenAPSOffline(0);
return true; return true;
} else if (item.getTitle().equals(MainApp.gs(R.string.suspendloopfor1h))) { } else if (item.getTitle().equals(MainApp.gs(R.string.suspendloopfor1h))) {
@ -620,6 +618,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
return true; return true;
} else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor1h))) { } else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor1h))) {
LoopPlugin.getPlugin().disconnectPump(60, profile); LoopPlugin.getPlugin().disconnectPump(60, profile);
SP.putBoolean(R.string.key_objectiveusedisconnect, true);
updateGUI("suspendmenu"); updateGUI("suspendmenu");
return true; return true;
} else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor2h))) { } else if (item.getTitle().equals(MainApp.gs(R.string.disconnectpumpfor2h))) {
@ -1324,54 +1323,22 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
cobView.setText(cobText); cobView.setText(cobText);
} }
if (statuslightsLayout != null) { if (statuslightsLayout != null && SP.getBoolean(R.string.key_show_statuslights, false)) {
if (SP.getBoolean(R.string.key_show_statuslights, false)) { StatuslightHandler handler = new StatuslightHandler();
CareportalEvent careportalEvent;
NSSettingsStatus nsSettings = new NSSettingsStatus().getInstance();
double iageUrgent = nsSettings.getExtendedWarnValue("iage", "urgent", 96);
double iageWarn = nsSettings.getExtendedWarnValue("iage", "warn", 72);
double cageUrgent = nsSettings.getExtendedWarnValue("cage", "urgent", 72);
double cageWarn = nsSettings.getExtendedWarnValue("cage", "warn", 48);
double sageUrgent = nsSettings.getExtendedWarnValue("sage", "urgent", 166);
double sageWarn = nsSettings.getExtendedWarnValue("sage", "warn", 164);
//double pbageUrgent = nsSettings.getExtendedWarnValue("pgage", "urgent", 360);
//double pbageWarn = nsSettings.getExtendedWarnValue("pgage", "warn", 240);
double batUrgent = SP.getDouble(R.string.key_statuslights_bat_critical, 5.0);
double batWarn = SP.getDouble(R.string.key_statuslights_bat_warning, 25.0);
double resUrgent = SP.getDouble(R.string.key_statuslights_res_critical, 10.0);
double resWarn = SP.getDouble(R.string.key_statuslights_res_warning, 80.0);
if (cageView != null) { if (SP.getBoolean(R.string.key_show_statuslights_easy, false)) {
careportalEvent = MainApp.getDbHelper().getLastCareportalEvent(CareportalEvent.SITECHANGE); handler.statuslight(cageView, iageView, reservoirView, sageView, batteryView);
double canAge = careportalEvent != null ? careportalEvent.getHoursFromStart() : Double.MAX_VALUE;
applyStatuslight(cageView, "CAN", canAge, cageWarn, cageUrgent, Double.MAX_VALUE, true);
}
if (iageView != null) { statuslightsLayout.setVisibility(View.VISIBLE);
careportalEvent = MainApp.getDbHelper().getLastCareportalEvent(CareportalEvent.INSULINCHANGE); } else if (SP.getBoolean(R.string.key_show_statuslights_extended, false)) {
double insulinAge = careportalEvent != null ? careportalEvent.getHoursFromStart() : Double.MAX_VALUE; handler.extendedStatuslight(cageView, iageView, reservoirView, sageView, batteryView);
applyStatuslight(iageView, "INS", insulinAge, iageWarn, iageUrgent, Double.MAX_VALUE, true);
}
if (reservoirView != null) {
double reservoirLevel = pump.isInitialized() ? pump.getReservoirLevel() : -1;
applyStatuslight(reservoirView, "RES", reservoirLevel, resWarn, resUrgent, -1, false);
}
if (sageView != null) {
careportalEvent = MainApp.getDbHelper().getLastCareportalEvent(CareportalEvent.SENSORCHANGE);
double sensorAge = careportalEvent != null ? careportalEvent.getHoursFromStart() : Double.MAX_VALUE;
applyStatuslight(sageView, "SEN", sensorAge, sageWarn, sageUrgent, Double.MAX_VALUE, true);
}
if (batteryView != null) {
double batteryLevel = pump.isInitialized() ? pump.getBatteryLevel() : -1;
applyStatuslight(batteryView, "BAT", batteryLevel, batWarn, batUrgent, -1, false);
}
statuslightsLayout.setVisibility(View.VISIBLE); statuslightsLayout.setVisibility(View.VISIBLE);
} else { } else {
statuslightsLayout.setVisibility(View.GONE); statuslightsLayout.setVisibility(View.GONE);
} }
} else if (statuslightsLayout != null) {
statuslightsLayout.setVisibility(View.GONE);
} }
boolean predictionsAvailable; boolean predictionsAvailable;
@ -1559,21 +1526,5 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
Profiler.log(log, from, updateGUIStart); Profiler.log(log, from, updateGUIStart);
} }
public static void applyStatuslight(TextView view, String text, double value, double warnThreshold, double urgentThreshold, double invalid, boolean checkAscending) {
Function<Double, Boolean> check = checkAscending ? (Double threshold) -> value >= threshold : (Double threshold) -> value <= threshold;
if (value != invalid) {
view.setText(text);
if (check.apply(urgentThreshold)) {
view.setTextColor(MainApp.gc(R.color.ribbonCritical));
} else if (check.apply(warnThreshold)) {
view.setTextColor(MainApp.gc(R.color.ribbonWarning));
} else {
view.setTextColor(MainApp.gc(R.color.ribbonDefault));
}
view.setVisibility(View.VISIBLE);
} else {
view.setVisibility(View.GONE);
}
}
} }

View file

@ -0,0 +1,135 @@
package info.nightscout.androidaps.plugins.general.overview;
import android.view.View;
import android.widget.TextView;
import androidx.arch.core.util.Function;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.SP;
import info.nightscout.androidaps.utils.SetWarnColor;
class StatuslightHandler {
/**
* applies the statuslight subview on the overview fragement
*/
void statuslight(TextView cageView, TextView iageView, TextView reservoirView,
TextView sageView, TextView batteryView) {
PumpInterface pump = ConfigBuilderPlugin.getPlugin().getActivePump();
applyStatuslight("cage", CareportalEvent.SITECHANGE, cageView, "CAN", 48, 72);
applyStatuslight("iage", CareportalEvent.INSULINCHANGE, iageView, "INS", 72, 96);
double reservoirLevel = pump.isInitialized() ? pump.getReservoirLevel() : -1;
applyStatuslightLevel(R.string.key_statuslights_res_critical, 10.0,
R.string.key_statuslights_res_warning, 80.0, reservoirView, "RES", reservoirLevel);
applyStatuslight("sage", CareportalEvent.SENSORCHANGE, sageView, "SEN", 164, 166);
double batteryLevel = pump.isInitialized() ? pump.getBatteryLevel() : -1;
applyStatuslightLevel(R.string.key_statuslights_bat_critical, 5.0,
R.string.key_statuslights_bat_warning, 22.0,
batteryView, "BAT", batteryLevel);
}
void applyStatuslight(String nsSettingPlugin, String eventName, TextView view, String text,
int defaultWarnThreshold, int defaultUrgentThreshold) {
NSSettingsStatus nsSettings = NSSettingsStatus.getInstance();
if (view != null) {
double urgent = nsSettings.getExtendedWarnValue(nsSettingPlugin, "urgent", defaultUrgentThreshold);
double warn = nsSettings.getExtendedWarnValue(nsSettingPlugin, "warn", defaultWarnThreshold);
CareportalEvent event = MainApp.getDbHelper().getLastCareportalEvent(eventName);
double age = event != null ? event.getHoursFromStart() : Double.MAX_VALUE;
applyStatuslight(view, text, age, warn, urgent, Double.MAX_VALUE, true);
}
}
void applyStatuslightLevel(int criticalSetting, double criticalDefaultValue,
int warnSetting, double warnDefaultValue,
TextView view, String text, double level) {
if (view != null) {
double resUrgent = SP.getDouble(criticalSetting, criticalDefaultValue);
double resWarn = SP.getDouble(warnSetting, warnDefaultValue);
applyStatuslight(view, text, level, resWarn, resUrgent, -1, false);
}
}
void applyStatuslight(TextView view, String text, double value, double warnThreshold,
double urgentThreshold, double invalid, boolean checkAscending) {
Function<Double, Boolean> check = checkAscending ? (Double threshold) -> value >= threshold :
(Double threshold) -> value <= threshold;
if (value != invalid) {
view.setText(text);
if (check.apply(urgentThreshold)) {
view.setTextColor(MainApp.gc(R.color.ribbonCritical));
} else if (check.apply(warnThreshold)) {
view.setTextColor(MainApp.gc(R.color.ribbonWarning));
} else {
view.setTextColor(MainApp.gc(R.color.ribbonDefault));
}
view.setVisibility(View.VISIBLE);
} else {
view.setVisibility(View.GONE);
}
}
/**
* applies the extended statuslight subview on the overview fragement
*/
void extendedStatuslight(TextView cageView, TextView iageView,
TextView reservoirView, TextView sageView,
TextView batteryView) {
PumpInterface pump = ConfigBuilderPlugin.getPlugin().getActivePump();
handleAge("cage", CareportalEvent.SITECHANGE, cageView, "CAN ",
48, 72);
handleAge("iage", CareportalEvent.INSULINCHANGE, iageView, "INS ",
72, 96);
handleLevel(R.string.key_statuslights_res_critical, 10.0,
R.string.key_statuslights_res_warning, 80.0,
reservoirView, "RES ", pump.getReservoirLevel());
handleAge("sage", CareportalEvent.SENSORCHANGE, sageView, "SEN ",
164, 166);
handleLevel(R.string.key_statuslights_bat_critical, 26.0,
R.string.key_statuslights_bat_warning, 51.0,
batteryView, "BAT ", pump.getBatteryLevel());
}
void handleAge(String nsSettingPlugin, String eventName, TextView view, String text,
int defaultUrgentThreshold, int defaultWarnThreshold) {
NSSettingsStatus nsSettings = new NSSettingsStatus().getInstance();
if (view != null) {
double urgent = nsSettings.getExtendedWarnValue(nsSettingPlugin, "urgent", defaultUrgentThreshold);
double warn = nsSettings.getExtendedWarnValue(nsSettingPlugin, "warn", defaultWarnThreshold);
CareportalFragment.handleAge(view, text, eventName, warn, urgent, true);
}
}
void handleLevel(int criticalSetting, double criticalDefaultValue,
int warnSetting, double warnDefaultValue,
TextView view, String text, double level) {
if (view != null) {
double resUrgent = SP.getDouble(criticalSetting, criticalDefaultValue);
double resWarn = SP.getDouble(warnSetting, warnDefaultValue);
view.setText(text + DecimalFormatter.to0Decimal(level));
SetWarnColor.setColorInverse(view, level, resWarn, resUrgent);
}
}
}

View file

@ -16,7 +16,6 @@ import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType; import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin;
import info.nightscout.androidaps.plugins.general.nsclient.data.NSSgv; import info.nightscout.androidaps.plugins.general.nsclient.data.NSSgv;
import info.nightscout.androidaps.utils.JsonHelper; import info.nightscout.androidaps.utils.JsonHelper;
import info.nightscout.androidaps.utils.SP; import info.nightscout.androidaps.utils.SP;
@ -85,8 +84,7 @@ public class SourceNSClientPlugin extends PluginBase implements BgSourceInterfac
} }
// Objectives 0 // Objectives 0
ObjectivesPlugin.getPlugin().bgIsAvailableInNS = true; SP.putBoolean(R.string.key_ObjectivesbgIsAvailableInNS, true);
ObjectivesPlugin.getPlugin().saveProgress();
} }
private void storeSgv(JSONObject sgvJson) { private void storeSgv(JSONObject sgvJson) {

View file

@ -425,8 +425,8 @@ public class SWDefinition {
.add(new SWBreak()) .add(new SWBreak())
.add(new SWFragment(this) .add(new SWFragment(this)
.add(new ObjectivesFragment())) .add(new ObjectivesFragment()))
.validator(() -> ObjectivesPlugin.getPlugin().objectives.get(0).isStarted()) .validator(() -> ObjectivesPlugin.INSTANCE.getObjectives().get(ObjectivesPlugin.INSTANCE.getFIRST_OBJECTIVE()).isStarted())
.visibility(() -> !ObjectivesPlugin.getPlugin().objectives.get(0).isStarted() && Config.APS); .visibility(() -> !ObjectivesPlugin.INSTANCE.getObjectives().get(ObjectivesPlugin.INSTANCE.getFIRST_OBJECTIVE()).isStarted() && Config.APS);
private void SWDefinitionFull() { private void SWDefinitionFull() {
// List all the screens here // List all the screens here

View file

@ -26,7 +26,6 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity;
import info.nightscout.androidaps.events.EventProfileNeedsUpdate; import info.nightscout.androidaps.events.EventProfileNeedsUpdate;
import info.nightscout.androidaps.events.EventProfileStoreChanged; import info.nightscout.androidaps.events.EventProfileStoreChanged;
import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesSaved;
import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientStatus; import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientStatus;
import info.nightscout.androidaps.setupwizard.elements.SWItem; import info.nightscout.androidaps.setupwizard.elements.SWItem;
import info.nightscout.androidaps.setupwizard.events.EventSWUpdate; import info.nightscout.androidaps.setupwizard.events.EventSWUpdate;
@ -121,11 +120,6 @@ public class SetupWizardActivity extends NoSplashAppCompatActivity {
updateButtons(); updateButtons();
} }
@Subscribe
public void onEventObjectivesSaved(EventObjectivesSaved ignored) {
updateButtons();
}
private void generateLayout() { private void generateLayout() {
SWScreen currentScreen = screens.get(currentWizardPage); SWScreen currentScreen = screens.get(currentWizardPage);
LinearLayout layout = SWItem.generateLayout(this.findViewById(R.id.sw_content_fields)); LinearLayout layout = SWItem.generateLayout(this.findViewById(R.id.sw_content_fields));

View file

@ -126,6 +126,13 @@ public class SP {
editor.apply(); editor.apply();
} }
static public void incInt(int resourceID) {
SharedPreferences.Editor editor = sharedPreferences.edit();
int value = SP.getInt(resourceID, 0) + 1;
editor.putInt(MainApp.gs(resourceID), value);
editor.apply();
}
static public void putString(int resourceID, String value) { static public void putString(int resourceID, String value) {
SharedPreferences.Editor editor = sharedPreferences.edit(); SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(MainApp.gs(resourceID), value); editor.putString(MainApp.gs(resourceID), value);

View file

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".plugins.constraints.objectives.activities.ObjectivesExamDialog">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp">
<LinearLayout
android:id="@+id/objectives_exam_options"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@+id/objectives_exam_hint"
tools:layout_editor_absoluteX="3dp">
</LinearLayout>
<LinearLayout
android:id="@+id/objectives_exam_hints"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@+id/objectives_exam_options"
tools:layout_editor_absoluteX="3dp" />
<LinearLayout
android:id="@+id/objectives_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="#3C3C3C"
android:orientation="horizontal"
android:padding="4dp"
app:layout_constraintTop_toBottomOf="@+id/objectives_exam_disabledto">
<Button
android:id="@+id/objectives_exam_reset"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/reset" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="" />
<Button
android:id="@+id/close"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/close" />
<Button
android:id="@+id/objectives_exam_verify"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/objectives_button_verify" />
</LinearLayout>
<TextView
android:id="@+id/objectives_exam_question"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Question"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/objectives_exam_name" />
<TextView
android:id="@+id/objectives_exam_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/objectives_hint"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/objectives_exam_question" />
<TextView
android:id="@+id/objectives_exam_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Name"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/objectives_exam_disabledto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Disabled to:"
android:textColor="#FF5722"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/objectives_exam_hints" />
<LinearLayout
android:id="@+id/objectives_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:background="#3C3C3C"
android:orientation="horizontal"
android:padding="4dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/objectives_buttons">
<Button
android:id="@+id/objectives_back_button"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/previous_button" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="" />
<Button
android:id="@+id/objectives_next_button"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/next_button" />
<Button
android:id="@+id/objectives_next_unanswered_button"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/unfinshed_button" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

View file

@ -49,7 +49,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:orientation="vertical" /> android:orientation="vertical" >
</LinearLayout>
<Button <Button
android:id="@+id/objective_verify" android:id="@+id/objective_verify"
@ -71,6 +73,50 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/objectives_button_back" /> android:text="@string/objectives_button_back" />
<TextView
android:id="@+id/objective_inputhint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/enter_code_obtained_from_developers_to_bypass_the_rest_of_objectives" />
<TextView
android:id="@+id/objective_requestcode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Request code: XXXXX" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<EditText
android:id="@+id/objective_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="XXXXXXXXXX"
android:inputType="text" />
<Button
android:id="@+id/objective_enterbutton"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/objectives_button_enter" />
</LinearLayout>
<TextView
android:id="@+id/objective_accomplished"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="#FFFFFF"
tools:text="Accomplished" />
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View file

@ -317,19 +317,19 @@
<string name="overview_bolusprogress_goingtodeliver">Gaan %1$.2fU lewer</string> <string name="overview_bolusprogress_goingtodeliver">Gaan %1$.2fU lewer</string>
<string name="objectives_0_objective">Opstel van visualisering en monitering, en ontleed basale en verhoudings</string> <string name="objectives_0_objective">Opstel van visualisering en monitering, en ontleed basale en verhoudings</string>
<string name="objectives_0_gate">Verifieer dat BG beskikbaar is in Nightscout, en dat pomp insulien data opgelaai word</string> <string name="objectives_0_gate">Verifieer dat BG beskikbaar is in Nightscout, en dat pomp insulien data opgelaai word</string>
<string name="objectives_1_objective">Begin op \'n oop lus</string> <string name="objectives_openloop_objective">Begin op \'n oop lus</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Verstaan jou oop lus, insluitend sy tydelike basale aanbevelings</string> <string name="objectives_maxbasal_objective">Verstaan jou oop lus, insluitend sy tydelike basale aanbevelings</string>
<string name="objectives_2_gate">Gebaseer op daardie ervaring, besluit watter maks basale moet gebruik word, en stel dit op die pomp en voorkeure</string> <string name="objectives_maxbasal_gate">Gebaseer op daardie ervaring, besluit watter maks basale moet gebruik word, en stel dit op die pomp en voorkeure</string>
<string name="objectives_3_objective">Begin toe die lus met lae glukose opgeskort</string> <string name="objectives_maxiobzero_objective">Begin toe die lus met lae glukose opgeskort</string>
<string name="objectives_3_gate">Loop in geslote lus met max IAB = 0 vir \'n paar dae sonder te veel LGS gebeure</string> <string name="objectives_maxiobzero_gate">Loop in geslote lus met max IAB = 0 vir \'n paar dae sonder te veel LGS gebeure</string>
<string name="objectives_4_objective">Verstel die geslote lus, verhoog maks IAB bo 0 en geleidelik verlaag BG doelwitte</string> <string name="objectives_maxiob_objective">Verstel die geslote lus, verhoog maks IAB bo 0 en geleidelik verlaag BG doelwitte</string>
<string name="objectives_4_gate">Lus vir \'n paar dae, en ten minste een nag met geen lae BG alarms, voor BG val</string> <string name="objectives_maxiob_gate">Lus vir \'n paar dae, en ten minste een nag met geen lae BG alarms, voor BG val</string>
<string name="objectives_5_objective">Pas basale en verhoudings aan as nodig, en dan aktiveer auto-sens</string> <string name="objectives_autosens_objective">Pas basale en verhoudings aan as nodig, en dan aktiveer auto-sens</string>
<string name="objectives_5_gate">1 week suksesvolle dagtyd lus met gereelde karb toevoegings</string> <string name="objectives_autosens_gate">1 week suksesvolle dagtyd lus met gereelde karb toevoegings</string>
<string name="objectives_6_objective">Skakel bykomende nutsfunskies aan vir bedagse gebruik, soos bv advanced meal assist</string> <string name="objectives_ama_objective">Skakel bykomende nutsfunskies aan vir bedagse gebruik, soos bv advanced meal assist</string>
<string name="objectives_7_objective">Skakel bykomende nutsfunskies aan vir bedags gebruik, soos bv. SMB</string> <string name="objectives_smb_objective">Skakel bykomende nutsfunskies aan vir bedags gebruik, soos bv. SMB</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">Die toegelate limiet is bereik</string> <string name="youareonallowedlimit">Die toegelate limiet is bereik</string>
<string name="noprofileselected">Geen profiel gekies</string> <string name="noprofileselected">Geen profiel gekies</string>
<string name="smscommunicator_loophasbeendisabled">Loop is gedeaktiveer</string> <string name="smscommunicator_loophasbeendisabled">Loop is gedeaktiveer</string>

View file

@ -318,19 +318,19 @@
<string name="overview_bolusprogress_goingtodeliver">Ще стартира %1$.2fЕ болус</string> <string name="overview_bolusprogress_goingtodeliver">Ще стартира %1$.2fЕ болус</string>
<string name="objectives_0_objective">Настройка на визуализацията и наблюдението, а също и анализиране на базалните нужди и коефициенти</string> <string name="objectives_0_objective">Настройка на визуализацията и наблюдението, а също и анализиране на базалните нужди и коефициенти</string>
<string name="objectives_0_gate">Потвърждаване, че КЗ е достъпна в Найтскаут и данните за помпата се качват там</string> <string name="objectives_0_gate">Потвърждаване, че КЗ е достъпна в Найтскаут и данните за помпата се качват там</string>
<string name="objectives_1_objective">Стартиране в режим Отворен кръг (Open loop)</string> <string name="objectives_openloop_objective">Стартиране в режим Отворен кръг (Open loop)</string>
<string name="objectives_1_gate">Работа в режим \"Отворен кръг\" за няколко дни и ръчно въвеждане на много временни базали. Настройте и използвайте временни и стандартни временни цели (напр. за активни или хипо-третирани въглехидрати)</string> <string name="objectives_openloop_gate">Работа в режим \"Отворен кръг\" за няколко дни и ръчно въвеждане на много временни базали. Настройте и използвайте временни и стандартни временни цели (напр. за активни или хипо-третирани въглехидрати)</string>
<string name="objectives_2_objective">Опитайте се да разбирате по-добре вашият APS в режим \"Отворен кръг\", включително препоръчваните временни базали</string> <string name="objectives_maxbasal_objective">Опитайте се да разбирате по-добре вашият APS в режим \"Отворен кръг\", включително препоръчваните временни базали</string>
<string name="objectives_2_gate">Определяне на макс. лимит на базалния инсулин и настройване в помпата и програмата</string> <string name="objectives_maxbasal_gate">Определяне на макс. лимит на базалния инсулин и настройване в помпата и програмата</string>
<string name="objectives_3_objective">Стартиране на \"Затворен кръг\" с изключване на базал при ниска КЗ</string> <string name="objectives_maxiobzero_objective">Стартиране на \"Затворен кръг\" с изключване на базал при ниска КЗ</string>
<string name="objectives_3_gate">Стартиране на \"Затворен кръг\" с макс. IOB=0 без твърде много събития тип ниска КЗ</string> <string name="objectives_maxiobzero_gate">Стартиране на \"Затворен кръг\" с макс. IOB=0 без твърде много събития тип ниска КЗ</string>
<string name="objectives_4_objective">Настройване на \"Затворен кръг\" чрез повишаване на максималният IOB над 0 и понижаване на целевите нива на КЗ</string> <string name="objectives_maxiob_objective">Настройване на \"Затворен кръг\" чрез повишаване на максималният IOB над 0 и понижаване на целевите нива на КЗ</string>
<string name="objectives_4_gate">Прекарайте няколко дни по този начин, като поне една нощ нямате аларма за ниска КЗ.</string> <string name="objectives_maxiob_gate">Прекарайте няколко дни по този начин, като поне една нощ нямате аларма за ниска КЗ.</string>
<string name="objectives_5_objective">Настройване на базалния инсулин и коефициенти ако е необходимо и активиране на auto-sens</string> <string name="objectives_autosens_objective">Настройване на базалния инсулин и коефициенти ако е необходимо и активиране на auto-sens</string>
<string name="objectives_5_gate">Една седмица успешно дневно използване с редовно въвеждане на въглехидрати</string> <string name="objectives_autosens_gate">Една седмица успешно дневно използване с редовно въвеждане на въглехидрати</string>
<string name="objectives_6_objective">Активиране на допълнителни функции за дневно използване, включително и advanced meal assist (АМА)</string> <string name="objectives_ama_objective">Активиране на допълнителни функции за дневно използване, включително и advanced meal assist (АМА)</string>
<string name="objectives_7_objective">Добавяне на допълнителни функции за използване през деня, като SMB</string> <string name="objectives_smb_objective">Добавяне на допълнителни функции за използване през деня, като SMB</string>
<string name="objectives_7_gate">Вие трябва да прочетете wiki и увеличите maxIOB за да може SMB да работи добре! Добро начало е maxIOB = средния болус за хранене + 3 x най-големия базал от профила</string> <string name="objectives_smb_gate">Вие трябва да прочетете wiki и увеличите maxIOB за да може SMB да работи добре! Добро начало е maxIOB = средния болус за хранене + 3 x най-големия базал от профила</string>
<string name="youareonallowedlimit">Достигнахте лимита</string> <string name="youareonallowedlimit">Достигнахте лимита</string>
<string name="noprofileselected">Няма избран профил</string> <string name="noprofileselected">Няма избран профил</string>
<string name="smscommunicator_loophasbeendisabled">APS е деактивиран</string> <string name="smscommunicator_loophasbeendisabled">APS е деактивиран</string>

View file

@ -319,19 +319,19 @@
<string name="overview_bolusprogress_goingtodeliver">Podávání %1$.2fU inzulínu</string> <string name="overview_bolusprogress_goingtodeliver">Podávání %1$.2fU inzulínu</string>
<string name="objectives_0_objective">Nastavit vizualizaci a monitoring, analyzovat bazály a koeficienty</string> <string name="objectives_0_objective">Nastavit vizualizaci a monitoring, analyzovat bazály a koeficienty</string>
<string name="objectives_0_gate">Zkontrolovat, zda jsou glykémie a údaje z pumpy viditelné v Nightscoutu</string> <string name="objectives_0_gate">Zkontrolovat, zda jsou glykémie a údaje z pumpy viditelné v Nightscoutu</string>
<string name="objectives_1_objective">Začít s otevřenou smyčkou</string> <string name="objectives_openloop_objective">Začít s otevřenou smyčkou</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Porozumět otevřené smyčce a doporučeným dočasným bazálům</string> <string name="objectives_maxbasal_objective">Porozumět otevřené smyčce a doporučeným dočasným bazálům</string>
<string name="objectives_2_gate">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</string> <string name="objectives_maxbasal_gate">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</string>
<string name="objectives_3_objective">Začít uzavřenou smyčku pouze s hlídáním nízké glykémie</string> <string name="objectives_maxiobzero_objective">Začít uzavřenou smyčku pouze s hlídáním nízké glykémie</string>
<string name="objectives_3_gate">Spustit uzavřenou smyčku s max IOB = 0 na několik dní s minimem nutných korekcí na nízkou glykémii</string> <string name="objectives_maxiobzero_gate">Spustit uzavřenou smyčku s max IOB = 0 na několik dní s minimem nutných korekcí na nízkou glykémii</string>
<string name="objectives_4_objective">Zapnout uzavřenou smyčku, zvyšovat max IOB nad 0 a snižovat cílovou glykémii</string> <string name="objectives_maxiob_objective">Zapnout uzavřenou smyčku, zvyšovat max IOB nad 0 a snižovat cílovou glykémii</string>
<string name="objectives_4_gate">Provozovat smyčku několik dní s alespoň jednou nocí bez alarmů na nízkou glykémii</string> <string name="objectives_maxiob_gate">Provozovat smyčku několik dní s alespoň jednou nocí bez alarmů na nízkou glykémii</string>
<string name="objectives_5_objective">Upravit bazály a koeficienty, když bude potřeba a povolit automatickou detekci citlivosti na inzulín</string> <string name="objectives_autosens_objective">Upravit bazály a koeficienty, když bude potřeba a povolit automatickou detekci citlivosti na inzulín</string>
<string name="objectives_5_gate">Jeden týden úspěšného používání s běžným příjmem sacharidů</string> <string name="objectives_autosens_gate">Jeden týden úspěšného používání s běžným příjmem sacharidů</string>
<string name="objectives_6_objective">Povolit další funkce pro běžné používání jako AMA</string> <string name="objectives_ama_objective">Povolit další funkce pro běžné používání jako AMA</string>
<string name="objectives_7_objective">Povolit další funkce pro běžné používání jako SMB</string> <string name="objectives_smb_objective">Povolit další funkce pro běžné používání jako SMB</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">Dosaženo limitu</string> <string name="youareonallowedlimit">Dosaženo limitu</string>
<string name="noprofileselected">Není vybrán žádný profil</string> <string name="noprofileselected">Není vybrán žádný profil</string>
<string name="smscommunicator_loophasbeendisabled">Smyčka byla zakázána</string> <string name="smscommunicator_loophasbeendisabled">Smyčka byla zakázána</string>

View file

@ -319,19 +319,19 @@
<string name="overview_bolusprogress_goingtodeliver">Werde %1$.2fU abgeben</string> <string name="overview_bolusprogress_goingtodeliver">Werde %1$.2fU abgeben</string>
<string name="objectives_0_objective">Konfiguriere die Anzeige und das Monitoring (Nightscout) und analysiere Basal-Raten und Faktoren</string> <string name="objectives_0_objective">Konfiguriere die Anzeige und das Monitoring (Nightscout) und analysiere Basal-Raten und Faktoren</string>
<string name="objectives_0_gate">Verifiziere, dass BZ- und Pumpen-Insulin-Daten erfolgreich zu Nightscout hochgeladen werden.</string> <string name="objectives_0_gate">Verifiziere, dass BZ- und Pumpen-Insulin-Daten erfolgreich zu Nightscout hochgeladen werden.</string>
<string name="objectives_1_objective">Starte den Open Loop Modus</string> <string name="objectives_openloop_objective">Starte den Open Loop Modus</string>
<string name="objectives_1_gate">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).</string> <string name="objectives_openloop_gate">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).</string>
<string name="objectives_2_objective">Verstehe den Open Loop und die TBR-Empfehlungen</string> <string name="objectives_maxbasal_objective">Verstehe den Open Loop und die TBR-Empfehlungen</string>
<string name="objectives_2_gate">Entscheide anhand von dieser Erfahrung, wie hoch max Basal sein sollte, und übernehme den Wert in die Pumpen- und AAPS-Einstellungen.</string> <string name="objectives_maxbasal_gate">Entscheide anhand von dieser Erfahrung, wie hoch max Basal sein sollte, und übernehme den Wert in die Pumpen- und AAPS-Einstellungen.</string>
<string name="objectives_3_objective">Starte den Closed Loop Modus mit Abschaltung bei niedrigen Werten</string> <string name="objectives_maxiobzero_objective">Starte den Closed Loop Modus mit Abschaltung bei niedrigen Werten</string>
<string name="objectives_3_gate">Erprobe den Closed Loop Modus mit max IOB = 0 für ein paar Tage, ohne zu viele Unterzuckerungen zu haben.</string> <string name="objectives_maxiobzero_gate">Erprobe den Closed Loop Modus mit max IOB = 0 für ein paar Tage, ohne zu viele Unterzuckerungen zu haben.</string>
<string name="objectives_4_objective">Stelle den Closed Loop fein ein, erhöhe max IOB über 0 und setze den Zielbereich langsam herunter.</string> <string name="objectives_maxiob_objective">Stelle den Closed Loop fein ein, erhöhe max IOB über 0 und setze den Zielbereich langsam herunter.</string>
<string name="objectives_4_gate">Verwende es ein paar Tage und zumindest eine Nacht ohne Niedrig-Alarme (UZ), bevor du den BZ-Zielbereich senkst.</string> <string name="objectives_maxiob_gate">Verwende es ein paar Tage und zumindest eine Nacht ohne Niedrig-Alarme (UZ), bevor du den BZ-Zielbereich senkst.</string>
<string name="objectives_5_objective">Passe, falls notwendig, Basal und Faktoren an und aktiviere dann die Autosens-Funktion.</string> <string name="objectives_autosens_objective">Passe, falls notwendig, Basal und Faktoren an und aktiviere dann die Autosens-Funktion.</string>
<string name="objectives_5_gate">Loope eine Woche erfolgreich am Tag mit regelmäßiger Kohlenhydrat-Eingabe.</string> <string name="objectives_autosens_gate">Loope eine Woche erfolgreich am Tag mit regelmäßiger Kohlenhydrat-Eingabe.</string>
<string name="objectives_6_objective">Aktiviere zusätzliche Funktionen wie z. B. den Mahlzeitenassistenten</string> <string name="objectives_ama_objective">Aktiviere zusätzliche Funktionen wie z. B. den Mahlzeitenassistenten</string>
<string name="objectives_7_objective">Aktiviere zusätzliche Funktionen wie z. B. SMB</string> <string name="objectives_smb_objective">Aktiviere zusätzliche Funktionen wie z. B. SMB</string>
<string name="objectives_7_gate">Lies das Wiki und hebe maxIOB an, damit SMB funktioniert. Ein guter Startwert ist <string name="objectives_smb_gate">Lies das Wiki und hebe maxIOB an, damit SMB funktioniert. Ein guter Startwert ist
maxIOB = durchschnittlicher Essensbolus + 3 x maximale Basalrate</string> maxIOB = durchschnittlicher Essensbolus + 3 x maximale Basalrate</string>
<string name="youareonallowedlimit">Limit erreicht</string> <string name="youareonallowedlimit">Limit erreicht</string>
<string name="noprofileselected">Kein Profil ausgewählt</string> <string name="noprofileselected">Kein Profil ausgewählt</string>

View file

@ -317,19 +317,19 @@
<string name="overview_bolusprogress_goingtodeliver">Προς έγχυση %1$.2fU</string> <string name="overview_bolusprogress_goingtodeliver">Προς έγχυση %1$.2fU</string>
<string name="objectives_0_objective">Δημιουργία παρακολούθησης και ανάλυση βασικού ρυθμού και αναλογιών</string> <string name="objectives_0_objective">Δημιουργία παρακολούθησης και ανάλυση βασικού ρυθμού και αναλογιών</string>
<string name="objectives_0_gate">Επιβεβαιώστε ότι η BG φαίνεται στο Nightscout και τα δεδομένα της αντλίας φορτώθηκαν</string> <string name="objectives_0_gate">Επιβεβαιώστε ότι η BG φαίνεται στο Nightscout και τα δεδομένα της αντλίας φορτώθηκαν</string>
<string name="objectives_1_objective">Ξεκινήστε σε ανοιχτό κύκλωμα</string> <string name="objectives_openloop_objective">Ξεκινήστε σε ανοιχτό κύκλωμα</string>
<string name="objectives_1_gate">Εκτελέστε σε ανοιχτό κύκλωμα για μερικές ημέρες και χειροκίνητα κάντε πολλές παρεμβάσεις με προσωρινό ρυθμό. Ρυθμίστε και χρησιμοποιήστε προσωρινούς στόχους (π.χ. για αθλήματα ή υπογλυκαιμία)</string> <string name="objectives_openloop_gate">Εκτελέστε σε ανοιχτό κύκλωμα για μερικές ημέρες και χειροκίνητα κάντε πολλές παρεμβάσεις με προσωρινό ρυθμό. Ρυθμίστε και χρησιμοποιήστε προσωρινούς στόχους (π.χ. για αθλήματα ή υπογλυκαιμία)</string>
<string name="objectives_2_objective">Κατανοήστε το ανοιχτό κύκλωμα, περιλαμβάνοντας τις προτάσεις για Προσωρινό ρυθμό</string> <string name="objectives_maxbasal_objective">Κατανοήστε το ανοιχτό κύκλωμα, περιλαμβάνοντας τις προτάσεις για Προσωρινό ρυθμό</string>
<string name="objectives_2_gate">Βάση της εμπειρίας σας, αποφασίστε ποιο είναι το μέγιστο βασικής δόσης και αποθηκεύστε το στην αντλία και στις Επιλογές</string> <string name="objectives_maxbasal_gate">Βάση της εμπειρίας σας, αποφασίστε ποιο είναι το μέγιστο βασικής δόσης και αποθηκεύστε το στην αντλία και στις Επιλογές</string>
<string name="objectives_3_objective">Ξεκινήστε να κλείσετε το κύκλωμα με Σταμάτημα Χαμηλής Γλυκόζης (Low Glucose Suspend) </string> <string name="objectives_maxiobzero_objective">Ξεκινήστε να κλείσετε το κύκλωμα με Σταμάτημα Χαμηλής Γλυκόζης (Low Glucose Suspend) </string>
<string name="objectives_3_gate">Εκτελέστε σε κλειστό κύκλωμα με μέγιστο IOB = 0 για μερικές ημέρες χωρίς πολλά LGS - υπογλυκαιμίες</string> <string name="objectives_maxiobzero_gate">Εκτελέστε σε κλειστό κύκλωμα με μέγιστο IOB = 0 για μερικές ημέρες χωρίς πολλά LGS - υπογλυκαιμίες</string>
<string name="objectives_4_objective">Ρυθμίζοντας το κλειστό κύκλωμα, αυξήστε το μέγιστο IOB πάνω από 0 και σταδιακά μειώστε τους στόχους BG</string> <string name="objectives_maxiob_objective">Ρυθμίζοντας το κλειστό κύκλωμα, αυξήστε το μέγιστο IOB πάνω από 0 και σταδιακά μειώστε τους στόχους BG</string>
<string name="objectives_4_gate">Τρέξτε το για λίγες ημέρες, και τουλάχιστον μία νύχτα χωρίς χαμηλό συναγερμό BG, πριν χαμηλώσετε τα όρια</string> <string name="objectives_maxiob_gate">Τρέξτε το για λίγες ημέρες, και τουλάχιστον μία νύχτα χωρίς χαμηλό συναγερμό BG, πριν χαμηλώσετε τα όρια</string>
<string name="objectives_5_objective">Ρυθμίστε τον βασικό ρυθμό και τις αναλογίες αν χρειάζεται, και μετά ενεργοποιήστε το auto-sens</string> <string name="objectives_autosens_objective">Ρυθμίστε τον βασικό ρυθμό και τις αναλογίες αν χρειάζεται, και μετά ενεργοποιήστε το auto-sens</string>
<string name="objectives_5_gate">1 επιτυχής εβδομάδα ημερήσιου κυκλώματος με κανονική εισαγωγή υδατανθράκων</string> <string name="objectives_autosens_gate">1 επιτυχής εβδομάδα ημερήσιου κυκλώματος με κανονική εισαγωγή υδατανθράκων</string>
<string name="objectives_6_objective">Ενεργοποιώντας επιπρόσθετα χαρακτηριστικά για χρήση κατά την ημέρα, όπως τον Προχωρημένο Βοηθό Γεύματος</string> <string name="objectives_ama_objective">Ενεργοποιώντας επιπρόσθετα χαρακτηριστικά για χρήση κατά την ημέρα, όπως τον Προχωρημένο Βοηθό Γεύματος</string>
<string name="objectives_7_objective">Ενεργοποιήστε άλλες λειτουργίες για χρήση κατά την ημέρα, όπως SMB</string> <string name="objectives_smb_objective">Ενεργοποιήστε άλλες λειτουργίες για χρήση κατά την ημέρα, όπως SMB</string>
<string name="objectives_7_gate">Πρέπει να διαβάσετε τον οδηγό wiki και να αυξήσετε το ανώτατο όριο του IOB για να μπορέσει να λειτουργήσει σωστά η SMB! Μια καλή αρχή είναι μέγιστο IOB= μέσο bolus γεύματος + 3 x το μέγιστο ημερήσιο βασικού ρυθμού</string> <string name="objectives_smb_gate">Πρέπει να διαβάσετε τον οδηγό wiki και να αυξήσετε το ανώτατο όριο του IOB για να μπορέσει να λειτουργήσει σωστά η SMB! Μια καλή αρχή είναι μέγιστο IOB= μέσο bolus γεύματος + 3 x το μέγιστο ημερήσιο βασικού ρυθμού</string>
<string name="youareonallowedlimit">Φτάσατε το επιτρεπτό όριο</string> <string name="youareonallowedlimit">Φτάσατε το επιτρεπτό όριο</string>
<string name="noprofileselected">Δεν επηλέχθηκε προφίλ</string> <string name="noprofileselected">Δεν επηλέχθηκε προφίλ</string>
<string name="smscommunicator_loophasbeendisabled">Το κύκλωμα απενεργοποιήθηκε</string> <string name="smscommunicator_loophasbeendisabled">Το κύκλωμα απενεργοποιήθηκε</string>

View file

@ -317,19 +317,19 @@
<string name="overview_bolusprogress_goingtodeliver">Se van a infundir %1$.2fU</string> <string name="overview_bolusprogress_goingtodeliver">Se van a infundir %1$.2fU</string>
<string name="objectives_0_objective">Configuración de visualización y monitorización, y análisis de basales y ratios</string> <string name="objectives_0_objective">Configuración de visualización y monitorización, y análisis de basales y ratios</string>
<string name="objectives_0_gate">Comprobar que los datos de BG están disponibles en Nightscout, y que los datos de la bomba de insulina se están subiendo</string> <string name="objectives_0_gate">Comprobar que los datos de BG están disponibles en Nightscout, y que los datos de la bomba de insulina se están subiendo</string>
<string name="objectives_1_objective">Empezar con lazo abierto</string> <string name="objectives_openloop_objective">Empezar con lazo abierto</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Entender el lazo abierto, incluidas las recomendaciones de basales temporales</string> <string name="objectives_maxbasal_objective">Entender el lazo abierto, incluidas las recomendaciones de basales temporales</string>
<string name="objectives_2_gate">Sobre la base de esa experiencia, decidir valores de máximo basal, y ajustar la bomba y preferencias</string> <string name="objectives_maxbasal_gate">Sobre la base de esa experiencia, decidir valores de máximo basal, y ajustar la bomba y preferencias</string>
<string name="objectives_3_objective">Iniciando el lazo cerrado con suspensión con baja glucosa</string> <string name="objectives_maxiobzero_objective">Iniciando el lazo cerrado con suspensión con baja glucosa</string>
<string name="objectives_3_gate">Ejecutar en lazo cerrado con max IOB=0 durante unos días sin demasiados valores bajos de glucosa</string> <string name="objectives_maxiobzero_gate">Ejecutar en lazo cerrado con max IOB=0 durante unos días sin demasiados valores bajos de glucosa</string>
<string name="objectives_4_objective">Ajuste del lazo cerrado, aumentando máximo IOB por encima de 0 y bajando gradualmente objetivos BG</string> <string name="objectives_maxiob_objective">Ajuste del lazo cerrado, aumentando máximo IOB por encima de 0 y bajando gradualmente objetivos BG</string>
<string name="objectives_4_gate">Funcionando unos cuantos días, y al menos una noche sin alarmas de glucosa baja, antes de bajar valor de glucosa</string> <string name="objectives_maxiob_gate">Funcionando unos cuantos días, y al menos una noche sin alarmas de glucosa baja, antes de bajar valor de glucosa</string>
<string name="objectives_5_objective">Ajustar los basales y ratios, si es necesario, y luego activar auto-sens</string> <string name="objectives_autosens_objective">Ajustar los basales y ratios, si es necesario, y luego activar auto-sens</string>
<string name="objectives_5_gate">Una semana con éxito en lazo cerrado durante el día con entrada regular de carbohidratos</string> <string name="objectives_autosens_gate">Una semana con éxito en lazo cerrado durante el día con entrada regular de carbohidratos</string>
<string name="objectives_6_objective">Habilitar funciones adicionales para su uso durante el día, como asistente de comida avanzado</string> <string name="objectives_ama_objective">Habilitar funciones adicionales para su uso durante el día, como asistente de comida avanzado</string>
<string name="objectives_7_objective">Habilitar funciones adicionales para uso durante el día como SMB</string> <string name="objectives_smb_objective">Habilitar funciones adicionales para uso durante el día como SMB</string>
<string name="objectives_7_gate">¡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</string> <string name="objectives_smb_gate">¡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</string>
<string name="youareonallowedlimit">Alcanzado el límite permitido</string> <string name="youareonallowedlimit">Alcanzado el límite permitido</string>
<string name="noprofileselected">Sin perfil seleccionado</string> <string name="noprofileselected">Sin perfil seleccionado</string>
<string name="smscommunicator_loophasbeendisabled">Lazo se ha desactivado</string> <string name="smscommunicator_loophasbeendisabled">Lazo se ha desactivado</string>

View file

@ -320,19 +320,19 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S
<string name="overview_bolusprogress_goingtodeliver">%1$.2fU vont être injectées</string> <string name="overview_bolusprogress_goingtodeliver">%1$.2fU vont être injectées</string>
<string name="objectives_0_objective">Paramétrer la visualisation et la surveillance des données, analyser les débits de basal et les ratios</string> <string name="objectives_0_objective">Paramétrer la visualisation et la surveillance des données, analyser les débits de basal et les ratios</string>
<string name="objectives_0_gate">Vérifiez que la Glycémie est disponible sur Nightscout et que les données dinsuline ont été téléchargées de la pompe</string> <string name="objectives_0_gate">Vérifiez que la Glycémie est disponible sur Nightscout et que les données dinsuline ont été téléchargées de la pompe</string>
<string name="objectives_1_objective">Commencez par la configuration Boucle Ouverte</string> <string name="objectives_openloop_objective">Commencez par la configuration Boucle Ouverte</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Comprendre votre système Boucle Ouverte, y compris ses recommandations de débit de Basal temporaire</string> <string name="objectives_maxbasal_objective">Comprendre votre système Boucle Ouverte, y compris ses recommandations de débit de Basal temporaire</string>
<string name="objectives_2_gate">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 </string> <string name="objectives_maxbasal_gate">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 </string>
<string name="objectives_3_objective">Commencez par utiliser la Boucle Fermée avec le système Arrêt Glycémie Basse</string> <string name="objectives_maxiobzero_objective">Commencez par utiliser la Boucle Fermée avec le système Arrêt Glycémie Basse</string>
<string name="objectives_3_gate">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)</string> <string name="objectives_maxiobzero_gate">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)</string>
<string name="objectives_4_objective">Ajustez votre système Boucle Fermée, augmentez la fonction « max IOB » au delà de 0 et diminuez progressivement vos cibles glycémiques</string> <string name="objectives_maxiob_objective">Ajustez votre système Boucle Fermée, augmentez la fonction « max IOB » au delà de 0 et diminuez progressivement vos cibles glycémiques</string>
<string name="objectives_4_gate">Utiliser pendant quelques jours, et au moins une nuit sans les alarmes dhypoglycémie, avant la baisse de G</string> <string name="objectives_maxiob_gate">Utiliser pendant quelques jours, et au moins une nuit sans les alarmes dhypoglycémie, avant la baisse de G</string>
<string name="objectives_5_objective">Ajustez si besoin les débits de base et les ratios, activez ensuite « Autosens »</string> <string name="objectives_autosens_objective">Ajustez si besoin les débits de base et les ratios, activez ensuite « Autosens »</string>
<string name="objectives_5_gate">Une semaine réussie avec des journées en Boucle Fermée, avec des entrées normales des glucides</string> <string name="objectives_autosens_gate">Une semaine réussie avec des journées en Boucle Fermée, avec des entrées normales des glucides</string>
<string name="objectives_6_objective">Activer dautres fonctionnalités pour lutilisation dans la journée, tel que Assistance Repas Avancée (AMA Advanced Meal Assist)</string> <string name="objectives_ama_objective">Activer dautres fonctionnalités pour lutilisation dans la journée, tel que Assistance Repas Avancée (AMA Advanced Meal Assist)</string>
<string name="objectives_7_objective">Activer des fonctionnalités supplémentaires pour l\'utilisation dans la journée, telles que la fonction SMB</string> <string name="objectives_smb_objective">Activer des fonctionnalités supplémentaires pour l\'utilisation dans la journée, telles que la fonction SMB</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">Vous avez atteint la limite maximale</string> <string name="youareonallowedlimit">Vous avez atteint la limite maximale</string>
<string name="noprofileselected">Aucun profil séléctionné</string> <string name="noprofileselected">Aucun profil séléctionné</string>
<string name="smscommunicator_loophasbeendisabled">La Boucle été désactivée</string> <string name="smscommunicator_loophasbeendisabled">La Boucle été désactivée</string>

View file

@ -34,6 +34,7 @@
<string name="description_smb">Algoritmo più recente per gli utenti avanzati</string> <string name="description_smb">Algoritmo più recente per gli utenti avanzati</string>
<string name="description_overview">Visualizza lo stato corrente del tuo loop e i pulsanti per le azioni più comuni</string> <string name="description_overview">Visualizza lo stato corrente del tuo loop e i pulsanti per le azioni più comuni</string>
<string name="description_persistent_notification">Mostra una notifica con una breve panoramica di ciò che sta facendo il tuo loop</string> <string name="description_persistent_notification">Mostra una notifica con una breve panoramica di ciò che sta facendo il tuo loop</string>
<string name="description_profile_local">Definisci un profilo disponibile offline.</string>
<string name="description_profile_nightscout">Fornisce il profilo definito in Nightscout</string> <string name="description_profile_nightscout">Fornisce il profilo definito in Nightscout</string>
<string name="description_profile_simple">Imposta un profilo con un solo intervallo temporale.</string> <string name="description_profile_simple">Imposta un profilo con un solo intervallo temporale.</string>
<string name="description_pump_combo">Integrazione del microinfusore Accu-Chek Combo, è necessario avere Ruffy installato</string> <string name="description_pump_combo">Integrazione del microinfusore Accu-Chek Combo, è necessario avere Ruffy installato</string>
@ -318,19 +319,19 @@
<string name="overview_bolusprogress_goingtodeliver">Sto per erogare %1$.2fU</string> <string name="overview_bolusprogress_goingtodeliver">Sto per erogare %1$.2fU</string>
<string name="objectives_0_objective">Configurazione della visualizzazione e del monitoraggio, analisi basali e rapporti</string> <string name="objectives_0_objective">Configurazione della visualizzazione e del monitoraggio, analisi basali e rapporti</string>
<string name="objectives_0_gate">Verificare che la Glicemia sia disponibile su Nightscout e che i dati sull\'insulina del micro siano in fase di caricamento</string> <string name="objectives_0_gate">Verificare che la Glicemia sia disponibile su Nightscout e che i dati sull\'insulina del micro siano in fase di caricamento</string>
<string name="objectives_1_objective">Partenza con Loop Aperto</string> <string name="objectives_openloop_objective">Partenza con Loop Aperto</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Comprendi il tuo Loop Aperto, incluse le relative raccomandazioni sulle basali temporanee</string> <string name="objectives_maxbasal_objective">Comprendi il tuo Loop Aperto, incluse le relative raccomandazioni sulle basali temporanee</string>
<string name="objectives_2_gate">Sulla base di tale esperienza, decidi quale deve essere il valore max della basale e impostalo sul microinfusore e nelle preferenze</string> <string name="objectives_maxbasal_gate">Sulla base di tale esperienza, decidi quale deve essere il valore max della basale e impostalo sul microinfusore e nelle preferenze</string>
<string name="objectives_3_objective">Iniziare a chiudere il Loop con Low Glucose Suspend</string> <string name="objectives_maxiobzero_objective">Iniziare a chiudere il Loop con Low Glucose Suspend</string>
<string name="objectives_3_gate">Esegui l\'applicazione in Loop Chiuso con max IOB = 0 per pochi giorni senza troppi eventi LGS</string> <string name="objectives_maxiobzero_gate">Esegui l\'applicazione in Loop Chiuso con max IOB = 0 per pochi giorni senza troppi eventi LGS</string>
<string name="objectives_4_objective">Regola il Loop Chiuso, aumentando max IOB al di sopra di 0 e abbassando gradualmente i target glicemici</string> <string name="objectives_maxiob_objective">Regola il Loop Chiuso, aumentando max IOB al di sopra di 0 e abbassando gradualmente i target glicemici</string>
<string name="objectives_4_gate">Esegui l\'applicazione per alcuni giorni e almeno una notte senza allarmi glicemia, prima di abbassare il target glicemico</string> <string name="objectives_maxiob_gate">Esegui l\'applicazione per alcuni giorni e almeno una notte senza allarmi glicemia, prima di abbassare il target glicemico</string>
<string name="objectives_5_objective">Regola le basali e i rapporti se necessario, quindi attiva auto-sens</string> <string name="objectives_autosens_objective">Regola le basali e i rapporti se necessario, quindi attiva auto-sens</string>
<string name="objectives_5_gate">1 settimana di looping diurno con dichiarazione regolare dei carboidrati, eseguito con successo</string> <string name="objectives_autosens_gate">1 settimana di looping diurno con dichiarazione regolare dei carboidrati, eseguito con successo</string>
<string name="objectives_6_objective">Abilita funzioni aggiuntive per l\'uso diurno, ad esempio AMA (advanced meal assist - assistenza avanzata del pasto)</string> <string name="objectives_ama_objective">Abilita funzioni aggiuntive per l\'uso diurno, ad esempio AMA (advanced meal assist - assistenza avanzata del pasto)</string>
<string name="objectives_7_objective">Abilita funzioni aggiuntive per l\'uso diurno, come SMB</string> <string name="objectives_smb_objective">Abilita funzioni aggiuntive per l\'uso diurno, come SMB</string>
<string name="objectives_7_gate">È 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</string> <string name="objectives_smb_gate">È 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</string>
<string name="youareonallowedlimit">Hai raggiunto il limite consentito</string> <string name="youareonallowedlimit">Hai raggiunto il limite consentito</string>
<string name="noprofileselected">Nessun profilo selezionato</string> <string name="noprofileselected">Nessun profilo selezionato</string>
<string name="smscommunicator_loophasbeendisabled">Disattivazione Loop corretta</string> <string name="smscommunicator_loophasbeendisabled">Disattivazione Loop corretta</string>
@ -950,6 +951,7 @@
<string name="sensitivitysetup">Configura il plugin di Sensibilità</string> <string name="sensitivitysetup">Configura il plugin di Sensibilità</string>
<string name="setupwizard_sensitivity_description">Il plugin di Sensibilità è utilizzato per il rilevamento della sensibilità all\'insulina e il calcolo di COB. Per ulteriori informazioni visita:</string> <string name="setupwizard_sensitivity_description">Il plugin di Sensibilità è utilizzato per il rilevamento della sensibilità all\'insulina e il calcolo di COB. Per ulteriori informazioni visita:</string>
<string name="setupwizard_sensitivity_url">https://github.com/MilosKozak/AndroidAPS/wiki/Sensitivity-detection-and-COB</string> <string name="setupwizard_sensitivity_url">https://github.com/MilosKozak/AndroidAPS/wiki/Sensitivity-detection-and-COB</string>
<string name="nsclientinfotext">NSClient gestisce la connessione a Nightscout. Puoi saltare questa parte ora, ma non sarai in grado di superare gli obiettivi fino a quando non ne porterai a termine la configurazione.</string>
<string name="diawarning">Ricorda: i nuovi profili di insulina richiedono una DIA di almeno 5h. DIA di 5 - 6h sui nuovi profili sono uguali a DIA di 3h sui vecchi profili di insulina.</string> <string name="diawarning">Ricorda: i nuovi profili di insulina richiedono una DIA di almeno 5h. DIA di 5 - 6h sui nuovi profili sono uguali a DIA di 3h sui vecchi profili di insulina.</string>
<string name="bgsourcesetup">Configura sorgente Glicemie</string> <string name="bgsourcesetup">Configura sorgente Glicemie</string>
<string name="setupwizard_profile_description">Seleziona il tipo di profilo. Se il paziente è un bambino è necessario utilizzare il profilo di NS. Se non c\'è nessuno a seguirti su Nightscout probabilmente preferirai il profilo locale. Ricorda che stai solo selezionando la sorgente del profilo. Per utilizzarlo devi attivarlo tramite l\'esecuzione del comando \"Cambio Profilo\"</string> <string name="setupwizard_profile_description">Seleziona il tipo di profilo. Se il paziente è un bambino è necessario utilizzare il profilo di NS. Se non c\'è nessuno a seguirti su Nightscout probabilmente preferirai il profilo locale. Ricorda che stai solo selezionando la sorgente del profilo. Per utilizzarlo devi attivarlo tramite l\'esecuzione del comando \"Cambio Profilo\"</string>

View file

@ -319,19 +319,19 @@
<string name="overview_bolusprogress_goingtodeliver">%1$.2fU을 주입합니다</string> <string name="overview_bolusprogress_goingtodeliver">%1$.2fU을 주입합니다</string>
<string name="objectives_0_objective">표시설정과 모니터설정을 완료하고, Basal과 비율을 분석한다.</string> <string name="objectives_0_objective">표시설정과 모니터설정을 완료하고, Basal과 비율을 분석한다.</string>
<string name="objectives_0_gate">나이트스카우트에서 혈당 데이터가 잘 들어오는지, 펌프데이터가 업로드 되는지 확인한다.</string> <string name="objectives_0_gate">나이트스카우트에서 혈당 데이터가 잘 들어오는지, 펌프데이터가 업로드 되는지 확인한다.</string>
<string name="objectives_1_objective">Open Loop를 시작한다.</string> <string name="objectives_openloop_objective">Open Loop를 시작한다.</string>
<string name="objectives_1_gate">Open Loop 모드에서 몇일간 사용하여보고, 임시Basal을 여러번 수동으로 주입해 본다. 임시목표와 기본임시목표(\'식사직전\', \'활동\',\'저혈당\' 임시목표)를 설정하고 사용해 본다.</string> <string name="objectives_openloop_gate">Open Loop 모드에서 몇일간 사용하여보고, 임시Basal을 여러번 수동으로 주입해 본다. 임시목표와 기본임시목표(\'식사직전\', \'활동\',\'저혈당\' 임시목표)를 설정하고 사용해 본다.</string>
<string name="objectives_2_objective">임시Basal 추천기능을 포함해서, Open Loop에 대해 이해한다.</string> <string name="objectives_maxbasal_objective">임시Basal 추천기능을 포함해서, Open Loop에 대해 이해한다.</string>
<string name="objectives_2_gate">이 경험을 토대로, 최대 Basal을 결정하고 이를 펌프와 설정에 입력한다.</string> <string name="objectives_maxbasal_gate">이 경험을 토대로, 최대 Basal을 결정하고 이를 펌프와 설정에 입력한다.</string>
<string name="objectives_3_objective">Closed Loop를 시작하고 저혈당인슐린 중지 기능을 사용해본다.</string> <string name="objectives_maxiobzero_objective">Closed Loop를 시작하고 저혈당인슐린 중지 기능을 사용해본다.</string>
<string name="objectives_3_gate">최대 IOB = 0 인 상태로 Closed Loop를 몇일동안 실행시켜 본다. 저혈당 인슐린일시중지가 많이 발생하지 않도록 한다.</string> <string name="objectives_maxiobzero_gate">최대 IOB = 0 인 상태로 Closed Loop를 몇일동안 실행시켜 본다. 저혈당 인슐린일시중지가 많이 발생하지 않도록 한다.</string>
<string name="objectives_4_objective">Closed Loop를 조정하여 최대 IOB를 0 이상으로 올려서 서서히 혈당 목표치를 낮춘다.</string> <string name="objectives_maxiob_objective">Closed Loop를 조정하여 최대 IOB를 0 이상으로 올려서 서서히 혈당 목표치를 낮춘다.</string>
<string name="objectives_4_gate">혈당을 낮추기 전에 몇일간 사용해보되 최소한 하루는 저혈당 혈당 알람이 발생하지 않도록 해본다.</string> <string name="objectives_maxiob_gate">혈당을 낮추기 전에 몇일간 사용해보되 최소한 하루는 저혈당 혈당 알람이 발생하지 않도록 해본다.</string>
<string name="objectives_5_objective">필요하면 Basal과 비율을 조절하고, auto-sens를 활성화한다.</string> <string name="objectives_autosens_objective">필요하면 Basal과 비율을 조절하고, auto-sens를 활성화한다.</string>
<string name="objectives_5_gate">평소의 탄수화물을 입력하면서 1주일동안 낮시간대에 loop를 성공적으로 사용해본다.</string> <string name="objectives_autosens_gate">평소의 탄수화물을 입력하면서 1주일동안 낮시간대에 loop를 성공적으로 사용해본다.</string>
<string name="objectives_6_objective">AMA(Advanced Meal Assist)같은 낮시간대를 위한 추가적인 기능들을 실행하여 본다.</string> <string name="objectives_ama_objective">AMA(Advanced Meal Assist)같은 낮시간대를 위한 추가적인 기능들을 실행하여 본다.</string>
<string name="objectives_7_objective">낮시간대에 SMB(Super Micro Bolus)같은 추가기능을 활성화해 사용해본다.</string> <string name="objectives_smb_objective">낮시간대에 SMB(Super Micro Bolus)같은 추가기능을 활성화해 사용해본다.</string>
<string name="objectives_7_gate">SMB가 잘 작동하게 하기위해서 wiki를 반드시 읽은다음 maxIOB를 올려주세요. maxIOB=평균 식사 Bolus + 3 x 최대하루 Basal이면 괜찮은 시작값입니다.</string> <string name="objectives_smb_gate">SMB가 잘 작동하게 하기위해서 wiki를 반드시 읽은다음 maxIOB를 올려주세요. maxIOB=평균 식사 Bolus + 3 x 최대하루 Basal이면 괜찮은 시작값입니다.</string>
<string name="youareonallowedlimit">허용된 제한값에 도달하였습니다</string> <string name="youareonallowedlimit">허용된 제한값에 도달하였습니다</string>
<string name="noprofileselected">프로파일이 선택되지 않았습니다</string> <string name="noprofileselected">프로파일이 선택되지 않았습니다</string>
<string name="smscommunicator_loophasbeendisabled">Loop가 중지되었습니다.</string> <string name="smscommunicator_loophasbeendisabled">Loop가 중지되었습니다.</string>

View file

@ -317,19 +317,19 @@
<string name="overview_bolusprogress_goingtodeliver">Bus suleista %1$.2fvv</string> <string name="overview_bolusprogress_goingtodeliver">Bus suleista %1$.2fvv</string>
<string name="objectives_0_objective">Nustatymai vizualizacijai, monitoringui ir bazės verčių bei koeficientų analizei</string> <string name="objectives_0_objective">Nustatymai vizualizacijai, monitoringui ir bazės verčių bei koeficientų analizei</string>
<string name="objectives_0_gate">Įsitikinkite, kad gliukozės duomenys rodomi Nightscout, o pompos insulino duomenys yra įkelti</string> <string name="objectives_0_gate">Įsitikinkite, kad gliukozės duomenys rodomi Nightscout, o pompos insulino duomenys yra įkelti</string>
<string name="objectives_1_objective">Aktyvuojamas atviras ciklas</string> <string name="objectives_openloop_objective">Aktyvuojamas atviras ciklas</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Perpraskite atvirojo ciklo veikimą bei laikinos bazės rekomendacijas</string> <string name="objectives_maxbasal_objective">Perpraskite atvirojo ciklo veikimą bei laikinos bazės rekomendacijas</string>
<string name="objectives_2_gate">Remdamiesi šia patirtimi, nuspręskite, koks turėtų būti maksimalus bazės dydis bei įveskite jį pompoje ir programos Nustatymuose</string> <string name="objectives_maxbasal_gate">Remdamiesi šia patirtimi, nuspręskite, koks turėtų būti maksimalus bazės dydis bei įveskite jį pompoje ir programos Nustatymuose</string>
<string name="objectives_3_objective">Pradėkite uždaro ciklo (Closed Loop) režimą su pompos stabdymu esant žemai gliukozei</string> <string name="objectives_maxiobzero_objective">Pradėkite uždaro ciklo (Closed Loop) režimą su pompos stabdymu esant žemai gliukozei</string>
<string name="objectives_3_gate">Keletą dienų praleiskite uždaro ciklo režime su kuo mažiau hipoglikemijų, kai IK = 0</string> <string name="objectives_maxiobzero_gate">Keletą dienų praleiskite uždaro ciklo režime su kuo mažiau hipoglikemijų, kai IK = 0</string>
<string name="objectives_4_objective">Koreguokite savo uždarąjį ciklą po truputį didindami maks IK ir mažindami tikslinę gliukozės vertę</string> <string name="objectives_maxiob_objective">Koreguokite savo uždarąjį ciklą po truputį didindami maks IK ir mažindami tikslinę gliukozės vertę</string>
<string name="objectives_4_gate">Praleiskite keletą dienų ir bent vieną naktį be hipoglikemijos aliarmų</string> <string name="objectives_maxiob_gate">Praleiskite keletą dienų ir bent vieną naktį be hipoglikemijos aliarmų</string>
<string name="objectives_5_objective">Jei reikia, paderinkite valandines bazės vertes bei pagrindinius parametrus ir įgalinkite Autosens funkciją.</string> <string name="objectives_autosens_objective">Jei reikia, paderinkite valandines bazės vertes bei pagrindinius parametrus ir įgalinkite Autosens funkciją.</string>
<string name="objectives_5_gate">1 savaitę praleiskite sėkmingai naudodami uždarąjį ciklą dienos metu ir įvesdami visus valgomus angliavandenius.</string> <string name="objectives_autosens_gate">1 savaitę praleiskite sėkmingai naudodami uždarąjį ciklą dienos metu ir įvesdami visus valgomus angliavandenius.</string>
<string name="objectives_6_objective">Dienos metu aktyvuokite papildomas funkcijas, tokias kaip pažangioji maisto skaičiuoklė (AMA Advanced Meal Assist)</string> <string name="objectives_ama_objective">Dienos metu aktyvuokite papildomas funkcijas, tokias kaip pažangioji maisto skaičiuoklė (AMA Advanced Meal Assist)</string>
<string name="objectives_7_objective">Dienos metu aktyvuokite papildomas funkcijas, tokias kaip SMB (Super Mikro Bolusas).</string> <string name="objectives_smb_objective">Dienos metu aktyvuokite papildomas funkcijas, tokias kaip SMB (Super Mikro Bolusas).</string>
<string name="objectives_7_gate">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.</string> <string name="objectives_smb_gate">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.</string>
<string name="youareonallowedlimit">Pasiekėte leistiną ribą</string> <string name="youareonallowedlimit">Pasiekėte leistiną ribą</string>
<string name="noprofileselected">Nepasirinktas profilis</string> <string name="noprofileselected">Nepasirinktas profilis</string>
<string name="smscommunicator_loophasbeendisabled">Ciklas buvo išjungtas</string> <string name="smscommunicator_loophasbeendisabled">Ciklas buvo išjungtas</string>

View file

@ -319,20 +319,20 @@
<string name="overview_bolusprogress_goingtodeliver">Er worden %1$.2fE toegediend</string> <string name="overview_bolusprogress_goingtodeliver">Er worden %1$.2fE toegediend</string>
<string name="objectives_0_objective">Opzetten van visualisatie en monitoring en analyzeren van basaal en ratio\'s</string> <string name="objectives_0_objective">Opzetten van visualisatie en monitoring en analyzeren van basaal en ratio\'s</string>
<string name="objectives_0_gate">Controleren van beschikbaarheid BG en insuline pomp data op Nightscout</string> <string name="objectives_0_gate">Controleren van beschikbaarheid BG en insuline pomp data op Nightscout</string>
<string name="objectives_1_objective">Starten met de Open Loop modus</string> <string name="objectives_openloop_objective">Starten met de Open Loop modus</string>
<string name="objectives_1_gate">In Open Loop modus werken voor enkele dagen en handmatig meermaals tijdelijke basaal instellen. <string name="objectives_openloop_gate">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)</string> Stel in en gebruik tijdelijk en standaard tijdelijke streefdoelen (bv. bij sporten of koolhydraten inname bij hypo)</string>
<string name="objectives_2_objective">De Open Loop begrijpen, inclusief de voorgestelde tijdelijke basaalstanden</string> <string name="objectives_maxbasal_objective">De Open Loop begrijpen, inclusief de voorgestelde tijdelijke basaalstanden</string>
<string name="objectives_2_gate">Gebaseerd op deze ervaringen beslissen wat het maximale basaal mag zijn en dit in de pomp instellen</string> <string name="objectives_maxbasal_gate">Gebaseerd op deze ervaringen beslissen wat het maximale basaal mag zijn en dit in de pomp instellen</string>
<string name="objectives_3_objective">Starten met closed Loop met bescherming tegen lage BG</string> <string name="objectives_maxiobzero_objective">Starten met closed Loop met bescherming tegen lage BG</string>
<string name="objectives_3_gate">In closed Loop werken met een max. IOB = 0 gedurende enkele dagen met een beperkt aantal lage BG</string> <string name="objectives_maxiobzero_gate">In closed Loop werken met een max. IOB = 0 gedurende enkele dagen met een beperkt aantal lage BG</string>
<string name="objectives_4_objective">Inregelen van de closed loop, verhoog de max IOB boven 0 en laat gelijdelijk het streef BG dalen</string> <string name="objectives_maxiob_objective">Inregelen van de closed loop, verhoog de max IOB boven 0 en laat gelijdelijk het streef BG dalen</string>
<string name="objectives_4_gate">Verhoog max. IOB en test enkele dagen als ook minstens 1 nacht zonder een laag BG alarm voordat je jouw streef BG verlaagt</string> <string name="objectives_maxiob_gate">Verhoog max. IOB en test enkele dagen als ook minstens 1 nacht zonder een laag BG alarm voordat je jouw streef BG verlaagt</string>
<string name="objectives_5_objective">Pas het basaal en de ratios aan indien nodig, activeer hierna de auto-sens optie</string> <string name="objectives_autosens_objective">Pas het basaal en de ratios aan indien nodig, activeer hierna de auto-sens optie</string>
<string name="objectives_5_gate">Gedurende 1 week succesvol closed loop met invoer van koolhydraten</string> <string name="objectives_autosens_gate">Gedurende 1 week succesvol closed loop met invoer van koolhydraten</string>
<string name="objectives_6_objective">Activeren van extra functies overdag zoals AMA</string> <string name="objectives_ama_objective">Activeren van extra functies overdag zoals AMA</string>
<string name="objectives_7_objective">Activeren van extra functies overdag zoals SMB</string> <string name="objectives_smb_objective">Activeren van extra functies overdag zoals SMB</string>
<string name="objectives_7_gate">Lees de wiki en verhoog maxIOB om SMB goed werkend te krijgen. Een goed begin is maxIOB=gemiddelde maaltijdbolus + 3 x max dagelijkse basaal</string> <string name="objectives_smb_gate">Lees de wiki en verhoog maxIOB om SMB goed werkend te krijgen. Een goed begin is maxIOB=gemiddelde maaltijdbolus + 3 x max dagelijkse basaal</string>
<string name="youareonallowedlimit">Limiet bereikt</string> <string name="youareonallowedlimit">Limiet bereikt</string>
<string name="noprofileselected">Geen profiel geselecteerd</string> <string name="noprofileselected">Geen profiel geselecteerd</string>
<string name="smscommunicator_loophasbeendisabled">Loop was uitgeschakeld</string> <string name="smscommunicator_loophasbeendisabled">Loop was uitgeschakeld</string>

View file

@ -319,19 +319,19 @@
<string name="overview_bolusprogress_goingtodeliver">Zamierzam dostarczyć %1$.2fU</string> <string name="overview_bolusprogress_goingtodeliver">Zamierzam dostarczyć %1$.2fU</string>
<string name="objectives_0_objective">Konfiguracja wizualizacji i monitorowania, analiza dawek i wartości bazowych</string> <string name="objectives_0_objective">Konfiguracja wizualizacji i monitorowania, analiza dawek i wartości bazowych</string>
<string name="objectives_0_gate">Sprawdź czy BG (pomiary cukru) są dostępne w Nightscout, i dane pompy insulinowej są ładowane</string> <string name="objectives_0_gate">Sprawdź czy BG (pomiary cukru) są dostępne w Nightscout, i dane pompy insulinowej są ładowane</string>
<string name="objectives_1_objective">Uruchamiam otwartą pętle (OpenLoop)</string> <string name="objectives_openloop_objective">Uruchamiam otwartą pętle (OpenLoop)</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Zrozumienie działania otwartej pętli, wraz z jej rekomendacjami dawek tymczasowych</string> <string name="objectives_maxbasal_objective">Zrozumienie działania otwartej pętli, wraz z jej rekomendacjami dawek tymczasowych</string>
<string name="objectives_2_gate">Na podstawie tych doświadczeń zdecyduj jaka maksymalna baza powinna być ustawiona, i wprowadź ją w pompie i w ustawieniach AAPS</string> <string name="objectives_maxbasal_gate">Na podstawie tych doświadczeń zdecyduj jaka maksymalna baza powinna być ustawiona, i wprowadź ją w pompie i w ustawieniach AAPS</string>
<string name="objectives_3_objective">Rozpoczęcie zamknięcia pętli z zawieszeniem podawania bazy przy niskim poziomie cukru</string> <string name="objectives_maxiobzero_objective">Rozpoczęcie zamknięcia pętli z zawieszeniem podawania bazy przy niskim poziomie cukru</string>
<string name="objectives_3_gate">Używaj zamkniętej pętli (Closed Loop) z max IOB (maksymalną dawką aktywnej insuliny) = 0 bez zbyt wielu incydentów niedocukrzeń</string> <string name="objectives_maxiobzero_gate">Używaj zamkniętej pętli (Closed Loop) z max IOB (maksymalną dawką aktywnej insuliny) = 0 bez zbyt wielu incydentów niedocukrzeń</string>
<string name="objectives_4_objective">Dostrajanie zamkniętej pętli, podniesienie wartości max IOB powyżej 0 i stopniowe obniżanie docelowego poziomu cukru (BG target)</string> <string name="objectives_maxiob_objective">Dostrajanie zamkniętej pętli, podniesienie wartości max IOB powyżej 0 i stopniowe obniżanie docelowego poziomu cukru (BG target)</string>
<string name="objectives_4_gate">Używaj pętli przez kilka dni i przynajmniej jedną noc bez żadnego alarmu niskiego poziomu, przed obniżeniem docelowego poziomu cukru (BG target)</string> <string name="objectives_maxiob_gate">Używaj pętli przez kilka dni i przynajmniej jedną noc bez żadnego alarmu niskiego poziomu, przed obniżeniem docelowego poziomu cukru (BG target)</string>
<string name="objectives_5_objective">Dostosuj bazę i wartości parametrów, i wtedy uruchom funkcję autosens</string> <string name="objectives_autosens_objective">Dostosuj bazę i wartości parametrów, i wtedy uruchom funkcję autosens</string>
<string name="objectives_5_gate">1 tydzień sukcesu w działaniu pętli w ciągu dnia z regularnym wprowadzaniem spożywanych węglowodanów (węglow.)</string> <string name="objectives_autosens_gate">1 tydzień sukcesu w działaniu pętli w ciągu dnia z regularnym wprowadzaniem spożywanych węglowodanów (węglow.)</string>
<string name="objectives_6_objective">Uruchomienie do użytku dziennego dodatkowych funkcji, jak AMA (zaawansowany asystent posiłku)</string> <string name="objectives_ama_objective">Uruchomienie do użytku dziennego dodatkowych funkcji, jak AMA (zaawansowany asystent posiłku)</string>
<string name="objectives_7_objective">Uruchomienie do użytku dziennego dodatkowych funkcji, jak SMB (Super Mikro Bolusy)</string> <string name="objectives_smb_objective">Uruchomienie do użytku dziennego dodatkowych funkcji, jak SMB (Super Mikro Bolusy)</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">Osiągnąłeś dozwolony limit</string> <string name="youareonallowedlimit">Osiągnąłeś dozwolony limit</string>
<string name="noprofileselected">Nie wybrano profilu</string> <string name="noprofileselected">Nie wybrano profilu</string>
<string name="smscommunicator_loophasbeendisabled">Pętla (Loop) została wyłączona</string> <string name="smscommunicator_loophasbeendisabled">Pętla (Loop) została wyłączona</string>

View file

@ -318,19 +318,19 @@
<string name="overview_bolusprogress_goingtodeliver">Vão ser administradas %1$.2fU</string> <string name="overview_bolusprogress_goingtodeliver">Vão ser administradas %1$.2fU</string>
<string name="objectives_0_objective">Configuração da visualização e monitoramento, e análise de rácios e basals</string> <string name="objectives_0_objective">Configuração da visualização e monitoramento, e análise de rácios e basals</string>
<string name="objectives_0_gate">Verificar se a BG está disponível no Nightscout, e se os dados de insulina da bomba estão a ser carregados</string> <string name="objectives_0_gate">Verificar se a BG está disponível no Nightscout, e se os dados de insulina da bomba estão a ser carregados</string>
<string name="objectives_1_objective">A iniciar um open loop</string> <string name="objectives_openloop_objective">A iniciar um open loop</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Compreender o seu open loop, incluindo as suas recomendações de basais temporárias</string> <string name="objectives_maxbasal_objective">Compreender o seu open loop, incluindo as suas recomendações de basais temporárias</string>
<string name="objectives_2_gate">Com base nessa experiência, decidir qual deve ser a basal máxima e configurá-la na bomba e nas preferências</string> <string name="objectives_maxbasal_gate">Com base nessa experiência, decidir qual deve ser a basal máxima e configurá-la na bomba e nas preferências</string>
<string name="objectives_3_objective">Começar o close loop com Suspensão por Glicose Baixa.</string> <string name="objectives_maxiobzero_objective">Começar o close loop com Suspensão por Glicose Baixa.</string>
<string name="objectives_3_gate">Utilizar em close loop com IOB máx = 0 por alguns dias sem muitas situações de Suspensão por Baixa Glicose</string> <string name="objectives_maxiobzero_gate">Utilizar em close loop com IOB máx = 0 por alguns dias sem muitas situações de Suspensão por Baixa Glicose</string>
<string name="objectives_4_objective">Ajustar o close loop, levantar a IOB máxima acima de 0 e reduzir gradualmente os alvos de valor glicémico</string> <string name="objectives_maxiob_objective">Ajustar o close loop, levantar a IOB máxima acima de 0 e reduzir gradualmente os alvos de valor glicémico</string>
<string name="objectives_4_gate">Utilizar por alguns dias e pelo menos uma noite sem alarmes de valores glicémicos baixos, antes de baixar os valores</string> <string name="objectives_maxiob_gate">Utilizar por alguns dias e pelo menos uma noite sem alarmes de valores glicémicos baixos, antes de baixar os valores</string>
<string name="objectives_5_objective">Ajustar as basals e os rácios se necessário e em seguida habilitar o auto-sens</string> <string name="objectives_autosens_objective">Ajustar as basals e os rácios se necessário e em seguida habilitar o auto-sens</string>
<string name="objectives_5_gate">1 semana de looping durante o dia com sucesso com entrada de hidratos de carbono regular</string> <string name="objectives_autosens_gate">1 semana de looping durante o dia com sucesso com entrada de hidratos de carbono regular</string>
<string name="objectives_6_objective">Ativando recursos adicionais para uso durante o dia, como assistente avançado de refeição</string> <string name="objectives_ama_objective">Ativando recursos adicionais para uso durante o dia, como assistente avançado de refeição</string>
<string name="objectives_7_objective">Ativando recursos adicionais para uso durante o dia, como SMB</string> <string name="objectives_smb_objective">Ativando recursos adicionais para uso durante o dia, como SMB</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">Atingiu o limite autorizado</string> <string name="youareonallowedlimit">Atingiu o limite autorizado</string>
<string name="noprofileselected">Nenhum perfil selecionado</string> <string name="noprofileselected">Nenhum perfil selecionado</string>
<string name="smscommunicator_loophasbeendisabled">Loop foi desativado</string> <string name="smscommunicator_loophasbeendisabled">Loop foi desativado</string>

View file

@ -319,19 +319,19 @@
<string name="overview_bolusprogress_goingtodeliver">Vão ser administradas %1$.2fU</string> <string name="overview_bolusprogress_goingtodeliver">Vão ser administradas %1$.2fU</string>
<string name="objectives_0_objective">Configuração da visualização e monitoramento, e análise de rácios e basals</string> <string name="objectives_0_objective">Configuração da visualização e monitoramento, e análise de rácios e basals</string>
<string name="objectives_0_gate">Verificar se a BG está disponível no Nightscout, e se os dados de insulina da bomba estão a ser carregados</string> <string name="objectives_0_gate">Verificar se a BG está disponível no Nightscout, e se os dados de insulina da bomba estão a ser carregados</string>
<string name="objectives_1_objective">A iniciar um open loop</string> <string name="objectives_openloop_objective">A iniciar um open loop</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Compreender o seu open loop, incluindo as suas recomendações de basais temporárias</string> <string name="objectives_maxbasal_objective">Compreender o seu open loop, incluindo as suas recomendações de basais temporárias</string>
<string name="objectives_2_gate">Com base nessa experiência, decidir qual deve ser a basal máxima e configurá-la na bomba e nas preferências</string> <string name="objectives_maxbasal_gate">Com base nessa experiência, decidir qual deve ser a basal máxima e configurá-la na bomba e nas preferências</string>
<string name="objectives_3_objective">Começar o close loop com Suspensão por Glicose Baixa.</string> <string name="objectives_maxiobzero_objective">Começar o close loop com Suspensão por Glicose Baixa.</string>
<string name="objectives_3_gate">Utilizar em close loop com IOB máx = 0 por alguns dias sem muitas situações de Suspensão por Baixa Glicose</string> <string name="objectives_maxiobzero_gate">Utilizar em close loop com IOB máx = 0 por alguns dias sem muitas situações de Suspensão por Baixa Glicose</string>
<string name="objectives_4_objective">Ajustar o close loop, levantar a IOB máxima acima de 0 e reduzir gradualmente os alvos de valor glicémico</string> <string name="objectives_maxiob_objective">Ajustar o close loop, levantar a IOB máxima acima de 0 e reduzir gradualmente os alvos de valor glicémico</string>
<string name="objectives_4_gate">Utilizar por alguns dias e pelo menos uma noite sem alarmes de valores glicémicos baixos, antes de baixar os valores</string> <string name="objectives_maxiob_gate">Utilizar por alguns dias e pelo menos uma noite sem alarmes de valores glicémicos baixos, antes de baixar os valores</string>
<string name="objectives_5_objective">Ajustar as basals e os rácios se necessário e em seguida habilitar o auto-sens</string> <string name="objectives_autosens_objective">Ajustar as basals e os rácios se necessário e em seguida habilitar o auto-sens</string>
<string name="objectives_5_gate">1 semana de looping durante o dia com sucesso com entrada de hidratos de carbono regular</string> <string name="objectives_autosens_gate">1 semana de looping durante o dia com sucesso com entrada de hidratos de carbono regular</string>
<string name="objectives_6_objective">Ativando recursos adicionais para uso durante o dia, como assistente avançado de refeição</string> <string name="objectives_ama_objective">Ativando recursos adicionais para uso durante o dia, como assistente avançado de refeição</string>
<string name="objectives_7_objective">Ativando recursos adicionais para uso durante o dia, como SMB</string> <string name="objectives_smb_objective">Ativando recursos adicionais para uso durante o dia, como SMB</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">Atingiu o limite autorizado</string> <string name="youareonallowedlimit">Atingiu o limite autorizado</string>
<string name="noprofileselected">Nenhum perfil seleccionado</string> <string name="noprofileselected">Nenhum perfil seleccionado</string>
<string name="smscommunicator_loophasbeendisabled">Loop foi desactivado</string> <string name="smscommunicator_loophasbeendisabled">Loop foi desactivado</string>

View file

@ -319,19 +319,19 @@
<string name="overview_bolusprogress_goingtodeliver">Se va livra un bolus de %1$.2fU</string> <string name="overview_bolusprogress_goingtodeliver">Se va livra un bolus de %1$.2fU</string>
<string name="objectives_0_objective">Se stabilesc vizualizările și monitorizarea și se analizează bazalele și valorile ratelor</string> <string name="objectives_0_objective">Se stabilesc vizualizările și monitorizarea și se analizează bazalele și valorile ratelor</string>
<string name="objectives_0_gate">Verificați că vedeți glicemia în Nightscout și că datele despre insulină date de pompă sunt înregistrate în site</string> <string name="objectives_0_gate">Verificați că vedeți glicemia în Nightscout și că datele despre insulină date de pompă sunt înregistrate în site</string>
<string name="objectives_1_objective">Pornire în mod buclă deschisă</string> <string name="objectives_openloop_objective">Pornire în mod buclă deschisă</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Trebuie să fie înțeleasă modalitatea de funcționare a buclei deschise, inclusiv recomandările de bazală temporară</string> <string name="objectives_maxbasal_objective">Trebuie să fie înțeleasă modalitatea de funcționare a buclei deschise, inclusiv recomandările de bazală temporară</string>
<string name="objectives_2_gate">Pe baza acestei experiențe, decideți care va fi bazala maximă și setați această valoare în pompă și în preferințe</string> <string name="objectives_maxbasal_gate">Pe baza acestei experiențe, decideți care va fi bazala maximă și setați această valoare în pompă și în preferințe</string>
<string name="objectives_3_objective">Se începe etapa de buclă închisă cu Suspendarea Insulinei la Valori Glicemie Mici (Low Glucose Suspend = LGS)</string> <string name="objectives_maxiobzero_objective">Se începe etapa de buclă închisă cu Suspendarea Insulinei la Valori Glicemie Mici (Low Glucose Suspend = LGS)</string>
<string name="objectives_3_gate">Folosiți sistemul în mod buclă închisă cu IOB maxim = 0 pentru câteva zile fără prea multe evenimente LGS</string> <string name="objectives_maxiobzero_gate">Folosiți sistemul în mod buclă închisă cu IOB maxim = 0 pentru câteva zile fără prea multe evenimente LGS</string>
<string name="objectives_4_objective">Acordați fin performanța buclei închise, prin mărirea valorii max IOB peste 0 și micșorarea graduală a țintelor glicemice</string> <string name="objectives_maxiob_objective">Acordați fin performanța buclei închise, prin mărirea valorii max IOB peste 0 și micșorarea graduală a țintelor glicemice</string>
<string name="objectives_4_gate">Folosiți pentru câteva zile și cel puțin o noapte fără a avea alarme de hipoglicemie, înainte de scăderea glicemiei</string> <string name="objectives_maxiob_gate">Folosiți pentru câteva zile și cel puțin o noapte fără a avea alarme de hipoglicemie, înainte de scăderea glicemiei</string>
<string name="objectives_5_objective">Ajustați bazalele și ratele dacă este cazul și apoi activați autosens</string> <string name="objectives_autosens_objective">Ajustați bazalele și ratele dacă este cazul și apoi activați autosens</string>
<string name="objectives_5_gate">O săptămână de folosire cu succes a sistemului cu buclă închisă cu introducerea normală de carbohidrați</string> <string name="objectives_autosens_gate">O săptămână de folosire cu succes a sistemului cu buclă închisă cu introducerea normală de carbohidrați</string>
<string name="objectives_6_objective">Folosirea instrumentelor adiționale pentru timpul zilei, cum ar fi asistența avansată pentru mese</string> <string name="objectives_ama_objective">Folosirea instrumentelor adiționale pentru timpul zilei, cum ar fi asistența avansată pentru mese</string>
<string name="objectives_7_objective">Se activează opțiuni pentru uzul în timpul zilei, cum ar fi SMB</string> <string name="objectives_smb_objective">Se activează opțiuni pentru uzul în timpul zilei, cum ar fi SMB</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">Ați atins limita permisă</string> <string name="youareonallowedlimit">Ați atins limita permisă</string>
<string name="noprofileselected">Niciun profil selectat</string> <string name="noprofileselected">Niciun profil selectat</string>
<string name="smscommunicator_loophasbeendisabled">Bucla a fost dezactivată</string> <string name="smscommunicator_loophasbeendisabled">Bucla a fost dezactivată</string>

View file

@ -319,19 +319,19 @@
<string name="overview_bolusprogress_goingtodeliver">Начинается подача болюса %1$.2fед.</string> <string name="overview_bolusprogress_goingtodeliver">Начинается подача болюса %1$.2fед.</string>
<string name="objectives_0_objective">настройка визуализации и мониторинга, анализ базала и коэффициентов</string> <string name="objectives_0_objective">настройка визуализации и мониторинга, анализ базала и коэффициентов</string>
<string name="objectives_0_gate">убедитесь что СК и данные помпы передаются в NS</string> <string name="objectives_0_gate">убедитесь что СК и данные помпы передаются в NS</string>
<string name="objectives_1_objective">старт незамкнутого цикла</string> <string name="objectives_openloop_objective">старт незамкнутого цикла</string>
<string name="objectives_1_gate">Работа в режиме незамкнутого цикла и ручной подстройки величины временного базала. Установите и применяйте временные цели и временные цели по умолчанию (напр. углеводы при нагрузке или купировании гипо)</string> <string name="objectives_openloop_gate">Работа в режиме незамкнутого цикла и ручной подстройки величины временного базала. Установите и применяйте временные цели и временные цели по умолчанию (напр. углеводы при нагрузке или купировании гипо)</string>
<string name="objectives_2_objective">анализ вашего незамкнутого цикла включая рекомендации по врем базалу</string> <string name="objectives_maxbasal_objective">анализ вашего незамкнутого цикла включая рекомендации по врем базалу</string>
<string name="objectives_2_gate">на основе полученного опыта определите макс величину базала и введите ее в помпу и настройки</string> <string name="objectives_maxbasal_gate">на основе полученного опыта определите макс величину базала и введите ее в помпу и настройки</string>
<string name="objectives_3_objective">закольцовывание цикла с Low Glucose Suspend (приостановка на низких СК)</string> <string name="objectives_maxiobzero_objective">закольцовывание цикла с Low Glucose Suspend (приостановка на низких СК)</string>
<string name="objectives_3_gate">работа в замкнутом цикле с макс IOB = 0 несколько дней избегая событий типа Low Suspend</string> <string name="objectives_maxiobzero_gate">работа в замкнутом цикле с макс IOB = 0 несколько дней избегая событий типа Low Suspend</string>
<string name="objectives_4_objective">настройка замкнутого цикла с поднятием макс величины IOB выше 0 и постепенным понижением целевых СК</string> <string name="objectives_maxiob_objective">настройка замкнутого цикла с поднятием макс величины IOB выше 0 и постепенным понижением целевых СК</string>
<string name="objectives_4_gate">работа несколько дней и по кр мере одну ночь без срабатывания оповещений о низком СК</string> <string name="objectives_maxiob_gate">работа несколько дней и по кр мере одну ночь без срабатывания оповещений о низком СК</string>
<string name="objectives_5_objective">при необходимости настройка базала и коэффициентов с последующей активацией auto-sens</string> <string name="objectives_autosens_objective">при необходимости настройка базала и коэффициентов с последующей активацией auto-sens</string>
<string name="objectives_5_gate">1 неделя успешной дневной работы с регулярным введением углеводов</string> <string name="objectives_autosens_gate">1 неделя успешной дневной работы с регулярным введением углеводов</string>
<string name="objectives_6_objective">активация таких доп функций для дневного времени как калькулятор advanced meal assist</string> <string name="objectives_ama_objective">активация таких доп функций для дневного времени как калькулятор advanced meal assist</string>
<string name="objectives_7_objective">Активация таких доп функций для дневного времени как супер микро болюс SMB</string> <string name="objectives_smb_objective">Активация таких доп функций для дневного времени как супер микро болюс SMB</string>
<string name="objectives_7_gate">Прочтите wiki и увеличьте maxIOB чтобы супер микро болюс SMB заработал как надо! Хорошее начало maxIOB = средний болюс на еду + троекратный максимальный базал суток</string> <string name="objectives_smb_gate">Прочтите wiki и увеличьте maxIOB чтобы супер микро болюс SMB заработал как надо! Хорошее начало maxIOB = средний болюс на еду + троекратный максимальный базал суток</string>
<string name="youareonallowedlimit">разрешенный предел достигнут</string> <string name="youareonallowedlimit">разрешенный предел достигнут</string>
<string name="noprofileselected">профиль не выбран</string> <string name="noprofileselected">профиль не выбран</string>
<string name="smscommunicator_loophasbeendisabled">зцикл был деактивирован</string> <string name="smscommunicator_loophasbeendisabled">зцикл был деактивирован</string>

View file

@ -318,19 +318,19 @@
<string name="overview_bolusprogress_goingtodeliver">Podávanie %1$.2fJ inzulínu</string> <string name="overview_bolusprogress_goingtodeliver">Podávanie %1$.2fJ inzulínu</string>
<string name="objectives_0_objective">Nastavenie vizualizácie a monitoringu (Nightscout), analyzovať bazály a prevody</string> <string name="objectives_0_objective">Nastavenie vizualizácie a monitoringu (Nightscout), analyzovať bazály a prevody</string>
<string name="objectives_0_gate">Skontrolovať, či sú glykémie a údaje z pumpy viditeľné v Nightscoute</string> <string name="objectives_0_gate">Skontrolovať, či sú glykémie a údaje z pumpy viditeľné v Nightscoute</string>
<string name="objectives_1_objective">Začať s otvoreným okruhom</string> <string name="objectives_openloop_objective">Začať s otvoreným okruhom</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Porozumieť otvorenému okruhu a doporučeným dočasným bazálom</string> <string name="objectives_maxbasal_objective">Porozumieť otvorenému okruhu a doporučeným dočasným bazálom</string>
<string name="objectives_2_gate">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</string> <string name="objectives_maxbasal_gate">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</string>
<string name="objectives_3_objective">Začať s uzavretým okruhom iba s vypínaním pri nízkej glykémii</string> <string name="objectives_maxiobzero_objective">Začať s uzavretým okruhom iba s vypínaním pri nízkej glykémii</string>
<string name="objectives_3_gate">Spustiť uzavretý okruh s max IOB = 0 na niekoľko dní s minimom nutných korekcií na nízku glykémiu</string> <string name="objectives_maxiobzero_gate">Spustiť uzavretý okruh s max IOB = 0 na niekoľko dní s minimom nutných korekcií na nízku glykémiu</string>
<string name="objectives_4_objective">Ladenie uzavretého okruhu, zvyšovať max IOB nad 0 a postupne znižovať cieľovú glykémiu</string> <string name="objectives_maxiob_objective">Ladenie uzavretého okruhu, zvyšovať max IOB nad 0 a postupne znižovať cieľovú glykémiu</string>
<string name="objectives_4_gate">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</string> <string name="objectives_maxiob_gate">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</string>
<string name="objectives_5_objective">Ak je to potrebné, prispôsob bazály a prevody a potom aktivuj automatickú detekciu citlivosti</string> <string name="objectives_autosens_objective">Ak je to potrebné, prispôsob bazály a prevody a potom aktivuj automatickú detekciu citlivosti</string>
<string name="objectives_5_gate">Jeden týždeň úspešne používaj uzavretý okruh so zadávaním bežného príjmu sacharidov cez deň</string> <string name="objectives_autosens_gate">Jeden týždeň úspešne používaj uzavretý okruh so zadávaním bežného príjmu sacharidov cez deň</string>
<string name="objectives_6_objective">Aktivuj ďalšie prídavné funkcie pre bežné používanie, ako napr. AMA (pokročilý asistent jedál)</string> <string name="objectives_ama_objective">Aktivuj ďalšie prídavné funkcie pre bežné používanie, ako napr. AMA (pokročilý asistent jedál)</string>
<string name="objectives_7_objective">Aktivuj ďalšie prídavné funkcie pre bežné používanie, ako napr. SMB (Super Micro Bolusy)</string> <string name="objectives_smb_objective">Aktivuj ďalšie prídavné funkcie pre bežné používanie, ako napr. SMB (Super Micro Bolusy)</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">Dosiahnutý limit</string> <string name="youareonallowedlimit">Dosiahnutý limit</string>
<string name="noprofileselected">Nebol vybraný žiadny profil</string> <string name="noprofileselected">Nebol vybraný žiadny profil</string>
<string name="smscommunicator_loophasbeendisabled">Uzavretý okruh bol deaktivovaný</string> <string name="smscommunicator_loophasbeendisabled">Uzavretý okruh bol deaktivovaný</string>

View file

@ -319,19 +319,19 @@ Eversense-appen.</string>
<string name="overview_bolusprogress_goingtodeliver">Kommer att leverera %1$.2f enheter</string> <string name="overview_bolusprogress_goingtodeliver">Kommer att leverera %1$.2f enheter</string>
<string name="objectives_0_objective">Ställer in utseende och övervakning för att sedan kunna analysera basaler och kvoter</string> <string name="objectives_0_objective">Ställer in utseende och övervakning för att sedan kunna analysera basaler och kvoter</string>
<string name="objectives_0_gate">Kontrollera att BG syns i Nightscout och att insulindata från pumpen laddas upp</string> <string name="objectives_0_gate">Kontrollera att BG syns i Nightscout och att insulindata från pumpen laddas upp</string>
<string name="objectives_1_objective">Starta med open loop</string> <string name="objectives_openloop_objective">Starta med open loop</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Förstå din open loop och hur den föreslår temp basaler</string> <string name="objectives_maxbasal_objective">Förstå din open loop och hur den föreslår temp basaler</string>
<string name="objectives_2_gate">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</string> <string name="objectives_maxbasal_gate">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</string>
<string name="objectives_3_objective">Börja använda closed loop med aktiverad funktion att stänga av vid lågt BG</string> <string name="objectives_maxiobzero_objective">Börja använda closed loop med aktiverad funktion att stänga av vid lågt BG</string>
<string name="objectives_3_gate">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</string> <string name="objectives_maxiobzero_gate">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</string>
<string name="objectives_4_objective">Finjustering av closed loop, gradvis ökande IOB och minskande målvärde för BG</string> <string name="objectives_maxiob_objective">Finjustering av closed loop, gradvis ökande IOB och minskande målvärde för BG</string>
<string name="objectives_4_gate">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.</string> <string name="objectives_maxiob_gate">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.</string>
<string name="objectives_5_objective">Justera basaler och kvoter om det behövs. Aktivera sedan autosens</string> <string name="objectives_autosens_objective">Justera basaler och kvoter om det behövs. Aktivera sedan autosens</string>
<string name="objectives_5_gate">1 veckas lyckad looping dagtid, där alla måltider lagts in</string> <string name="objectives_autosens_gate">1 veckas lyckad looping dagtid, där alla måltider lagts in</string>
<string name="objectives_6_objective">Aktiverar extra funktioner som kan användas dagtid, såsom avancerad måltidsassistans, AMA</string> <string name="objectives_ama_objective">Aktiverar extra funktioner som kan användas dagtid, såsom avancerad måltidsassistans, AMA</string>
<string name="objectives_7_objective">Aktiverar ytterligare funktioner för användning dagtid, t ex SMB</string> <string name="objectives_smb_objective">Aktiverar ytterligare funktioner för användning dagtid, t ex SMB</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">Du har nått din tillåtna gräns</string> <string name="youareonallowedlimit">Du har nått din tillåtna gräns</string>
<string name="noprofileselected">Ingen profil vald</string> <string name="noprofileselected">Ingen profil vald</string>
<string name="smscommunicator_loophasbeendisabled">Loop stängdes av</string> <string name="smscommunicator_loophasbeendisabled">Loop stängdes av</string>

View file

@ -306,19 +306,19 @@
<string name="waitingforpump">Pompa bekleniyor</string> <string name="waitingforpump">Pompa bekleniyor</string>
<string name="objectives_0_objective">Nightscout üzerinden izlemeyi ve görselleştirmeyi yapılandırın ve bazal oranlarını ve faktörleri düzenleyin</string> <string name="objectives_0_objective">Nightscout üzerinden izlemeyi ve görselleştirmeyi yapılandırın ve bazal oranlarını ve faktörleri düzenleyin</string>
<string name="objectives_0_gate">Nightscout\'ta KŞ\'nin bulunduğunu ve insülin verilerinin yüklenmekte olduğunu doğrulayın</string> <string name="objectives_0_gate">Nightscout\'ta KŞ\'nin bulunduğunu ve insülin verilerinin yüklenmekte olduğunu doğrulayın</string>
<string name="objectives_1_objective">ık Döngü modu başlatılıyor</string> <string name="objectives_openloop_objective">ık Döngü modu başlatılıyor</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Geçici bazal tavsiyeleri de dahil olmak üzere Açık Döngü anlamak</string> <string name="objectives_maxbasal_objective">Geçici bazal tavsiyeleri de dahil olmak üzere Açık Döngü anlamak</string>
<string name="objectives_2_gate">Bu deneyime dayanarak, max bazalın ne olması gerektiğine karar vermeli ve bunu pompa ve tercihlere koymalısınız</string> <string name="objectives_maxbasal_gate">Bu deneyime dayanarak, max bazalın ne olması gerektiğine karar vermeli ve bunu pompa ve tercihlere koymalısınız</string>
<string name="objectives_3_objective">Kapalı Döngü, (LGS) Düşük Kan Şekerinde Duraklatma modunda başlatılıyor</string> <string name="objectives_maxiobzero_objective">Kapalı Döngü, (LGS) Düşük Kan Şekerinde Duraklatma modunda başlatılıyor</string>
<string name="objectives_3_gate">Çok sayıda LGS (düşük KŞ) olmadan birkaç gün boyunca maksimum IOB = 0 (Aktif insülin) Kapalı Döngü\'de deneyin</string> <string name="objectives_maxiobzero_gate">Çok sayıda LGS (düşük KŞ) olmadan birkaç gün boyunca maksimum IOB = 0 (Aktif insülin) Kapalı Döngü\'de deneyin</string>
<string name="objectives_4_objective">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</string> <string name="objectives_maxiob_objective">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</string>
<string name="objectives_4_gate">KŞ hedefini azaltmadan önce birkaç gün ve en az bir gece düşük KŞ (Hipo) alarmı olmadan deneyin</string> <string name="objectives_maxiob_gate">KŞ hedefini azaltmadan önce birkaç gün ve en az bir gece düşük KŞ (Hipo) alarmı olmadan deneyin</string>
<string name="objectives_5_objective">Gerekirse, bazal ve oranları ayarlayın ve sonra auto-sens\'i etkinleştirin</string> <string name="objectives_autosens_objective">Gerekirse, bazal ve oranları ayarlayın ve sonra auto-sens\'i etkinleştirin</string>
<string name="objectives_5_gate">Bir hafta boyunca düzenli Karbonhidrad girdileri yaparak gün boyunca Kapalı Döngüyü çalıştırın</string> <string name="objectives_autosens_gate">Bir hafta boyunca düzenli Karbonhidrad girdileri yaparak gün boyunca Kapalı Döngüyü çalıştırın</string>
<string name="objectives_6_objective">Gelişmiş yemek asistanı gibi gündüz kullanımı için ek özelliklerin etkinleştirilmesi</string> <string name="objectives_ama_objective">Gelişmiş yemek asistanı gibi gündüz kullanımı için ek özelliklerin etkinleştirilmesi</string>
<string name="objectives_7_objective">SMB (Super Micro Bolus) gibi gündüz kullanımı için ek özelliklerin etkinleştirilmesi</string> <string name="objectives_smb_objective">SMB (Super Micro Bolus) gibi gündüz kullanımı için ek özelliklerin etkinleştirilmesi</string>
<string name="objectives_7_gate">(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</string> <string name="objectives_smb_gate">(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</string>
<string name="youareonallowedlimit">İzin verilen sınıra ulaştınız</string> <string name="youareonallowedlimit">İzin verilen sınıra ulaştınız</string>
<string name="noprofileselected">Profil seçilmedi</string> <string name="noprofileselected">Profil seçilmedi</string>
<string name="smscommunicator_loophasbeendisabled">Döngü devre dışı bırakıldı</string> <string name="smscommunicator_loophasbeendisabled">Döngü devre dışı bırakıldı</string>

View file

@ -317,19 +317,19 @@
<string name="overview_bolusprogress_goingtodeliver">将要输注 %1$.2fU</string> <string name="overview_bolusprogress_goingtodeliver">将要输注 %1$.2fU</string>
<string name="objectives_0_objective">设置可视化和监视, 并分析基础率和比率</string> <string name="objectives_0_objective">设置可视化和监视, 并分析基础率和比率</string>
<string name="objectives_0_gate">验证 Nightscout 中的血糖是否可用, 并且正在上传泵的胰岛素数据</string> <string name="objectives_0_gate">验证 Nightscout 中的血糖是否可用, 并且正在上传泵的胰岛素数据</string>
<string name="objectives_1_objective">开始开环</string> <string name="objectives_openloop_objective">开始开环</string>
<string name="objectives_1_gate">在开环模式下运行几天,并在手机上手动制定很多次临时基础率。设置和使用临时目标和默认的临时目标 (例如, 用于活动或处理碳水化合物)</string> <string name="objectives_openloop_gate">在开环模式下运行几天,并在手机上手动制定很多次临时基础率。设置和使用临时目标和默认的临时目标 (例如, 用于活动或处理碳水化合物)</string>
<string name="objectives_2_objective">了解你的开环,包括它的临时基础率建议</string> <string name="objectives_maxbasal_objective">了解你的开环,包括它的临时基础率建议</string>
<string name="objectives_2_gate">基于以上的经验,决定适合自己的最大基础率,在泵和本软件的参数选项上设置</string> <string name="objectives_maxbasal_gate">基于以上的经验,决定适合自己的最大基础率,在泵和本软件的参数选项上设置</string>
<string name="objectives_3_objective">开始闭环模式,低血糖自动暂停</string> <string name="objectives_maxiobzero_objective">开始闭环模式,低血糖自动暂停</string>
<string name="objectives_3_gate">在闭环模式下运行设置最大IOB = 0 运行几天确保没有太多的低血糖事件</string> <string name="objectives_maxiobzero_gate">在闭环模式下运行设置最大IOB = 0 运行几天确保没有太多的低血糖事件</string>
<string name="objectives_4_objective">优化闭环逐渐增加最大IOB并逐渐降低目标血糖值</string> <string name="objectives_maxiob_objective">优化闭环逐渐增加最大IOB并逐渐降低目标血糖值</string>
<string name="objectives_4_gate">运行几天,至少一个晚上没有低血糖报警,然后才可以继续调低目标血糖</string> <string name="objectives_maxiob_gate">运行几天,至少一个晚上没有低血糖报警,然后才可以继续调低目标血糖</string>
<string name="objectives_5_objective">如果需要的话调整基础率和比值然后再启用auto-sense</string> <string name="objectives_autosens_objective">如果需要的话调整基础率和比值然后再启用auto-sense</string>
<string name="objectives_5_gate">一个星期成功的白天闭环,常规的碳水化合物摄入</string> <string name="objectives_autosens_gate">一个星期成功的白天闭环,常规的碳水化合物摄入</string>
<string name="objectives_6_objective">启用额外的功能以供白天使用,例如用餐助手(meal assist)</string> <string name="objectives_ama_objective">启用额外的功能以供白天使用,例如用餐助手(meal assist)</string>
<string name="objectives_7_objective">启用额外的功能以供白天使用, 例如微型大剂量 SMB</string> <string name="objectives_smb_objective">启用额外的功能以供白天使用, 例如微型大剂量 SMB</string>
<string name="objectives_7_gate">为了让微型大剂量工作的更好你必须读指南提高最大IOB的值。 建议是最大IOB值=餐时大剂量的平均值+3倍 的每日基础率中的最大值</string> <string name="objectives_smb_gate">为了让微型大剂量工作的更好你必须读指南提高最大IOB的值。 建议是最大IOB值=餐时大剂量的平均值+3倍 的每日基础率中的最大值</string>
<string name="youareonallowedlimit">你达到了允许的极限</string> <string name="youareonallowedlimit">你达到了允许的极限</string>
<string name="noprofileselected">没有选定配置文件</string> <string name="noprofileselected">没有选定配置文件</string>
<string name="smscommunicator_loophasbeendisabled">闭环已经被禁用</string> <string name="smscommunicator_loophasbeendisabled">闭环已经被禁用</string>

View file

@ -0,0 +1,146 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="dia_whatmeansdia">What is true about DIA?</string>
<string name="dia_meaningofdia">Meaning of DIA</string>
<string name="dia_minimumis3h">The predetermined minimum is 3 hours.</string>
<string name="dia_minimumis5h">The predetermined minimum is 5 hours.</string>
<string name="dia_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html?#insulin</string>
<string name="dia_meaningisequaltodiapump">It is equal to the DIA parameter used in your pump.</string>
<string name="dia_valuemustbedetermined">You have to determine your individual value (but not less than 5 hours).</string>
<string name="hypott">Hypo temp target</string>
<string name="hypott_whenhypott">Why is it useful to set a hypo TT?</string>
<string name="hypott_goinglow">Prevent to be low.</string>
<string name="hypott_havinglow">To help recovering from a low BG.</string>
<string name="hypott_preventoversmb">To prevent SMB after a hypo rise from fast carbs</string>
<string name="hypott_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html</string>
<string name="offlineprofile_whatprofile">Which profile can be used and configured offline?</string>
<string name="offlineprofile">Offline profile</string>
<string name="offlineprofile_nsprofile">NS Profile can be used but not configured</string>
<string name="offlineprofile_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#profile</string>
<string name="pumpdisconnect">Taking off pump</string>
<string name="pumpdisconnect_whattodo">What to do when taking the pump off?</string>
<string name="pumpdisconnect_letknow">Let loop know that there is no insulin running to your body by clicking disconnect pump.</string>
<string name="pumpdisconnect_dontchnage">Don\'t change anything in loop, just take it off.</string>
<string name="pumpdisconnect_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#other-settings</string>
<string name="objectives_howtosave">What are best practices to backup your settings?</string>
<string name="objectives_writetopaper">Write every setting you did to a paper and make a hardcopy of it.</string>
<string name="objectives_exportsettings">Locally export them from Maintenance menu.</string>
<string name="objectives_storeelsewhere">Store exported file to another place like email, Dropbox, Google drive …</string>
<string name="objectives_doexportonstart">Export them right after installation of AAPS.</string>
<string name="objectives_doexportafterchange">Export them after every change of a setting.</string>
<string name="objectives_doexportafterfirtssettings">Export them when you finish initial settings.</string>
<string name="objectives_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/ExportImportSettings.html</string>
<string name="noisycgm">Noisy CGM</string>
<string name="noisycgm_whattodo">What to do when you see CGM signals are too noisy?</string>
<string name="nothing">Nothing, the loop will deal with it.</string>
<string name="noisycgm_pause">Pause closed loop mode to avoid overdosing.</string>
<string name="noisycgm_replacesensor">Replace sensor</string>
<string name="noisycgm_turnoffcgmreceiver">Turn off CGM receiver.</string>
<string name="noisycgm_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Smoothing-Blood-Glucose-Data-in-xDrip.html#smoothing-blood-glucose-data</string>
<string name="noisycgm_checksmoothing">Check if your CGM app smoothes data.</string>
<string name="exercise">Exercise</string>
<string name="exercise_whattodo">How to help the system deal with exercise</string>
<string name="exercise_setactivitytt">Set activity temp target</string>
<string name="exercise_switchprofilebelow100">Do a profile switch below 100%</string>
<string name="exercise_switchprofileabove100">Do profile switch above 100%</string>
<string name="exercise_stoploop">Stop loop</string>
<string name="exercise_doitbeforestart">Help before start exercise</string>
<string name="exercise_doitafterstart">Help after start exercise</string>
<string name="exercise_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/temptarget.html#activity-temp-target</string>
<string name="suspendloop_doigetinsulin">Do I get insuling when loop is suspended?</string>
<string name="suspendloop_yes">Yes, common basal rate</string>
<string name="suspendloop_no">No, delivering of insulin is stopped</string>
<string name="basaltest">Basal and ISF, IC testing</string>
<string name="basaltest_when">When should I test basals, ISF and IC?</string>
<string name="basaltest_beforeloop">Before I start looping</string>
<string name="basaltest_havingregularhypo">When having regular hypos</string>
<string name="basaltest_havingregularhyper">When having regular hypers</string>
<string name="basaltest_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#androidaps-settings</string>
<string name="prerequisites">Prerequisites</string>
<string name="prerequisites_what">What do I need?</string>
<string name="prerequisites_determinedcorrectprofile">Determined correct profile (Basals, IC, ISF, DIA)</string>
<string name="prerequisites_computer">Computer to create an APK</string>
<string name="prerequisites_phone">Supported phone</string>
<string name="prerequisites_car">Car</string>
<string name="prerequisites_nightscout">Nightscout to pass objectives</string>
<string name="prerequisites_tidepoolaccount">Tidepool account</string>
<string name="prerequisites_googleaccount">Google account</string>
<string name="prerequisites_githubaccount">Github account</string>
<string name="prerequisites_beanandroiddeveloper">To be an Android developer</string>
<string name="prerequisites_own670g">Own a 670g pump</string>
<string name="prerequisites_hint1">https://androidaps.readthedocs.io/en/latest/EN/Module/module.html</string>
<string name="prerequisites_smartwatch">Smartwatch</string>
<string name="prerequisites_supportedcgm">Supported CGM</string>
<string name="update_update">Updating of AndroidAPS</string>
<string name="whatistrue">What is true?</string>
<string name="update_git">You need to have Git installed</string>
<string name="update_asap">Update as soon as new version is released</string>
<string name="update_keys">Use the same signing keys</string>
<string name="update_neverupdate">Never update if system is working well</string>
<string name="update_askfriend">Ask your friend for new APK</string>
<string name="update_hint1">https://androidaps.readthedocs.io/en/latest/EN/Installing-AndroidAPS/Update-to-new-version.html#update-to-a-new-version-or-branch</string>
<string name="troubleshooting">Troubleshooting</string>
<string name="troubleshooting_wheretoask">Where to look for help?</string>
<string name="troubleshooting_fb">Facebook group</string>
<string name="troubleshooting_wiki">Wiki</string>
<string name="troubleshooting_gitter">Gitter</string>
<string name="troubleshooting_googlesupport">Google support</string>
<string name="troubleshooting_yourendo">Your endo</string>
<string name="troubleshooting_hint1">https://androidaps.readthedocs.io/en/latest/EN/Installing-AndroidAPS/Update-to-new-version.html#troubleshooting</string>
<string name="troubleshooting_hint2">https://www.facebook.com/groups/AndroidAPSUsers/</string>
<string name="troubleshooting_hint3">https://gitter.im/MilosKozak/AndroidAPS</string>
<string name="insulin">Insulin</string>
<string name="insulin_ultrarapid">Which insulin can be used with Ultra-Rapid-Oref plugin?</string>
<string name="insulin_fiasp">Fiasp</string>
<string name="insulin_novorapid">Novorapid</string>
<string name="insulin_humalog">Humalog</string>
<string name="insulin_actrapid">Actrapid</string>
<string name="insulin_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Config-Builder.html#insulin</string>
<string name="sensitivity">Sensitivity plugin</string>
<string name="sensitivity_which">Which sensitivity plugin has user defined time range for detection?</string>
<string name="sensitivity_hint1">https://androidaps.readthedocs.io/en/latest/EN/Configuration/Sensitivity-detection-and-COB.html</string>
<string name="sensitivityuam_which">Which sensitivity plugin must be used for UAM?</string>
<string name="wrongcarbs">Wrong carbs</string>
<string name="wrongcarbs_whattodo">You see you have entered wrong carbs. What should you do?</string>
<string name="wrongcarbs_treatmentstab">Go to treatments, delete wrong carbs and enter new carbs</string>
<string name="extendedcarbs">Food with fat and protein</string>
<string name="extendedcarbs_handling">What to do if your food contains larger amount of fat or proteins?</string>
<string name="extendedcarbs_useextendedcarbs">Recalculate fat and proteins to carbs and use \"Extended carbs\" feature to tell system about it</string>
<string name="extendedcarbs_add">Recalculate fat and proteins to carbs and add it to bolus calculation</string>
<string name="extendedcarbs_useextendedbolus">Use extended bolus to cover fat and proteins</string>
<string name="nsclient_monitoring">Monitoring children</string>
<string name="nsclient_howcanyou">How can you monitor AAPS of your child remotely?</string>
<string name="nightscout">Nightscout</string>
<string name="dexcomfollow">Dexcom follow if you are using original Dexcom app</string>
<string name="dexcomfollowxdrip">Dexcom follow if you are using xDrip</string>
<string name="xdripfollower">xDrip in follower mode</string>
<string name="looponiphone">Loop app on iPhone</string>
<string name="spikeiphone">Spike on iPhone</string>
<string name="isf_increasingvalue">Assume you have high glycemia. Increasing ISF number will lead to giving less insulin if you try to correct high glycemia by bolus wizard</string>
<string name="isf_decreasingvalue">Assume you have high glycemia. Decreasing ISF number will lead to giving less insulin if you try to correct high glycemia by bolus wizard</string>
<string name="isf_noeffect">Changing ISF has no effect on amount of insulin given by APS when trying to correct high glycemia</string>
<string name="isf_preferences">You have to enter ISF in preferences</string>
<string name="isf_profile">Changing ISF in profile is enough to apply the change</string>
<string name="isf_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#insulin-sensitivity-factor-isf-mmol-l-u-or-mg-dl-u</string>
<string name="isf_hint2">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html</string>
<string name="ic_increasingvalue">Increasing IC value will lead to giving less insulin for the same amount of carbs</string>
<string name="ic_decreasingvalue">Decreasing IC value will lead to giving less insulin for the same amount of carbs</string>
<string name="ic_noeffect">Assume you have no active carbs. Changing IC will lead to different amount of insuling to correct your glycemia</string>
<string name="ic_different">IC will be different if you count bread unit as 10g or 12g</string>
<string name="ic_meaning">IC meaning is: How much bread units is covered by 1U of insulin</string>
<string name="ic_hint1">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#carbohydrate-to-insulin-ratio-cr-g-u</string>
<string name="profileswitch_pctwillchange">By specifying 90% in profile switch</string>
<string name="profileswitch_basalhigher">Basals will be 10% higher</string>
<string name="profileswitch_basallower">Basals will be 10% lower</string>
<string name="profileswitch_ichigher">IC value will be 10% higher</string>
<string name="profileswitch_iclower">IC value will be 10% lower</string>
<string name="profileswitch_isfhigher">ISF value will be 10% higher</string>
<string name="profileswitch_isflower">ISF value will be 10% lower</string>
<string name="profileswitch_overall">You will get 10% less insulin in total</string>
<string name="profileswitch_targethigher">Target wiil be 10% higher</string>
<string name="profileswitch_targetlower">Target will be 10% lower</string>
<string name="profileswitch_targetbottom">Only bottom target will be 10% lower</string>
<string name="objectives_hint2">https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#what-emergency-equipment-is-recommended-to-take-with-me</string>
<string name="profileswitch_hint1">https://androidaps.readthedocs.io/en/latest/EN/Usage/Profiles.html?highlight=profile%20switch#profile-switch</string>
</resources>

View file

@ -350,19 +350,19 @@
<string name="overview_bolusprogress_goingtodeliver">Going to deliver %1$.2fU</string> <string name="overview_bolusprogress_goingtodeliver">Going to deliver %1$.2fU</string>
<string name="objectives_0_objective">Setting up visualization and monitoring, and analyzing basals and ratios</string> <string name="objectives_0_objective">Setting up visualization and monitoring, and analyzing basals and ratios</string>
<string name="objectives_0_gate">Verify that BG is available in Nightscout, and pump insulin data is being uploaded</string> <string name="objectives_0_gate">Verify that BG is available in Nightscout, and pump insulin data is being uploaded</string>
<string name="objectives_1_objective">Starting on an open loop</string> <string name="objectives_openloop_objective">Starting on an open loop</string>
<string name="objectives_1_gate">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)</string> <string name="objectives_openloop_gate">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)</string>
<string name="objectives_2_objective">Understanding your open loop, including its temp basal recommendations</string> <string name="objectives_maxbasal_objective">Understanding your open loop, including its temp basal recommendations</string>
<string name="objectives_2_gate">Based on that experience, decide what max basal should be, and set it on the pump and preferences</string> <string name="objectives_maxbasal_gate">Based on that experience, decide what max basal should be, and set it on the pump and preferences</string>
<string name="objectives_3_objective">Starting to close the loop with Low Glucose Suspend</string> <string name="objectives_maxiobzero_objective">Starting to close the loop with Low Glucose Suspend</string>
<string name="objectives_3_gate">Run in closed loop with max IOB = 0 for a few days without too many LGS events</string> <string name="objectives_maxiobzero_gate">Run in closed loop with max IOB = 0 for a few days without too many LGS events</string>
<string name="objectives_4_objective">Tuning the closed loop, raising max IOB above 0 and gradually lowering BG targets</string> <string name="objectives_maxiob_objective">Tuning the closed loop, raising max IOB above 0 and gradually lowering BG targets</string>
<string name="objectives_4_gate">Run for a few days, and at least one night with no low BG alarms, before dropping BG</string> <string name="objectives_maxiob_gate">Run for a few days, and at least one night with no low BG alarms, before dropping BG</string>
<string name="objectives_5_objective">Adjust basals and ratios if needed, and then enable auto-sens</string> <string name="objectives_autosens_objective">Adjust basals and ratios if needed, and then enable auto-sens</string>
<string name="objectives_5_gate">1 week successful daytime looping with regular carb entry</string> <string name="objectives_autosens_gate">1 week successful daytime looping with regular carb entry</string>
<string name="objectives_6_objective">Enabling additional features for daytime use, such as advanced meal assist</string> <string name="objectives_ama_objective">Enabling additional features for daytime use, such as advanced meal assist</string>
<string name="objectives_7_objective">Enabling additional features for daytime use, such as SMB</string> <string name="objectives_smb_objective">Enabling additional features for daytime use, such as SMB</string>
<string name="objectives_7_gate">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</string> <string name="objectives_smb_gate">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</string>
<string name="youareonallowedlimit">You reached allowed limit</string> <string name="youareonallowedlimit">You reached allowed limit</string>
<string name="noprofileselected">No profile selected</string> <string name="noprofileselected">No profile selected</string>
<string name="smscommunicator_loophasbeendisabled">Loop has been disabled</string> <string name="smscommunicator_loophasbeendisabled">Loop has been disabled</string>
@ -623,8 +623,13 @@
<string name="enablesuperbolus">Enable superbolus in wizard</string> <string name="enablesuperbolus">Enable superbolus in wizard</string>
<string name="enablesuperbolus_summary">Enable superbolus functionality in wizard. Do not enable until you learn what it really does. IT MAY CAUSE INSULIN OVERDOSE IF USED BLINDLY!</string> <string name="enablesuperbolus_summary">Enable superbolus functionality in wizard. Do not enable until you learn what it really does. IT MAY CAUSE INSULIN OVERDOSE IF USED BLINDLY!</string>
<string name="key_show_statuslights" translatable="false">key_show_statuslights</string> <string name="key_show_statuslights" translatable="false">key_show_statuslights</string>
<string name="key_show_statuslights_easy" translatable="false">key_show_statuslights_easy</string>
<string name="key_show_statuslights_extended" translatable="false">key_show_statuslights_extended</string>
<string name="show_statuslights">Show status lights on home screen</string> <string name="show_statuslights">Show status lights on home screen</string>
<string name="show_statuslights_summary">Enable status lights for cage, iage, sage, reservoir and battery level on home screen.</string> <string name="show_statuslights_easy">Show original status lights on home screen</string>
<string name="show_statuslights_easy_summary">Enable original status lights for cage, iage, sage, reservoir and battery level on home screen.</string>
<string name="show_statuslights_extended">Show extended status lights on home screen</string>
<string name="show_statuslights_extended_summary">Enable extended status lights for cage, iage, sage, reservoir and battery level on home screen.</string>
<string name="key_statuslights_res_warning" translatable="false">key_statuslights_res_warning</string> <string name="key_statuslights_res_warning" translatable="false">key_statuslights_res_warning</string>
<string name="statuslights_res_warning">Threshold warning reservoir level [U]</string> <string name="statuslights_res_warning">Threshold warning reservoir level [U]</string>
<string name="key_statuslights_res_critical" translatable="false">key_statuslights_res_critical</string> <string name="key_statuslights_res_critical" translatable="false">key_statuslights_res_critical</string>
@ -1605,10 +1610,45 @@
<string name="deliverpartofboluswizard">Bolus wizard performs calculation but only this part of calculated insulin is delivered. Useful with SMB algorithm.</string> <string name="deliverpartofboluswizard">Bolus wizard performs calculation but only this part of calculated insulin is delivered. Useful with SMB algorithm.</string>
<string name="loading">Loading ...</string> <string name="loading">Loading ...</string>
<string name="snooze">Snooze</string> <string name="snooze">Snooze</string>
<string name="time_range">Time range</string> <string name="time_range">Time range</string>
<string name="timerange_value">Time is between %1$s and %2$s</string> <string name="timerange_value">Time is between %1$s and %2$s</string>
<string name="between">Between </string> <string name="between">Between </string>
<string name="accomplished">Accomplished: %1$s</string>
<string name="objectives_usage_objective">Learn how to control AndroidAPS</string>
<string name="objectives_usage_gate">Perform different actions in AndroidAPS</string>
<string name="objectives_useprofileswitch">Set profile 90% for 10 min (Long-press profile name on Overview)</string>
<string name="key_objectiveuseprofileswitch" translatable="false">ObjectivesProfileSwitchUsed</string>
<string name="key_objectiveusedisconnect" translatable="false">ObjectivesDisconnectUsed</string>
<string name="key_objectiveusereconnect" translatable="false">ObjectivesReconnectUsed</string>
<string name="key_objectiveusetemptarget" translatable="false">ObjectivesTempTargetUsed</string>
<string name="key_objectiveuseactions" translatable="false">ObjectivesActionsUsed</string>
<string name="key_objectiveuseloop" translatable="false">ObjectivesLoopUsed</string>
<string name="key_objectiveusescale" translatable="false">ObjectivesScaleUsed</string>
<string name="objectives_usedisconnectpump">Simulate shower. Disconnect pump for 1h (Long-press on Open Loop)</string>
<string name="objectives_usereconnectpump">... and reconnect back the same way</string>
<string name="objectives_usetemptarget">Create custom temporary target with 10 min duration (Long-press on your current target)</string>
<string name="objectives_useactions">In Config Builder enable Actions plugin, make it visible and display its content from top menu</string>
<string name="objectives_useloop">Display content of Loop plugin</string>
<string name="objectives_usescale">Use scale function by long-pressing BG chart</string>
<string name="objectives_button_enter">Enter</string>
<string name="enter_code_obtained_from_developers_to_bypass_the_rest_of_objectives">Enter code obtained from developers to bypass the rest of objectives</string>
<string name="codeaccepted">Code accepted</string>
<string name="codeinvalid">Code invalid</string>
<string name="key_ObjectivesbgIsAvailableInNS" translatable="false">ObjectivesbgIsAvailableInNS</string>
<string name="key_ObjectivespumpStatusIsAvailableInNS" translatable="false">ObjectivespumpStatusIsAvailableInNS</string>
<string name="key_ObjectivesmanualEnacts" translatable="false">ObjectivesmanualEnacts</string>
<string name="objectives_exam_objective">Prove your knowledge</string>
<string name="objectives_exam_gate">Study and answer questions correctly</string>
<string name="answerdisabledto">Answering disabled to: %1$s</string>
<string name="wronganswer">Wrong answer!</string>
<string name="unfinshed_button">Next unfinished</string>
<string name="close">Close</string>
<string name="key_objectives_request_code" translatable="false">objectives_request_code</string>
<string name="requestcode">Request code: %1$s</string>
<string name="objectives_hint">(check all correct answers)</string>
<plurals name="objective_days"> <plurals name="objective_days">
<item quantity="one">%1$d day</item> <item quantity="one">%1$d day</item>
<item quantity="other">%1$d days</item> <item quantity="other">%1$d days</item>
@ -1621,4 +1661,4 @@
<item quantity="one">%1$d minute</item> <item quantity="one">%1$d minute</item>
<item quantity="other">%1$d minutes</item> <item quantity="other">%1$d minutes</item>
</plurals> </plurals>
</resources> </resources>

View file

@ -165,9 +165,22 @@
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="@string/key_show_statuslights" android:key="@string/key_show_statuslights"
android:summary="@string/show_statuslights_summary"
android:title="@string/show_statuslights" /> android:title="@string/show_statuslights" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_show_statuslights"
android:key="@string/key_show_statuslights_easy"
android:summary="@string/show_statuslights_easy_summary"
android:title="@string/show_statuslights_easy" />
<SwitchPreference
android:defaultValue="false"
android:dependency="@string/key_show_statuslights"
android:key="@string/key_show_statuslights_extended"
android:summary="@string/show_statuslights_extended_summary"
android:title="@string/show_statuslights_extended" />
<com.andreabaccega.widget.ValidatingEditTextPreference <com.andreabaccega.widget.ValidatingEditTextPreference
android:defaultValue="80" android:defaultValue="80"
android:dependency="@string/key_show_statuslights" android:dependency="@string/key_show_statuslights"

View file

@ -58,11 +58,11 @@ public class ConstraintsCheckerTest {
boolean notificationSent = false; boolean notificationSent = false;
public ConstraintsCheckerTest() throws JSONException { public ConstraintsCheckerTest() {
} }
@Test @Test
public void isLoopInvokationAllowedTest() throws Exception { public void isLoopInvokationAllowedTest() {
comboPlugin.setPluginEnabled(PluginType.PUMP, true); comboPlugin.setPluginEnabled(PluginType.PUMP, true);
comboPlugin.setValidBasalRateProfileSelectedOnPump(false); comboPlugin.setValidBasalRateProfileSelectedOnPump(false);
@ -73,9 +73,9 @@ public class ConstraintsCheckerTest {
} }
@Test @Test
public void isClosedLoopAllowedTest() throws Exception { public void isClosedLoopAllowedTest() {
when(SP.getString(R.string.key_aps_mode, "open")).thenReturn("closed"); when(SP.getString(R.string.key_aps_mode, "open")).thenReturn("closed");
objectivesPlugin.objectives.get(3).setStartedOn(null); objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getMAXIOB_ZERO_CL_OBJECTIVE()).setStartedOn(0);
Constraint<Boolean> c = constraintChecker.isClosedLoopAllowed(); Constraint<Boolean> c = constraintChecker.isClosedLoopAllowed();
Assert.assertEquals(true, c.getReasonList().size() == 2); // Safety & Objectives Assert.assertEquals(true, c.getReasonList().size() == 2); // Safety & Objectives
@ -90,8 +90,8 @@ public class ConstraintsCheckerTest {
} }
@Test @Test
public void isAutosensModeEnabledTest() throws Exception { public void isAutosensModeEnabledTest() {
objectivesPlugin.objectives.get(5).setStartedOn(null); objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getAUTOSENS_OBJECTIVE()).setStartedOn(0);
when(SP.getBoolean(R.string.key_openapsama_useautosens, false)).thenReturn(false); when(SP.getBoolean(R.string.key_openapsama_useautosens, false)).thenReturn(false);
Constraint<Boolean> c = constraintChecker.isAutosensModeEnabled(); Constraint<Boolean> c = constraintChecker.isAutosensModeEnabled();
@ -101,8 +101,8 @@ public class ConstraintsCheckerTest {
} }
@Test @Test
public void isAMAModeEnabledTest() throws Exception { public void isAMAModeEnabledTest() {
objectivesPlugin.objectives.get(6).setStartedOn(null); objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getAMA_OBJECTIVE()).setStartedOn(0);
Constraint<Boolean> c = constraintChecker.isAMAModeEnabled(); Constraint<Boolean> c = constraintChecker.isAMAModeEnabled();
Assert.assertEquals(true, c.getReasonList().size() == 1); // Objectives Assert.assertEquals(true, c.getReasonList().size() == 1); // Objectives
@ -111,7 +111,7 @@ public class ConstraintsCheckerTest {
} }
@Test @Test
public void isAdvancedFilteringEnabledTest() throws Exception { public void isAdvancedFilteringEnabledTest() {
when(ConfigBuilderPlugin.getPlugin().getActiveBgSource()).thenReturn(SourceGlimpPlugin.getPlugin()); when(ConfigBuilderPlugin.getPlugin().getActiveBgSource()).thenReturn(SourceGlimpPlugin.getPlugin());
Constraint<Boolean> c = constraintChecker.isAdvancedFilteringEnabled(); Constraint<Boolean> c = constraintChecker.isAdvancedFilteringEnabled();
@ -130,7 +130,7 @@ public class ConstraintsCheckerTest {
@Test @Test
public void isSMBModeEnabledTest() throws Exception { public void isSMBModeEnabledTest() throws Exception {
objectivesPlugin.objectives.get(7).setStartedOn(null); objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getSMB_OBJECTIVE()).setStartedOn(0);
when(SP.getBoolean(R.string.key_use_smb, false)).thenReturn(false); when(SP.getBoolean(R.string.key_use_smb, false)).thenReturn(false);
when(MainApp.getConstraintChecker().isClosedLoopAllowed()).thenReturn(new Constraint<>(true)); when(MainApp.getConstraintChecker().isClosedLoopAllowed()).thenReturn(new Constraint<>(true));
@ -294,7 +294,7 @@ public class ConstraintsCheckerTest {
constraintChecker = new ConstraintChecker(); constraintChecker = new ConstraintChecker();
safetyPlugin = SafetyPlugin.getPlugin(); safetyPlugin = SafetyPlugin.getPlugin();
objectivesPlugin = ObjectivesPlugin.getPlugin(); objectivesPlugin = ObjectivesPlugin.INSTANCE;
comboPlugin = ComboPlugin.getPlugin(); comboPlugin = ComboPlugin.getPlugin();
danaRPlugin = DanaRPlugin.getPlugin(); danaRPlugin = DanaRPlugin.getPlugin();
danaRSPlugin = DanaRSPlugin.getPlugin(); danaRSPlugin = DanaRSPlugin.getPlugin();

View file

@ -14,6 +14,7 @@ import info.AAPSMocker;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraint;
import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.SP; import info.nightscout.androidaps.utils.SP;
/** /**
@ -27,53 +28,53 @@ public class ObjectivesPluginTest {
ObjectivesPlugin objectivesPlugin; ObjectivesPlugin objectivesPlugin;
@Test @Test
public void notStartedObjectivesShouldLimitLoopInvocation() throws Exception { public void notStartedObjectivesShouldLimitLoopInvocation() {
objectivesPlugin.objectives.get(0).setStartedOn(null); objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getFIRST_OBJECTIVE()).setStartedOn(0);
Constraint<Boolean> c = new Constraint<>(true); Constraint<Boolean> c = new Constraint<>(true);
c = objectivesPlugin.isLoopInvocationAllowed(c); c = objectivesPlugin.isLoopInvocationAllowed(c);
Assert.assertEquals("Objectives: Objective 1 not started", c.getReasons()); Assert.assertEquals("Objectives: Objective 1 not started", c.getReasons());
Assert.assertEquals(Boolean.FALSE, c.value()); Assert.assertEquals(Boolean.FALSE, c.value());
objectivesPlugin.objectives.get(0).setStartedOn(new Date()); objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getFIRST_OBJECTIVE()).setStartedOn(DateUtil.now());
} }
@Test @Test
public void notStartedObjective4ShouldLimitClosedLoop() throws Exception { public void notStartedObjective6ShouldLimitClosedLoop() {
objectivesPlugin.objectives.get(3).setStartedOn(null); objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getMAXIOB_ZERO_CL_OBJECTIVE()).setStartedOn(0);
Constraint<Boolean> c = new Constraint<>(true); Constraint<Boolean> c = new Constraint<>(true);
c = objectivesPlugin.isClosedLoopAllowed(c); c = objectivesPlugin.isClosedLoopAllowed(c);
Assert.assertEquals(true, c.getReasons().contains("Objective 4 not started"));
Assert.assertEquals(Boolean.FALSE, c.value());
}
@Test
public void notStartedObjective6ShouldLimitAutosensMode() throws Exception {
objectivesPlugin.objectives.get(5).setStartedOn(null);
Constraint<Boolean> c = new Constraint<>(true);
c = objectivesPlugin.isAutosensModeEnabled(c);
Assert.assertEquals(true, c.getReasons().contains("Objective 6 not started")); Assert.assertEquals(true, c.getReasons().contains("Objective 6 not started"));
Assert.assertEquals(Boolean.FALSE, c.value()); Assert.assertEquals(Boolean.FALSE, c.value());
} }
@Test @Test
public void notStartedObjective7ShouldLimitAMAMode() throws Exception { public void notStartedObjective8ShouldLimitAutosensMode() {
objectivesPlugin.objectives.get(6).setStartedOn(null); objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getAUTOSENS_OBJECTIVE()).setStartedOn(0);
Constraint<Boolean> c = new Constraint<>(true); Constraint<Boolean> c = new Constraint<>(true);
c = objectivesPlugin.isAMAModeEnabled(c); c = objectivesPlugin.isAutosensModeEnabled(c);
Assert.assertEquals(true, c.getReasons().contains("Objective 7 not started")); Assert.assertEquals(true, c.getReasons().contains("Objective 8 not started"));
Assert.assertEquals(Boolean.FALSE, c.value()); Assert.assertEquals(Boolean.FALSE, c.value());
} }
@Test @Test
public void notStartedObjective8ShouldLimitSMBMode() throws Exception { public void notStartedObjective9ShouldLimitAMAMode() {
objectivesPlugin.objectives.get(7).setStartedOn(null); objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getAMA_OBJECTIVE()).setStartedOn(0);
Constraint<Boolean> c = new Constraint<>(true);
c = objectivesPlugin.isAMAModeEnabled(c);
Assert.assertEquals(true, c.getReasons().contains("Objective 9 not started"));
Assert.assertEquals(Boolean.FALSE, c.value());
}
@Test
public void notStartedObjective10ShouldLimitSMBMode() {
objectivesPlugin.getObjectives().get(ObjectivesPlugin.INSTANCE.getSMB_OBJECTIVE()).setStartedOn(0);
Constraint<Boolean> c = new Constraint<>(true); Constraint<Boolean> c = new Constraint<>(true);
c = objectivesPlugin.isSMBModeEnabled(c); c = objectivesPlugin.isSMBModeEnabled(c);
Assert.assertEquals(true, c.getReasons().contains("Objective 8 not started")); Assert.assertEquals(true, c.getReasons().contains("Objective 10 not started"));
Assert.assertEquals(Boolean.FALSE, c.value()); Assert.assertEquals(Boolean.FALSE, c.value());
} }
@ -85,6 +86,6 @@ public class ObjectivesPluginTest {
AAPSMocker.mockSP(); AAPSMocker.mockSP();
AAPSMocker.mockStrings(); AAPSMocker.mockStrings();
objectivesPlugin = ObjectivesPlugin.getPlugin(); objectivesPlugin = ObjectivesPlugin.INSTANCE;
} }
} }