OpenAPS MA target value
This commit is contained in:
parent
a284f2fc38
commit
49d6690450
5 changed files with 14 additions and 1 deletions
|
@ -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));
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -300,4 +300,5 @@
|
|||
<string name="objectives_5_objective">Upravit bazály a koeficinty, když bude potřeba a povolit automatickou detekci citlivosti na inzulín</string>
|
||||
<string name="objectives_6_objective">Povolit další fukce pro běžné používání jako AMA</string>
|
||||
<string name="youareonallowedlimit">Dosaženo limitu</string>
|
||||
<string name="openapsma_target_bg">Cílová hodnota pro výpočty</string>
|
||||
</resources>
|
|
@ -302,5 +302,6 @@
|
|||
<string name="objectives_5_gate">1 week successful daytime looping with regular carb entry</string>
|
||||
<string name="objectives_6_objective">Enabling additional features for daytime use, such as advanced meal assist</string>
|
||||
<string name="youareonallowedlimit">You reached allowed limit</string>
|
||||
<string name="openapsma_target_bg">Target value for calculations</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
android:numeric="decimal"
|
||||
android:title="@string/openapsma_high_summary" />
|
||||
|
||||
<EditTextPreference
|
||||
android:defaultValue=""
|
||||
android:key="openapsma_target_bg"
|
||||
android:numeric="decimal"
|
||||
android:title="@string/openapsma_target_bg" />
|
||||
|
||||
<EditTextPreference
|
||||
android:defaultValue="1"
|
||||
android:key="openapsma_max_basal"
|
||||
|
|
Loading…
Reference in a new issue