fix merge conflits

This commit is contained in:
Milos Kozak 2017-09-18 22:03:26 +02:00
commit fdc3c49a2a
21 changed files with 233 additions and 123 deletions

View file

@ -44,7 +44,7 @@ android {
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 23 targetSdkVersion 23
versionCode 1500 versionCode 1500
version "1.52" version "1.53"
buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "VERSION", '"' + version + '"'
buildConfigField "String", "BUILDVERSION", generateGitBuild() buildConfigField "String", "BUILDVERSION", generateGitBuild()

View file

@ -52,6 +52,7 @@ public interface TreatmentsInterface {
boolean addToHistoryTreatment(DetailedBolusInfo detailedBolusInfo); boolean addToHistoryTreatment(DetailedBolusInfo detailedBolusInfo);
TempTarget getTempTargetFromHistory();
TempTarget getTempTargetFromHistory(long time); TempTarget getTempTargetFromHistory(long time);
Intervals<TempTarget> getTempTargetsFromHistory(); Intervals<TempTarget> getTempTargetsFromHistory();

View file

@ -34,6 +34,8 @@ import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.db.Source; import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.Overview.Notification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.PlusMinusEditText; import info.nightscout.utils.PlusMinusEditText;
import info.nightscout.utils.SP; import info.nightscout.utils.SP;
@ -172,11 +174,17 @@ public class FillDialog extends DialogFragment implements OnClickListener {
detailedBolusInfo.isValid = false; // do not count it in IOB (for pump history) detailedBolusInfo.isValid = false; // do not count it in IOB (for pump history)
PumpEnactResult result = pump.deliverTreatment(detailedBolusInfo); PumpEnactResult result = pump.deliverTreatment(detailedBolusInfo);
if (!result.success) { if (!result.success) {
try {
AlertDialog.Builder builder = new AlertDialog.Builder(context); AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror)); builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(result.comment); builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null); builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show(); builder.show();
} catch (WindowManager.BadTokenException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
}
} }
} }
}); });

View file

@ -10,6 +10,7 @@ import android.support.v7.app.AlertDialog;
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.view.WindowManager;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.RadioButton; import android.widget.RadioButton;
@ -27,6 +28,8 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Overview.Notification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.utils.PlusMinusEditText; import info.nightscout.utils.PlusMinusEditText;
import info.nightscout.utils.SafeParse; import info.nightscout.utils.SafeParse;
@ -103,11 +106,17 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
public void run() { public void run() {
PumpEnactResult result = pump.setExtendedBolus(finalInsulin, finalDurationInMinutes); PumpEnactResult result = pump.setExtendedBolus(finalInsulin, finalDurationInMinutes);
if (!result.success) { if (!result.success) {
try {
AlertDialog.Builder builder = new AlertDialog.Builder(context); AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(context.getString(R.string.treatmentdeliveryerror)); builder.setTitle(context.getString(R.string.treatmentdeliveryerror));
builder.setMessage(result.comment); builder.setMessage(result.comment);
builder.setPositiveButton(context.getString(R.string.ok), null); builder.setPositiveButton(context.getString(R.string.ok), null);
builder.show(); builder.show();
} catch (WindowManager.BadTokenException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
}
} }
} }
}); });

View file

@ -890,6 +890,12 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
return newRecordCreated; return newRecordCreated;
} }
@Override
@Nullable
public TempTarget getTempTargetFromHistory() {
return activeTreatments.getTempTargetFromHistory(System.currentTimeMillis());
}
@Override @Override
@Nullable @Nullable
public TempTarget getTempTargetFromHistory(long time) { public TempTarget getTempTargetFromHistory(long time) {

View file

@ -183,7 +183,7 @@ public class BroadcastTreatment {
ret.add(newarr); ret.add(newarr);
} }
newarr = new JSONArray(); newarr = new JSONArray();
count = 100; count = 50;
} }
newarr.put(array.get(i)); newarr.put(array.get(i));
--count; --count;

View file

@ -14,8 +14,6 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import com.crashlytics.android.answers.Answers; import com.crashlytics.android.answers.Answers;
import com.crashlytics.android.answers.CustomEvent; import com.crashlytics.android.answers.CustomEvent;
@ -34,8 +32,9 @@ import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.db.CareportalEvent; import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.Source; import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Overview.Notification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.utils.NumberPicker; import info.nightscout.utils.NumberPicker;
import info.nightscout.utils.PlusMinusEditText;
import info.nightscout.utils.SafeParse; import info.nightscout.utils.SafeParse;
public class NewTreatmentDialog extends DialogFragment implements OnClickListener { public class NewTreatmentDialog extends DialogFragment implements OnClickListener {
@ -112,19 +111,27 @@ public class NewTreatmentDialog extends DialogFragment implements OnClickListene
@Override @Override
public void run() { public void run() {
DetailedBolusInfo detailedBolusInfo = new DetailedBolusInfo(); DetailedBolusInfo detailedBolusInfo = new DetailedBolusInfo();
if (finalInsulinAfterConstraints == 0) detailedBolusInfo.eventType = CareportalEvent.CARBCORRECTION; if (finalInsulinAfterConstraints == 0)
if (finalCarbsAfterConstraints == 0) detailedBolusInfo.eventType = CareportalEvent.CORRECTIONBOLUS; detailedBolusInfo.eventType = CareportalEvent.CARBCORRECTION;
if (finalCarbsAfterConstraints == 0)
detailedBolusInfo.eventType = CareportalEvent.CORRECTIONBOLUS;
detailedBolusInfo.insulin = finalInsulinAfterConstraints; detailedBolusInfo.insulin = finalInsulinAfterConstraints;
detailedBolusInfo.carbs = finalCarbsAfterConstraints; detailedBolusInfo.carbs = finalCarbsAfterConstraints;
detailedBolusInfo.context = context; detailedBolusInfo.context = context;
detailedBolusInfo.source = Source.USER; detailedBolusInfo.source = Source.USER;
PumpEnactResult result = pump.deliverTreatment(detailedBolusInfo); PumpEnactResult result = pump.deliverTreatment(detailedBolusInfo);
if (!result.success) { if (!result.success) {
try {
AlertDialog.Builder builder = new AlertDialog.Builder(context); AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror)); builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(result.comment); builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null); builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show(); builder.show();
} catch (WindowManager.BadTokenException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
}
} }
} }
}); });

View file

