public static double currentSlope(boolean is_follower) { List<BgReading> last_2 = BgReading.latest(2, is_follower); if ((last_2 != null) && (last_2.size() == 2)) { double slope = calculateSlope(last_2.get(0), last_2.get(1)); return slope; } else { return 0d; } }
public static double currentSlope(boolean is_follower) { List<BgReading> last_2 = BgReading.latest(2, is_follower); if ((last_2 != null) && (last_2.size() == 2)) { double slope = calculateSlope(last_2.get(0), last_2.get(1)); return slope; } else { return 0d; } }
public static double currentSlope(boolean is_follower) { List<BgReading> last_2 = BgReading.latest(2, is_follower); if ((last_2 != null) && (last_2.size() == 2)) { double slope = calculateSlope(last_2.get(0), last_2.get(1)); return slope; } else { return 0d; } }
public void find_slope() { List<BgReading> last_2 = BgReading.latest(2); // FYI: By default, assertions are disabled at runtime. Add "-ea" to commandline to enable. // https://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html assert last_2.get(0).uuid.equals(this.uuid) : "Invariant condition not fulfilled: calculating slope and current reading wasn't saved before"; if ((last_2 != null) && (last_2.size() == 2)) { calculated_value_slope = calculateSlope(this, last_2.get(1)); save(); } else if ((last_2 != null) && (last_2.size() == 1)) { calculated_value_slope = 0; save(); } else { if (JoH.ratelimit("no-bg-couldnt-find-slope", 15)) { Log.w(TAG, "NO BG? COULDNT FIND SLOPE!"); } } }
public void find_slope() { List<BgReading> last_2 = BgReading.latest(2); // FYI: By default, assertions are disabled at runtime. Add "-ea" to commandline to enable. // https://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html assert last_2.get(0).uuid.equals(this.uuid) : "Invariant condition not fulfilled: calculating slope and current reading wasn't saved before"; if ((last_2 != null) && (last_2.size() == 2)) { calculated_value_slope = calculateSlope(this, last_2.get(1)); save(); } else if ((last_2 != null) && (last_2.size() == 1)) { calculated_value_slope = 0; save(); } else { if (JoH.ratelimit("no-bg-couldnt-find-slope", 15)) { Log.w(TAG, "NO BG? COULDNT FIND SLOPE!"); } } }
public void find_slope() { List<BgReading> last_2 = BgReading.latest(2); // FYI: By default, assertions are disabled at runtime. Add "-ea" to commandline to enable. // https://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html assert last_2.get(0).uuid.equals(this.uuid) : "Invariant condition not fulfilled: calculating slope and current reading wasn't saved before"; if ((last_2 != null) && (last_2.size() == 2)) { calculated_value_slope = calculateSlope(this, last_2.get(1)); save(); } else if ((last_2 != null) && (last_2.size() == 1)) { calculated_value_slope = 0; save(); } else { if (JoH.ratelimit("no-bg-couldnt-find-slope", 15)) { Log.w(TAG, "NO BG? COULDNT FIND SLOPE!"); } } }