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;
|
||||
}
|
||||
|
||||
public double getTargetUnits() {
|
||||
if (units.equals(Constants.MGDL)) {
|
||||
return getTargetMgdl(secondsFromMidnight());
|
||||
} else {
|
||||
return getTargetMmol(secondsFromMidnight());
|
||||
}
|
||||
}
|
||||
|
||||
public double getTargetMgdl() {
|
||||
return getTargetMgdl(secondsFromMidnight());
|
||||
}
|
||||
|
||||
public double getTargetMmol() {
|
||||
return getTargetMmol(secondsFromMidnight());
|
||||
}
|
||||
|
||||
public double getTargetMgdl(int timeAsSeconds) {
|
||||
return toMgdl((getTargetLowTimeFromMidnight(timeAsSeconds) + getTargetHighTimeFromMidnight(timeAsSeconds)) / 2, units);
|
||||
}
|
||||
public double getTargetMmol(int timeAsSeconds) {
|
||||
return toMmol((getTargetLowTimeFromMidnight(timeAsSeconds) + getTargetHighTimeFromMidnight(timeAsSeconds)) / 2, units);
|
||||
}
|
||||
|
||||
public double getTargetLowMgdl() {
|
||||
return toMgdl(getTargetLowTimeFromMidnight(secondsFromMidnight()), units);
|
||||
|
|
Loading…
Reference in a new issue