@ -51,12 +51,15 @@ import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.db.CareportalEvent; import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.db.DatabaseHelper;
import info.nightscout.androidaps.db.Source; import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.events.EventNewBG; import info.nightscout.androidaps.events.EventNewBG;
import info.nightscout.androidaps.events.EventRefreshOverview; import info.nightscout.androidaps.events.EventRefreshOverview;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
import info.nightscout.androidaps.plugins.OpenAPSAMA.OpenAPSAMAPlugin; import info.nightscout.androidaps.plugins.OpenAPSAMA.OpenAPSAMAPlugin;
import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateGui; import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateGui;
import info.nightscout.androidaps.plugins.Overview.Notification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.utils.BolusWizard; import info.nightscout.utils.BolusWizard;
import info.nightscout.utils.DateUtil; import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
@ -74,6 +77,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
TextView bgInsulin; TextView bgInsulin;
TextView bgUnits; TextView bgUnits;
CheckBox bgCheckbox; CheckBox bgCheckbox;
CheckBox ttCheckbox;
TextView carbs; TextView carbs;
TextView carbsInsulin; TextView carbsInsulin;
TextView bolusIobInsulin; TextView bolusIobInsulin;
@ -217,17 +221,21 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
cobInsulin = (TextView) view.findViewById(R.id.treatments_wizard_cobinsulin); cobInsulin = (TextView) view.findViewById(R.id.treatments_wizard_cobinsulin);
bgCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bgcheckbox); bgCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bgcheckbox);
ttCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_ttcheckbox);
bgtrendCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bgtrendcheckbox);
cobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_cobcheckbox);
bolusIobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bolusiobcheckbox); bolusIobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bolusiobcheckbox);
basalIobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_basaliobcheckbox); basalIobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_basaliobcheckbox);
superbolusCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_sbcheckbox); superbolusCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_sbcheckbox);
bgtrendCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bgtrendcheckbox); loadCheckedStates();
cobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_cobcheckbox);
bgCheckbox.setOnCheckedChangeListener(this); bgCheckbox.setOnCheckedChangeListener(this);
ttCheckbox.setOnCheckedChangeListener(this);
bgtrendCheckbox.setOnCheckedChangeListener(this);
cobCheckbox.setOnCheckedChangeListener(this);
basalIobCheckbox.setOnCheckedChangeListener(this); basalIobCheckbox.setOnCheckedChangeListener(this);
bolusIobCheckbox.setOnCheckedChangeListener(this); bolusIobCheckbox.setOnCheckedChangeListener(this);
superbolusCheckbox.setOnCheckedChangeListener(this); superbolusCheckbox.setOnCheckedChangeListener(this);
bgtrendCheckbox.setOnCheckedChangeListener(this);
cobCheckbox.setOnCheckedChangeListener(this);
profileSpinner = (Spinner) view.findViewById(R.id.treatments_wizard_profile); profileSpinner = (Spinner) view.findViewById(R.id.treatments_wizard_profile);
profileSpinner.setOnItemSelectedListener(this); profileSpinner.setOnItemSelectedListener(this);
@ -254,9 +262,27 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
saveCheckedStates();
ttCheckbox.setEnabled(bgCheckbox.isChecked() && MainApp.getConfigBuilder().getTempTargetFromHistory() != null);
calculateInsulin(); calculateInsulin();
} }
private void saveCheckedStates() {
//SP.putBoolean(getString(R.string.key_wizard_include_bg), bgCheckbox.isChecked());
SP.putBoolean(getString(R.string.key_wizard_include_cob), cobCheckbox.isChecked());
SP.putBoolean(getString(R.string.key_wizard_include_trend_bg), bgtrendCheckbox.isChecked());
//SP.putBoolean(getString(R.string.key_wizard_include_bolus_iob), bolusIobCheckbox.isChecked());
//SP.putBoolean(getString(R.string.key_wizard_include_basal_iob), basalIobCheckbox.isChecked());
}
private void loadCheckedStates() {
//bgCheckbox.setChecked(SP.getBoolean(getString(R.string.key_wizard_include_bg), true));
bgtrendCheckbox.setChecked(SP.getBoolean(getString(R.string.key_wizard_include_trend_bg), false));
cobCheckbox.setChecked(SP.getBoolean(getString(R.string.key_wizard_include_cob), false));
//bolusIobCheckbox.setChecked(SP.getBoolean(getString(R.string.key_wizard_include_bolus_iob), true));
//basalIobCheckbox.setChecked(SP.getBoolean(getString(R.string.key_wizard_include_basal_iob), true));
}
@Override @Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
calculateInsulin(); calculateInsulin();
@ -285,7 +311,6 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
confirmMessage += "<br/>" + getString(R.string.carbs) + ": " + carbsAfterConstraints + "g"; confirmMessage += "<br/>" + getString(R.string.carbs) + ": " + carbsAfterConstraints + "g";
if (insulinAfterConstraints - calculatedTotalInsulin != 0 || !carbsAfterConstraints.equals(calculatedCarbs)) { if (insulinAfterConstraints - calculatedTotalInsulin != 0 || !carbsAfterConstraints.equals(calculatedCarbs)) {
AlertDialog.Builder builder = new AlertDialog.Builder(context); AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror)); builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
@ -336,7 +361,17 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
detailedBolusInfo.source = Source.USER; detailedBolusInfo.source = Source.USER;
result = pump.deliverTreatment(detailedBolusInfo); result = pump.deliverTreatment(detailedBolusInfo);
if (!result.success) { if (!result.success) {
OKDialog.show(getActivity(), MainApp.sResources.getString(R.string.treatmentdeliveryerror), result.comment, null); try {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
} catch (WindowManager.BadTokenException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
}
} }
} }
}); });
@ -385,31 +420,17 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
BgReading lastBg = DatabaseHelper.actualBg(); BgReading lastBg = DatabaseHelper.actualBg();
if (lastBg != null) { if (lastBg != null) {
Double lastBgValue = lastBg.valueToUnits(units);
Double sens = profile.getIsf();
Double targetBGLow = profile.getTargetLow();
Double targetBGHigh = profile.getTargetHigh();
Double bgDiff;
if (lastBgValue <= targetBGLow) {
bgDiff = lastBgValue - targetBGLow;
} else {
bgDiff = lastBgValue - targetBGHigh;
}
bg.setText(lastBg.valueToUnitsToString(units) + " ISF: " + DecimalFormatter.to1Decimal(sens));
bgInsulin.setText(DecimalFormatter.to2Decimal(bgDiff / sens) + "U");
editBg.removeTextChangedListener(textWatcher); editBg.removeTextChangedListener(textWatcher);
//bgInput.setText(lastBg.valueToUnitsToString(units)); //bgInput.setText(lastBg.valueToUnitsToString(units));
editBg.setValue(lastBg.valueToUnits(units)); editBg.setValue(lastBg.valueToUnits(units));
editBg.addTextChangedListener(textWatcher); editBg.addTextChangedListener(textWatcher);
} else { } else {
bg.setText("");
bgInsulin.setText("");
editBg.removeTextChangedListener(textWatcher); editBg.removeTextChangedListener(textWatcher);
//bgInput.setText(""); //bgInput.setText("");
editBg.setValue(0d); editBg.setValue(0d);
editBg.addTextChangedListener(textWatcher); editBg.addTextChangedListener(textWatcher);
} }
ttCheckbox.setEnabled(MainApp.getConfigBuilder().getTempTargetFromHistory() != null);
// IOB calculation // IOB calculation
MainApp.getConfigBuilder().updateTotalIOBTreatments(); MainApp.getConfigBuilder().updateTotalIOBTreatments();
@ -462,6 +483,7 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
} }
c_bg = bgCheckbox.isChecked() ? c_bg : 0d; c_bg = bgCheckbox.isChecked() ? c_bg : 0d;
TempTarget tempTarget = ttCheckbox.isChecked() ? MainApp.getConfigBuilder().getTempTargetFromHistory() : null;
// COB // COB
Double c_cob = 0d; Double c_cob = 0d;
@ -470,12 +492,13 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
try { try {
c_cob = SafeParse.stringToDouble(ConfigBuilderPlugin.getActiveAPS().getLastAPSResult().json().getString("COB")); c_cob = SafeParse.stringToDouble(ConfigBuilderPlugin.getActiveAPS().getLastAPSResult().json().getString("COB"));
} catch (JSONException e) { } catch (JSONException e) {
log.error("Unhandled exception", e);
} }
} }
} }
BolusWizard wizard = new BolusWizard(); BolusWizard wizard = new BolusWizard();
wizard.doCalc(specificProfile, carbsAfterConstraint, c_cob, c_bg, corrAfterConstraint, bolusIobCheckbox.isChecked(), basalIobCheckbox.isChecked(), superbolusCheckbox.isChecked(), bgtrendCheckbox.isChecked()); wizard.doCalc(specificProfile, tempTarget, carbsAfterConstraint, c_cob, c_bg, corrAfterConstraint, bolusIobCheckbox.isChecked(), basalIobCheckbox.isChecked(), superbolusCheckbox.isChecked(), bgtrendCheckbox.isChecked());
bg.setText(c_bg + " ISF: " + DecimalFormatter.to1Decimal(wizard.sens)); bg.setText(c_bg + " ISF: " + DecimalFormatter.to1Decimal(wizard.sens));
bgInsulin.setText(DecimalFormatter.to2Decimal(wizard.insulinFromBG) + "U"); bgInsulin.setText(DecimalFormatter.to2Decimal(wizard.insulinFromBG) + "U");
@ -526,6 +549,8 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
total.setText(getString(R.string.result) + ": " + insulinText + " " + carbsText); total.setText(getString(R.string.result) + ": " + insulinText + " " + carbsText);
okButton.setVisibility(View.VISIBLE); okButton.setVisibility(View.VISIBLE);
} else { } else {
// TODO this should also be run when loading the dialog as the OK button is initially visible
// but does nothing if neither carbs nor insulin is > 0
total.setText(getString(R.string.missing) + " " + DecimalFormatter.to0Decimal(wizard.carbsEquivalent) + "g"); total.setText(getString(R.string.missing) + " " + DecimalFormatter.to0Decimal(wizard.carbsEquivalent) + "g");
okButton.setVisibility(View.INVISIBLE); okButton.setVisibility(View.INVISIBLE);
} }

