diff --git a/.gitignore b/.gitignore index 692e056954..b80e6aff48 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ wear/wear.iml .DS_Store /build /captures +*.apk +build/ +**/*.iml diff --git a/app/build.gradle b/app/build.gradle index 997c5e1d87..ec7e25f692 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -44,7 +44,7 @@ android { minSdkVersion 21 targetSdkVersion 23 versionCode 1100 - versionName "1.1d" + versionName "1.1e" buildConfigField "String", "BUILDVERSION", generateGitBuild() } lintOptions { @@ -105,12 +105,22 @@ android { } } +allprojects { + repositories { + jcenter() + flatDir { + dirs 'libs' + } + } +} + dependencies { wearWearApp project(path: ':wear', configuration: 'fullRelease') compile fileTree(include: ['*.jar'], dir: 'libs') compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') { transitive = true; } + compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:cardview-v7:23.4.0' @@ -134,4 +144,6 @@ dependencies { androidTestCompile 'org.mockito:mockito-core:2.+' androidTestCompile "com.google.dexmaker:dexmaker:1.2" androidTestCompile "com.google.dexmaker:dexmaker-mockito:1.2" + compile(name:'android-edittext-validator-v1.3.4-mod', ext:'aar') + } diff --git a/app/libs/android-edittext-validator-v1.3.4-mod.aar b/app/libs/android-edittext-validator-v1.3.4-mod.aar new file mode 100644 index 0000000000..e08904b772 Binary files /dev/null and b/app/libs/android-edittext-validator-v1.3.4-mod.aar differ diff --git a/app/src/main/java/info/nightscout/androidaps/Constants.java b/app/src/main/java/info/nightscout/androidaps/Constants.java index 77c8e2b9a0..96f18396ce 100644 --- a/app/src/main/java/info/nightscout/androidaps/Constants.java +++ b/app/src/main/java/info/nightscout/androidaps/Constants.java @@ -25,19 +25,8 @@ public class Constants { public static final long keepAliveMsecs = 5 * 60 * 1000L; // SMS COMMUNICATOR - public static final long remoteBolusMinDistance = 15 * 60 * 1000L; - - // AMA - public static final int MAX_DAILY_SAFETY_MULTIPLIER = 3; - public static final int CURRENT_BASAL_SAFETY_MULTIPLIER = 4; - - public static final int BOLUSSNOOZE_DIA_ADVISOR = 2; - public static final double AUTOSENS_MAX = 1.2d; - public static final double AUTOSENS_MIN = 0.7d; - public static final double MIN_5M_CARBIMPACT = 3d; - // Circadian Percentage Profile public static final int CPP_MIN_PERCENTAGE = 50; public static final int CPP_MAX_PERCENTAGE = 200; diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.java b/app/src/main/java/info/nightscout/androidaps/MainActivity.java index 2bd72f178b..b81138ed60 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.java @@ -9,7 +9,6 @@ import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.app.ActivityCompat; -import android.support.v4.app.Fragment; import android.support.v4.content.ContextCompat; import android.support.v4.view.ViewPager; import android.support.v7.app.AlertDialog; @@ -29,10 +28,9 @@ import info.nightscout.androidaps.events.EventAppExit; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.events.EventRefreshGui; import info.nightscout.androidaps.interfaces.PluginBase; -import info.nightscout.androidaps.plugins.DanaR.Services.ExecutionService; -import info.nightscout.androidaps.receivers.KeepAliveReceiver; import info.nightscout.androidaps.tabs.SlidingTabLayout; import info.nightscout.androidaps.tabs.TabPageAdapter; +import info.nightscout.utils.LogDialog; import info.nightscout.utils.ImportExportPrefs; import info.nightscout.utils.LocaleHelper; @@ -145,6 +143,9 @@ public class MainActivity extends AppCompatActivity { ImportExportPrefs.verifyStoragePermissions(this); ImportExportPrefs.importSharedPreferences(this); break; + case R.id.nav_show_logcat: + LogDialog.showLogcat(this); + break; // case R.id.nav_test_alarm: // final int REQUEST_CODE_ASK_PERMISSIONS = 2355; // int permission = ActivityCompat.checkSelfPermission(this, Manifest.permission.SYSTEM_ALERT_WINDOW); diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index e09c90fab8..415e30c1ce 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -90,7 +90,7 @@ public class MainApp extends Application { pluginsList.add(SimpleProfileFragment.getPlugin()); pluginsList.add(LocalProfileFragment.getPlugin()); pluginsList.add(CircadianPercentageProfileFragment.getPlugin()); - pluginsList.add(TempTargetRangeFragment.getPlugin()); + if (Config.APS) pluginsList.add(TempTargetRangeFragment.getPlugin()); pluginsList.add(TreatmentsFragment.getPlugin()); pluginsList.add(TempBasalsFragment.getPlugin()); pluginsList.add(SafetyFragment.getPlugin()); diff --git a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java index 10169a8d51..ccd6fc3857 100644 --- a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java @@ -11,6 +11,7 @@ import android.preference.PreferenceFragment; import android.preference.PreferenceGroup; import android.preference.PreferenceManager; + import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.events.EventRefreshGui; import info.nightscout.androidaps.interfaces.PluginBase; @@ -53,10 +54,10 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre } if (pref instanceof EditTextPreference) { EditTextPreference editTextPref = (EditTextPreference) pref; - if (pref.getTitle().toString().toLowerCase().contains("password")) - { + if (pref.getKey().contains("danar_password")) { pref.setSummary("******"); - } else if (editTextPref.getText() != null && !editTextPref.getText().equals("")){ + } else if (editTextPref.getText() != null && !editTextPref.getText().equals("")) { + ((EditTextPreference) pref).setDialogMessage(editTextPref.getDialogMessage()); pref.setSummary(editTextPref.getText()); } } @@ -90,7 +91,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre addPreferencesFromResource(R.xml.pref_closedmode); if (Config.OPENAPSENABLED) addPreferencesFromResource(R.xml.pref_openapsma); - if (MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class).isEnabled(PluginBase.APS)) + if (MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class) != null && MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class).isEnabled(PluginBase.APS)) addPreferencesFromResource(R.xml.pref_openapsama); addPreferencesFromResource(R.xml.pref_profile); if (Config.DANAR) { diff --git a/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java b/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java index 113b3dc25c..9a28e56359 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java @@ -81,9 +81,9 @@ public class GlucoseStatus { BgReading then = data.get(i); long then_date = then.timeIndex; double avgdelta = 0; - int minutesago; + long minutesago; - minutesago = Math.round((now_date - then_date) / (1000 * 60)); + minutesago = Math.round((now_date - then_date) / (1000d * 60)); // multiply by 5 to get the same units as delta, i.e. mg/dL/5m change = now.value - then.value; avgdelta = change / minutesago * 5; diff --git a/app/src/main/java/info/nightscout/androidaps/data/MealData.java b/app/src/main/java/info/nightscout/androidaps/data/MealData.java index dc24599d9a..a03dde3181 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/MealData.java +++ b/app/src/main/java/info/nightscout/androidaps/data/MealData.java @@ -18,14 +18,13 @@ import info.nightscout.client.data.NSProfile; public class MealData { public double boluses = 0d; public double carbs = 0d; - public double mealCOB = 0.0d; // TODO: add calculation for AMA + public double mealCOB = 0.0d; public void addTreatment(Treatment treatment) { NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); if (profile == null) return; - // TODO: not sure how much data do i need for AMA List bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime((long) (new Date().getTime() - 60 * 60 * 1000L * profile.getDia() * 2), false); long now = new Date().getTime(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/NewTempBasalDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/NewTempBasalDialog.java index f95bdc41b4..ea0ef114e8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/NewTempBasalDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/NewTempBasalDialog.java @@ -151,7 +151,7 @@ public class NewTempBasalDialog extends DialogFragment implements View.OnClickLi } if (!result.success) { AlertDialog.Builder builder = new AlertDialog.Builder(context); - builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror)); + builder.setTitle(MainApp.sResources.getString(R.string.tempbasaldeliveryerror)); builder.setMessage(result.comment); builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null); builder.show(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java index 7c23346711..ad7d4ae647 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java @@ -64,7 +64,6 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase { // TODO: sorting - // TODO: Toast and sound when command failed @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRFragment.java index 787f241612..7c59790e35 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRFragment.java @@ -219,7 +219,7 @@ public class DanaRFragment extends Fragment implements FragmentBase { Long agoMsec = new Date().getTime() - pump.lastBolusTime.getTime(); double agoHours = agoMsec / 60d / 60d / 1000d; if (agoHours < 6) // max 6h back - lastBolusView.setText(DateUtil.timeString(pump.lastBolusTime) + " (" + DecimalFormatter.to1Decimal(agoHours) + " " + getString(R.string.hoursago) + ") " + DecimalFormatter.to2Decimal(getPlugin().getDanaRPump().lastBolusAmount) + " U"); + lastBolusView.setText(DateUtil.timeString(pump.lastBolusTime) + " (" + DecimalFormatter.to1Decimal(agoHours) + " " + MainApp.sResources.getString(R.string.hoursago) + ") " + DecimalFormatter.to2Decimal(getPlugin().getDanaRPump().lastBolusAmount) + " U"); else lastBolusView.setText(""); } @@ -242,7 +242,7 @@ public class DanaRFragment extends Fragment implements FragmentBase { SetWarnColor.setColorInverse(batteryView, pump.batteryRemaining, 51d, 26d); iobView.setText(pump.iob + " U"); if (pump.isNewPump) { - firmwareView.setText(String.format(getString(R.string.danar_model), pump.model, pump.protocol, pump.productCode)); + firmwareView.setText(String.format(MainApp.sResources.getString(R.string.danar_model), pump.model, pump.protocol, pump.productCode)); } else { firmwareView.setText("OLD"); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java index 577e1d3bcf..f2fa7909c7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java @@ -258,6 +258,8 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf if (!isInitialized()) return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS DanaRPump pump = getDanaRPump(); + if (pump.pumpProfiles == null) + return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS int basalValues = pump.basal48Enable ? 48 : 24; int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60; for (int h = 0; h < basalValues; h++) { @@ -290,17 +292,19 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf @Override public double getTempBasalAbsoluteRate() { - if (isRealTempBasalInProgress()) { - if (getRealTempBasal().isAbsolute) { - return getRealTempBasal().absolute; + TempBasal tb = getRealTempBasal(); + if (tb != null) { + if (tb.isAbsolute) { + return tb.absolute; } else { Double baseRate = getBaseBasalRate(); - Double tempRate = baseRate * (getRealTempBasal().percent / 100d); + Double tempRate = baseRate * (tb.percent / 100d); return tempRate; } } - if (isExtendedBoluslInProgress() && useExtendedBoluses) { - return getBaseBasalRate() + getExtendedBolus().absolute; + TempBasal eb = getExtendedBolus(); + if (eb != null && useExtendedBoluses) { + return getBaseBasalRate() + eb.absolute; } return 0; } @@ -707,11 +711,12 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf extended.put("PumpIOB", getDanaRPump().iob); extended.put("LastBolus", getDanaRPump().lastBolusTime.toLocaleString()); extended.put("LastBolusAmount", getDanaRPump().lastBolusAmount); - if (isTempBasalInProgress()) { + TempBasal tb = getTempBasal(); + if (tb != null) { extended.put("TempBasalAbsoluteRate", getTempBasalAbsoluteRate()); - extended.put("TempBasalStart", getTempBasal().timeStart.toLocaleString()); - extended.put("TempBasalRemaining", getTempBasal().getPlannedRemainingMinutes()); - extended.put("IsExtended", getTempBasal().isExtended); + extended.put("TempBasalStart", tb.timeStart.toLocaleString()); + extended.put("TempBasalRemaining", tb.getPlannedRemainingMinutes()); + extended.put("IsExtended", tb.isExtended); } extended.put("BaseBasalRate", getBaseBasalRate()); try { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRStatsActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRStatsActivity.java index 4e75c4c999..1ded51f982 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRStatsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRStatsActivity.java @@ -56,6 +56,7 @@ import info.nightscout.androidaps.plugins.DanaR.comm.RecordTypes; import info.nightscout.androidaps.plugins.DanaR.events.EventDanaRConnectionStatus; import info.nightscout.androidaps.plugins.DanaR.events.EventDanaRSyncStatus; import info.nightscout.utils.DecimalFormatter; +import info.nightscout.utils.SafeParse; import info.nightscout.utils.ToastUtils; public class DanaRStatsActivity extends Activity { @@ -366,7 +367,7 @@ public class DanaRStatsActivity extends Activity { return; } else { - magicNumber = Double.parseDouble(TBB); + magicNumber = SafeParse.stringToDouble(TBB); } magicNumber *=2; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanFragment.java index f6778ed5f6..4142b43ff6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanFragment.java @@ -240,7 +240,7 @@ public class DanaRKoreanFragment extends Fragment implements FragmentBase { SetWarnColor.setColorInverse(batteryView, pump.batteryRemaining, 51d, 26d); iobView.setText(pump.iob + " U"); if (pump.isNewPump) { - firmwareView.setText(String.format(getString(R.string.danar_model), pump.model, pump.protocol, pump.productCode)); + firmwareView.setText(String.format(MainApp.sResources.getString(R.string.danar_model), pump.model, pump.protocol, pump.productCode)); } else { firmwareView.setText("OLD"); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java index e5b40a60a5..1b3aced79e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java @@ -258,6 +258,8 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints if (!isInitialized()) return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS DanaRKoreanPump pump = getDanaRPump(); + if (pump.pumpProfiles == null) + return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS int basalValues = pump.basal48Enable ? 48 : 24; int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60; for (int h = 0; h < basalValues; h++) { @@ -290,17 +292,19 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints @Override public double getTempBasalAbsoluteRate() { - if (isRealTempBasalInProgress()) { - if (getRealTempBasal().isAbsolute) { - return getRealTempBasal().absolute; + TempBasal tb = getRealTempBasal(); + if (tb != null) { + if (tb.isAbsolute) { + return tb.absolute; } else { Double baseRate = getBaseBasalRate(); - Double tempRate = baseRate * (getRealTempBasal().percent / 100d); + Double tempRate = baseRate * (tb.percent / 100d); return tempRate; } } - if (isExtendedBoluslInProgress() && useExtendedBoluses) { - return getBaseBasalRate() + getExtendedBolus().absolute; + TempBasal eb = getExtendedBolus(); + if (eb != null && useExtendedBoluses) { + return getBaseBasalRate() + eb.absolute; } return 0; } @@ -707,11 +711,12 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints extended.put("PumpIOB", getDanaRPump().iob); // extended.put("LastBolus", getDanaRPump().lastBolusTime.toLocaleString()); // extended.put("LastBolusAmount", getDanaRPump().lastBolusAmount); - if (isTempBasalInProgress()) { + TempBasal tb = getTempBasal(); + if (tb != null) { extended.put("TempBasalAbsoluteRate", getTempBasalAbsoluteRate()); - extended.put("TempBasalStart", getTempBasal().timeStart.toLocaleString()); - extended.put("TempBasalRemaining", getTempBasal().getPlannedRemainingMinutes()); - extended.put("IsExtended", getTempBasal().isExtended); + extended.put("TempBasalStart", tb.timeStart.toLocaleString()); + extended.put("TempBasalRemaining", tb.getPlannedRemainingMinutes()); + extended.put("IsExtended", tb.isExtended); } extended.put("BaseBasalRate", getBaseBasalRate()); try { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/History/DanaRStatsActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/History/DanaRStatsActivity.java index bf7a7c4321..995924b9c7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/History/DanaRStatsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/History/DanaRStatsActivity.java @@ -56,6 +56,7 @@ import info.nightscout.androidaps.plugins.DanaR.events.EventDanaRConnectionStatu import info.nightscout.androidaps.plugins.DanaR.events.EventDanaRSyncStatus; import info.nightscout.androidaps.plugins.DanaRKorean.Services.ExecutionService; import info.nightscout.utils.DecimalFormatter; +import info.nightscout.utils.SafeParse; import info.nightscout.utils.ToastUtils; public class DanaRStatsActivity extends Activity { @@ -366,7 +367,7 @@ public class DanaRStatsActivity extends Activity { return; } else { - magicNumber = Double.parseDouble(TBB); + magicNumber = SafeParse.stringToDouble(TBB); } magicNumber *=2; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/Autosens.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/Autosens.java index cf89f07fe1..eb449b96c8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/Autosens.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/Autosens.java @@ -1,5 +1,8 @@ package info.nightscout.androidaps.plugins.OpenAPSAMA; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -14,13 +17,14 @@ import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.db.BgReading; import info.nightscout.client.data.NSProfile; import info.nightscout.utils.Round; +import info.nightscout.utils.SafeParse; public class Autosens { private static Logger log = LoggerFactory.getLogger(Autosens.class); public static AutosensResult detectSensitivityandCarbAbsorption(List glucose_data, Long mealTime) { - + SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); //console.error(mealTime); @@ -128,7 +132,7 @@ public class Autosens { if (mealTime != null && bgTime > mealTime) { // figure out how many carbs that represents // but always assume at least 3mg/dL/5m (default) absorption - double ci = Math.max(deviation, Constants.MIN_5M_CARBIMPACT); + double ci = Math.max(deviation, SafeParse.stringToDouble(SP.getString("openapsama_min_5m_carbimpact", "3.0"))); double absorbed = ci * profile.getIc(secondsFromMidnight) / sens; // and add that to the running total carbsAbsorbed carbsAbsorbed += absorbed; @@ -176,10 +180,10 @@ public class Autosens { log.debug(sensResult); ratio = 1 + (basalOff / profile.getMaxDailyBasal()); - // don't adjust more than 1.5x - double rawRatio = ratio; - ratio = Math.max(ratio, Constants.AUTOSENS_MIN); - ratio = Math.min(ratio, Constants.AUTOSENS_MAX); + // don't adjust more than 1.5x + double rawRatio = ratio; + ratio = Math.max(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_min", "0.7"))); + ratio = Math.min(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_max", "1.2"))); if (ratio != rawRatio) { ratioLimit = "Ratio limited from " + rawRatio + " to " + ratio; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java index ed14acb591..d443113fc4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java @@ -27,6 +27,7 @@ import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.Loop.ScriptReader; import info.nightscout.androidaps.data.IobTotal; import info.nightscout.client.data.NSProfile; +import info.nightscout.utils.SafeParse; public class DetermineBasalAdapterAMAJS { private static Logger log = LoggerFactory.getLogger(DetermineBasalAdapterAMAJS.class); @@ -209,7 +210,6 @@ public class DetermineBasalAdapterAMAJS { String units = profile.getUnits(); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); - boolean autosensAdustTargets = preferences.getBoolean("openapsama_autosens_adjusttargets", false); mProfile = new V8Object(mV8rt); mProfile.add("max_iob", maxIob); @@ -222,13 +222,13 @@ public class DetermineBasalAdapterAMAJS { mProfile.add("target_bg", targetBg); mProfile.add("carb_ratio", profile.getIc(profile.secondsFromMidnight())); mProfile.add("sens", NSProfile.toMgdl(profile.getIsf(NSProfile.secondsFromMidnight()).doubleValue(), units)); - mProfile.add("max_daily_safety_multiplier", Constants.MAX_DAILY_SAFETY_MULTIPLIER); - mProfile.add("current_basal_safety_multiplier", Constants.CURRENT_BASAL_SAFETY_MULTIPLIER); + mProfile.add("max_daily_safety_multiplier", SafeParse.stringToInt(preferences.getString("openapsama_max_daily_safety_multiplier", "3"))); + mProfile.add("current_basal_safety_multiplier", SafeParse.stringToInt(preferences.getString("openapsama_max_basal_safety_multiplier", "4"))); mProfile.add("skip_neutral_temps", true); mProfile.add("current_basal", pump.getBaseBasalRate()); mProfile.add("temptargetSet", tempTargetSet); - mProfile.add("autosens_adjust_targets", autosensAdustTargets); - mProfile.add("min_5m_carbimpact", min_5m_carbimpact); + mProfile.add("autosens_adjust_targets", preferences.getBoolean("openapsama_autosens_adjusttargets", true)); + mProfile.add("min_5m_carbimpact", SafeParse.stringToDouble(preferences.getString("openapsama_min_5m_carbimpact", "3.0"))); mV8rt.add(PARAM_profile, mProfile); mCurrentTemp = new V8Object(mV8rt); 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 e90a14ff96..49d5b760b9 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 @@ -235,7 +235,7 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface { determineBasalAdapterAMAJS.setData(profile, maxIob, maxBasal, minBg, maxBg, targetBg, pump, iobArray, glucoseStatus, mealData, lastAutosensResult.ratio, //autosensDataRatio isTempTarget, - Constants.MIN_5M_CARBIMPACT //min_5m_carbimpact + SafeParse.stringToDouble(SP.getString("openapsama_min_5m_carbimpact", "3.0"))//min_5m_carbimpact ); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java index 090a63e47a..dfedda106e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/BolusProgressDialog.java @@ -137,7 +137,7 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL @Override public void run() { if (c.sStatus == c.CONNECTING) { - statusView.setText(String.format(getString(R.string.danar_history_connectingfor), c.sSecondsElapsed)); + statusView.setText(String.format(MainApp.sResources.getString(R.string.danar_history_connectingfor), c.sSecondsElapsed)); } else if (c.sStatus == c.CONNECTED) { statusView.setText(MainApp.sResources.getString(R.string.connected)); } else { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Notification.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Notification.java index daa882bd8f..8a7a9b00ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Notification.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Notification.java @@ -21,6 +21,7 @@ public class Notification { public static final int FAILED_UDPATE_PROFILE = 6; public static final int BASAL_VALUE_BELOW_MINIMUM = 7; public static final int OLD_NSCLIENT = 8; + public static final int INVALID_PHONE_NUMBER = 9; public int id; public Date date; 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 076d1c63b5..4bea8a72ad 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 @@ -237,7 +237,7 @@ public class OverviewFragment extends Fragment { acceptTempButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - MainApp.getConfigBuilder().getActiveLoop().invoke("Accept temp button", false); + ConfigBuilderPlugin.getActiveLoop().invoke("Accept temp button", false); final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun; if (finalLastRun != null && finalLastRun.lastAPSRun != null && finalLastRun.constraintsProcessed.changeRequested) { AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); @@ -532,7 +532,7 @@ public class OverviewFragment extends Fragment { // temp target NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); TempTargetRangePlugin tempTargetRangePlugin = (TempTargetRangePlugin) MainApp.getSpecificPlugin(TempTargetRangePlugin.class); - if (tempTargetRangePlugin != null && tempTargetRangePlugin.isEnabled(PluginBase.GENERAL)) { + if (Config.APS && tempTargetRangePlugin != null && tempTargetRangePlugin.isEnabled(PluginBase.GENERAL)) { TempTarget tempTarget = tempTargetRangePlugin.getTempTargetInProgress(new Date().getTime()); if (tempTarget != null) { tempTargetView.setTextColor(Color.BLACK); @@ -564,7 +564,7 @@ public class OverviewFragment extends Fragment { showAcceptButton = showAcceptButton && (finalLastRun.lastOpenModeAccept == null || finalLastRun.lastOpenModeAccept.getTime() < finalLastRun.lastAPSRun.getTime()); // never accepted or before last result showAcceptButton = showAcceptButton && finalLastRun.constraintsProcessed.changeRequested; // change is requested - if (showAcceptButton && pump.isInitialized()) { + if (showAcceptButton && pump.isInitialized() && ConfigBuilderPlugin.getActiveLoop() != null) { acceptTempLayout.setVisibility(View.VISIBLE); acceptTempButton.setText(getContext().getString(R.string.setbasalquestion) + "\n" + finalLastRun.constraintsProcessed); } else { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SafetyFragment/SafetyPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SafetyFragment/SafetyPlugin.java index ceb0d96efa..b01abf3436 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SafetyFragment/SafetyPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SafetyFragment/SafetyPlugin.java @@ -103,8 +103,8 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface { if (profile == null) return absoluteRate; if (absoluteRate < 0) absoluteRate = 0d; - Integer maxBasalMult = Constants.CURRENT_BASAL_SAFETY_MULTIPLIER; - Integer maxBasalFromDaily = Constants.MAX_DAILY_SAFETY_MULTIPLIER; + Integer maxBasalMult = SafeParse.stringToInt(SP.getString("openapsama_max_basal_safety_multiplier", "4")); + Integer maxBasalFromDaily = SafeParse.stringToInt(SP.getString("openapsama_max_daily_safety_multiplier", "3")); // Check percentRate but absolute rate too, because we know real current basal in pump Double origRate = absoluteRate; if (absoluteRate > maxBasal) { @@ -142,8 +142,8 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface { if (absoluteRate < 0) absoluteRate = 0d; - Integer maxBasalMult = Constants.CURRENT_BASAL_SAFETY_MULTIPLIER; - Integer maxBasalFromDaily = Constants.MAX_DAILY_SAFETY_MULTIPLIER; + Integer maxBasalMult = SafeParse.stringToInt(SP.getString("openapsama_max_basal_safety_multiplier", "4")); + Integer maxBasalFromDaily = SafeParse.stringToInt(SP.getString("openapsama_max_daily_safety_multiplier", "3")); // Check percentRate but absolute rate too, because we know real current basal in pump Double origRate = absoluteRate; if (absoluteRate > maxBasal) { @@ -191,7 +191,7 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface { public Integer applyCarbsConstraints(Integer carbs) { SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); try { - Integer maxCarbs = Integer.parseInt(SP.getString("treatmentssafety_maxcarbs", "48")); + Integer maxCarbs = SafeParse.stringToInt(SP.getString("treatmentssafety_maxcarbs", "48")); if (carbs < 0) carbs = 0; if (carbs > maxCarbs) carbs = maxCarbs; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java index 21e66a37aa..c072c88b59 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java @@ -31,6 +31,8 @@ import info.nightscout.androidaps.plugins.DanaR.DanaRPlugin; import info.nightscout.androidaps.plugins.DanaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.data.IobTotal; +import info.nightscout.androidaps.plugins.Overview.Notification; +import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.SmsCommunicator.events.EventNewSMS; import info.nightscout.androidaps.plugins.SmsCommunicator.events.EventSmsCommunicatorUpdateGui; import info.nightscout.client.data.NSProfile; @@ -446,8 +448,13 @@ public class SmsCommunicatorPlugin implements PluginBase { SmsManager smsManager = SmsManager.getDefault(); sms.text = stripAccents(sms.text); if (sms.text.length() > 140) sms.text = sms.text.substring(0, 139); - smsManager.sendTextMessage(sms.phoneNumber, null, sms.text, null, null); - messages.add(sms); + try { + smsManager.sendTextMessage(sms.phoneNumber, null, sms.text, null, null); + messages.add(sms); + } catch (IllegalArgumentException e) { + Notification notification = new Notification(Notification.INVALID_PHONE_NUMBER, MainApp.sResources.getString(R.string.smscommunicator_invalidphonennumber), Notification.NORMAL); + MainApp.bus().post(new EventNewNotification(notification)); + } } private String generatePasscode() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java index eca00d6159..966a5e7578 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java @@ -1,5 +1,8 @@ package info.nightscout.androidaps.plugins.Treatments; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; + import com.j256.ormlite.dao.Dao; import com.j256.ormlite.stmt.PreparedQuery; import com.j256.ormlite.stmt.QueryBuilder; @@ -26,6 +29,7 @@ import info.nightscout.androidaps.interfaces.TreatmentsInterface; import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.client.data.NSProfile; +import info.nightscout.utils.SafeParse; /** * Created by mike on 05.08.2016. @@ -121,6 +125,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface { @Override public IobTotal getCalculationToTime(long time) { + SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); IobTotal total = new IobTotal(time); if (MainApp.getConfigBuilder() == null || ConfigBuilderPlugin.getActiveProfile() == null) // app not initialized yet @@ -138,7 +143,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface { Iob tIOB = t.iobCalc(now, dia); total.iob += tIOB.iobContrib; total.activity += tIOB.activityContrib; - Iob bIOB = t.iobCalc(now, dia / Constants.BOLUSSNOOZE_DIA_ADVISOR); + Iob bIOB = t.iobCalc(now, dia / SafeParse.stringToInt(SP.getString("openapsama_bolussnooze_dia_divisor", "2"))); total.bolussnooze += bIOB.iobContrib; } return total; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/persistentnotification/PersistentNotificationPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/persistentnotification/PersistentNotificationPlugin.java index 54b4070bed..31e369889d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/persistentnotification/PersistentNotificationPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/persistentnotification/PersistentNotificationPlugin.java @@ -113,14 +113,14 @@ public class PersistentNotificationPlugin implements PluginBase{ if(profile != null && lastBG != null) { line1 = lastBG.valueToUnitsToString(profile.getUnits()); - } - if (glucoseStatus != null) { - line1 += " Δ" + deltastring(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, profile.getUnits()) - + " avgΔ" + deltastring(glucoseStatus.avgdelta, glucoseStatus.avgdelta * Constants.MGDL_TO_MMOLL, profile.getUnits()); - } else { - line1 += " " + - ctx.getString(R.string.old_data) + - " "; + if (glucoseStatus != null) { + line1 += " Δ" + deltastring(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, profile.getUnits()) + + " avgΔ" + deltastring(glucoseStatus.avgdelta, glucoseStatus.avgdelta * Constants.MGDL_TO_MMOLL, profile.getUnits()); + } else { + line1 += " " + + ctx.getString(R.string.old_data) + + " "; + } } PumpInterface pump = MainApp.getConfigBuilder(); diff --git a/app/src/main/java/info/nightscout/utils/LogDialog.java b/app/src/main/java/info/nightscout/utils/LogDialog.java new file mode 100644 index 0000000000..0bd4216163 --- /dev/null +++ b/app/src/main/java/info/nightscout/utils/LogDialog.java @@ -0,0 +1,68 @@ +package info.nightscout.utils; + +import android.app.AlertDialog; +import android.content.ClipData; +import android.content.Context; +import android.content.DialogInterface; +import android.content.ClipboardManager; +import android.widget.TextView; + +import com.crashlytics.android.Crashlytics; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; + +import info.nightscout.androidaps.MainApp; +import info.nightscout.androidaps.R; + +/** + * Created by mike on 09.02.2017. + */ + +public class LogDialog { + + public static void showLogcat(Context context) { + String logCat = "no logs"; + final String processId = Integer.toString(android.os.Process.myPid()); + try { + Process process = Runtime.getRuntime().exec("logcat -d " + MainApp.sResources.getString(R.string.app_name) + ":D"); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream())); + StringBuilder log = new StringBuilder(); + String line; + + while ((line = bufferedReader.readLine()) != null) { + if (line.contains(processId)) log.append(line + "\n"); + } + logCat = log.toString(); + + } catch (IOException e) { + logCat = e.getLocalizedMessage(); + } finally { + showAlertText(logCat, context); + } + } + + public static void showAlertText(final String msg, final Context context) { + try { + AlertDialog alertDialog = new AlertDialog.Builder(context) + .setMessage(msg) + .setPositiveButton(MainApp.sResources.getString(R.string.copy_to_clipboard), new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); + clipboard.setPrimaryClip(ClipData.newPlainText(null, msg)); + ToastUtils.showToastInUiThread(context, MainApp.sResources.getString(R.string.copied_to_clipboard)); + } + }) + .setNegativeButton(android.R.string.cancel, null) + .show(); + + if (msg.length() > 100) { + TextView textView = (TextView) alertDialog.findViewById(android.R.id.message); + textView.setTextSize(10); + } + } catch (Exception e) { + // crashing on screen rotation + } + } +} diff --git a/app/src/main/res/layout/overview_editquickwizard_dialog.xml b/app/src/main/res/layout/overview_editquickwizard_dialog.xml index c851d708c1..29515f7c79 100644 --- a/app/src/main/res/layout/overview_editquickwizard_dialog.xml +++ b/app/src/main/res/layout/overview_editquickwizard_dialog.xml @@ -4,7 +4,6 @@ android:layout_height="match_parent" tools:context="info.nightscout.androidaps.plugins.Overview.Dialogs.EditQuickWizardDialog"> - + android:id="@+id/nav_show_logcat" + android:title="@string/nav_show_logcat" /> diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index b1f53a89f0..db2ac7c986 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -410,7 +410,6 @@ Дългоср. изменение Писалки OpenAPS AMA - Позволи autosens да променя целите Разреши AMA autosens Autosens данни СТАРИ ДАННИ diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 231091bed4..14932334e2 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -191,8 +191,6 @@ German Maximální hodnota glykémie ještě v rozsahu Minimální hodnota glykémie ještě v rozsahu - Maximální povolený bazál [U/h] - Maximální bazální IOB [U] Bulgarian POTVRDIT Jazyk @@ -240,7 +238,6 @@ Jiný Senzor DanaR profil - Celková doba aktivity inzulínu[h] Chyba při nastavení dočasného bazálu alarm hodinový bazál @@ -434,9 +431,23 @@ TDD Pravděpodobně nepřesné při používání bolusů k doplňování Váha - Povolit funkci Autosens měnit cílový rozsah Nastavení parametru delta BG Profil Krátké názvy modulů Firmware: + Špatné telefonní číslo + Chyba nastavování dočasného bazálu + Nakopírováno do schránky + Kopírovat do schránky + Celková doba aktivity inzulínu + DIA [h] + Toto pole nesmí být prázdné + Zobrazit log + Maximální povolený bazál [U/h] + Maximální bazální IOB [U] + Tato hodnota je v kontextu OpenAPS nazývána max basal + Tato hodnota je v kontextu OpenAPS nazývána max IOB + Povoleny pouze číslice + Povoleny pouze čísla v rozsahu %1$s - %2$s + Neplatné telefonní číslo diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 6db2e7134f..c0f505f944 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -328,4 +328,8 @@ "CONF" "CPP" "CP" + Bitte verwenden Sie nur Ziffern. + Pflichtfeld + Telefonnummer ist nicht gültig. + Bitte verwenden Sie nur Ziffern von %1$s - %2$s diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9dcc45a2a3..5f96bfaee6 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -401,6 +401,8 @@ Actualizar objetivo temporal desde NS Unidades: - Reajuste objetivos por autosens - + Sólo se permiten caracteres numéricos + Sólo se permiten dígitos en el rango %1$s - %2$s + Este campo no puede estar vacío + Número de teléfono inválido diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1aa42e39b4..c3d637f7fb 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -116,6 +116,7 @@ Plugin is disabled Constraints violation Bolus delivery error + Tempbasal delivery error Basal value % (100% = current) Accept new temp basal: @@ -210,8 +211,10 @@ Greek The minimum BG value to be in range. The maximum BG value to be in range. - Max U/hr a Temp Basal can be set to - Maximum basal IOB OpenAPS can deliver [U] + 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] + This value is called Max IOB in OpenAPS context\nThis will default to zero. After several days or weeks, depending on your comfort level, you may choose to adjust this number. Bulgarian DISMISS Language @@ -264,7 +267,8 @@ Temporary Target Cancel DanaR profile settings DIA [h] - Failed to update basal profile + Duration of Insulin Activity + Failed to update basal profile History Reload Uploading @@ -426,7 +430,6 @@ Total Base Basal TBB * 2 Initializing ... - Allow autosens to adjust targets ACT CONF LOOP @@ -453,4 +456,28 @@ Firmware: Model: %02X Protocol: %02X Code: %02X Profile + max_daily_safety_multiplier + Default value: 3\nThis is a key OpenAPS safety cap. What this does is limit your basals to be 3x (in this people) your biggest basal rate. You likely will not need to change this, but you should be aware that’s what is discussed about “3x max daily; 4x current” for safety caps. + current_basal_safety_multiplier + Default value: 4\nThis is the other half of the key OpenAPS safety caps, and the other half of “3x max daily; 4x current” of the safety caps. This means your basal, regardless of max basal set on your pump, cannot be any higher than this number times the current level of your basal. This is to prevent people from getting into dangerous territory by setting excessively high max basals before understanding how the algorithm works. Again, the default is 4x; most people will never need to adjust this and are instead more likely to need to adjust other settings if they feel like they are “running into” this safety cap. + autosens_max + Default value: 1.2\nThis is a multiplier cap for autosens (and soon autotune) to set a 20% max limit on how high the autosens ratio can be, which in turn determines how high autosens can adjust basals, how low it can adjust ISF, and how low it can set the BG target. + autosens_min + Default value: 0.7\nThe other side of the autosens safety limits, putting a cap on how low autosens can adjust basals, and how high it can adjust ISF and BG targets. + autosens_adjust_targets + Default value: true\nThis is used to allow autosens to adjust BG targets, in addition to ISF and basals. + bolussnooze_dia_divisor + Default value: 2\nBolus snooze is enacted after you do a meal bolus, so the loop won’t counteract with low temps when you’ve just eaten. The example here and default is 2; so a 3 hour DIA means that bolus snooze will be gradually phased out over 1.5 hours (3DIA/2). + min_5m_carbimpact + Default value: 3.0\nThis is a setting for default carb absorption impact per 5 minutes. The default is an expected 3mg/dl/5min. This affects how fast COB are decayed, and how much carb absorption is assumed in calculating future predicted BG, when BG is falling more than expected, or not rising as much as expected. + Attention!\nNormally you do not have to change these values below. Please CLICK HERE and READ the text and make sure you UNDERSTAND it before change any of these values. + http://openaps.readthedocs.io/en/latest/docs/walkthrough/phase-3/beyond-low-glucose-suspend.html + Only numeric digits are allowed. + Only numeric digits within the range %1$s - %2$s are allowed. + The field must not be empty + Phone number not valid + Invalid SMS phone number + Copy To Clipboard + Copied to clipboard + Show log diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 4cafe9dd35..5c1f55b5f7 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -8,7 +8,9 @@ @color/colorAccent - +