public static boolean trendingToAlertEnd(Context context, boolean above) { // TODO: check if we are not in an UnclerTime. Log.d(TAG_ALERT, "trendingToAlertEnd called"); List<BgReading> latest = getXRecentPoints(3); if(latest == null) { Log.d(TAG_ALERT, "trendingToAlertEnd we don't have enough points from the last 15 minutes, returning false"); return false; } if(above == false) { // This is a low alert, we should be going up if((latest.get(0).calculated_value - latest.get(1).calculated_value > 4) || (latest.get(0).calculated_value - latest.get(2).calculated_value > 10)) { Log.d(TAG_ALERT, "trendingToAlertEnd returning true for low alert"); return true; } } else { // This is a high alert we should be heading down if((latest.get(1).calculated_value - latest.get(0).calculated_value > 4) || (latest.get(2).calculated_value - latest.get(0).calculated_value > 10)) { Log.d(TAG_ALERT, "trendingToAlertEnd returning true for high alert"); return true; } } Log.d(TAG_ALERT, "trendingToAlertEnd returning false, not in the right direction (or not fast enough)"); return false; }
public static boolean trendingToAlertEnd(Context context, boolean above) { // TODO: check if we are not in an UnclerTime. Log.d(TAG_ALERT, "trendingToAlertEnd called"); List<BgReading> latest = getXRecentPoints(3); if(latest == null) { Log.d(TAG_ALERT, "trendingToAlertEnd we don't have enough points from the last 15 minutes, returning false"); return false; } if(above == false) { // This is a low alert, we should be going up if((latest.get(0).calculated_value - latest.get(1).calculated_value > 4) || (latest.get(0).calculated_value - latest.get(2).calculated_value > 10)) { Log.d(TAG_ALERT, "trendingToAlertEnd returning true for low alert"); return true; } } else { // This is a high alert we should be heading down if((latest.get(1).calculated_value - latest.get(0).calculated_value > 4) || (latest.get(2).calculated_value - latest.get(0).calculated_value > 10)) { Log.d(TAG_ALERT, "trendingToAlertEnd returning true for high alert"); return true; } } Log.d(TAG_ALERT, "trendingToAlertEnd returning false, not in the right direction (or not fast enough)"); return false; }
public static boolean trendingToAlertEnd(Context context, boolean above) { // TODO: check if we are not in an UnclerTime. Log.d(TAG_ALERT, "trendingToAlertEnd called"); List<BgReading> latest = getXRecentPoints(3); if(latest == null) { Log.d(TAG_ALERT, "trendingToAlertEnd we don't have enough points from the last 15 minutes, returning false"); return false; } if(above == false) { // This is a low alert, we should be going up if((latest.get(0).calculated_value - latest.get(1).calculated_value > 4) || (latest.get(0).calculated_value - latest.get(2).calculated_value > 10)) { Log.d(TAG_ALERT, "trendingToAlertEnd returning true for low alert"); return true; } } else { // This is a high alert we should be heading down if((latest.get(1).calculated_value - latest.get(0).calculated_value > 4) || (latest.get(2).calculated_value - latest.get(0).calculated_value > 10)) { Log.d(TAG_ALERT, "trendingToAlertEnd returning true for high alert"); return true; } } Log.d(TAG_ALERT, "trendingToAlertEnd returning false, not in the right direction (or not fast enough)"); return false; }
private static boolean checkForDropRiseAllert(float MaxSpeed, boolean drop) { Log.d(TAG_ALERT, "checkForDropRiseAllert called drop=" + drop); List<BgReading> latest = getXRecentPoints(4); if(latest == null) { Log.d(TAG_ALERT, "checkForDropRiseAllert we don't have enough points from the last 15 minutes, returning false");
private static boolean checkForDropRiseAllert(float MaxSpeed, boolean drop) { Log.d(TAG_ALERT, "checkForDropRiseAllert called drop=" + drop); List<BgReading> latest = getXRecentPoints(4); if(latest == null) { Log.d(TAG_ALERT, "checkForDropRiseAllert we don't have enough points from the last 15 minutes, returning false");
private static boolean checkForDropRiseAllert(float MaxSpeed, boolean drop) { Log.d(TAG_ALERT, "checkForDropRiseAllert called drop=" + drop); List<BgReading> latest = getXRecentPoints(4); if(latest == null) { Log.d(TAG_ALERT, "checkForDropRiseAllert we don't have enough points from the last 15 minutes, returning false");