View file

@ -50,6 +50,7 @@ public class Notification {
public static final int SHORT_DIA = 21; public static final int SHORT_DIA = 21;
public static final int TOAST_ALARM = 22; public static final int TOAST_ALARM = 22;
public static final int WRONGBASALSTEP = 23; public static final int WRONGBASALSTEP = 23;
public static final int BOLUS_DELIVERY_ERROR = 24;
public int id; public int id;

View file

@ -26,6 +26,7 @@ import android.view.LayoutInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button; import android.widget.Button;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
@ -110,6 +111,7 @@ import info.nightscout.androidaps.plugins.Overview.Dialogs.CalibrationDialog;
import info.nightscout.androidaps.plugins.Overview.Dialogs.NewTreatmentDialog; import info.nightscout.androidaps.plugins.Overview.Dialogs.NewTreatmentDialog;
import info.nightscout.androidaps.plugins.Overview.Dialogs.WizardDialog; import info.nightscout.androidaps.plugins.Overview.Dialogs.WizardDialog;
import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
import info.nightscout.androidaps.plugins.Overview.events.EventSetWakeLock; import info.nightscout.androidaps.plugins.Overview.events.EventSetWakeLock;
import info.nightscout.androidaps.plugins.Overview.graphExtensions.AreaGraphSeries; import info.nightscout.androidaps.plugins.Overview.graphExtensions.AreaGraphSeries;
import info.nightscout.androidaps.plugins.Overview.graphExtensions.DataPointWithLabelInterface; import info.nightscout.androidaps.plugins.Overview.graphExtensions.DataPointWithLabelInterface;
@ -127,9 +129,6 @@ import info.nightscout.utils.Profiler;
import info.nightscout.utils.Round; import info.nightscout.utils.Round;
import info.nightscout.utils.SP; import info.nightscout.utils.SP;
import info.nightscout.utils.ToastUtils; import info.nightscout.utils.ToastUtils;
//Added By Rumen for staledata alarm
import info.nightscout.androidaps.plugins.Overview.Notification;
import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification;
public class OverviewFragment extends Fragment implements View.OnClickListener, CompoundButton.OnCheckedChangeListener { public class OverviewFragment extends Fragment implements View.OnClickListener, CompoundButton.OnCheckedChangeListener {
private static Logger log = LoggerFactory.getLogger(OverviewFragment.class); private static Logger log = LoggerFactory.getLogger(OverviewFragment.class);
@ -637,12 +636,13 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
void onClickQuickwizard() { void onClickQuickwizard() {
final BgReading actualBg = DatabaseHelper.actualBg(); final BgReading actualBg = DatabaseHelper.actualBg();
final Profile profile = MainApp.getConfigBuilder().getProfile(); final Profile profile = MainApp.getConfigBuilder().getProfile();
final TempTarget tempTarget = MainApp.getConfigBuilder().getTempTargetFromHistory();
QuickWizard.QuickWizardEntry quickWizardEntry = getPlugin().quickWizard.getActive(); QuickWizard.QuickWizardEntry quickWizardEntry = getPlugin().quickWizard.getActive();
if (quickWizardEntry != null && actualBg != null) { if (quickWizardEntry != null && actualBg != null) {
quickWizardButton.setVisibility(View.VISIBLE); quickWizardButton.setVisibility(View.VISIBLE);
BolusWizard wizard = new BolusWizard(); BolusWizard wizard = new BolusWizard();
wizard.doCalc(profile, quickWizardEntry.carbs(), 0d, actualBg.valueToUnits(profile.getUnits()), 0d, true, true, false, false); wizard.doCalc(profile, tempTarget, quickWizardEntry.carbs(), 0d, actualBg.valueToUnits(profile.getUnits()), 0d, true, true, false, false);
final JSONObject boluscalcJSON = new JSONObject(); final JSONObject boluscalcJSON = new JSONObject();
try { try {
@ -707,11 +707,17 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
detailedBolusInfo.source = Source.USER; detailedBolusInfo.source = Source.USER;
PumpEnactResult result = pump.deliverTreatment(detailedBolusInfo); PumpEnactResult result = pump.deliverTreatment(detailedBolusInfo);
if (!result.success) { if (!result.success) {
try {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror)); builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(result.comment); builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null); builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show(); builder.show();
} catch (WindowManager.BadTokenException e) {
// window has been destroyed
Notification notification = new Notification(Notification.BOLUS_DELIVERY_ERROR, MainApp.sResources.getString(R.string.treatmentdeliveryerror), Notification.URGENT);
MainApp.bus().post(new EventNewNotification(notification));
}
} }
} }
}); });
@ -976,7 +982,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} }
// temp target // temp target
TempTarget tempTarget = MainApp.getConfigBuilder().getTempTargetFromHistory(System.currentTimeMillis()); TempTarget tempTarget = MainApp.getConfigBuilder().getTempTargetFromHistory();
if (tempTarget != null) { if (tempTarget != null) {
tempTargetView.setTextColor(Color.BLACK); tempTargetView.setTextColor(Color.BLACK);
tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetBackground)); tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetBackground));
@ -1117,7 +1123,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
quickWizardButton.setVisibility(View.VISIBLE); quickWizardButton.setVisibility(View.VISIBLE);
String text = quickWizardEntry.buttonText() + "\n" + DecimalFormatter.to0Decimal(quickWizardEntry.carbs()) + "g"; String text = quickWizardEntry.buttonText() + "\n" + DecimalFormatter.to0Decimal(quickWizardEntry.carbs()) + "g";
BolusWizard wizard = new BolusWizard(); BolusWizard wizard = new BolusWizard();
wizard.doCalc(profile, quickWizardEntry.carbs(), 0d, lastBG.valueToUnits(units), 0d, true, true, false, false); wizard.doCalc(profile, tempTarget, quickWizardEntry.carbs(), 0d, lastBG.valueToUnits(units), 0d, true, true, false, false);
text += " " + DecimalFormatter.to2Decimal(wizard.calculatedTotalInsulin) + "U"; text += " " + DecimalFormatter.to2Decimal(wizard.calculatedTotalInsulin) + "U";
quickWizardButton.setText(text); quickWizardButton.setText(text);
if (wizard.calculatedTotalInsulin <= 0) if (wizard.calculatedTotalInsulin <= 0)

