Merge pull request #2458 from sabsoubi/xDripStatusLineFixBgi

Fixed Bug that doesn't show COB if BGI disabled.
This commit is contained in:
Milos Kozak 2020-03-17 16:36:25 +01:00 committed by GitHub
commit 12612c2d1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,13 +202,13 @@ public class StatuslinePlugin extends PluginBase {
+ DecimalFormatter.to2Decimal(basalIob.basaliob) + ")";
}
if (!mPrefs.getBoolean("xdripstatus_showbgi", false)) {
return status;
// BGI
if (mPrefs.getBoolean("xdripstatus_showbgi", true)) {
double bgi = -(bolusIob.activity + basalIob.activity) * 5 * Profile.fromMgdlToUnits(profile.getIsfMgdl(), ProfileFunctions.getSystemUnits());
status += " " + ((bgi >= 0) ? "+" : "") + DecimalFormatter.to2Decimal(bgi);
}
double bgi = -(bolusIob.activity + basalIob.activity) * 5 * Profile.fromMgdlToUnits(profile.getIsfMgdl(), ProfileFunctions.getSystemUnits());
status += " " + ((bgi >= 0) ? "+" : "") + DecimalFormatter.to2Decimal(bgi);
/* COB */
status += " " + IobCobCalculatorPlugin.getPlugin().getCobInfo(false, "StatuslinePlugin").generateCOBString();
return status;