Merge branch 'virtual_pump_Bug863' of github.com:andyrozman/AndroidAPS into virtual_pump_Bug863

This commit is contained in:
Andy Rozman 2018-08-09 15:16:13 +01:00
commit e62fbfb189
2 changed files with 8 additions and 5 deletions

View file

@ -4,6 +4,8 @@ package info.nightscout.androidaps.plugins.PumpCommon.defs;
import java.util.HashMap;
import java.util.Map;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.PumpCommon.data.DoseSettings;
@ -272,18 +274,21 @@ public enum PumpType {
}
public String getFullDescription(String i18nTemplate) {
public String getFullDescription(String i18nTemplate, boolean hasExtendedBasals) {
String unit = getPumpTempBasalType()==PumpTempBasalType.Percent ? "%" : "";
DoseSettings eb = getExtendedBolusSettings();
DoseSettings tbr = getTbrSettings();
String extendedNote = hasExtendedBasals ? MainApp.gs(R.string.virtualpump_pump_def_extended_note) : "";
return String.format(i18nTemplate, //
getStep("" + getBolusSize(), getSpecialBolusSize()), //
eb.getStep(), eb.getDurationStep(), eb.getMaxDuration()/60, //
getStep(getBaseBasalRange(), getBaseBasalSpecialSteps()), //
tbr.getMinDose() + unit + "-" + tbr.getMaxDose() + unit, tbr.getStep() + unit, tbr.getDurationStep(), tbr.getMaxDuration()/60);
tbr.getMinDose() + unit + "-" + tbr.getMaxDose() + unit, tbr.getStep() + unit,
tbr.getDurationStep(), tbr.getMaxDuration()/60, extendedNote);
}

View file

@ -113,10 +113,8 @@ public class VirtualPumpFragment extends SubscriberFragment {
String template = MainApp.gs(R.string.virtualpump_pump_def);
template = template.replace("EXTENDED_NOTE", pumpType.hasExtendedBasals() ? //
MainApp.gs(R.string.virtualpump_pump_def_extended_note) : "");
pumpSettingsView.setText(pumpType.getFullDescription(template));
pumpSettingsView.setText(pumpType.getFullDescription(template, pumpType.hasExtendedBasals()));
}
});