View file

@ -428,9 +428,17 @@ public class DanaRv2ExecutionService extends Service {
} }
} }
} }
waitMsec(3000);
bolusingTreatment = null; bolusingTreatment = null;
// run loading history in separate thread and allow bolus dialog to be closed
new Thread(new Runnable() {
@Override
public void run() {
waitMsec(4000);
if (!(isConnected()))
connect("loadEvents");
loadEvents(); loadEvents();
}
}).start();
return true; return true;
} }

View file

@ -218,6 +218,7 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
result.success = true; result.success = true;
result.bolusDelivered = detailedBolusInfo.insulin; result.bolusDelivered = detailedBolusInfo.insulin;
result.carbsDelivered = detailedBolusInfo.carbs; result.carbsDelivered = detailedBolusInfo.carbs;
result.enacted = result.bolusDelivered > 0 || result.carbsDelivered > 0;
result.comment = MainApp.instance().getString(R.string.virtualpump_resultok); result.comment = MainApp.instance().getString(R.string.virtualpump_resultok);
Double delivering = 0d; Double delivering = 0d;

View file

@ -172,6 +172,10 @@ public class SensitivityWeightedAveragePlugin implements PluginBase, Sensitivity
weightedsum += weight * value; weightedsum += weight * value;
} }
if (weights == 0) {
return new AutosensResult();
}
Profile profile = MainApp.getConfigBuilder().getProfile(); Profile profile = MainApp.getConfigBuilder().getProfile();
double sens = profile.getIsf(); double sens = profile.getIsf();

View file

@ -272,7 +272,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
@Override @Override
public TemporaryBasal getRealTempBasalFromHistory(long time) { public TemporaryBasal getRealTempBasalFromHistory(long time) {
return (TemporaryBasal) tempBasals.getValueByInterval(time); return tempBasals.getValueByInterval(time);
} }
@Override @Override
@ -358,7 +358,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
@Override @Override
public ExtendedBolus getExtendedBolusFromHistory(long time) { public ExtendedBolus getExtendedBolusFromHistory(long time) {
return (ExtendedBolus) extendedBoluses.getValueByInterval(time); return extendedBoluses.getValueByInterval(time);
} }
@Override @Override
@ -464,10 +464,16 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
initializeTempTargetData(); initializeTempTargetData();
} }
@Nullable
@Override
public TempTarget getTempTargetFromHistory() {
return tempTargets.getValueByInterval(System.currentTimeMillis());
}
@Nullable @Nullable
@Override @Override
public TempTarget getTempTargetFromHistory(long time) { public TempTarget getTempTargetFromHistory(long time) {
return (TempTarget) tempTargets.getValueByInterval(time); return tempTargets.getValueByInterval(time);
} }
@Override @Override

View file

