diff --git a/app/build.gradle b/app/build.gradle index f800902ecd..24f609f8a9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -44,7 +44,7 @@ android { minSdkVersion 21 targetSdkVersion 23 versionCode 1500 - version "1.5f" + version "1.5g" buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "BUILDVERSION", generateGitBuild() } diff --git a/app/src/main/java/info/nightscout/androidaps/Constants.java b/app/src/main/java/info/nightscout/androidaps/Constants.java index 51f27d84a2..e361e4cc8c 100644 --- a/app/src/main/java/info/nightscout/androidaps/Constants.java +++ b/app/src/main/java/info/nightscout/androidaps/Constants.java @@ -33,14 +33,6 @@ public class Constants { public static final int CPP_MIN_PERCENTAGE = 50; public static final int CPP_MAX_PERCENTAGE = 200; - // Defaults for settings - public static final Double MAX_BG_DEFAULT_MGDL = 180d; - public static final Double MAX_BG_DEFAULT_MMOL = 10d; - public static final Double MIN_BG_DEFAULT_MGDL = 100d; - public static final Double MIN_BG_DEFAULT_MMOL = 5d; - public static final Double TARGET_BG_DEFAULT_MGDL = 150d; - public static final Double TARGET_BG_DEFAULT_MMOL = 7d; - // Very Hard Limits Ranges // First value is the Lowest and second value is the Highest a Limit can define public static final int[] VERY_HARD_LIMIT_MIN_BG = {72,180}; diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.java b/app/src/main/java/info/nightscout/androidaps/MainActivity.java index c4b93657d3..528cbd21bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.java @@ -36,6 +36,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import info.nightscout.androidaps.Services.AlarmSoundService; +import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.events.EventAppExit; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.events.EventRefreshGui; @@ -79,6 +80,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe Manifest.permission.WRITE_EXTERNAL_STORAGE}, CASE_STORAGE); } askForBatteryOptimizationPermission(); + checkUpgradeToProfileTarget(); if (Config.logFunctionCalls) log.debug("onCreate"); @@ -154,6 +156,29 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe } } + private void checkUpgradeToProfileTarget() { // TODO: can be removed in the future + boolean oldKeyExists = SP.contains("openapsma_min_bg"); + if (oldKeyExists) { + Profile profile = MainApp.getConfigBuilder().getProfile(); + String oldRange = SP.getDouble("openapsma_min_bg", 0d) + " - " + SP.getDouble("openapsma_max_bg", 0d); + String newRange = ""; + if (profile != null) { + newRange = profile.getTargetLow() + " - " + profile.getTargetHigh(); + } + String message = "Target range is changed in current version.\n\nIt's not taken from preferences but from profile.\n\n!!! REVIEW YOUR SETTINGS !!!"; + message += "\n\nOld settings: " + oldRange; + message += "\nProfile settings: " + newRange; + OKDialog.show(this, "Target range change", message, new Runnable() { + @Override + public void run() { + SP.remove("openapsma_min_bg"); + SP.remove("openapsma_max_bg"); + SP.remove("openapsma_target_bg"); + } + }); + } + } + //check for sms permission if enable in prefernces @Subscribe public void onStatusEvent(final EventPreferenceChange ev) { diff --git a/app/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.java b/app/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.java index 3ea93dd0b1..00a04df4c4 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.java +++ b/app/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.java @@ -28,5 +28,6 @@ public class DetailedBolusInfo { public JSONObject boluscalc = null; // additional bolus wizard info public Context context = null; // context for progress dialog public boolean addToTreatments = true; - public long pumpId = 0; // id of record if comming from pump history (not a newly created treatment) + public long pumpId = 0; // id of record if comming from pump history (not a newly created treatment) + public boolean isSMB = false; // is a Super-MicroBolus } diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java index cdcda5c229..21fc5a47a8 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -60,7 +60,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { public static final String DATABASE_CAREPORTALEVENTS = "CareportalEvents"; public static final String DATABASE_PROFILESWITCHES = "ProfileSwitches"; - private static final int DATABASE_VERSION = 7; + private static final int DATABASE_VERSION = 8; private static Long earliestDataChange = null; @@ -113,17 +113,23 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { @Override public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource, int oldVersion, int newVersion) { try { - log.info(DatabaseHelper.class.getName(), "onUpgrade"); - TableUtils.dropTable(connectionSource, TempTarget.class, true); - TableUtils.dropTable(connectionSource, Treatment.class, true); - TableUtils.dropTable(connectionSource, BgReading.class, true); - TableUtils.dropTable(connectionSource, DanaRHistoryRecord.class, true); - TableUtils.dropTable(connectionSource, DbRequest.class, true); - TableUtils.dropTable(connectionSource, TemporaryBasal.class, true); - TableUtils.dropTable(connectionSource, ExtendedBolus.class, true); - TableUtils.dropTable(connectionSource, CareportalEvent.class, true); - TableUtils.dropTable(connectionSource, ProfileSwitch.class, true); - onCreate(database, connectionSource); + if (oldVersion == 7 && newVersion == 8) { + log.debug("Upgrading database from v7 to v8"); + TableUtils.dropTable(connectionSource, Treatment.class, true); + TableUtils.createTableIfNotExists(connectionSource, Treatment.class); + } else { + log.info(DatabaseHelper.class.getName(), "onUpgrade"); + TableUtils.dropTable(connectionSource, TempTarget.class, true); + TableUtils.dropTable(connectionSource, Treatment.class, true); + TableUtils.dropTable(connectionSource, BgReading.class, true); + TableUtils.dropTable(connectionSource, DanaRHistoryRecord.class, true); + TableUtils.dropTable(connectionSource, DbRequest.class, true); + TableUtils.dropTable(connectionSource, TemporaryBasal.class, true); + TableUtils.dropTable(connectionSource, ExtendedBolus.class, true); + TableUtils.dropTable(connectionSource, CareportalEvent.class, true); + TableUtils.dropTable(connectionSource, ProfileSwitch.class, true); + onCreate(database, connectionSource); + } } catch (SQLException e) { log.error("Can't drop databases", e); throw new RuntimeException(e); @@ -683,6 +689,8 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { treatment.insulin = trJson.has("insulin") ? trJson.getDouble("insulin") : 0d; treatment.pumpId = trJson.has("pumpId") ? trJson.getLong("pumpId") : 0; treatment._id = trJson.getString("_id"); + if (trJson.has("isSMB")) + treatment.isSMB = trJson.getBoolean("isSMB"); if (trJson.has("eventType")) { treatment.mealBolus = !trJson.get("eventType").equals("Correction Bolus"); double carbs = treatment.carbs; @@ -1260,6 +1268,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { scheduleExtendedBolusChange(); } } + public ExtendedBolus findExtendedBolusById(String _id) { try { QueryBuilder queryBuilder = null; diff --git a/app/src/main/java/info/nightscout/androidaps/db/Treatment.java b/app/src/main/java/info/nightscout/androidaps/db/Treatment.java index aaf7778cd6..722b534c7d 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/Treatment.java +++ b/app/src/main/java/info/nightscout/androidaps/db/Treatment.java @@ -47,6 +47,8 @@ public class Treatment implements DataPointWithLabelInterface { public double carbs = 0d; @DatabaseField public boolean mealBolus = true; // true for meal bolus , false for correction bolus + @DatabaseField + public boolean isSMB = false; @DatabaseField public int insulinInterfaceID = InsulinInterface.FASTACTINGINSULIN; @@ -79,6 +81,7 @@ public class Treatment implements DataPointWithLabelInterface { "date= " + date + ", date= " + DateUtil.dateAndTimeString(date) + ", isValid= " + isValid + + ", isSMB= " + isSMB + ", _id= " + _id + ", pumpId= " + pumpId + ", insulin= " + insulin + @@ -110,6 +113,8 @@ public class Treatment implements DataPointWithLabelInterface { return false; if (pumpId != other.pumpId) return false; + if (isSMB != other.isSMB) + return false; if (!Objects.equals(_id, other._id)) return false; return true; @@ -122,6 +127,7 @@ public class Treatment implements DataPointWithLabelInterface { carbs = t.carbs; mealBolus = t.mealBolus; pumpId = t.pumpId; + isSMB = t.isSMB; } // ----------------- DataPointInterface -------------------- diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java index a29427381a..b10ab5dab8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java @@ -183,7 +183,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick profile = MainApp.getConfigBuilder().getProfile(); profileStore = ConfigBuilderPlugin.getActiveProfileInterface().getProfile(); ArrayList profileList; - units = profile.getUnits(); + units = profile != null ? profile.getUnits() : Constants.MGDL; profileList = profileStore.getProfileList(); ArrayAdapter adapter = new ArrayAdapter(getContext(), R.layout.spinner_centered, profileList); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index 0d1ef93d67..7c869a19a5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -12,7 +12,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; import java.util.List; @@ -34,9 +33,6 @@ import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.IobCobCalculator.events.BasalData; import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventAutosensCalculationFinished; import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventNewHistoryData; -import info.nightscout.utils.Round; -import info.nightscout.utils.SP; -import info.nightscout.utils.SafeParse; /** * Created by mike on 24.04.2017. @@ -390,7 +386,7 @@ public class IobCobCalculatorPlugin implements PluginBase { } delta = (bg - bucketed_data.get(i + 1).value); - IobTotal iob = calulateFromTreatmentsAndTemps(bgTime); + IobTotal iob = calculateFromTreatmentsAndTemps(bgTime); double bgi = -iob.activity * sens * 5; double deviation = delta - bgi; @@ -463,14 +459,20 @@ public class IobCobCalculatorPlugin implements PluginBase { return getBGDataFrom; } - public static IobTotal calulateFromTreatmentsAndTemps(long time) { + public static IobTotal calculateFromTreatmentsAndTempsSynchronized(long time) { + synchronized (dataLock) { + return calculateFromTreatmentsAndTemps(time); + } + } + + public static IobTotal calculateFromTreatmentsAndTemps(long time) { long now = System.currentTimeMillis(); time = roundUpTime(time); if (time < now && iobTable.get(time) != null) { - //og.debug(">>> calulateFromTreatmentsAndTemps Cache hit " + new Date(time).toLocaleString()); + //og.debug(">>> calculateFromTreatmentsAndTemps Cache hit " + new Date(time).toLocaleString()); return iobTable.get(time); } else { - //log.debug(">>> calulateFromTreatmentsAndTemps Cache miss " + new Date(time).toLocaleString()); + //log.debug(">>> calculateFromTreatmentsAndTemps Cache miss " + new Date(time).toLocaleString()); } IobTotal bolusIob = MainApp.getConfigBuilder().getCalculationToTimeTreatments(time).round(); IobTotal basalIob = MainApp.getConfigBuilder().getCalculationToTimeTempBasals(time).round(); @@ -559,7 +561,7 @@ public class IobCobCalculatorPlugin implements PluginBase { int pos = 0; for (int i = 0; i < len; i++) { long t = time + i * 5 * 60000; - IobTotal iob = calulateFromTreatmentsAndTemps(t); + IobTotal iob = calculateFromTreatmentsAndTempsSynchronized(t); array[pos] = iob; pos++; } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java index 5e0c97d23d..53bcfcf1ec 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java @@ -158,22 +158,11 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface { String units = profile.getUnits(); - double maxBgDefault = Constants.MAX_BG_DEFAULT_MGDL; - double minBgDefault = Constants.MIN_BG_DEFAULT_MGDL; - double targetBgDefault = Constants.TARGET_BG_DEFAULT_MGDL; - if (!units.equals(Constants.MGDL)) { - maxBgDefault = Constants.MAX_BG_DEFAULT_MMOL; - minBgDefault = Constants.MIN_BG_DEFAULT_MMOL; - targetBgDefault = Constants.TARGET_BG_DEFAULT_MMOL; - } - - Date now = new Date(); - double maxIob = SP.getDouble("openapsma_max_iob", 1.5d); double maxBasal = SP.getDouble("openapsma_max_basal", 1d); - double minBg = Profile.toMgdl(SP.getDouble("openapsma_min_bg", minBgDefault), units); - double maxBg = Profile.toMgdl(SP.getDouble("openapsma_max_bg", maxBgDefault), units); - double targetBg = Profile.toMgdl(SP.getDouble("openapsma_target_bg", targetBgDefault), units); + double minBg = Profile.toMgdl(profile.getTargetLow(), units); + double maxBg = Profile.toMgdl(profile.getTargetHigh(), units); + double targetBg = (minBg + maxBg) / 2; minBg = Round.roundTo(minBg, 0.1d); maxBg = Round.roundTo(maxBg, 0.1d); @@ -248,6 +237,8 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface { determineBasalAdapterAMAJS.release(); + Date now = new Date(); + try { determineBasalResultAMA.json.put("timestamp", DateUtil.toISOString(now)); } catch (JSONException e) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java index fe2b017133..95f1235161 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java @@ -156,22 +156,13 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface { String units = profile.getUnits(); - Double maxBgDefault = Constants.MAX_BG_DEFAULT_MGDL; - Double minBgDefault = Constants.MIN_BG_DEFAULT_MGDL; - Double targetBgDefault = Constants.TARGET_BG_DEFAULT_MGDL; - if (!units.equals(Constants.MGDL)) { - maxBgDefault = Constants.MAX_BG_DEFAULT_MMOL; - minBgDefault = Constants.MIN_BG_DEFAULT_MMOL; - targetBgDefault = Constants.TARGET_BG_DEFAULT_MMOL; - } - Date now = new Date(); double maxIob = SP.getDouble("openapsma_max_iob", 1.5d); double maxBasal = SafeParse.stringToDouble(SP.getString("openapsma_max_basal", "1")); - double minBg = Profile.toMgdl(SP.getDouble("openapsma_min_bg", minBgDefault), units); - double maxBg = Profile.toMgdl(SP.getDouble("openapsma_max_bg", maxBgDefault), units); - double targetBg = Profile.toMgdl(SP.getDouble("openapsma_target_bg", targetBgDefault), units); + double minBg = Profile.toMgdl(profile.getTargetLow(), units); + double maxBg = Profile.toMgdl(profile.getTargetHigh(), units); + double targetBg = (minBg + maxBg) / 2; minBg = Round.roundTo(minBg, 0.1d); maxBg = Round.roundTo(maxBg, 0.1d); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index 7e33d1ff8c..2738491634 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -959,16 +959,10 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, else tempTargetView.setText(Profile.toUnitsString(tempTarget.low, Profile.fromMgdlToUnits(tempTarget.low, units), units) + " - " + Profile.toUnitsString(tempTarget.high, Profile.fromMgdlToUnits(tempTarget.high, units), units)); } else { - Double maxBgDefault = Constants.MAX_BG_DEFAULT_MGDL; - Double minBgDefault = Constants.MIN_BG_DEFAULT_MGDL; - if (!units.equals(Constants.MGDL)) { - maxBgDefault = Constants.MAX_BG_DEFAULT_MMOL; - minBgDefault = Constants.MIN_BG_DEFAULT_MMOL; - } tempTargetView.setTextColor(Color.WHITE); tempTargetView.setBackgroundColor(MainApp.sResources.getColor(R.color.tempTargetDisabledBackground)); - double low = SP.getDouble("openapsma_min_bg", minBgDefault); - double high = SP.getDouble("openapsma_max_bg", maxBgDefault); + double low = MainApp.getConfigBuilder().getProfile().getTargetLow(); + double high = MainApp.getConfigBuilder().getProfile().getTargetHigh(); if (low == high) tempTargetView.setText("" + low); else @@ -1409,7 +1403,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, int lastCob = 0; for (long time = fromTime; time <= now; time += 5 * 60 * 1000L) { if (showIobView.isChecked()) { - double iob = IobCobCalculatorPlugin.calulateFromTreatmentsAndTemps(time).iob; + double iob = IobCobCalculatorPlugin.calculateFromTreatmentsAndTempsSynchronized(time).iob; if (Math.abs(lastIob - iob) > 0.02) { if (Math.abs(lastIob - iob) > 0.2) iobArray.add(new DataPoint(time, lastIob)); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java index 7ed4345093..aaae495c58 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java @@ -380,6 +380,9 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C if (percentRate > getPumpDescription().maxTempPercent) { percentRate = getPumpDescription().maxTempPercent; } + if (Config.logPumpActions) + log.debug("setTempBasalAbsolute: Calculated percent rate: " + percentRate); + // If extended in progress if (MainApp.getConfigBuilder().isInHistoryExtendedBoluslInProgress() && useExtendedBoluses) { if (Config.logPumpActions) @@ -393,7 +396,10 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C // Check if some temp is already in progress if (MainApp.getConfigBuilder().isInHistoryRealTempBasalInProgress()) { // Correct basal already set ? - if (MainApp.getConfigBuilder().getRealTempBasalFromHistory(System.currentTimeMillis()).percentRate == percentRate) { + TemporaryBasal running = MainApp.getConfigBuilder().getRealTempBasalFromHistory(System.currentTimeMillis()); + if (Config.logPumpActions) + log.debug("setTempBasalAbsolute: currently running: " + running.toString()); + if (running.percentRate == percentRate) { result.success = true; result.percent = percentRate; result.absolute = MainApp.getConfigBuilder().getTempBasalAbsoluteRateHistory(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index bca65dd4b5..2db941e1c5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -477,18 +477,9 @@ public class ActionStringHandler { ret += "\n\n"; } - //Default Range/Target - Double maxBgDefault = Constants.MAX_BG_DEFAULT_MGDL; - Double minBgDefault = Constants.MIN_BG_DEFAULT_MGDL; - Double targetBgDefault = Constants.TARGET_BG_DEFAULT_MGDL; - if (!profile.getUnits().equals(Constants.MGDL)) { - maxBgDefault = Constants.MAX_BG_DEFAULT_MMOL; - minBgDefault = Constants.MIN_BG_DEFAULT_MMOL; - targetBgDefault = Constants.TARGET_BG_DEFAULT_MMOL; - } ret += "DEFAULT RANGE: "; - ret += SP.getDouble("openapsma_min_bg", minBgDefault) + " - " + SP.getDouble("openapsma_max_bg", maxBgDefault); - ret += " target: " + SP.getDouble("openapsma_target_bg", targetBgDefault); + ret += profile.getTargetLow() + " - " + profile.getTargetHigh(); + ret += " target: " + (profile.getTargetLow() + profile.getTargetHigh()) / 2; return ret; } diff --git a/app/src/main/java/info/nightscout/utils/NSUpload.java b/app/src/main/java/info/nightscout/utils/NSUpload.java index aeb1f7181d..09ecbc9370 100644 --- a/app/src/main/java/info/nightscout/utils/NSUpload.java +++ b/app/src/main/java/info/nightscout/utils/NSUpload.java @@ -252,6 +252,7 @@ public class NSUpload { if (detailedBolusInfo.carbs != 0d) data.put("carbs", (int) detailedBolusInfo.carbs); data.put("created_at", DateUtil.toISOString(detailedBolusInfo.date)); data.put("date", detailedBolusInfo.date); + data.put("isSMB", detailedBolusInfo.isSMB); if (detailedBolusInfo.pumpId != 0) data.put("pumpId", detailedBolusInfo.pumpId); if (detailedBolusInfo.glucose != 0d) diff --git a/app/src/main/java/info/nightscout/utils/SP.java b/app/src/main/java/info/nightscout/utils/SP.java index acb727d864..36ab3b05e7 100644 --- a/app/src/main/java/info/nightscout/utils/SP.java +++ b/app/src/main/java/info/nightscout/utils/SP.java @@ -88,12 +88,6 @@ public class SP { editor.apply(); } - static public void removeBoolean(int resourceID) { - SharedPreferences.Editor editor = sharedPreferences.edit(); - editor.remove(MainApp.sResources.getString(resourceID)); - editor.apply(); - } - static public void putLong(String key, long value) { SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putLong(key, value); @@ -130,9 +124,15 @@ public class SP { editor.apply(); } - static public void removeString(int resourceID) { + static public void remove(int resourceID) { SharedPreferences.Editor editor = sharedPreferences.edit(); editor.remove(MainApp.sResources.getString(resourceID)); editor.apply(); } + + static public void remove(String key) { + SharedPreferences.Editor editor = sharedPreferences.edit(); + editor.remove(key); + editor.apply(); + } } diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 8b026dd0b2..3293aa7f03 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -68,7 +68,6 @@ Няма избана помпа Не се изисква промяна Искане - Долна граница(КЗ) Стойност Срок Основание @@ -204,8 +203,6 @@ Greek Italian Russian - Мин. стойност, която е в границите - Максималната стойност на КЗ за да бъде в границите. Максимално позволен временен базал Е/ч Макс. лимит на временен базал [Е/ч] Максимален IOB @@ -311,7 +308,6 @@ Една седмица успешно дневно използване с редовно въвеждане на въглехидрати Активиране на допълнителни функции за дневно използване, включително и advanced meal assist Достигнахте лимита - Целева стойност използвана в изчисленията Няма избран профил Loop has been disabled Loop has been enabled diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 1deda05866..e3605d0f5f 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -104,7 +104,6 @@ Poslední provedení Poslední spuštění Data o jídle - Cílová nízká glykémie Nedostupná data o glykémiích Nedostupný profil Žádná pumpa @@ -184,8 +183,6 @@ Exportovat nastavení Importovat nastavení German - Maximální hodnota glykémie ještě v rozsahu - Minimální hodnota glykémie ještě v rozsahu Bulgarian POTVRDIT Jazyk @@ -282,7 +279,6 @@ Upravit bazály a koeficinty, když bude potřeba a povolit automatickou detekci citlivosti na inzulín Povolit další fukce pro běžné používání jako AMA Dosaženo limitu - Cílová hodnota pro výpočty Aplikováno %.2fU Smyčka byla zakázána Smyčka byla povolena diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 702a18ca2a..2b145dba34 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -128,7 +128,6 @@ Keine Pumpe verfügbar Kein Profil verfügbar Keine BZ Daten verfügbar - Low target Mahlzeiten Daten Last run Last enacted @@ -185,8 +184,6 @@ Deutsch Max U/hr die man für eine Temp Basal setzen kann Maximale Menge von nicht bolus IOB die OpenAPs abgeben kann - Maximalwert für deinen persönlichen Zielbereich. - Minimalwert für deinen persönlichen Zielbereich. Bulgarian Nightscout +XXXXXXXXXX;+YYYYYYYYYY diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index c619bc3322..18cfbe75a4 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -66,7 +66,6 @@ No se dispone de bomba Ninguna acción requerida Solicitud - Objetivo mínimo Dosis Duración Razón @@ -192,8 +191,6 @@ Exportar ajustes Importar ajustes German - Valor mínimo de BG para estar en rango - Valor máximo BG para estar en rango Max valor U / hr en Basal temporal Máximos basales IOB para OpenAPS [U] Bulgarian @@ -294,7 +291,6 @@ 1 semana lazo cerrado completado con entrada regular de carbohidratos Habilitar funciones adicionales para su uso durante el día, como asistente de comida avanzado Alcanzado el límite permitido - Valor objetivo para los cálculos Sin perfil seleccionado Korean Acciones diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 0461f4b0fc..13ea3fe715 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -264,12 +264,9 @@ OpenAPS MA Plugin e\' disabilitato Stato glucosio - Valore massimo di Bg nel range Entrata parametro - Valore minimo di Bg nel range Il valore e\' chiamati basale in OpenAPS Basale Massima in IOB OpenAPS - Obbietivo minimo IOB dati Ultimo attuato Ultimo corsa @@ -344,7 +341,6 @@ Impostazione di visualizzazione, monitoraggio e analisi basali e rapporti Eseguire in modalità Open Loop per alcuni giorni e impostare manualmente la basale tempor Script debug - Target per calcolare Comunicazioni SMS Numero di telefono acettato Bolo fallito diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index f39c68d957..0365cc5461 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -68,7 +68,6 @@ No pump available 변경사항 없음 요청 - Low target Rate 기간 근거 @@ -195,8 +194,6 @@ German Spanish Greek - 목표범위 최소 혈당값 - 목표범위 최대 혈당값 임시기초주입 최대량 [U/hr] 이 값은 OpenAPS에서 Max Basal(임시기초주입 최대량)로 설정되는 값입니다 OpenAPS가 주입할수 있는 최대 기초주입 IOB [U] @@ -304,7 +301,6 @@ 평소 먹는 탄수화물 입력하면서 Loop를 실행하고 1주일간 성공적으로 낮시간을 관리한다. AMA(Advanced Meal Assist)같은 주간용을 위한 추가적인 기능들을 실행하여 본다. 허용된 제한값에 도달하였습니다 - 계산을 위한 목표 혈당 값 프로파일이 선택되지 않았습니다 Loop가 중지되었습니다. Loop가 실행되었습니다. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index ee6f7cf8e9..03bc3dcebe 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -345,19 +345,16 @@ текущий врем базал модуль не активен статус гликемии - макс значение СК диапазона параметры ввода данные IOB (активн инс) последнее заданное последнее выполненное - мин значение СК диапазона в контексте OpenAPS называется макс базал макс разрешенный врем базал Е/ч эта величина называется макс IOB (макс активн инс) в OpenAPS. Значение по умолчанию 0. Через несколько дней или недель пользования величину можно юстировать в зависимости от вашего уровня комфорта. макс базал активн инс подаваемый с OpenAPS (ед) данные приема пищи - нижнее целевое значение СК - данные гликемии недоступны + данные гликемии недоступны профиль недоступен помпа недоступна профиль @@ -365,7 +362,6 @@ результат выполнить сейчас отладка скрипта - целевое значение для расчетов %.2f ограничено до %.2f величина %s недопустима открытый цикл diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 459f671821..48db77c158 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -20,6 +20,7 @@ @string/it_lang @string/ko_lang @string/ru_lang + @string/sv_lang en @@ -31,6 +32,7 @@ it ko ru + sv @@ -43,5 +45,4 @@ @string/key_teenage @string/key_adult - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fc97ca722d..136ffeacf1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -69,8 +69,7 @@ No pump available No change requested Request - Low target - Rate + Rate Duration Reason Glucose @@ -209,8 +208,7 @@ Greek Italian Russian - The minimum BG value to be in range. - The maximum BG value to be in range. + Swedish Max U/hr a Temp Basal can be set to This value is called max basal in OpenAPS context Maximum basal IOB OpenAPS can deliver [U] @@ -318,7 +316,6 @@ 1 week successful daytime looping with regular carb entry Enabling additional features for daytime use, such as advanced meal assist You reached allowed limit - Target value for calculations No profile selected Loop has been disabled Loop has been enabled diff --git a/app/src/main/res/xml/pref_openapsma.xml b/app/src/main/res/xml/pref_openapsma.xml index bb63e1f5b8..f091bbce0b 100644 --- a/app/src/main/res/xml/pref_openapsma.xml +++ b/app/src/main/res/xml/pref_openapsma.xml @@ -3,22 +3,6 @@ - - - -