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 Long getUnclearTime(Long interstingTime) { List<BgReading> latest = BgReading.latest((interstingTime.intValue() + MAX_INFLUANCE)/ 60000 /5 ); if (latest == null) { return 0L; } final Long now = new Date().getTime(); return getUnclearTimeHelper(latest, interstingTime, now); }
public static Long getUnclearTime(Long interstingTime) { List<BgReading> latest = BgReading.latest((interstingTime.intValue() + MAX_INFLUANCE)/ 60000 /5 ); if (latest == null) { return 0L; } final Long now = new Date().getTime(); return getUnclearTimeHelper(latest, interstingTime, now); }
public static Long getUnclearTime(Long interstingTime) { List<BgReading> latest = BgReading.latest((interstingTime.intValue() + MAX_INFLUANCE)/ 60000 /5 ); if (latest == null) { return 0L; } final Long now = new Date().getTime(); return getUnclearTimeHelper(latest, interstingTime, now); }
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 List<BgReading> latest(int number) { return latest(number, Home.get_follower()); }
public static List<BgReading> latest(int number) { return latest(number, Home.get_follower()); }
public static List<BgReading> latest(int number) { return latest(number, Home.get_follower()); }
public static String unitizedDeltaString(boolean showUnit, boolean highGranularity, boolean is_follower, boolean doMgdl) { List<BgReading> last2 = BgReading.latest(2,is_follower); if (last2.size() < 2 || last2.get(0).timestamp - last2.get(1).timestamp > 20 * 60 * 1000) { // don't show delta if there are not enough values or the values are more than 20 mintes apart return "???"; } double value = BgReading.currentSlope(is_follower) * 5 * 60 * 1000; return unitizedDeltaStringRaw(showUnit, highGranularity, value, doMgdl); }
public static String unitizedDeltaString(boolean showUnit, boolean highGranularity, boolean is_follower, boolean doMgdl) { List<BgReading> last2 = BgReading.latest(2,is_follower); if (last2.size() < 2 || last2.get(0).timestamp - last2.get(1).timestamp > 20 * 60 * 1000) { // don't show delta if there are not enough values or the values are more than 20 mintes apart return "???"; } double value = BgReading.currentSlope(is_follower) * 5 * 60 * 1000; return unitizedDeltaStringRaw(showUnit, highGranularity, value, doMgdl); }
public static String unitizedDeltaString(boolean showUnit, boolean highGranularity, boolean is_follower, boolean doMgdl) { List<BgReading> last2 = BgReading.latest(2,is_follower); if (last2.size() < 2 || last2.get(0).timestamp - last2.get(1).timestamp > 20 * 60 * 1000) { // don't show delta if there are not enough values or the values are more than 20 mintes apart return "???"; } double value = BgReading.currentSlope(is_follower) * 5 * 60 * 1000; return unitizedDeltaStringRaw(showUnit, highGranularity, value, doMgdl); }
public static String unitizedDeltaString(boolean showUnit, boolean highGranularity, boolean is_follower, boolean doMgdl) { List<BgReading> last2 = BgReading.latest(2,is_follower); if (last2.size() < 2 || last2.get(0).timestamp - last2.get(1).timestamp > 20 * 60 * 1000) { // don't show delta if there are not enough values or the values are more than 20 mintes apart return "???"; } double value = BgReading.currentSlope(is_follower) * 5 * 60 * 1000; return unitizedDeltaStringRaw(showUnit, highGranularity, value, doMgdl); }
public static String unitizedDeltaString(boolean showUnit, boolean highGranularity, boolean is_follower, boolean doMgdl) { List<BgReading> last2 = BgReading.latest(2,is_follower); if (last2.size() < 2 || last2.get(0).timestamp - last2.get(1).timestamp > 20 * 60 * 1000) { // don't show delta if there are not enough values or the values are more than 20 mintes apart return "???"; } double value = BgReading.currentSlope(is_follower) * 5 * 60 * 1000; return unitizedDeltaStringRaw(showUnit, highGranularity, value, doMgdl); }
public static String unitizedDeltaString(boolean showUnit, boolean highGranularity, boolean is_follower, boolean doMgdl) { List<BgReading> last2 = BgReading.latest(2,is_follower); if (last2.size() < 2 || last2.get(0).timestamp - last2.get(1).timestamp > 20 * 60 * 1000) { // don't show delta if there are not enough values or the values are more than 20 mintes apart return "???"; } double value = BgReading.currentSlope(is_follower) * 5 * 60 * 1000; return unitizedDeltaStringRaw(showUnit, highGranularity, value, doMgdl); }
private void getData() { final List<BgReading> latest = BgReading.latest(5000); ListAdapter adapter = new BgReadingAdapter(this, latest); this.setListAdapter(adapter); }
private void getData() { final List<BgReading> latest = BgReading.latest(5000); ListAdapter adapter = new BgReadingAdapter(this, latest); this.setListAdapter(adapter); }
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!"); } } }