private void addBgReadingValues() { addBgReadingValues(true); }
private void addBgReadingValues() { addBgReadingValues(true); }
private void addBgReadingValues(final boolean simple) {//KS TODO Add Noise, Momentum Trend implmentation addBgReadingValues(); }
public static synchronized void refreshNoiseIfOlderThan(long timestamp) { if (noise_processed_till_timestamp < timestamp) { Log.d(TAG, "Refreshing Noise as Older: " + JoH.dateTimeText((long) noise_processed_till_timestamp) + " vs " + JoH.dateTimeText(timestamp)); // new only the last hour worth of data for this, simple mode should work for this calculation (new BgGraphBuilder(xdrip.getAppContext(), System.currentTimeMillis() - 60 * 60 * 1000, System.currentTimeMillis() + 5 * 60 * 1000, 24, true)).addBgReadingValues(true); } }
public static synchronized void refreshNoiseIfOlderThan(long timestamp) { if (noise_processed_till_timestamp < timestamp) { Log.d(TAG, "Refreshing Noise as Older: " + JoH.dateTimeText((long) noise_processed_till_timestamp) + " vs " + JoH.dateTimeText(timestamp)); // new only the last hour worth of data for this, simple mode should work for this calculation (new BgGraphBuilder(xdrip.getAppContext(), System.currentTimeMillis() - 60 * 60 * 1000, System.currentTimeMillis() + 5 * 60 * 1000, 24, true)).addBgReadingValues(true); } }
public static synchronized double getCurrentLowOccursAt() { try { final long last_bg_reading_timestamp = BgReading.last().timestamp; // TODO remove any duplication by using refreshNoiseIfOlderThan() if (low_occurs_at_processed_till_timestamp < last_bg_reading_timestamp) { Log.d(TAG, "Recalculating lowOccursAt: " + JoH.dateTimeText((long) low_occurs_at_processed_till_timestamp) + " vs " + JoH.dateTimeText(last_bg_reading_timestamp)); // new only the last hour worth of data for this (new BgGraphBuilder(xdrip.getAppContext(), System.currentTimeMillis() - 60 * 60 * 1000, System.currentTimeMillis() + 5 * 60 * 1000, 24, true)).addBgReadingValues(false); } else { Log.d(TAG, "Cached current low timestamp ok: " + JoH.dateTimeText((long) low_occurs_at_processed_till_timestamp) + " vs " + JoH.dateTimeText(last_bg_reading_timestamp)); } } catch (Exception e) { Log.e(TAG, "Got exception in getCurrentLowOccursAt() " + e); } return low_occurs_at; }
public static synchronized double getCurrentLowOccursAt() { try { final long last_bg_reading_timestamp = BgReading.last().timestamp; // TODO remove any duplication by using refreshNoiseIfOlderThan() if (low_occurs_at_processed_till_timestamp < last_bg_reading_timestamp) { Log.d(TAG, "Recalculating lowOccursAt: " + JoH.dateTimeText((long) low_occurs_at_processed_till_timestamp) + " vs " + JoH.dateTimeText(last_bg_reading_timestamp)); // new only the last hour worth of data for this (new BgGraphBuilder(xdrip.getAppContext(), System.currentTimeMillis() - 60 * 60 * 1000, System.currentTimeMillis() + 5 * 60 * 1000, 24, true)).addBgReadingValues(false); } else { Log.d(TAG, "Cached current low timestamp ok: " + JoH.dateTimeText((long) low_occurs_at_processed_till_timestamp) + " vs " + JoH.dateTimeText(last_bg_reading_timestamp)); } } catch (Exception e) { Log.e(TAG, "Got exception in getCurrentLowOccursAt() " + e); } return low_occurs_at; }
public List<Line> defaultLines() { addBgReadingValues(); List<Line> lines = new ArrayList<Line>(); Line[] calib = calibrationValuesLine(); lines.add(calib[0]); // white circle of calib in background lines.add(minShowLine()); lines.add(maxShowLine()); lines.add(highLine()); lines.add(lowLine()); if (prefs.getBoolean("show_filtered_curve", false)) { final ArrayList<Line> filtered_lines = filteredLines(); for (Line thisline : filtered_lines) { lines.add(thisline); } } // these last entries cannot be moved if // the point size change in previewLineData is to work lines.add(inRangeValuesLine()); lines.add(lowValuesLine()); lines.add(highValuesLine()); lines.add(rawInterpretedLine()); lines.add(calib[1]); // red dot of calib in foreground return lines; }
try { addBgReadingValues(simple);
try { addBgReadingValues(simple);
public static synchronized double getCurrentLowOccursAt() {//KS TODO implement low predictions try { final long last_bg_reading_timestamp = BgReading.last().timestamp; if (low_occurs_at_processed_till_timestamp < last_bg_reading_timestamp) { Log.d(TAG, "Recalculating lowOccursAt: " + JoH.dateTimeText((long) low_occurs_at_processed_till_timestamp) + " vs " + JoH.dateTimeText(last_bg_reading_timestamp)); // new only the last hour worth of data for this (new BgGraphBuilder(xdrip.getAppContext(), System.currentTimeMillis() - 60 * 60 * 1000, System.currentTimeMillis() + 5 * 60 * 1000, 24, true)).addBgReadingValues(false); } else { Log.d(TAG, "Cached current low timestamp ok: " + JoH.dateTimeText((long) low_occurs_at_processed_till_timestamp) + " vs " + JoH.dateTimeText(last_bg_reading_timestamp)); } } catch (Exception e) { Log.e(TAG, "Got exception in getCurrentLowOccursAt() " + e); } return low_occurs_at; }