Add required functions
This commit is contained in:
parent
cbf830353c
commit
9fc84dbeeb
1 changed files with 15 additions and 0 deletions
|
@ -523,13 +523,28 @@ public class Profile {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getTargetUnits() {
|
||||||
|
if (units.equals(Constants.MGDL)) {
|
||||||
|
return getTargetMgdl(secondsFromMidnight());
|
||||||
|
} else {
|
||||||
|
return getTargetMmol(secondsFromMidnight());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public double getTargetMgdl() {
|
public double getTargetMgdl() {
|
||||||
return getTargetMgdl(secondsFromMidnight());
|
return getTargetMgdl(secondsFromMidnight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getTargetMmol() {
|
||||||
|
return getTargetMmol(secondsFromMidnight());
|
||||||
|
}
|
||||||
|
|
||||||
public double getTargetMgdl(int timeAsSeconds) {
|
public double getTargetMgdl(int timeAsSeconds) {
|
||||||
return toMgdl((getTargetLowTimeFromMidnight(timeAsSeconds) + getTargetHighTimeFromMidnight(timeAsSeconds)) / 2, units);
|
return toMgdl((getTargetLowTimeFromMidnight(timeAsSeconds) + getTargetHighTimeFromMidnight(timeAsSeconds)) / 2, units);
|
||||||
}
|
}
|
||||||
|
public double getTargetMmol(int timeAsSeconds) {
|
||||||
|
return toMmol((getTargetLowTimeFromMidnight(timeAsSeconds) + getTargetHighTimeFromMidnight(timeAsSeconds)) / 2, units);
|
||||||
|
}
|
||||||
|
|
||||||
public double getTargetLowMgdl() {
|
public double getTargetLowMgdl() {
|
||||||
return toMgdl(getTargetLowTimeFromMidnight(secondsFromMidnight()), units);
|
return toMgdl(getTargetLowTimeFromMidnight(secondsFromMidnight()), units);
|
||||||
|
|
Loading…
Reference in a new issue