Merge branch 'dev' into smb
This commit is contained in:
commit
01a93a35b9
1 changed files with 31 additions and 24 deletions
|
@ -908,6 +908,34 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
return;
|
||||
}
|
||||
|
||||
Double lowLine = SP.getDouble("low_mark", 0d);
|
||||
Double highLine = SP.getDouble("high_mark", 0d);
|
||||
|
||||
//Start with updating the BG as it is unaffected by loop.
|
||||
// **** BG value ****
|
||||
if (lastBG != null) {
|
||||
int color = MainApp.sResources.getColor(R.color.inrange);
|
||||
if (lastBG.valueToUnits(units) < lowLine)
|
||||
color = MainApp.sResources.getColor(R.color.low);
|
||||
else if (lastBG.valueToUnits(units) > highLine)
|
||||
color = MainApp.sResources.getColor(R.color.high);
|
||||
bgView.setText(lastBG.valueToUnitsToString(units));
|
||||
arrowView.setText(lastBG.directionToSymbol());
|
||||
bgView.setTextColor(color);
|
||||
arrowView.setTextColor(color);
|
||||
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
|
||||
if (glucoseStatus != null) {
|
||||
deltaView.setText("Δ " + Profile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units);
|
||||
if (avgdeltaView != null)
|
||||
avgdeltaView.setText("øΔ15m: " + Profile.toUnitsString(glucoseStatus.short_avgdelta, glucoseStatus.short_avgdelta * Constants.MGDL_TO_MMOLL, units) +
|
||||
" øΔ40m: " + Profile.toUnitsString(glucoseStatus.long_avgdelta, glucoseStatus.long_avgdelta * Constants.MGDL_TO_MMOLL, units));
|
||||
} else {
|
||||
deltaView.setText("Δ " + MainApp.sResources.getString(R.string.notavailable));
|
||||
if (avgdeltaView != null)
|
||||
avgdeltaView.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
// open loop mode
|
||||
final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun;
|
||||
if (Config.APS && MainApp.getConfigBuilder().getPumpDescription().isTempBasalCapable) {
|
||||
|
@ -1101,8 +1129,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
treatmentButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
Double lowLine = SP.getDouble("low_mark", 0d);
|
||||
Double highLine = SP.getDouble("high_mark", 0d);
|
||||
|
||||
if (lowLine < 1) {
|
||||
lowLine = Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units);
|
||||
}
|
||||
|
@ -1111,28 +1138,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
}
|
||||
|
||||
// **** BG value ****
|
||||
if (lastBG != null) {
|
||||
int color = MainApp.sResources.getColor(R.color.inrange);
|
||||
if (lastBG.valueToUnits(units) < lowLine)
|
||||
color = MainApp.sResources.getColor(R.color.low);
|
||||
else if (lastBG.valueToUnits(units) > highLine)
|
||||
color = MainApp.sResources.getColor(R.color.high);
|
||||
bgView.setText(lastBG.valueToUnitsToString(units));
|
||||
arrowView.setText(lastBG.directionToSymbol());
|
||||
bgView.setTextColor(color);
|
||||
arrowView.setTextColor(color);
|
||||
GlucoseStatus glucoseStatus = GlucoseStatus.getGlucoseStatusData();
|
||||
if (glucoseStatus != null) {
|
||||
deltaView.setText("Δ " + Profile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units);
|
||||
if (avgdeltaView != null)
|
||||
avgdeltaView.setText("øΔ15m: " + Profile.toUnitsString(glucoseStatus.short_avgdelta, glucoseStatus.short_avgdelta * Constants.MGDL_TO_MMOLL, units) +
|
||||
" øΔ40m: " + Profile.toUnitsString(glucoseStatus.long_avgdelta, glucoseStatus.long_avgdelta * Constants.MGDL_TO_MMOLL, units));
|
||||
} else {
|
||||
deltaView.setText("Δ " + MainApp.sResources.getString(R.string.notavailable));
|
||||
if (avgdeltaView != null)
|
||||
avgdeltaView.setText("");
|
||||
}
|
||||
} else {
|
||||
if (lastBG == null) { //left this here as it seems you want to exit at this point if it is null...
|
||||
|
||||
return;
|
||||
}
|
||||
Integer flag = bgView.getPaintFlags();
|
||||
|
|
Loading…
Reference in a new issue