Add required functions

This commit is contained in:
Tim Gunn 2020-05-21 00:09:31 +12:00
parent cbf830353c
commit 9fc84dbeeb
No known key found for this signature in database
GPG key ID: C9BC1E9D0D0AED8C

View file

@ -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);