Merge pull request #60 from MilosKozak/dev

Dev
This commit is contained in:
AdrianLxM 2017-02-09 23:47:12 +01:00 committed by GitHub
commit 8ece312b6a
40 changed files with 339 additions and 108 deletions

3
.gitignore vendored
View file

@ -7,3 +7,6 @@ wear/wear.iml
.DS_Store .DS_Store
/build /build
/captures /captures
*.apk
build/
**/*.iml

View file

@ -44,7 +44,7 @@ android {
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 23 targetSdkVersion 23
versionCode 1100 versionCode 1100
versionName "1.1d" versionName "1.1e"
buildConfigField "String", "BUILDVERSION", generateGitBuild() buildConfigField "String", "BUILDVERSION", generateGitBuild()
} }
lintOptions { lintOptions {
@ -105,12 +105,22 @@ android {
} }
} }
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}
dependencies { dependencies {
wearWearApp project(path: ':wear', configuration: 'fullRelease') wearWearApp project(path: ':wear', configuration: 'fullRelease')
compile fileTree(include: ['*.jar'], dir: 'libs') compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') { compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') {
transitive = true; transitive = true;
} }
compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0' compile 'com.android.support:cardview-v7:23.4.0'
@ -134,4 +144,6 @@ dependencies {
androidTestCompile 'org.mockito:mockito-core:2.+' androidTestCompile 'org.mockito:mockito-core:2.+'
androidTestCompile "com.google.dexmaker:dexmaker:1.2" androidTestCompile "com.google.dexmaker:dexmaker:1.2"
androidTestCompile "com.google.dexmaker:dexmaker-mockito:1.2" androidTestCompile "com.google.dexmaker:dexmaker-mockito:1.2"
compile(name:'android-edittext-validator-v1.3.4-mod', ext:'aar')
} }

Binary file not shown.

View file

@ -25,19 +25,8 @@ public class Constants {
public static final long keepAliveMsecs = 5 * 60 * 1000L; public static final long keepAliveMsecs = 5 * 60 * 1000L;
// SMS COMMUNICATOR // SMS COMMUNICATOR
public static final long remoteBolusMinDistance = 15 * 60 * 1000L; 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 // Circadian Percentage Profile
public static final int CPP_MIN_PERCENTAGE = 50; public static final int CPP_MIN_PERCENTAGE = 50;
public static final int CPP_MAX_PERCENTAGE = 200; public static final int CPP_MAX_PERCENTAGE = 200;

View file

@ -9,7 +9,6 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog; 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.EventPreferenceChange;
import info.nightscout.androidaps.events.EventRefreshGui; import info.nightscout.androidaps.events.EventRefreshGui;
import info.nightscout.androidaps.interfaces.PluginBase; 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.SlidingTabLayout;
import info.nightscout.androidaps.tabs.TabPageAdapter; import info.nightscout.androidaps.tabs.TabPageAdapter;
import info.nightscout.utils.LogDialog;
import info.nightscout.utils.ImportExportPrefs; import info.nightscout.utils.ImportExportPrefs;
import info.nightscout.utils.LocaleHelper; import info.nightscout.utils.LocaleHelper;
@ -145,6 +143,9 @@ public class MainActivity extends AppCompatActivity {
ImportExportPrefs.verifyStoragePermissions(this); ImportExportPrefs.verifyStoragePermissions(this);
ImportExportPrefs.importSharedPreferences(this); ImportExportPrefs.importSharedPreferences(this);
break; break;
case R.id.nav_show_logcat:
LogDialog.showLogcat(this);
break;
// case R.id.nav_test_alarm: // case R.id.nav_test_alarm:
// final int REQUEST_CODE_ASK_PERMISSIONS = 2355; // final int REQUEST_CODE_ASK_PERMISSIONS = 2355;
// int permission = ActivityCompat.checkSelfPermission(this, Manifest.permission.SYSTEM_ALERT_WINDOW); // int permission = ActivityCompat.checkSelfPermission(this, Manifest.permission.SYSTEM_ALERT_WINDOW);

View file

@ -90,7 +90,7 @@ public class MainApp extends Application {
pluginsList.add(SimpleProfileFragment.getPlugin()); pluginsList.add(SimpleProfileFragment.getPlugin());
pluginsList.add(LocalProfileFragment.getPlugin()); pluginsList.add(LocalProfileFragment.getPlugin());
pluginsList.add(CircadianPercentageProfileFragment.getPlugin()); pluginsList.add(CircadianPercentageProfileFragment.getPlugin());
pluginsList.add(TempTargetRangeFragment.getPlugin()); if (Config.APS) pluginsList.add(TempTargetRangeFragment.getPlugin());
pluginsList.add(TreatmentsFragment.getPlugin()); pluginsList.add(TreatmentsFragment.getPlugin());
pluginsList.add(TempBasalsFragment.getPlugin()); pluginsList.add(TempBasalsFragment.getPlugin());
pluginsList.add(SafetyFragment.getPlugin()); pluginsList.add(SafetyFragment.getPlugin());

View file

@ -11,6 +11,7 @@ import android.preference.PreferenceFragment;
import android.preference.PreferenceGroup; import android.preference.PreferenceGroup;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.events.EventRefreshGui; import info.nightscout.androidaps.events.EventRefreshGui;
import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginBase;
@ -53,10 +54,10 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
} }
if (pref instanceof EditTextPreference) { if (pref instanceof EditTextPreference) {
EditTextPreference editTextPref = (EditTextPreference) pref; EditTextPreference editTextPref = (EditTextPreference) pref;
if (pref.getTitle().toString().toLowerCase().contains("password")) if (pref.getKey().contains("danar_password")) {
{
pref.setSummary("******"); 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()); pref.setSummary(editTextPref.getText());
} }
} }
@ -90,7 +91,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
addPreferencesFromResource(R.xml.pref_closedmode); addPreferencesFromResource(R.xml.pref_closedmode);
if (Config.OPENAPSENABLED) if (Config.OPENAPSENABLED)
addPreferencesFromResource(R.xml.pref_openapsma); 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_openapsama);
addPreferencesFromResource(R.xml.pref_profile); addPreferencesFromResource(R.xml.pref_profile);
if (Config.DANAR) { if (Config.DANAR) {

View file

@ -81,9 +81,9 @@ public class GlucoseStatus {
BgReading then = data.get(i); BgReading then = data.get(i);
long then_date = then.timeIndex; long then_date = then.timeIndex;
double avgdelta = 0; 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 // multiply by 5 to get the same units as delta, i.e. mg/dL/5m
change = now.value - then.value; change = now.value - then.value;
avgdelta = change / minutesago * 5; avgdelta = change / minutesago * 5;

View file

@ -18,14 +18,13 @@ import info.nightscout.client.data.NSProfile;
public class MealData { public class MealData {
public double boluses = 0d; public double boluses = 0d;
public double carbs = 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) { public void addTreatment(Treatment treatment) {
NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile();
if (profile == null) return; if (profile == null) return;
// TODO: not sure how much data do i need for AMA
List<BgReading> bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime((long) (new Date().getTime() - 60 * 60 * 1000L * profile.getDia() * 2), false); List<BgReading> bgReadings = MainApp.getDbHelper().getBgreadingsDataFromTime((long) (new Date().getTime() - 60 * 60 * 1000L * profile.getDia() * 2), false);
long now = new Date().getTime(); long now = new Date().getTime();

View file

@ -151,7 +151,7 @@ public class NewTempBasalDialog extends DialogFragment implements View.OnClickLi
} }
if (!result.success) { if (!result.success) {
AlertDialog.Builder builder = new AlertDialog.Builder(context); 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.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null); builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show(); builder.show();

View file

@ -64,7 +64,6 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase {
// TODO: sorting // TODO: sorting
// TODO: Toast and sound when command failed
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,

View file

@ -219,7 +219,7 @@ public class DanaRFragment extends Fragment implements FragmentBase {
Long agoMsec = new Date().getTime() - pump.lastBolusTime.getTime(); Long agoMsec = new Date().getTime() - pump.lastBolusTime.getTime();
double agoHours = agoMsec / 60d / 60d / 1000d; double agoHours = agoMsec / 60d / 60d / 1000d;
if (agoHours < 6) // max 6h back 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(""); else lastBolusView.setText("");
} }
@ -242,7 +242,7 @@ public class DanaRFragment extends Fragment implements FragmentBase {
SetWarnColor.setColorInverse(batteryView, pump.batteryRemaining, 51d, 26d); SetWarnColor.setColorInverse(batteryView, pump.batteryRemaining, 51d, 26d);
iobView.setText(pump.iob + " U"); iobView.setText(pump.iob + " U");
if (pump.isNewPump) { 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 { } else {
firmwareView.setText("OLD"); firmwareView.setText("OLD");
} }

View file

@ -258,6 +258,8 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
if (!isInitialized()) if (!isInitialized())
return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS
DanaRPump pump = getDanaRPump(); 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 basalValues = pump.basal48Enable ? 48 : 24;
int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60; int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60;
for (int h = 0; h < basalValues; h++) { for (int h = 0; h < basalValues; h++) {
@ -290,17 +292,19 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
@Override @Override
public double getTempBasalAbsoluteRate() { public double getTempBasalAbsoluteRate() {
if (isRealTempBasalInProgress()) { TempBasal tb = getRealTempBasal();
if (getRealTempBasal().isAbsolute) { if (tb != null) {
return getRealTempBasal().absolute; if (tb.isAbsolute) {
return tb.absolute;
} else { } else {
Double baseRate = getBaseBasalRate(); Double baseRate = getBaseBasalRate();
Double tempRate = baseRate * (getRealTempBasal().percent / 100d); Double tempRate = baseRate * (tb.percent / 100d);
return tempRate; return tempRate;
} }
} }
if (isExtendedBoluslInProgress() && useExtendedBoluses) { TempBasal eb = getExtendedBolus();
return getBaseBasalRate() + getExtendedBolus().absolute; if (eb != null && useExtendedBoluses) {
return getBaseBasalRate() + eb.absolute;
} }
return 0; return 0;
} }
@ -707,11 +711,12 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
extended.put("PumpIOB", getDanaRPump().iob); extended.put("PumpIOB", getDanaRPump().iob);
extended.put("LastBolus", getDanaRPump().lastBolusTime.toLocaleString()); extended.put("LastBolus", getDanaRPump().lastBolusTime.toLocaleString());
extended.put("LastBolusAmount", getDanaRPump().lastBolusAmount); extended.put("LastBolusAmount", getDanaRPump().lastBolusAmount);
if (isTempBasalInProgress()) { TempBasal tb = getTempBasal();
if (tb != null) {
extended.put("TempBasalAbsoluteRate", getTempBasalAbsoluteRate()); extended.put("TempBasalAbsoluteRate", getTempBasalAbsoluteRate());
extended.put("TempBasalStart", getTempBasal().timeStart.toLocaleString()); extended.put("TempBasalStart", tb.timeStart.toLocaleString());
extended.put("TempBasalRemaining", getTempBasal().getPlannedRemainingMinutes()); extended.put("TempBasalRemaining", tb.getPlannedRemainingMinutes());
extended.put("IsExtended", getTempBasal().isExtended); extended.put("IsExtended", tb.isExtended);
} }
extended.put("BaseBasalRate", getBaseBasalRate()); extended.put("BaseBasalRate", getBaseBasalRate());
try { try {

View file

@ -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.EventDanaRConnectionStatus;
import info.nightscout.androidaps.plugins.DanaR.events.EventDanaRSyncStatus; import info.nightscout.androidaps.plugins.DanaR.events.EventDanaRSyncStatus;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.SafeParse;
import info.nightscout.utils.ToastUtils; import info.nightscout.utils.ToastUtils;
public class DanaRStatsActivity extends Activity { public class DanaRStatsActivity extends Activity {
@ -366,7 +367,7 @@ public class DanaRStatsActivity extends Activity {
return; return;
} }
else { else {
magicNumber = Double.parseDouble(TBB); magicNumber = SafeParse.stringToDouble(TBB);
} }
magicNumber *=2; magicNumber *=2;

View file

@ -240,7 +240,7 @@ public class DanaRKoreanFragment extends Fragment implements FragmentBase {
SetWarnColor.setColorInverse(batteryView, pump.batteryRemaining, 51d, 26d); SetWarnColor.setColorInverse(batteryView, pump.batteryRemaining, 51d, 26d);
iobView.setText(pump.iob + " U"); iobView.setText(pump.iob + " U");
if (pump.isNewPump) { 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 { } else {
firmwareView.setText("OLD"); firmwareView.setText("OLD");
} }

View file

@ -258,6 +258,8 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
if (!isInitialized()) if (!isInitialized())
return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS return true; // TODO: not sure what's better. so far TRUE to prevent too many SMS
DanaRKoreanPump pump = getDanaRPump(); 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 basalValues = pump.basal48Enable ? 48 : 24;
int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60; int basalIncrement = pump.basal48Enable ? 30 * 60 : 60 * 60;
for (int h = 0; h < basalValues; h++) { for (int h = 0; h < basalValues; h++) {
@ -290,17 +292,19 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
@Override @Override
public double getTempBasalAbsoluteRate() { public double getTempBasalAbsoluteRate() {
if (isRealTempBasalInProgress()) { TempBasal tb = getRealTempBasal();
if (getRealTempBasal().isAbsolute) { if (tb != null) {
return getRealTempBasal().absolute; if (tb.isAbsolute) {
return tb.absolute;
} else { } else {
Double baseRate = getBaseBasalRate(); Double baseRate = getBaseBasalRate();
Double tempRate = baseRate * (getRealTempBasal().percent / 100d); Double tempRate = baseRate * (tb.percent / 100d);
return tempRate; return tempRate;
} }
} }
if (isExtendedBoluslInProgress() && useExtendedBoluses) { TempBasal eb = getExtendedBolus();
return getBaseBasalRate() + getExtendedBolus().absolute; if (eb != null && useExtendedBoluses) {
return getBaseBasalRate() + eb.absolute;
} }
return 0; return 0;
} }
@ -707,11 +711,12 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
extended.put("PumpIOB", getDanaRPump().iob); extended.put("PumpIOB", getDanaRPump().iob);
// extended.put("LastBolus", getDanaRPump().lastBolusTime.toLocaleString()); // extended.put("LastBolus", getDanaRPump().lastBolusTime.toLocaleString());
// extended.put("LastBolusAmount", getDanaRPump().lastBolusAmount); // extended.put("LastBolusAmount", getDanaRPump().lastBolusAmount);
if (isTempBasalInProgress()) { TempBasal tb = getTempBasal();
if (tb != null) {
extended.put("TempBasalAbsoluteRate", getTempBasalAbsoluteRate()); extended.put("TempBasalAbsoluteRate", getTempBasalAbsoluteRate());
extended.put("TempBasalStart", getTempBasal().timeStart.toLocaleString()); extended.put("TempBasalStart", tb.timeStart.toLocaleString());
extended.put("TempBasalRemaining", getTempBasal().getPlannedRemainingMinutes()); extended.put("TempBasalRemaining", tb.getPlannedRemainingMinutes());
extended.put("IsExtended", getTempBasal().isExtended); extended.put("IsExtended", tb.isExtended);
} }
extended.put("BaseBasalRate", getBaseBasalRate()); extended.put("BaseBasalRate", getBaseBasalRate());
try { try {

View file

@ -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.DanaR.events.EventDanaRSyncStatus;
import info.nightscout.androidaps.plugins.DanaRKorean.Services.ExecutionService; import info.nightscout.androidaps.plugins.DanaRKorean.Services.ExecutionService;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.SafeParse;
import info.nightscout.utils.ToastUtils; import info.nightscout.utils.ToastUtils;
public class DanaRStatsActivity extends Activity { public class DanaRStatsActivity extends Activity {
@ -366,7 +367,7 @@ public class DanaRStatsActivity extends Activity {
return; return;
} }
else { else {
magicNumber = Double.parseDouble(TBB); magicNumber = SafeParse.stringToDouble(TBB);
} }
magicNumber *=2; magicNumber *=2;

View file

@ -1,5 +1,8 @@
package info.nightscout.androidaps.plugins.OpenAPSAMA; package info.nightscout.androidaps.plugins.OpenAPSAMA;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -14,13 +17,14 @@ import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.db.BgReading; import info.nightscout.androidaps.db.BgReading;
import info.nightscout.client.data.NSProfile; import info.nightscout.client.data.NSProfile;
import info.nightscout.utils.Round; import info.nightscout.utils.Round;
import info.nightscout.utils.SafeParse;
public class Autosens { public class Autosens {
private static Logger log = LoggerFactory.getLogger(Autosens.class); private static Logger log = LoggerFactory.getLogger(Autosens.class);
public static AutosensResult detectSensitivityandCarbAbsorption(List<BgReading> glucose_data, Long mealTime) { public static AutosensResult detectSensitivityandCarbAbsorption(List<BgReading> glucose_data, Long mealTime) {
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile();
//console.error(mealTime); //console.error(mealTime);
@ -128,7 +132,7 @@ public class Autosens {
if (mealTime != null && bgTime > mealTime) { if (mealTime != null && bgTime > mealTime) {
// figure out how many carbs that represents // figure out how many carbs that represents
// but always assume at least 3mg/dL/5m (default) absorption // 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; double absorbed = ci * profile.getIc(secondsFromMidnight) / sens;
// and add that to the running total carbsAbsorbed // and add that to the running total carbsAbsorbed
carbsAbsorbed += absorbed; carbsAbsorbed += absorbed;
@ -176,10 +180,10 @@ public class Autosens {
log.debug(sensResult); log.debug(sensResult);
ratio = 1 + (basalOff / profile.getMaxDailyBasal()); ratio = 1 + (basalOff / profile.getMaxDailyBasal());
// don't adjust more than 1.5x // don't adjust more than 1.5x
double rawRatio = ratio; double rawRatio = ratio;
ratio = Math.max(ratio, Constants.AUTOSENS_MIN); ratio = Math.max(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_min", "0.7")));
ratio = Math.min(ratio, Constants.AUTOSENS_MAX); ratio = Math.min(ratio, SafeParse.stringToDouble(SP.getString("openapsama_autosens_max", "1.2")));
if (ratio != rawRatio) { if (ratio != rawRatio) {
ratioLimit = "Ratio limited from " + rawRatio + " to " + ratio; ratioLimit = "Ratio limited from " + rawRatio + " to " + ratio;

View file

@ -27,6 +27,7 @@ import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.Loop.ScriptReader; import info.nightscout.androidaps.plugins.Loop.ScriptReader;
import info.nightscout.androidaps.data.IobTotal; import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.client.data.NSProfile; import info.nightscout.client.data.NSProfile;
import info.nightscout.utils.SafeParse;
public class DetermineBasalAdapterAMAJS { public class DetermineBasalAdapterAMAJS {
private static Logger log = LoggerFactory.getLogger(DetermineBasalAdapterAMAJS.class); private static Logger log = LoggerFactory.getLogger(DetermineBasalAdapterAMAJS.class);
@ -209,7 +210,6 @@ public class DetermineBasalAdapterAMAJS {
String units = profile.getUnits(); String units = profile.getUnits();
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
boolean autosensAdustTargets = preferences.getBoolean("openapsama_autosens_adjusttargets", false);
mProfile = new V8Object(mV8rt); mProfile = new V8Object(mV8rt);
mProfile.add("max_iob", maxIob); mProfile.add("max_iob", maxIob);
@ -222,13 +222,13 @@ public class DetermineBasalAdapterAMAJS {
mProfile.add("target_bg", targetBg); mProfile.add("target_bg", targetBg);
mProfile.add("carb_ratio", profile.getIc(profile.secondsFromMidnight())); mProfile.add("carb_ratio", profile.getIc(profile.secondsFromMidnight()));
mProfile.add("sens", NSProfile.toMgdl(profile.getIsf(NSProfile.secondsFromMidnight()).doubleValue(), units)); mProfile.add("sens", NSProfile.toMgdl(profile.getIsf(NSProfile.secondsFromMidnight()).doubleValue(), units));
mProfile.add("max_daily_safety_multiplier", Constants.MAX_DAILY_SAFETY_MULTIPLIER); mProfile.add("max_daily_safety_multiplier", SafeParse.stringToInt(preferences.getString("openapsama_max_daily_safety_multiplier", "3")));
mProfile.add("current_basal_safety_multiplier", Constants.CURRENT_BASAL_SAFETY_MULTIPLIER); mProfile.add("current_basal_safety_multiplier", SafeParse.stringToInt(preferences.getString("openapsama_max_basal_safety_multiplier", "4")));
mProfile.add("skip_neutral_temps", true); mProfile.add("skip_neutral_temps", true);
mProfile.add("current_basal", pump.getBaseBasalRate()); mProfile.add("current_basal", pump.getBaseBasalRate());
mProfile.add("temptargetSet", tempTargetSet); mProfile.add("temptargetSet", tempTargetSet);
mProfile.add("autosens_adjust_targets", autosensAdustTargets); mProfile.add("autosens_adjust_targets", preferences.getBoolean("openapsama_autosens_adjusttargets", true));
mProfile.add("min_5m_carbimpact", min_5m_carbimpact); mProfile.add("min_5m_carbimpact", SafeParse.stringToDouble(preferences.getString("openapsama_min_5m_carbimpact", "3.0")));
mV8rt.add(PARAM_profile, mProfile); mV8rt.add(PARAM_profile, mProfile);
mCurrentTemp = new V8Object(mV8rt); mCurrentTemp = new V8Object(mV8rt);

View file

@ -235,7 +235,7 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
determineBasalAdapterAMAJS.setData(profile, maxIob, maxBasal, minBg, maxBg, targetBg, pump, iobArray, glucoseStatus, mealData, determineBasalAdapterAMAJS.setData(profile, maxIob, maxBasal, minBg, maxBg, targetBg, pump, iobArray, glucoseStatus, mealData,
lastAutosensResult.ratio, //autosensDataRatio lastAutosensResult.ratio, //autosensDataRatio
isTempTarget, isTempTarget,
Constants.MIN_5M_CARBIMPACT //min_5m_carbimpact SafeParse.stringToDouble(SP.getString("openapsama_min_5m_carbimpact", "3.0"))//min_5m_carbimpact
); );

View file

@ -137,7 +137,7 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL
@Override @Override
public void run() { public void run() {
if (c.sStatus == c.CONNECTING) { 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) { } else if (c.sStatus == c.CONNECTED) {
statusView.setText(MainApp.sResources.getString(R.string.connected)); statusView.setText(MainApp.sResources.getString(R.string.connected));
} else { } else {

View file

@ -21,6 +21,7 @@ public class Notification {
public static final int FAILED_UDPATE_PROFILE = 6; public static final int FAILED_UDPATE_PROFILE = 6;
public static final int BASAL_VALUE_BELOW_MINIMUM = 7; public static final int BASAL_VALUE_BELOW_MINIMUM = 7;
public static final int OLD_NSCLIENT = 8; public static final int OLD_NSCLIENT = 8;
public static final int INVALID_PHONE_NUMBER = 9;
public int id; public int id;
public Date date; public Date date;

View file

@ -237,7 +237,7 @@ public class OverviewFragment extends Fragment {
acceptTempButton.setOnClickListener(new View.OnClickListener() { acceptTempButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { 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; final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun;
if (finalLastRun != null && finalLastRun.lastAPSRun != null && finalLastRun.constraintsProcessed.changeRequested) { if (finalLastRun != null && finalLastRun.lastAPSRun != null && finalLastRun.constraintsProcessed.changeRequested) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext()); AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
@ -532,7 +532,7 @@ public class OverviewFragment extends Fragment {
// temp target // temp target
NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile();
TempTargetRangePlugin tempTargetRangePlugin = (TempTargetRangePlugin) MainApp.getSpecificPlugin(TempTargetRangePlugin.class); 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()); TempTarget tempTarget = tempTargetRangePlugin.getTempTargetInProgress(new Date().getTime());
if (tempTarget != null) { if (tempTarget != null) {
tempTargetView.setTextColor(Color.BLACK); 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.lastOpenModeAccept == null || finalLastRun.lastOpenModeAccept.getTime() < finalLastRun.lastAPSRun.getTime()); // never accepted or before last result
showAcceptButton = showAcceptButton && finalLastRun.constraintsProcessed.changeRequested; // change is requested showAcceptButton = showAcceptButton && finalLastRun.constraintsProcessed.changeRequested; // change is requested
if (showAcceptButton && pump.isInitialized()) { if (showAcceptButton && pump.isInitialized() && ConfigBuilderPlugin.getActiveLoop() != null) {
acceptTempLayout.setVisibility(View.VISIBLE); acceptTempLayout.setVisibility(View.VISIBLE);
acceptTempButton.setText(getContext().getString(R.string.setbasalquestion) + "\n" + finalLastRun.constraintsProcessed); acceptTempButton.setText(getContext().getString(R.string.setbasalquestion) + "\n" + finalLastRun.constraintsProcessed);
} else { } else {

View file

@ -103,8 +103,8 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface {
if (profile == null) return absoluteRate; if (profile == null) return absoluteRate;
if (absoluteRate < 0) absoluteRate = 0d; if (absoluteRate < 0) absoluteRate = 0d;
Integer maxBasalMult = Constants.CURRENT_BASAL_SAFETY_MULTIPLIER; Integer maxBasalMult = SafeParse.stringToInt(SP.getString("openapsama_max_basal_safety_multiplier", "4"));
Integer maxBasalFromDaily = Constants.MAX_DAILY_SAFETY_MULTIPLIER; 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 // Check percentRate but absolute rate too, because we know real current basal in pump
Double origRate = absoluteRate; Double origRate = absoluteRate;
if (absoluteRate > maxBasal) { if (absoluteRate > maxBasal) {
@ -142,8 +142,8 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface {
if (absoluteRate < 0) absoluteRate = 0d; if (absoluteRate < 0) absoluteRate = 0d;
Integer maxBasalMult = Constants.CURRENT_BASAL_SAFETY_MULTIPLIER; Integer maxBasalMult = SafeParse.stringToInt(SP.getString("openapsama_max_basal_safety_multiplier", "4"));
Integer maxBasalFromDaily = Constants.MAX_DAILY_SAFETY_MULTIPLIER; 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 // Check percentRate but absolute rate too, because we know real current basal in pump
Double origRate = absoluteRate; Double origRate = absoluteRate;
if (absoluteRate > maxBasal) { if (absoluteRate > maxBasal) {
@ -191,7 +191,7 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface {
public Integer applyCarbsConstraints(Integer carbs) { public Integer applyCarbsConstraints(Integer carbs) {
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
try { 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 < 0) carbs = 0;
if (carbs > maxCarbs) carbs = maxCarbs; if (carbs > maxCarbs) carbs = maxCarbs;

View file

@ -31,6 +31,8 @@ import info.nightscout.androidaps.plugins.DanaR.DanaRPlugin;
import info.nightscout.androidaps.plugins.DanaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.plugins.DanaRKorean.DanaRKoreanPlugin;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
import info.nightscout.androidaps.data.IobTotal; 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.EventNewSMS;
import info.nightscout.androidaps.plugins.SmsCommunicator.events.EventSmsCommunicatorUpdateGui; import info.nightscout.androidaps.plugins.SmsCommunicator.events.EventSmsCommunicatorUpdateGui;
import info.nightscout.client.data.NSProfile; import info.nightscout.client.data.NSProfile;
@ -446,8 +448,13 @@ public class SmsCommunicatorPlugin implements PluginBase {
SmsManager smsManager = SmsManager.getDefault(); SmsManager smsManager = SmsManager.getDefault();
sms.text = stripAccents(sms.text); sms.text = stripAccents(sms.text);
if (sms.text.length() > 140) sms.text = sms.text.substring(0, 139); if (sms.text.length() > 140) sms.text = sms.text.substring(0, 139);
smsManager.sendTextMessage(sms.phoneNumber, null, sms.text, null, null); try {
messages.add(sms); 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() { private String generatePasscode() {

View file

@ -1,5 +1,8 @@
package info.nightscout.androidaps.plugins.Treatments; package info.nightscout.androidaps.plugins.Treatments;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.j256.ormlite.dao.Dao; import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.stmt.PreparedQuery; import com.j256.ormlite.stmt.PreparedQuery;
import com.j256.ormlite.stmt.QueryBuilder; 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.data.IobTotal;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.client.data.NSProfile; import info.nightscout.client.data.NSProfile;
import info.nightscout.utils.SafeParse;
/** /**
* Created by mike on 05.08.2016. * Created by mike on 05.08.2016.
@ -121,6 +125,7 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
@Override @Override
public IobTotal getCalculationToTime(long time) { public IobTotal getCalculationToTime(long time) {
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
IobTotal total = new IobTotal(time); IobTotal total = new IobTotal(time);
if (MainApp.getConfigBuilder() == null || ConfigBuilderPlugin.getActiveProfile() == null) // app not initialized yet 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); Iob tIOB = t.iobCalc(now, dia);
total.iob += tIOB.iobContrib; total.iob += tIOB.iobContrib;
total.activity += tIOB.activityContrib; 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; total.bolussnooze += bIOB.iobContrib;
} }
return total; return total;

View file

@ -113,14 +113,14 @@ public class PersistentNotificationPlugin implements PluginBase{
if(profile != null && lastBG != null) { if(profile != null && lastBG != null) {
line1 = lastBG.valueToUnitsToString(profile.getUnits()); line1 = lastBG.valueToUnitsToString(profile.getUnits());
} if (glucoseStatus != null) {
if (glucoseStatus != null) { line1 += " Δ" + deltastring(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, profile.getUnits())
line1 += " Δ" + deltastring(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, profile.getUnits()) + " avgΔ" + deltastring(glucoseStatus.avgdelta, glucoseStatus.avgdelta * Constants.MGDL_TO_MMOLL, profile.getUnits());
+ " avgΔ" + deltastring(glucoseStatus.avgdelta, glucoseStatus.avgdelta * Constants.MGDL_TO_MMOLL, profile.getUnits()); } else {
} else { line1 += " " +
line1 += " " + ctx.getString(R.string.old_data) +
ctx.getString(R.string.old_data) + " ";
" "; }
} }
PumpInterface pump = MainApp.getConfigBuilder(); PumpInterface pump = MainApp.getConfigBuilder();

View file

@ -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
}
}
}

View file

@ -4,7 +4,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="info.nightscout.androidaps.plugins.Overview.Dialogs.EditQuickWizardDialog"> tools:context="info.nightscout.androidaps.plugins.Overview.Dialogs.EditQuickWizardDialog">
<!-- TODO: Update blank fragment layout -->
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -14,8 +14,8 @@
android:id="@+id/nav_import" android:id="@+id/nav_import"
android:title="@string/nav_import" /> android:title="@string/nav_import" />
<item <item
android:id="@+id/nav_test_alarm" android:id="@+id/nav_show_logcat"
android:title="@string/nav_test_alert" /> android:title="@string/nav_show_logcat" />
<item <item
android:id="@+id/nav_exit" android:id="@+id/nav_exit"
android:title="@string/nav_exit" /> android:title="@string/nav_exit" />

View file

@ -410,7 +410,6 @@
<string name="long_avgdelta">Дългоср. изменение</string> <string name="long_avgdelta">Дългоср. изменение</string>
<string name="mdi">Писалки</string> <string name="mdi">Писалки</string>
<string name="openapsama">OpenAPS AMA</string> <string name="openapsama">OpenAPS AMA</string>
<string name="openapsama_autosens_adjusttargets">Позволи autosens да променя целите</string>
<string name="openapsama_useautosens">Разреши AMA autosens</string> <string name="openapsama_useautosens">Разреши AMA autosens</string>
<string name="openapsma_autosensdata_label">Autosens данни</string> <string name="openapsma_autosensdata_label">Autosens данни</string>
<string name="old_data">СТАРИ ДАННИ</string> <string name="old_data">СТАРИ ДАННИ</string>

View file

@ -191,8 +191,6 @@
<string name="de_lang">German</string> <string name="de_lang">German</string>
<string name="openapsma_high_summary">Maximální hodnota glykémie ještě v rozsahu</string> <string name="openapsma_high_summary">Maximální hodnota glykémie ještě v rozsahu</string>
<string name="openapsma_low_summary">Minimální hodnota glykémie ještě v rozsahu</string> <string name="openapsma_low_summary">Minimální hodnota glykémie ještě v rozsahu</string>
<string name="openapsma_maxbasal_summary">Maximální povolený bazál [U/h]</string>
<string name="openapsma_maxiob_summary">Maximální bazální IOB [U]</string>
<string name="bg_lang">Bulgarian</string> <string name="bg_lang">Bulgarian</string>
<string name="dismiss">POTVRDIT</string> <string name="dismiss">POTVRDIT</string>
<string name="language">Jazyk</string> <string name="language">Jazyk</string>
@ -240,7 +238,6 @@
<string name="manual">Jiný</string> <string name="manual">Jiný</string>
<string name="glucosetype_sensor">Senzor</string> <string name="glucosetype_sensor">Senzor</string>
<string name="danarprofile">DanaR profil</string> <string name="danarprofile">DanaR profil</string>
<string name="danarprofile_dia">Celková doba aktivity inzulínu[h]</string>
<string name="failedupdatebasalprofile">Chyba při nastavení dočasného bazálu</string> <string name="failedupdatebasalprofile">Chyba při nastavení dočasného bazálu</string>
<string name="danar_alarm">alarm</string> <string name="danar_alarm">alarm</string>
<string name="danar_basalhour">hodinový bazál</string> <string name="danar_basalhour">hodinový bazál</string>
@ -434,9 +431,23 @@
<string name="danar_stats_tdd">TDD</string> <string name="danar_stats_tdd">TDD</string>
<string name="danar_stats_warning_Message">Pravděpodobně nepřesné při používání bolusů k doplňování</string> <string name="danar_stats_warning_Message">Pravděpodobně nepřesné při používání bolusů k doplňování</string>
<string name="danar_stats_weight">Váha</string> <string name="danar_stats_weight">Váha</string>
<string name="openapsama_autosens_adjusttargets">Povolit funkci Autosens měnit cílový rozsah</string>
<string name="prefs_delta_title">Nastavení parametru delta BG</string> <string name="prefs_delta_title">Nastavení parametru delta BG</string>
<string name="profile">Profil</string> <string name="profile">Profil</string>
<string name="short_tabtitles">Krátké názvy modulů</string> <string name="short_tabtitles">Krátké názvy modulů</string>
<string name="virtualpump_firmware_label">Firmware:</string> <string name="virtualpump_firmware_label">Firmware:</string>
<string name="smscommunicator_invalidphonennumber">Špatné telefonní číslo</string>
<string name="tempbasaldeliveryerror">Chyba nastavování dočasného bazálu</string>
<string name="copied_to_clipboard">Nakopírováno do schránky</string>
<string name="copy_to_clipboard">Kopírovat do schránky</string>
<string name="danarprofile_dia_summary">Celková doba aktivity inzulínu</string>
<string name="danarprofile_dia">DIA [h]</string>
<string name="error_field_must_not_be_empty">Toto pole nesmí být prázdné</string>
<string name="nav_show_logcat">Zobrazit log</string>
<string name="openapsma_maxbasal_title">Maximální povolený bazál [U/h]</string>
<string name="openapsma_maxiob_title">Maximální bazální IOB [U]</string>
<string name="openapsma_maxbasal_summary">Tato hodnota je v kontextu OpenAPS nazývána max basal</string>
<string name="openapsma_maxiob_summary">Tato hodnota je v kontextu OpenAPS nazývána max IOB</string>
<string name="error_only_numeric_digits_allowed">Povoleny pouze číslice</string>
<string name="error_only_numeric_digits_range_allowed">Povoleny pouze čísla v rozsahu %1$s - %2$s</string>
<string name="error_phone_not_valid">Neplatné telefonní číslo</string>
</resources> </resources>

View file

@ -328,4 +328,8 @@
<string name="configbuilder_shortname">"CONF"</string> <string name="configbuilder_shortname">"CONF"</string>
<string name="circadian_percentage_profile_shortname">"CPP"</string> <string name="circadian_percentage_profile_shortname">"CPP"</string>
<string name="careportal_shortname">"CP"</string> <string name="careportal_shortname">"CP"</string>
<string name="error_only_numeric_digits_allowed">Bitte verwenden Sie nur Ziffern.</string>
<string name="error_field_must_not_be_empty">Pflichtfeld</string>
<string name="error_phone_not_valid">Telefonnummer ist nicht gültig.</string>
<string name="error_only_numeric_digits_range_allowed">Bitte verwenden Sie nur Ziffern von %1$s - %2$s</string>
</resources> </resources>

View file

@ -401,6 +401,8 @@
<string name="temptargetrange_refreshfromnightscout">Actualizar objetivo temporal desde NS</string> <string name="temptargetrange_refreshfromnightscout">Actualizar objetivo temporal desde NS</string>
<string name="timeshift_hint"></string> <string name="timeshift_hint"></string>
<string name="units">Unidades:</string> <string name="units">Unidades:</string>
<string name="openapsama_autosens_adjusttargets">Reajuste objetivos por autosens</string> <string name="error_only_numeric_digits_allowed">Sólo se permiten caracteres numéricos</string>
<string name="error_only_numeric_digits_range_allowed">Sólo se permiten dígitos en el rango %1$s - %2$s</string>
<string name="error_field_must_not_be_empty">Este campo no puede estar vacío</string>
<string name="error_phone_not_valid">Número de teléfono inválido</string>
</resources> </resources>

View file

@ -116,6 +116,7 @@
<string name="openapsma_disabled">Plugin is disabled</string> <string name="openapsma_disabled">Plugin is disabled</string>
<string name="constraints_violation">Constraints violation</string> <string name="constraints_violation">Constraints violation</string>
<string name="treatmentdeliveryerror">Bolus delivery error</string> <string name="treatmentdeliveryerror">Bolus delivery error</string>
<string name="tempbasaldeliveryerror">Tempbasal delivery error</string>
<string name="overview_newtempbasal_basal_label">Basal value</string> <string name="overview_newtempbasal_basal_label">Basal value</string>
<string name="overview_newtempbasal_percent_label">% (100% = current)</string> <string name="overview_newtempbasal_percent_label">% (100% = current)</string>
<string name="setbasalquestion">Accept new temp basal:</string> <string name="setbasalquestion">Accept new temp basal:</string>
@ -210,8 +211,10 @@
<string name="el_lang">Greek</string> <string name="el_lang">Greek</string>
<string name="openapsma_low_summary">The minimum BG value to be in range.</string> <string name="openapsma_low_summary">The minimum BG value to be in range.</string>
<string name="openapsma_high_summary">The maximum BG value to be in range.</string> <string name="openapsma_high_summary">The maximum BG value to be in range.</string>
<string name="openapsma_maxbasal_summary">Max U/hr a Temp Basal can be set to</string> <string name="openapsma_maxbasal_title">Max U/hr a Temp Basal can be set to</string>
<string name="openapsma_maxiob_summary">Maximum basal IOB OpenAPS can deliver [U]</string> <string name="openapsma_maxbasal_summary">This value is called max basal in OpenAPS context</string>
<string name="openapsma_maxiob_title">Maximum basal IOB OpenAPS can deliver [U]</string>
<string name="openapsma_maxiob_summary">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.</string>
<string name="bg_lang">Bulgarian</string> <string name="bg_lang">Bulgarian</string>
<string name="dismiss">DISMISS</string> <string name="dismiss">DISMISS</string>
<string name="language">Language</string> <string name="language">Language</string>
@ -264,7 +267,8 @@
<string name="careportal_temporarytargetcancel">Temporary Target Cancel</string> <string name="careportal_temporarytargetcancel">Temporary Target Cancel</string>
<string name="danarprofile">DanaR profile settings</string> <string name="danarprofile">DanaR profile settings</string>
<string name="danarprofile_dia">DIA [h]</string> <string name="danarprofile_dia">DIA [h]</string>
<string name="failedupdatebasalprofile">Failed to update basal profile</string> <string name="danarprofile_dia_summary">Duration of Insulin Activity</string>
<string name="failedupdatebasalprofile">Failed to update basal profile</string>
<string name="danar_history">History</string> <string name="danar_history">History</string>
<string name="danar_historyreload">Reload</string> <string name="danar_historyreload">Reload</string>
<string name="uploading">Uploading</string> <string name="uploading">Uploading</string>
@ -426,7 +430,6 @@
<string name="danar_stats_tbb">Total Base Basal</string> <string name="danar_stats_tbb">Total Base Basal</string>
<string name="danar_stats_tbb2">TBB * 2</string> <string name="danar_stats_tbb2">TBB * 2</string>
<string name="initializing">Initializing ...</string> <string name="initializing">Initializing ...</string>
<string name="openapsama_autosens_adjusttargets">Allow autosens to adjust targets</string>
<string name="actions_shortname">ACT</string> <string name="actions_shortname">ACT</string>
<string name="configbuilder_shortname">CONF</string> <string name="configbuilder_shortname">CONF</string>
<string name="loop_shortname">LOOP</string> <string name="loop_shortname">LOOP</string>
@ -453,4 +456,28 @@
<string name="virtualpump_firmware_label">Firmware:</string> <string name="virtualpump_firmware_label">Firmware:</string>
<string formatted="false" name="danar_model">Model: %02X Protocol: %02X Code: %02X</string> <string formatted="false" name="danar_model">Model: %02X Protocol: %02X Code: %02X</string>
<string name="profile">Profile</string> <string name="profile">Profile</string>
<string name="openapsama_max_daily_safety_multiplier" translatable="false">max_daily_safety_multiplier</string>
<string name="openapsama_max_daily_safety_multiplier_summary">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 thats what is discussed about “3x max daily; 4x current” for safety caps.</string>
<string name="openapsama_current_basal_safety_multiplier" translatable="false">current_basal_safety_multiplier</string>
<string name="openapsama_current_basal_safety_multiplier_summary">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.</string>
<string name="openapsama_autosens_max" translatable="false">autosens_max</string>
<string name="openapsama_autosens_max_summary">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.</string>
<string name="openapsama_autosens_min" translatable="false">autosens_min</string>
<string name="openapsama_autosens_min_summary">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.</string>
<string name="openapsama_autosens_adjusttargets" translatable="false">autosens_adjust_targets</string>
<string name="openapsama_autosens_adjusttargets_summary">Default value: true\nThis is used to allow autosens to adjust BG targets, in addition to ISF and basals.</string>
<string name="openapsama_bolussnooze_dia_divisor" translatable="false">bolussnooze_dia_divisor</string>
<string name="openapsama_bolussnooze_dia_divisor_summary">Default value: 2\nBolus snooze is enacted after you do a meal bolus, so the loop wont counteract with low temps when youve 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).</string>
<string name="openapsama_min_5m_carbimpact" translatable="false">min_5m_carbimpact</string>
<string name="openapsama_min_5m_carbimpact_summary">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.</string>
<string name="openapsama_link_to_preferncejson_doc_txt">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.</string>
<string name="openapsama_link_to_preferncejson_doc">http://openaps.readthedocs.io/en/latest/docs/walkthrough/phase-3/beyond-low-glucose-suspend.html</string>
<string name="error_only_numeric_digits_allowed">Only numeric digits are allowed.</string>
<string name="error_only_numeric_digits_range_allowed">Only numeric digits within the range %1$s - %2$s are allowed.</string>
<string name="error_field_must_not_be_empty">The field must not be empty</string>
<string name="error_phone_not_valid">Phone number not valid</string>
<string name="smscommunicator_invalidphonennumber">Invalid SMS phone number</string>
<string name="copy_to_clipboard">Copy To Clipboard</string>
<string name="copied_to_clipboard">Copied to clipboard</string>
<string name="nav_show_logcat">Show log</string>
</resources> </resources>

View file

@ -8,7 +8,9 @@
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
</style> </style>
<style name="AppTheme.base" parent="Theme.AppCompat.NoActionBar"></style> <style name="AppTheme.base" parent="Theme.AppCompat.NoActionBar">
<item name="android:textColorSecondary">@color/mdtp_white</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory <PreferenceCategory
android:key="advanced" android:key="advanced"
android:title="@string/advancedsettings_title"> android:title="@string/advancedsettings_title">
@ -25,6 +26,95 @@
android:title="@string/always_use_shortavg" android:title="@string/always_use_shortavg"
android:summary="@string/always_use_shortavg_summary"/> android:summary="@string/always_use_shortavg_summary"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory
android:title="OpenAPS preferences.json">
<Preference
android:summary="@string/openapsama_link_to_preferncejson_doc_txt" >
<intent
android:action="android.intent.action.VIEW"
android:data="@string/openapsama_link_to_preferncejson_doc" />
</Preference>
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:testType="numericRange"
validate:minNumber="1"
validate:maxNumber="10"
android:digits="0123456789.,"
android:defaultValue="3"
android:selectAllOnFocus="true"
android:inputType="number"
android:maxLines="20"
android:title="@string/openapsama_max_daily_safety_multiplier"
android:dialogMessage="@string/openapsama_max_daily_safety_multiplier_summary"
android:key="openapsama_max_daily_safety_multiplier" />
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:testType="numericRange"
validate:minNumber="1"
validate:maxNumber="10"
android:digits="0123456789.,"
android:defaultValue="4"
android:selectAllOnFocus="true"
android:singleLine="true"
android:inputType="number"
android:maxLines="20"
android:title="@string/openapsama_current_basal_safety_multiplier"
android:dialogMessage="@string/openapsama_current_basal_safety_multiplier_summary"
android:key="openapsama_current_basal_safety_multiplier" />
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:testType="floatNumericRange"
validate:floatminNumber="0.5"
validate:floatmaxNumber="3"
android:digits="0123456789.,"
android:defaultValue="1.2"
android:selectAllOnFocus="true"
android:singleLine="true"
android:inputType="numberDecimal"
android:maxLines="20"
android:title="@string/openapsama_autosens_max"
android:dialogMessage="@string/openapsama_autosens_max_summary"
android:key="openapsama_autosens_max" />
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:testType="floatNumericRange"
validate:floatminNumber="0.1"
validate:floatmaxNumber="1.0"
android:defaultValue="0.7"
android:selectAllOnFocus="true"
android:singleLine="true"
android:inputType="numberDecimal"
android:maxLines="20"
android:title="@string/openapsama_autosens_min"
android:dialogMessage="@string/openapsama_autosens_min_summary"
android:key="openapsama_autosens_min" />
<SwitchPreference
android:defaultValue="true"
android:key="openapsama_autosens_adjusttargets"
android:title="@string/openapsama_autosens_adjusttargets"
android:summary="@string/openapsama_autosens_adjusttargets_summary"/>
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:testType="numericRange"
validate:minNumber="1"
validate:maxNumber="5"
android:digits="0123456789.,"
android:defaultValue="2"
android:selectAllOnFocus="true"
android:singleLine="true"
android:inputType="number"
android:maxLines="20"
android:title="@string/openapsama_bolussnooze_dia_divisor"
android:dialogMessage="@string/openapsama_bolussnooze_dia_divisor_summary"
android:key="openapsama_bolussnooze_dia_divisor" />
<com.andreabaccega.widget.ValidatingEditTextPreference
validate:testType="floatNumericRange"
validate:floatminNumber="0.1"
validate:floatmaxNumber="5.0"
android:defaultValue="3.0"
android:selectAllOnFocus="true"
android:singleLine="true"
android:inputType="numberDecimal"
android:maxLines="20"
android:title="@string/openapsama_min_5m_carbimpact"
android:dialogMessage="@string/openapsama_min_5m_carbimpact_summary"
android:key="openapsama_min_5m_carbimpact" />
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View file

@ -7,6 +7,7 @@
android:defaultValue="" android:defaultValue=""
android:key="danarprofile_dia" android:key="danarprofile_dia"
android:numeric="decimal" android:numeric="decimal"
android:dialogMessage="@string/danarprofile_dia_summary"
android:title="@string/danarprofile_dia" /> android:title="@string/danarprofile_dia" />
</PreferenceCategory> </PreferenceCategory>

View file

@ -9,13 +9,6 @@
android:key="openapsama_useautosens" android:key="openapsama_useautosens"
android:title="@string/openapsama_useautosens" /> android:title="@string/openapsama_useautosens" />
<SwitchPreference
android:defaultValue="false"
android:key="openapsama_autosens_adjusttargets"
android:dependency="openapsama_useautosens"
android:title="@string/openapsama_autosens_adjusttargets"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View file

@ -24,11 +24,13 @@
android:defaultValue="1" android:defaultValue="1"
android:key="openapsma_max_basal" android:key="openapsma_max_basal"
android:numeric="decimal" android:numeric="decimal"
android:title="@string/openapsma_maxbasal_summary" /> android:dialogMessage="@string/openapsma_maxbasal_summary"
android:title="@string/openapsma_maxbasal_title" />
<EditTextPreference <EditTextPreference
android:defaultValue="1.5" android:defaultValue="1.5"
android:key="openapsma_max_iob" android:key="openapsma_max_iob"
android:numeric="decimal" android:numeric="decimal"
android:title="@string/openapsma_maxiob_summary" /> android:dialogMessage="@string/openapsma_maxiob_summary"
android:title="@string/openapsma_maxiob_title" />
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>