public double getDg_slope(){ if(dg_mgdl != 0) return dg_slope; if(calculated_value_slope !=0) return calculated_value_slope; return currentSlope(); }
public double getDg_slope(){ if(dg_mgdl != 0) return dg_slope; if(calculated_value_slope !=0) return calculated_value_slope; return currentSlope(); }
public double getDg_slope(){ if(dg_mgdl != 0) return dg_slope; if(calculated_value_slope !=0) return calculated_value_slope; return currentSlope(); }
public static double currentSlope() { return currentSlope(Home.get_follower()); }
public static double currentSlope() { return currentSlope(Home.get_follower()); }
public static double currentSlope() { return currentSlope(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); }
double value = BgReading.currentSlope() * 5*60*1000;
private void populateV1APIBGEntry(JSONArray array, BgReading record) throws Exception { JSONObject json = new JSONObject(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US); format.setTimeZone(TimeZone.getDefault()); json.put("device", getDeviceString(record)); if (record != null) {//KS json.put("date", record.timestamp); json.put("dateString", format.format(record.timestamp)); if(prefs.getBoolean("cloud_storage_api_use_best_glucose", false)){ json.put("sgv", (int) record.getDg_mgdl()); json.put("delta", new BigDecimal(record.getDg_slope() * 5 * 60 * 1000).setScale(3, BigDecimal.ROUND_HALF_UP)); json.put("direction", record.getDg_deltaName()); } else { json.put("sgv", (int) record.calculated_value); json.put("delta", new BigDecimal(record.currentSlope() * 5 * 60 * 1000).setScale(3, BigDecimal.ROUND_HALF_UP)); // jamorham for automation json.put("direction", record.slopeName()); } json.put("type", "sgv"); json.put("filtered", record.ageAdjustedFiltered() * 1000); json.put("unfiltered", record.usedRaw() * 1000); json.put("rssi", 100); json.put("noise", record.noiseValue()); json.put("sysTime", format.format(record.timestamp)); array.put(json); } else Log.e(TAG, "doRESTUploadTo BG record is null."); }
private void populateV1APIBGEntry(JSONArray array, BgReading record) throws Exception { JSONObject json = new JSONObject(); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US); format.setTimeZone(TimeZone.getDefault()); json.put("device", getDeviceString(record)); if (record != null) {//KS json.put("date", record.timestamp); json.put("dateString", format.format(record.timestamp)); if(prefs.getBoolean("cloud_storage_api_use_best_glucose", false)){ json.put("sgv", (int) record.getDg_mgdl()); json.put("delta", new BigDecimal(record.getDg_slope() * 5 * 60 * 1000).setScale(3, BigDecimal.ROUND_HALF_UP)); json.put("direction", record.getDg_deltaName()); } else { json.put("sgv", (int) record.calculated_value); json.put("delta", new BigDecimal(record.currentSlope() * 5 * 60 * 1000).setScale(3, BigDecimal.ROUND_HALF_UP)); // jamorham for automation json.put("direction", record.slopeName()); } json.put("type", "sgv"); json.put("filtered", record.ageAdjustedFiltered() * 1000); json.put("unfiltered", record.usedRaw() * 1000); json.put("rssi", 100); json.put("noise", record.noiseValue()); json.put("sysTime", format.format(record.timestamp)); array.put(json); } else Log.e(TAG, "doRESTUploadTo BG record is null."); }
bundle.putDouble(Intents.EXTRA_BG_SLOPE, BgReading.currentSlope()); if (bgReading.hide_slope) { bundle.putString(Intents.EXTRA_BG_SLOPE_NAME, "9"); // not sure if this is right but has been this way for a long time
bundle.putDouble(Intents.EXTRA_BG_SLOPE, BgReading.currentSlope()); if (bgReading.hide_slope) { bundle.putString(Intents.EXTRA_BG_SLOPE_NAME, "9"); // not sure if this is right but has been this way for a long time
bundle.putDouble(Intents.EXTRA_BG_SLOPE, BgReading.currentSlope()); if (bgReading.hide_slope) { bundle.putString(Intents.EXTRA_BG_SLOPE_NAME, "9"); // not sure if this is right but has been this way for a long time