convert target values to mdgl before passing to openaps

This commit is contained in:
Milos Kozak 2017-08-05 18:14:10 +02:00
parent e295c8a2dc
commit 4fda4fd547
2 changed files with 4 additions and 4 deletions

View file

@ -160,8 +160,8 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
double maxIob = SP.getDouble("openapsma_max_iob", 1.5d);
double maxBasal = SP.getDouble("openapsma_max_basal", 1d);
double minBg = profile.getTargetLow();
double maxBg = profile.getTargetHigh();
double minBg = Profile.toMgdl(profile.getTargetLow(), units);
double maxBg = Profile.toMgdl(profile.getTargetHigh(), units);
double targetBg = (minBg + maxBg) / 2;
minBg = Round.roundTo(minBg, 0.1d);

View file

@ -160,8 +160,8 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
double maxIob = SP.getDouble("openapsma_max_iob", 1.5d);
double maxBasal = SafeParse.stringToDouble(SP.getString("openapsma_max_basal", "1"));
double minBg = profile.getTargetLow();
double maxBg = profile.getTargetHigh();
double minBg = Profile.toMgdl(profile.getTargetLow(), units);
double maxBg = Profile.toMgdl(profile.getTargetHigh(), units);
double targetBg = (minBg + maxBg) / 2;
minBg = Round.roundTo(minBg, 0.1d);