@ -202,9 +202,10 @@ public class ActionStringHandler {
sendError("No recent BG to base calculation on!"); sendError("No recent BG to base calculation on!");
return; return;
} }
DecimalFormat format = new DecimalFormat("0.00"); DecimalFormat format = new DecimalFormat("0.00");
BolusWizard bolusWizard = new BolusWizard(); BolusWizard bolusWizard = new BolusWizard();
bolusWizard.doCalc(profile, carbsAfterConstraints, 0d, useBG ? bgReading.valueToUnits(profile.getUnits()) : 0d, 0d, percentage, useBolusIOB, useBasalIOB, false, false); bolusWizard.doCalc(profile, null, carbsAfterConstraints, 0d, useBG ? bgReading.valueToUnits(profile.getUnits()) : 0d, 0d, percentage, useBolusIOB, useBasalIOB, false, false);
Double insulinAfterConstraints = MainApp.getConfigBuilder().applyBolusConstraints(bolusWizard.calculatedTotalInsulin); Double insulinAfterConstraints = MainApp.getConfigBuilder().applyBolusConstraints(bolusWizard.calculatedTotalInsulin);
if (insulinAfterConstraints - bolusWizard.calculatedTotalInsulin != 0) { if (insulinAfterConstraints - bolusWizard.calculatedTotalInsulin != 0) {
@ -470,7 +471,7 @@ public class ActionStringHandler {
} }
//Check for Temp-Target: //Check for Temp-Target:
TempTarget tempTarget = MainApp.getConfigBuilder().getTempTargetFromHistory(System.currentTimeMillis()); TempTarget tempTarget = MainApp.getConfigBuilder().getTempTargetFromHistory();
if (tempTarget != null) { if (tempTarget != null) {
ret += "Temp Target: " + Profile.toTargetRangeString(tempTarget.low, tempTarget.low, Constants.MGDL, profile.getUnits()); ret += "Temp Target: " + Profile.toTargetRangeString(tempTarget.low, tempTarget.low, Constants.MGDL, profile.getUnits());
ret += "\nuntil: " + DateUtil.timeString(tempTarget.originalEnd()); ret += "\nuntil: " + DateUtil.timeString(tempTarget.originalEnd());

View file

@ -192,6 +192,10 @@ public class StatuslinePlugin implements PluginBase {
+ DecimalFormatter.to2Decimal(basalIob.basaliob) + ")"; + DecimalFormatter.to2Decimal(basalIob.basaliob) + ")";
} }
Profile profile = MainApp.getConfigBuilder().getProfile(); Profile profile = MainApp.getConfigBuilder().getProfile();
if (profile == null)
return status;
if (!mPrefs.getBoolean("xdripstatus_showbgi", false)) { if (!mPrefs.getBoolean("xdripstatus_showbgi", false)) {
return status; return status;
} }

View file

@ -1,12 +1,11 @@
package info.nightscout.utils; package info.nightscout.utils;
import java.util.Date;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.data.GlucoseStatus; import info.nightscout.androidaps.data.GlucoseStatus;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
/** /**
* Created by mike on 11.10.2016. * Created by mike on 11.10.2016.
@ -15,6 +14,7 @@ import info.nightscout.androidaps.data.Profile;
public class BolusWizard { public class BolusWizard {
// Inputs // Inputs
Profile specificProfile = null; Profile specificProfile = null;
TempTarget tempTarget;
public Integer carbs = 0; public Integer carbs = 0;
Double bg = 0d; Double bg = 0d;
Double correction; Double correction;
@ -33,9 +33,6 @@ public class BolusWizard {
public Double targetBGHigh = 0d; public Double targetBGHigh = 0d;
public Double bgDiff = 0d; public Double bgDiff = 0d;
IobTotal bolusIob;
IobTotal basalIob;
public Double insulinFromBG = 0d; public Double insulinFromBG = 0d;
public Double insulinFromCarbs = 0d; public Double insulinFromCarbs = 0d;
public Double insulingFromBolusIOB = 0d; public Double insulingFromBolusIOB = 0d;
@ -50,23 +47,29 @@ public class BolusWizard {
public Double totalBeforePercentageAdjustment = 0d; public Double totalBeforePercentageAdjustment = 0d;
public Double carbsEquivalent = 0d; public Double carbsEquivalent = 0d;
public Double doCalc(Profile specificProfile, Integer carbs, Double cob, Double bg, Double correction, Boolean includeBolusIOB, Boolean includeBasalIOB, Boolean superBolus, Boolean trend) { public Double doCalc(Profile specificProfile, TempTarget tempTarget, Integer carbs, Double cob, Double bg, Double correction, Boolean includeBolusIOB, Boolean includeBasalIOB, Boolean superBolus, Boolean trend) {
return doCalc(specificProfile, carbs, cob, bg, correction, 100d, includeBolusIOB, includeBasalIOB, superBolus, trend); return doCalc(specificProfile, tempTarget, carbs, cob, bg, correction, 100d, includeBolusIOB, includeBasalIOB, superBolus, trend);
} }
public Double doCalc(Profile specificProfile, Integer carbs, Double cob, Double bg, Double correction, double percentageCorrection, Boolean includeBolusIOB, Boolean includeBasalIOB, Boolean superBolus, Boolean trend) { public Double doCalc(Profile specificProfile, TempTarget tempTarget, Integer carbs, Double cob, Double bg, Double correction, double percentageCorrection, Boolean includeBolusIOB, Boolean includeBasalIOB, Boolean superBolus, Boolean trend) {
this.specificProfile = specificProfile; this.specificProfile = specificProfile;
this.tempTarget = tempTarget;
this.carbs = carbs; this.carbs = carbs;
this.bg = bg; this.bg = bg;
this.correction = correction; this.correction = correction;
this.includeBolusIOB = includeBolusIOB;
this.includeBasalIOB = includeBasalIOB;
this.superBolus = superBolus; this.superBolus = superBolus;
this.trend = trend; this.trend = trend;
// Insulin from BG // Insulin from BG
sens = specificProfile.getIsf(); sens = specificProfile.getIsf();
targetBGLow = specificProfile.getTargetLow(); targetBGLow = specificProfile.getTargetLow();
targetBGHigh = specificProfile.getTargetHigh(); targetBGHigh = specificProfile.getTargetHigh();
if (tempTarget != null) {
targetBGLow = Profile.fromMgdlToUnits(tempTarget.low, specificProfile.getUnits());
targetBGHigh = Profile.fromMgdlToUnits(tempTarget.high, specificProfile.getUnits());
}
if (bg <= targetBGLow) { if (bg <= targetBGLow) {
bgDiff = bg - targetBGLow; bgDiff = bg - targetBGLow;
} else { } else {
@ -108,14 +111,14 @@ public class BolusWizard {
} }
// Total // Total
calculatedTotalInsulin = totalBeforePercentageAdjustment = insulinFromBG + insulinFromTrend + insulinFromCarbs + insulingFromBolusIOB + insulingFromBasalsIOB + insulinFromCorrection + insulinFromSuperBolus + insulinFromCOB; calculatedTotalInsulin = insulinFromBG + insulinFromTrend + insulinFromCarbs + insulingFromBolusIOB + insulingFromBasalsIOB + insulinFromCorrection + insulinFromSuperBolus + insulinFromCOB;
//percentage // Percentage adjustment
if(totalBeforePercentageAdjustment > 0){ totalBeforePercentageAdjustment = calculatedTotalInsulin;
calculatedTotalInsulin = totalBeforePercentageAdjustment*percentageCorrection/100d; if (calculatedTotalInsulin > 0) {
calculatedTotalInsulin = calculatedTotalInsulin * percentageCorrection / 100d;
} }
if (calculatedTotalInsulin < 0) { if (calculatedTotalInsulin < 0) {
carbsEquivalent = -calculatedTotalInsulin * ic; carbsEquivalent = -calculatedTotalInsulin * ic;
calculatedTotalInsulin = 0d; calculatedTotalInsulin = 0d;

View file

@ -85,15 +85,15 @@ public class DateUtil {
} }
public static int toSeconds(String hh_colon_mm) { public static int toSeconds(String hh_colon_mm) {
Pattern p = Pattern.compile("(\\d+):(\\d+)( a.m.| p.m.|)"); Pattern p = Pattern.compile("(\\d+):(\\d+)( a.m.| p.m.| AM | PM)");
Matcher m = p.matcher(hh_colon_mm); Matcher m = p.matcher(hh_colon_mm);
int retval = 0; int retval = 0;
if (m.find()) { if (m.find()) {
retval = SafeParse.stringToInt(m.group(1)) * 60 * 60 + SafeParse.stringToInt(m.group(2)) * 60; retval = SafeParse.stringToInt(m.group(1)) * 60 * 60 + SafeParse.stringToInt(m.group(2)) * 60;
if (m.group(3).equals(" .a.m") && m.group(1).equals("12")) if ((m.group(3).equals(" a.m.") || m.group(3).equals(" AM")) && m.group(1).equals("12"))
retval -= 12 * 60 * 60; retval -= 12 * 60 * 60;
if (m.group(3).equals(" p.m.") && !m.group(1).equals("12")) if ((m.group(3).equals(" p.m.") || m.group(3).equals(" PM")) && !(m.group(1).equals("12")))
retval += 12 * 60 * 60; retval += 12 * 60 * 60;
} }
return retval; return retval;

View file

@ -225,15 +225,29 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="80dp" android:width="24dp"
android:text="@string/treatments_wizard_bg_label" android:text="@string/treatments_wizard_bg_label"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<CheckBox
android:id="@+id/treatments_wizard_ttcheckbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="32dp"
android:checked="false" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:width="30dp"
android:text="@string/treatments_wizard_tt_label"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView <TextView
android:id="@+id/treatments_wizard_bg" android:id="@+id/treatments_wizard_bg"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="100dp" android:width="94dp"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView <TextView
@ -261,7 +275,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="80dp" android:width="86dp"
android:text="@string/treatments_wizard_bgtrend_label" android:text="@string/treatments_wizard_bgtrend_label"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
@ -269,7 +283,7 @@
android:id="@+id/treatments_wizard_bgtrend" android:id="@+id/treatments_wizard_bgtrend"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="100dp" android:width="94dp"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView <TextView
@ -298,7 +312,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="80dp" android:width="86dp"
android:text="@string/treatments_wizard_cob_label" android:text="@string/treatments_wizard_cob_label"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
@ -306,7 +320,7 @@
android:id="@+id/treatments_wizard_cob" android:id="@+id/treatments_wizard_cob"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="100dp" android:width="94dp"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView <TextView
@ -404,7 +418,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="80dp" android:width="86dp"
android:text="@string/treatments_wizard_carbs_label" android:text="@string/treatments_wizard_carbs_label"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
@ -412,7 +426,7 @@
android:id="@+id/treatments_wizard_carbs" android:id="@+id/treatments_wizard_carbs"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="100dp" android:width="94dp"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView <TextView
@ -438,7 +452,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="80dp" android:width="86dp"
android:text="@string/superbolus" android:text="@string/superbolus"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
@ -446,7 +460,7 @@
android:id="@+id/treatments_wizard_sb" android:id="@+id/treatments_wizard_sb"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="100dp" android:width="94dp"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView <TextView
@ -472,7 +486,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="80dp" android:width="86dp"
android:text="@string/treatments_wizard_correction_label" android:text="@string/treatments_wizard_correction_label"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
@ -480,7 +494,7 @@
android:id="@+id/treatments_wizard_correction" android:id="@+id/treatments_wizard_correction"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:width="100dp" android:width="94dp"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView <TextView

View file

@ -39,7 +39,7 @@
<string name="waitingforpumpclicktorefresh">Wacht op pomp. Klik om te vernieuwen.</string> <string name="waitingforpumpclicktorefresh">Wacht op pomp. Klik om te vernieuwen.</string>
<string name="waitingforpump">Wacht op pomp</string> <string name="waitingforpump">Wacht op pomp</string>
<string name="vitualpump_label">VIRTUELE POMP</string> <string name="vitualpump_label">VIRTUELE POMP</string>
<string name="visible">Zichtbaar</string> <string name="visible">Toon</string>
<string name="virtualpump_uploadstatus_title">Upload status naar NS</string> <string name="virtualpump_uploadstatus_title">Upload status naar NS</string>
<string name="virtualpump_tempbasal_label">Tijdelijk basaal</string> <string name="virtualpump_tempbasal_label">Tijdelijk basaal</string>
<string name="virtualpump_sqlerror">SQL Storing</string> <string name="virtualpump_sqlerror">SQL Storing</string>
@ -79,7 +79,7 @@
<string name="button1">Knop 1</string> <string name="button1">Knop 1</string>
<string name="button2">Knop 2</string> <string name="button2">Knop 2</string>
<string name="button3">Knop 3</string> <string name="button3">Knop 3</string>
<string name="calibrationsent">Kalibratie naat xDrip verzonden</string> <string name="calibrationsent">Kalibratie naar xDrip verzonden</string>
<string name="cancel">Annuleer</string> <string name="cancel">Annuleer</string>
<string name="canceltemp">Annuleer tijdelijk basaal</string> <string name="canceltemp">Annuleer tijdelijk basaal</string>
<string name="carbs">Koolhydraten</string> <string name="carbs">Koolhydraten</string>
@ -91,12 +91,12 @@
<string name="careportal_carbsandbolus_label">KOOLHYDRATEN &amp; BOLUS</string> <string name="careportal_carbsandbolus_label">KOOLHYDRATEN &amp; BOLUS</string>
<string name="careportal_carbscorrection">Koolhydraten correctie</string> <string name="careportal_carbscorrection">Koolhydraten correctie</string>
<string name="careportal_cgm_label">CGM &amp; OPENAPS</string> <string name="careportal_cgm_label">CGM &amp; OPENAPS</string>
<string name="careportal_cgmsensorinsert">CGM Sensor geplaatst</string> <string name="careportal_cgmsensorinsert">CGM Sens. ingebracht</string>
<string name="careportal_cgmsensorstart">CGM Sensor Start</string> <string name="careportal_cgmsensorstart">CGM Sens. Start</string>
<string name="careportal_combobolus">Multiwave bolus</string> <string name="careportal_combobolus">Multiwave bolus</string>
<string name="careportal_correctionbolus">Correctie bolus</string> <string name="careportal_correctionbolus">Correctie bolus</string>
<string name="careportal_exercise">Sport</string> <string name="careportal_exercise">Sport</string>
<string name="careportal_insulinage_label">Insuline leeftijd</string> <string name="careportal_insulinage_label">Ouderdom insuline</string>
<string name="careportal_insulinage_label_short">IAGE</string> <string name="careportal_insulinage_label_short">IAGE</string>
<string name="careportal_insulincartridgechange">Insuline ampul wissel</string> <string name="careportal_insulincartridgechange">Insuline ampul wissel</string>
<string name="careportal_mealbolus">Maaltijd bolus</string> <string name="careportal_mealbolus">Maaltijd bolus</string>
@ -118,19 +118,19 @@
<string name="careportal_newnstreatment_split_label">Splitzen</string> <string name="careportal_newnstreatment_split_label">Splitzen</string>
<string name="careportal_note">Notitie</string> <string name="careportal_note">Notitie</string>
<string name="careportal_openapsoffline">OpenAPS Offline</string> <string name="careportal_openapsoffline">OpenAPS Offline</string>
<string name="careportal_pbage_label">Leeftijd batterij</string> <string name="careportal_pbage_label">Ouderdom batterij</string>
<string name="careportal_profileswitch">Profiel wissel</string> <string name="careportal_profileswitch">Profiel wissel</string>
<string name="careportal_pump_label">Pomp</string> <string name="careportal_pump_label">Pomp</string>
<string name="careportal_pumpbatterychange">Pomp batterij wissel</string> <string name="careportal_pumpbatterychange">Pomp bat. wissel</string>
<string name="careportal_pumpsitechange">Infusieplaats wissel</string> <string name="careportal_pumpsitechange">Infuus wissel</string>
<string name="careportal_question">Vraag</string> <string name="careportal_question">Vraag</string>
<string name="careportal_sensorage_label">Leeftijd sensor</string> <string name="careportal_sensorage_label">Ouderdom sensor</string>
<string name="careportal_sensorage_label_short">SAGE</string> <string name="careportal_sensorage_label_short">SAGE</string>
<string name="careportal_shortname">CP</string> <string name="careportal_shortname">CP</string>
<string name="careportal_snackbolus">Snack bolus</string> <string name="careportal_snackbolus">Snack bolus</string>
<string name="careportal_tempbasalend">Einde tijdelijk basaal</string> <string name="careportal_tempbasalend">Einde tijd. basaal</string>
<string name="careportal_tempbasalstart">Begin tijdelijk basaal</string> <string name="careportal_tempbasalstart">Start tijd. basaal</string>
<string name="careportal_temporarytarget">Tijdelijk streefdoel</string> <string name="careportal_temporarytarget">Tijd. streefdoel</string>
<string name="careportal_temporarytargetcancel">Tijdelijk streefdoel annuleren</string> <string name="careportal_temporarytargetcancel">Tijdelijk streefdoel annuleren</string>
<string name="changeyourinput">Wijzig het ingegevene!</string> <string name="changeyourinput">Wijzig het ingegevene!</string>
<string name="child">Kind</string> <string name="child">Kind</string>
@ -143,7 +143,7 @@
<string name="configbuilder_bgsource">BG bron</string> <string name="configbuilder_bgsource">BG bron</string>
<string name="configbuilder_constraints">Beperkingen</string> <string name="configbuilder_constraints">Beperkingen</string>
<string name="configbuilder_general">Algemeen</string> <string name="configbuilder_general">Algemeen</string>
<string name="configbuilder_insulin">insuline</string> <string name="configbuilder_insulin">Insuline curve</string>
<string name="clear_queue">Ledig wachtrij</string> <string name="clear_queue">Ledig wachtrij</string>
<string name="configbuilder_loop">Loop</string> <string name="configbuilder_loop">Loop</string>
<string name="configbuilder_nightscoutversion_label">Nightscout versie:</string> <string name="configbuilder_nightscoutversion_label">Nightscout versie:</string>
@ -213,7 +213,7 @@
<string name="smscommunicator_bolusreplywithcode" formatted="false">Om de bolus %.2fU toe te dienen antwoord met de code %s</string> <string name="smscommunicator_bolusreplywithcode" formatted="false">Om de bolus %.2fU toe te dienen antwoord met de code %s</string>
<string name="smscommunicator_calibrationfailed">XDrip ontvangt geen callibraties</string> <string name="smscommunicator_calibrationfailed">XDrip ontvangt geen callibraties</string>
<string name="smscommunicator_calibrationreplywithcode" formatted="false">Om calibratie %.2f te verzenden antwoord met de code %s</string> <string name="smscommunicator_calibrationreplywithcode" formatted="false">Om calibratie %.2f te verzenden antwoord met de code %s</string>
<string name="smscommunicator_calibrationsent">Callibratie verzonden. Het ontvangen van callibraties moet actief zijn in xDrip.</string> <string name="smscommunicator_calibrationsent">Kalibratie verzonden. Het ontvangen van kalibraties moet actief zijn in xDrip.</string>
<string name="ko_lang">한국어</string> <string name="ko_lang">한국어</string>
<string name="language">Taal</string> <string name="language">Taal</string>
<string name="localprofile">Lokaal profiel</string> <string name="localprofile">Lokaal profiel</string>
@ -269,7 +269,7 @@
<string name="end_user_license_agreement">Eind gebruiker overeenkomst</string> <string name="end_user_license_agreement">Eind gebruiker overeenkomst</string>
<string name="enablesuperbolus_summary">Activeer de superbolus functie in de wizard. Activeer deze niet tot je begrijpt wat dit doet. OVERDOSISEN ZIJN MOGELIJK BIJ ONWETENDHEID</string> <string name="enablesuperbolus_summary">Activeer de superbolus functie in de wizard. Activeer deze niet tot je begrijpt wat dit doet. OVERDOSISEN ZIJN MOGELIJK BIJ ONWETENDHEID</string>
<string name="enablesuperbolus">Activeer superbolus in de wizard</string> <string name="enablesuperbolus">Activeer superbolus in de wizard</string>
<string name="enabled">Geactiveerd</string> <string name="enabled">Actief</string>
<string name="dont_show_again">Toon niet opnieuw</string> <string name="dont_show_again">Toon niet opnieuw</string>
<string name="eatingsoon">Eet binnenkort</string> <string name="eatingsoon">Eet binnenkort</string>
<string name="edit_base_basal">Verander basaal patroon</string> <string name="edit_base_basal">Verander basaal patroon</string>
@ -306,7 +306,7 @@
<string name="nsclientinternal_url">URL:</string> <string name="nsclientinternal_url">URL:</string>
<string name="nsclientinternal_url_dialogmessage">Nightscout URL ingeven</string> <string name="nsclientinternal_url_dialogmessage">Nightscout URL ingeven</string>
<string name="nsclientinternal_url_title">Nightscout URL</string> <string name="nsclientinternal_url_title">Nightscout URL</string>
<string name="nsprofileview_target_label">Doelstelling</string> <string name="nsprofileview_target_label">Streefdoel</string>
<string name="nsprofileview_isf_label">ISF</string> <string name="nsprofileview_isf_label">ISF</string>
<string name="nsclientinternal_secret_dialogtitle">NS API geheim</string> <string name="nsclientinternal_secret_dialogtitle">NS API geheim</string>
<string name="danar_invalidinput">Verkeerde ingave</string> <string name="danar_invalidinput">Verkeerde ingave</string>
@ -341,13 +341,13 @@
<string name="nightscout">Nightscout</string> <string name="nightscout">Nightscout</string>
<string name="ok">Ok</string> <string name="ok">Ok</string>
<string name="danar_stats_basalrate">Basaal</string> <string name="danar_stats_basalrate">Basaal</string>
<string name="loopdisabled">Loop gedeactiveerd door beperkingen</string> <string name="loopdisabled">Loop gedeactiveerd door doelen tab</string>
<string name="loopmenu">Loop menu</string> <string name="loopmenu">Loop menu</string>
<string name="loopsuperbolusfor" formatted="false">Superbolus (%d m)</string> <string name="loopsuperbolusfor" formatted="false">Superbolus (%d m)</string>
<string name="loopsuspended">Loop pauzeren</string> <string name="loopsuspended">Loop pauzeren</string>
<string name="loopsuspendedfor" formatted="false">Pauzeer (%d m)</string> <string name="loopsuspendedfor" formatted="false">Pauzeer (%d m)</string>
<string name="lowbattery">Batterij bijna leeg</string> <string name="lowbattery">Batterij bijna leeg</string>
<string name="manual">Maneel</string> <string name="manual">Manueel</string>
<string name="mdi">MDI</string> <string name="mdi">MDI</string>
<string name="mdtp_cancel">Afbreken</string> <string name="mdtp_cancel">Afbreken</string>
<string name="mdtp_ok">OK</string> <string name="mdtp_ok">OK</string>
@ -430,17 +430,17 @@
<string name="duration">Periode</string> <string name="duration">Periode</string>
<string name="openapsma_scriptdebugdata_label">Script debug</string> <string name="openapsma_scriptdebugdata_label">Script debug</string>
<string name="openapsma_mealdata_label">Maaltijd gegevens</string> <string name="openapsma_mealdata_label">Maaltijd gegevens</string>
<string name="nsprofileview_units_label">éénheid</string> <string name="nsprofileview_units_label">Eénheid</string>
<string name="objectives">Doelen</string> <string name="objectives">Doelen</string>
<string name="objectives_0_gate">Controleren dat BG beschikbaar is op Nightscout en dat de insulinepomp data is geupload</string> <string name="objectives_0_gate">Controleren van beschikbaarheid BG en insuline pomp data op Nightscout</string>
<string name="objectives_0_objective">Opzetten van visualisatie en monitoring eveneens onalyze van basaal en ratio\'s</string> <string name="objectives_0_objective">Opzetten van visualisatie en monitoring eveneens analyze van basaal en ratio\'s</string>
<string name="objectives_1_gate">Werking in Open Loop modus voor enkele dagen, manueel vele tijdelijke basalen instellen</string> <string name="objectives_1_gate">In Open Loop modus werken voor enkele dagen, manueel tijdelijke basaal instellen</string>
<string name="objectives_1_objective">Starten met de Open Loop modus</string> <string name="objectives_1_objective">Starten met de Open Loop modus</string>
<string name="objectives_2_gate">Gebaseerd op deze ervarinegen beslissen wat het maximale basaal mag zijn en dit in de pomp instellen</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_2_objective">De Open Loop begrijpen, inclusief de voorgestelde tijdelijke basalen</string> <string name="objectives_2_objective">De Open Loop begrijpen, inclusief de voorgestelde tijdelijke basalen</string>
<string name="objectives_3_gate">In gesloten Loop werken met een max. IOB = 0 voor enkele dagen met een beperkt aantal LBG</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_3_objective">Starten met gesloten Loop met lage glucose begrenzing</string> <string name="objectives_3_objective">Starten met closed Loop met bescherming tegen lage BG</string>
<string name="objectives_4_gate">Gebruik enkele dagen en ten miinste 1 naght zonder een laag BG alarm voordat je je BG doel laat dalen</string> <string name="objectives_4_gate">Verhoog max. IOB en test enkele dagen alsook minstens 1 nacht zonder een laag BG alarm voordat je jouw BG doel laat dalen</string>
<string name="objectives_bgavailableinns">BG beschikbaar op NS</string> <string name="objectives_bgavailableinns">BG beschikbaar op NS</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_5_objective">Pas het basaal en de ratios aan indien nodig, activeer hierna de auto-sens optie</string>
<string name="openapsma_run">Bereken nu</string> <string name="openapsma_run">Bereken nu</string>
@ -627,7 +627,7 @@
<string name="openapsama_autosens_min_summary">Standaard waarde: 0.7 Dit is de andere kan van de autosens veiligheid limiet. Dit zet een limiet op hoe laag het basaal kan aangepast worden, en hoe hoog het ISF en het BG doel</string> <string name="openapsama_autosens_min_summary">Standaard waarde: 0.7 Dit is de andere kan van de autosens veiligheid limiet. Dit zet een limiet op hoe laag het basaal kan aangepast worden, en hoe hoog het ISF en het BG doel</string>
<string name="openapsama_bolussnooze_dia_divisor_summary">Standaard waarde: 2 Bolus snooze is actief nadat je een maaltijd bolus toegediend hebt, zodat de loop geen tegenvoorstel met een verlaagd tijdelijk basaal doet nadat je gegeten hebt. Het voorbeeld hier van van standaard 2; dus een 3 u DIA betekent dat de bolus snooze gemiddeld 1.5u actief is (3DIA/2).</string> <string name="openapsama_bolussnooze_dia_divisor_summary">Standaard waarde: 2 Bolus snooze is actief nadat je een maaltijd bolus toegediend hebt, zodat de loop geen tegenvoorstel met een verlaagd tijdelijk basaal doet nadat je gegeten hebt. Het voorbeeld hier van van standaard 2; dus een 3 u DIA betekent dat de bolus snooze gemiddeld 1.5u actief is (3DIA/2).</string>
<string name="openapsama_current_basal_safety_multiplier_summary">Standaard waarde: 4 Dit is een combinatie van enerzijds het OpenAPS veiligheid limieten en anderzijds van “3 x max dagelijks basaal ; 4x actueel”. Dit betekent dat het basaal niet hoger kan ingesteld worden dan het ingestelde nummer keer het actueel basaal waarbij de limiet in de pomp geen invloed heeft.Dit is een veiligheidsmaatregel om te vermijden dat patiënten in gevaarlijke laag bereik komen zonder te snappen hoe het algoritme werkt. Nogmaals de standaard waarde is 4x; de meeste zullen deze waarde nooit moeten aanpassen maar zullen eerder andere waardes moeten aanpassen als ze tegen een limiet aanstoten.</string> <string name="openapsama_current_basal_safety_multiplier_summary">Standaard waarde: 4 Dit is een combinatie van enerzijds het OpenAPS veiligheid limieten en anderzijds van “3 x max dagelijks basaal ; 4x actueel”. Dit betekent dat het basaal niet hoger kan ingesteld worden dan het ingestelde nummer keer het actueel basaal waarbij de limiet in de pomp geen invloed heeft.Dit is een veiligheidsmaatregel om te vermijden dat patiënten in gevaarlijke laag bereik komen zonder te snappen hoe het algoritme werkt. Nogmaals de standaard waarde is 4x; de meeste zullen deze waarde nooit moeten aanpassen maar zullen eerder andere waardes moeten aanpassen als ze tegen een limiet aanstoten.</string>
<string name="objectives_5_gate">1 week succesvol loop gedurende de dag met geregeld KH ingave</string> <string name="objectives_5_gate">Gedurende 1 week succesvol closed loop met KH ingave</string>
<string name="syncprofiletopump_title">Synchroniseer profiel met de pomp</string> <string name="syncprofiletopump_title">Synchroniseer profiel met de pomp</string>
<string name="careportal_activity_label">ACTIVITIJD &amp; FEEDBACK</string> <string name="careportal_activity_label">ACTIVITIJD &amp; FEEDBACK</string>
<string name="danar_model" formatted="false">Model: %02X Protokoll: %02X Code: %02X</string> <string name="danar_model" formatted="false">Model: %02X Protokoll: %02X Code: %02X</string>

View file

@ -42,6 +42,7 @@
<string name="treatments_newtreatment_insulinamount_label">Insulin</string> <string name="treatments_newtreatment_insulinamount_label">Insulin</string>
<string name="treatments_newtreatment_carbsamount_label">Carbs</string> <string name="treatments_newtreatment_carbsamount_label">Carbs</string>
<string name="treatments_wizard_bg_label">BG</string> <string name="treatments_wizard_bg_label">BG</string>
<string name="treatments_wizard_tt_label">TT</string>
<string name="treatments_wizard_carbs_label">Carbs</string> <string name="treatments_wizard_carbs_label">Carbs</string>
<string name="treatments_wizard_correction_label">Corr</string> <string name="treatments_wizard_correction_label">Corr</string>
<string name="treatments_wizard_unit_label">U</string> <string name="treatments_wizard_unit_label">U</string>
@ -720,5 +721,10 @@
<string name="key_danars_bolusspeed">danars_bolusspeed</string> <string name="key_danars_bolusspeed">danars_bolusspeed</string>
<string name="danar_setbasalstep001">Set basal step to 0.01 U/h</string> <string name="danar_setbasalstep001">Set basal step to 0.01 U/h</string>
<string name="serialnumber">Serial number</string> <string name="serialnumber">Serial number</string>
<string name="key_wizard_include_bg">wizard_include_bg</string>
<string name="key_wizard_include_cob">wizard_include_cob</string>
<string name="key_wizard_include_trend_bg">wizard_include_trend_bg</string>
<string name="key_wizard_include_bolus_iob">wizard_include_bolus_iob</string>
<string name="key_wizard_include_basal_iob">wizard_include_basal_iob</string>
</resources> </resources>