diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterJS.java
index abd306ef4c..ca62b7a197 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterJS.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterJS.java
@@ -263,6 +263,7 @@ public class DetermineBasalAdapterJS implements Parcelable {
double maxBasal,
double minBg,
double maxBg,
+ double targetBg,
PumpInterface pump,
IobTotal iobData,
DatabaseHelper.GlucoseStatus glucoseStatus,
@@ -278,6 +279,7 @@ public class DetermineBasalAdapterJS implements Parcelable {
mProfile.add("max_basal", maxBasal);
mProfile.add("min_bg", minBg);
mProfile.add("max_bg", maxBg);
+ mProfile.add("target_bg", targetBg);
mProfile.add("carbratio", profile.getIc(profile.secondsFromMidnight()));
mProfile.add("sens", NSProfile.toMgdl(profile.getIsf(NSProfile.secondsFromMidnight()).doubleValue(), units));
diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java
index 321d4ca1d4..46f25b6bad 100644
--- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java
+++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java
@@ -141,9 +141,11 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
String maxBgDefault = "180";
String minBgDefault = "100";
+ String targetBgDefault = "150";
if (!units.equals(Constants.MGDL)) {
maxBgDefault = "10";
minBgDefault = "5";
+ targetBgDefault = "7";
}
Date now = new Date();
@@ -152,6 +154,7 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
double maxBasal = SafeParse.stringToDouble(SP.getString("openapsma_max_basal", "1"));
double minBg = NSProfile.toMgdl(SafeParse.stringToDouble(SP.getString("openapsma_min_bg", minBgDefault)), units);
double maxBg = NSProfile.toMgdl(SafeParse.stringToDouble(SP.getString("openapsma_max_bg", maxBgDefault)), units);
+ double targetBg = NSProfile.toMgdl(SafeParse.stringToDouble(SP.getString("openapsma_target_bg", targetBgDefault)), units);
minBg = Round.roundTo(minBg, 0.1d);
maxBg = Round.roundTo(maxBg, 0.1d);
@@ -168,7 +171,7 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
maxIob = MainApp.getConfigBuilder().applyMaxIOBConstraints(maxIob);
- determineBasalAdapterJS.setData(profile, maxIob, maxBasal, minBg, maxBg, pump, iobTotal, glucoseStatus, mealData);
+ determineBasalAdapterJS.setData(profile, maxIob, maxBasal, minBg, maxBg, targetBg, pump, iobTotal, glucoseStatus, mealData);
DetermineBasalResult determineBasalResult = determineBasalAdapterJS.invoke();
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index 356bad438d..30d30ef7cd 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -300,4 +300,5 @@
Upravit bazály a koeficinty, když bude potřeba a povolit automatickou detekci citlivosti na inzulín
Povolit další fukce pro běžné používání jako AMA
Dosaženo limitu
+ Cílová hodnota pro výpočty
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 70a02b8ec3..8f8c1c57b9 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -302,5 +302,6 @@
1 week successful daytime looping with regular carb entry
Enabling additional features for daytime use, such as advanced meal assist
You reached allowed limit
+ Target value for calculations
diff --git a/app/src/main/res/xml/pref_openapsma.xml b/app/src/main/res/xml/pref_openapsma.xml
index f7d8699df8..1834822070 100644
--- a/app/src/main/res/xml/pref_openapsma.xml
+++ b/app/src/main/res/xml/pref_openapsma.xml
@@ -14,6 +14,12 @@
android:numeric="decimal"
android:title="@string/openapsma_high_summary" />
+
+