Merge branch 'virtual_pump_Bug863' of github.com:andyrozman/AndroidAPS into virtual_pump_Bug863
This commit is contained in:
commit
e62fbfb189
2 changed files with 8 additions and 5 deletions
|
@ -4,6 +4,8 @@ package info.nightscout.androidaps.plugins.PumpCommon.defs;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import info.nightscout.androidaps.MainApp;
|
||||||
|
import info.nightscout.androidaps.R;
|
||||||
import info.nightscout.androidaps.plugins.PumpCommon.data.DoseSettings;
|
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 ? "%" : "";
|
String unit = getPumpTempBasalType()==PumpTempBasalType.Percent ? "%" : "";
|
||||||
|
|
||||||
DoseSettings eb = getExtendedBolusSettings();
|
DoseSettings eb = getExtendedBolusSettings();
|
||||||
DoseSettings tbr = getTbrSettings();
|
DoseSettings tbr = getTbrSettings();
|
||||||
|
|
||||||
|
String extendedNote = hasExtendedBasals ? MainApp.gs(R.string.virtualpump_pump_def_extended_note) : "";
|
||||||
|
|
||||||
return String.format(i18nTemplate, //
|
return String.format(i18nTemplate, //
|
||||||
getStep("" + getBolusSize(), getSpecialBolusSize()), //
|
getStep("" + getBolusSize(), getSpecialBolusSize()), //
|
||||||
eb.getStep(), eb.getDurationStep(), eb.getMaxDuration()/60, //
|
eb.getStep(), eb.getDurationStep(), eb.getMaxDuration()/60, //
|
||||||
getStep(getBaseBasalRange(), getBaseBasalSpecialSteps()), //
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -113,10 +113,8 @@ public class VirtualPumpFragment extends SubscriberFragment {
|
||||||
|
|
||||||
String template = MainApp.gs(R.string.virtualpump_pump_def);
|
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()));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue