From 61cce65947b980a1e2ca97f82a7f80e38889cb3a Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Wed, 11 Apr 2018 15:22:38 +0200 Subject: [PATCH] Revert "NewCarbsDialog: prefill with carbsReq." This reverts commit f8d022ba87cb7ca90412195d3c2df17403b1f54b. --- .../Overview/Dialogs/NewCarbsDialog.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java index 93ba7c9d81..1725fed14f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java @@ -132,6 +132,9 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, C maxCarbs = MainApp.getConstraintChecker().getMaxCarbsAllowed().value(); + editCarbs = view.findViewById(R.id.newcarb_carbsamount); + editCarbs.setParams(0d, 0d, (double) maxCarbs, 1d, new DecimalFormat("0"), false, textWatcher); + startActivityTTCheckbox = view.findViewById(R.id.newcarbs_activity_tt); startActivityTTCheckbox.setOnCheckedChangeListener(this); startEatingSoonTTCheckbox = view.findViewById(R.id.newcarbs_eating_soon_tt); @@ -147,22 +150,6 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, C editDuration = view.findViewById(R.id.new_carbs_duration); editDuration.setParams(0d, 0d, 10d, 1d, new DecimalFormat("0"), false, textWatcher); - editCarbs = view.findViewById(R.id.newcarb_carbsamount); - editCarbs.setParams(0d, 0d, (double) maxCarbs, 1d, new DecimalFormat("0"), false, textWatcher); - - if (MainApp.engineeringMode) { - // use SMB's carbs required as preset, check hypo TT if any - if (ConfigBuilderPlugin.getActiveAPS() != null && ConfigBuilderPlugin.getActiveAPS().getLastAPSResult() != null) { - APSResult lastAPSResult = ConfigBuilderPlugin.getActiveAPS().getLastAPSResult(); - if (lastAPSResult != null && lastAPSResult instanceof DetermineBasalResultSMB && ((DetermineBasalResultSMB) lastAPSResult).carbsReq > 0) { - editCarbs.setValue(((DetermineBasalResultSMB) lastAPSResult).carbsReq); - startHypoTTCheckbox.setOnCheckedChangeListener(null); - startHypoTTCheckbox.setChecked(true); - startHypoTTCheckbox.setOnClickListener(this); - } - } - } - fav1Button = view.findViewById(R.id.newcarbs_plus1); fav1Button.setOnClickListener(this); fav1Button.setText(toSignedString(SP.getInt(R.string.key_carbs_button_increment_1, FAV1_DEFAULT)));