Revert "NewCarbsDialog: prefill with carbsReq."

This reverts commit f8d022ba87.
This commit is contained in:
Johannes Mockenhaupt 2018-04-11 15:22:38 +02:00
parent f8d022ba87
commit 61cce65947
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -132,6 +132,9 @@ public class NewCarbsDialog extends DialogFragment implements OnClickListener, C
maxCarbs = MainApp.getConstraintChecker().getMaxCarbsAllowed().value(); 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 = view.findViewById(R.id.newcarbs_activity_tt);
startActivityTTCheckbox.setOnCheckedChangeListener(this); startActivityTTCheckbox.setOnCheckedChangeListener(this);
startEatingSoonTTCheckbox = view.findViewById(R.id.newcarbs_eating_soon_tt); 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 = view.findViewById(R.id.new_carbs_duration);
editDuration.setParams(0d, 0d, 10d, 1d, new DecimalFormat("0"), false, textWatcher); 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 = view.findViewById(R.id.newcarbs_plus1);
fav1Button.setOnClickListener(this); fav1Button.setOnClickListener(this);
fav1Button.setText(toSignedString(SP.getInt(R.string.key_carbs_button_increment_1, FAV1_DEFAULT))); fav1Button.setText(toSignedString(SP.getInt(R.string.key_carbs_button_increment_1, FAV1_DEFAULT)));