public static String minMaxCarbs(List<ProfileItem> myprofileItemList) { double carbsmin = 9999999; double carbsmax = -1; for (ProfileItem item : myprofileItemList) { if (item.carb_ratio > carbsmax) carbsmax = item.carb_ratio; if (item.carb_ratio < carbsmin) carbsmin = item.carb_ratio; } if (carbsmin == carbsmax) return JoH.qs(carbsmin, -1); return JoH.qs(carbsmin, -1) + " - " + JoH.qs(carbsmax, -1); }
public static String minMaxCarbs(List<ProfileItem> myprofileItemList) { double carbsmin = 9999999; double carbsmax = -1; for (ProfileItem item : myprofileItemList) { if (item.carb_ratio > carbsmax) carbsmax = item.carb_ratio; if (item.carb_ratio < carbsmin) carbsmin = item.carb_ratio; } if (carbsmin == carbsmax) return JoH.qs(carbsmin, -1); return JoH.qs(carbsmin, -1) + " - " + JoH.qs(carbsmax, -1); }
public static String minMaxSens(List<ProfileItem> myprofileItemList) { double sensmin = 9999999; double sensmax = -1; for (ProfileItem item : myprofileItemList) { if (item.sensitivity > sensmax) sensmax = item.sensitivity; if (item.sensitivity < sensmin) sensmin = item.sensitivity; } if (sensmin == sensmax) return JoH.qs(sensmin, -1); return JoH.qs(sensmin, -1) + " - " + JoH.qs(sensmax, -1); }
public static String minMaxSens(List<ProfileItem> myprofileItemList) { double sensmin = 9999999; double sensmax = -1; for (ProfileItem item : myprofileItemList) { if (item.sensitivity > sensmax) sensmax = item.sensitivity; if (item.sensitivity < sensmin) sensmin = item.sensitivity; } if (sensmin == sensmax) return JoH.qs(sensmin, -1); return JoH.qs(sensmin, -1) + " - " + JoH.qs(sensmax, -1); }
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { adjustmentFactor = 1 + ((progress - 25) * 0.02); adjustPercentage.setText(JoH.qs(adjustmentFactor * 100, 0) + "%"); }
private static void updateAdjustmentFactor(double factor) { adjustmentFactor = factor; adjustPercentage.setText(JoH.qs(adjustmentFactor * 100, 0) + "%"); int position = (int) ((adjustmentFactor - 1) / 0.02) + 25; adjustallSeekBar.setProgress(position > 0 ? position : 0); }
private static void updateAdjustmentFactor(double factor) { adjustmentFactor = factor; adjustPercentage.setText(JoH.qs(adjustmentFactor * 100, 0) + "%"); int position = (int) ((adjustmentFactor - 1) / 0.02) + 25; adjustallSeekBar.setProgress(position > 0 ? position : 0); }
public static String getReservoirString() { final double reservoir = getReservoir(); if (reservoir > -1) { return "\uD83D\uDCDF" + "" + JoH.qs(reservoir, 1) + "U "; } else { return ""; } }
public static String getReservoirString() { final double reservoir = getReservoir(); if (reservoir > -1) { return "\uD83D\uDCDF" + "" + JoH.qs(reservoir, 1) + "U "; } else { return ""; } }
public static String getBolusIoBString() { final double value = getBolusIoB(); if (value > -1) { // return "\u231B" + " " + JoH.qs(value, 1) + "U "; return "\u23F3" + "" + JoH.qs(value, 2) + "U "; } else { return ""; } }
public static String getBatteryString() { final double value = getBattery(); if (value > -1) { return "\uD83D\uDD0B" + "" + JoH.qs(value, 0) + "% "; } else { return ""; } }
public static String getBolusIoBString() { final double value = getBolusIoB(); if (value > -1) { // return "\u231B" + " " + JoH.qs(value, 1) + "U "; return "\u23F3" + "" + JoH.qs(value, 2) + "U "; } else { return ""; } }
private void setConnectionStatusFollower() { if (GcmListenerSvc.lastMessageReceived == 0) { connection_status.setText(getApplicationContext().getString(R.string.no_data)); } else { connection_status.setText((JoH.qs((JoH.ts() - GcmListenerSvc.lastMessageReceived) / 60000, 0)) + " mins ago"); } } private void setConnectionStatusWifiWixel() {
private void setConnectionStatusFollower() { if (GcmListenerSvc.lastMessageReceived == 0) { connection_status.setText(getApplicationContext().getString(R.string.no_data)); } else { connection_status.setText((JoH.qs((JoH.ts() - GcmListenerSvc.lastMessageReceived) / 60000, 0)) + " mins ago"); } } private void setConnectionStatusWifiWixel() {
private void setConnectionStatusFollower() { if (GcmListenerSvc.lastMessageReceived == 0) { connection_status.setText(safeGetContext().getString(R.string.no_data)); } else { connection_status.setText((JoH.qs((JoH.ts() - GcmListenerSvc.lastMessageReceived) / 60000, 0)) + " mins ago"); } }
private void setConnectionStatusFollower() { if (GcmListenerSvc.lastMessageReceived == 0) { connection_status.setText(safeGetContext().getString(R.string.no_data)); } else { connection_status.setText((JoH.qs((JoH.ts() - GcmListenerSvc.lastMessageReceived) / 60000, 0)) + " mins ago"); } }
static double getCarbsToRaiseByMmolBetweenTwoTimes(double mmol, double whennow, double whenthen) { double result = (getCarbsToRaiseByMmol(mmol, whennow) + getCarbsToRaiseByMmol(mmol, whenthen)) / 2; UserError.Log.d(TAG, "GetCarbsToRaiseByMmolBetweenTwoTimes: " + JoH.qs(mmol) + " result: " + JoH.qs(result)); return result; }
static double getCarbsToRaiseByMmolBetweenTwoTimes(double mmol, double whennow, double whenthen) { double result = (getCarbsToRaiseByMmol(mmol, whennow) + getCarbsToRaiseByMmol(mmol, whenthen)) / 2; UserError.Log.d(TAG, "GetCarbsToRaiseByMmolBetweenTwoTimes: " + JoH.qs(mmol) + " result: " + JoH.qs(result)); return result; }
public static void validateTargetRange() { final double default_target_glucose = tolerantParseDouble(Pref.getString("plus_target_range", Double.toString(5.5 / scale_factor))); if (default_target_glucose > tolerantParseDouble(Pref.getString("highValue", Double.toString(5.5 / scale_factor)))) { Pref.setString("plus_target_range", JoH.qs(default_target_glucose * Constants.MGDL_TO_MMOLL, 1)); UserError.Log.i(TAG, "Converted initial value of target glucose to mmol"); } }