Merge pull request #8 from nightscout/dev

nightscrout:dev to dev
This commit is contained in:
rICTx-T1D 2021-01-04 20:45:34 +01:00 committed by GitHub
commit 022df5e70d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 85 additions and 81 deletions

View file

@ -151,7 +151,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_
} }
} }
//cherry pick from oref upstream dev cb8e94990301277fb1016c778b4e9efa55a6edbc //cherry pick from oref upstream dev cb8e94990301277fb1016c778b4e9efa55a6edbc
if (bg <= 10 || bg === 38 || noise >= 3 || minAgo > 12 || minAgo < -5 || ( bg > 60 && glucose_status.delta == 0 && glucose_status.short_avgdelta > -1 && glucose_status.short_avgdelta < 1 && glucose_status.long_avgdelta > -1 && glucose_status.long_avgdelta < 1 ) ) { if (bg <= 10 || bg === 38 || noise >= 3 || minAgo > 12 || minAgo < -5 || ( bg > 60 && glucose_status.delta == 0 && glucose_status.short_avgdelta > -1 && glucose_status.short_avgdelta < 1 && glucose_status.long_avgdelta > -1 && glucose_status.long_avgdelta < 1 ) && !isSaveCgmSource ) {
if (currenttemp.rate > basal) { // high temp is running if (currenttemp.rate > basal) { // high temp is running
rT.reason += ". Replacing high temp basal of "+currenttemp.rate+" with neutral temp of "+basal; rT.reason += ". Replacing high temp basal of "+currenttemp.rate+" with neutral temp of "+basal;
rT.deliverAt = deliverAt; rT.deliverAt = deliverAt;

View file

@ -237,18 +237,21 @@ class LoopDialog : DaggerDialogFragment() {
val profile = profileFunction.getProfile() ?: return true val profile = profileFunction.getProfile() ?: return true
when (v.id) { when (v.id) {
R.id.overview_closeloop -> { R.id.overview_closeloop -> {
aapsLogger.debug("USER ENTRY: CLOSED LOOP MODE")
sp.putString(R.string.key_aps_mode, "closed") sp.putString(R.string.key_aps_mode, "closed")
rxBus.send(EventPreferenceChange(resourceHelper.gs(R.string.closedloop))) rxBus.send(EventPreferenceChange(resourceHelper.gs(R.string.closedloop)))
return true return true
} }
R.id.overview_lgsloop -> { R.id.overview_lgsloop -> {
aapsLogger.debug("USER ENTRY: LGS LOOP MODE")
sp.putString(R.string.key_aps_mode, "lgs") sp.putString(R.string.key_aps_mode, "lgs")
rxBus.send(EventPreferenceChange(resourceHelper.gs(R.string.lowglucosesuspend))) rxBus.send(EventPreferenceChange(resourceHelper.gs(R.string.lowglucosesuspend)))
return true return true
} }
R.id.overview_openloop -> { R.id.overview_openloop -> {
aapsLogger.debug("USER ENTRY: OPEN LOOP MODE")
sp.putString(R.string.key_aps_mode, "open") sp.putString(R.string.key_aps_mode, "open")
rxBus.send(EventPreferenceChange(resourceHelper.gs(R.string.lowglucosesuspend))) rxBus.send(EventPreferenceChange(resourceHelper.gs(R.string.lowglucosesuspend)))
return true return true

View file

@ -19,7 +19,6 @@ import java.nio.charset.StandardCharsets;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.inject.Inject; import javax.inject.Inject;
import info.nightscout.androidaps.plugins.general.openhumans.OpenHumansUploader;
import dagger.android.HasAndroidInjector; import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
@ -28,13 +27,14 @@ import info.nightscout.androidaps.data.MealData;
import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.interfaces.ActivePluginProvider; import info.nightscout.androidaps.interfaces.ActivePluginProvider;
import info.nightscout.androidaps.interfaces.ProfileFunction;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback; import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback;
import info.nightscout.androidaps.plugins.aps.loop.ScriptReader; import info.nightscout.androidaps.plugins.aps.loop.ScriptReader;
import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker; import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker;
import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.plugins.general.openhumans.OpenHumansUploader;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus;
import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
@ -73,10 +73,6 @@ public class DetermineBasalAdapterSMBJS {
private String storedGlucoseStatus = null; private String storedGlucoseStatus = null;
private String storedProfile = null; private String storedProfile = null;
private String storedMeal_data = null; private String storedMeal_data = null;
private String storedAutosens_data = null;
private String storedMicroBolusAllowed = null;
private String storedSMBAlwaysAllowed = null;
private String storedCurrentTime = null;
private String scriptDebug = ""; private String scriptDebug = "";
@ -102,13 +98,13 @@ public class DetermineBasalAdapterSMBJS {
aapsLogger.debug(LTag.APS, "Profile: " + (storedProfile = mProfile.toString())); aapsLogger.debug(LTag.APS, "Profile: " + (storedProfile = mProfile.toString()));
aapsLogger.debug(LTag.APS, "Meal data: " + (storedMeal_data = mMealData.toString())); aapsLogger.debug(LTag.APS, "Meal data: " + (storedMeal_data = mMealData.toString()));
if (mAutosensData != null) if (mAutosensData != null)
aapsLogger.debug(LTag.APS, "Autosens data: " + (storedAutosens_data = mAutosensData.toString())); aapsLogger.debug(LTag.APS, "Autosens data: " + mAutosensData.toString());
else else
aapsLogger.debug(LTag.APS, "Autosens data: " + (storedAutosens_data = "undefined")); aapsLogger.debug(LTag.APS, "Autosens data: " + "undefined");
aapsLogger.debug(LTag.APS, "Reservoir data: " + "undefined"); aapsLogger.debug(LTag.APS, "Reservoir data: " + "undefined");
aapsLogger.debug(LTag.APS, "MicroBolusAllowed: " + (storedMicroBolusAllowed = "" + mMicrobolusAllowed)); aapsLogger.debug(LTag.APS, "MicroBolusAllowed: " + mMicrobolusAllowed);
aapsLogger.debug(LTag.APS, "SMBAlwaysAllowed: " + (storedSMBAlwaysAllowed = "" + mSMBAlwaysAllowed)); aapsLogger.debug(LTag.APS, "SMBAlwaysAllowed: " + mSMBAlwaysAllowed);
aapsLogger.debug(LTag.APS, "CurrentTime: " + (storedCurrentTime = "" + mCurrentTime)); aapsLogger.debug(LTag.APS, "CurrentTime: " + mCurrentTime);
aapsLogger.debug(LTag.APS, "isSaveCgmSource: " + mIsSaveCgmSource); aapsLogger.debug(LTag.APS, "isSaveCgmSource: " + mIsSaveCgmSource);
@ -151,9 +147,10 @@ public class DetermineBasalAdapterSMBJS {
makeParam(mAutosensData, rhino, scope), makeParam(mAutosensData, rhino, scope),
makeParam(mMealData, rhino, scope), makeParam(mMealData, rhino, scope),
setTempBasalFunctionsObj, setTempBasalFunctionsObj,
new Boolean(mMicrobolusAllowed), Boolean.valueOf(mMicrobolusAllowed),
makeParam(null, rhino, scope), // reservoir data as undefined makeParam(null, rhino, scope), // reservoir data as undefined
new Long(mCurrentTime) Long.valueOf(mCurrentTime),
Boolean.valueOf(mIsSaveCgmSource)
}; };
@ -213,14 +210,6 @@ public class DetermineBasalAdapterSMBJS {
return storedMeal_data; return storedMeal_data;
} }
String getAutosensDataParam() {
return storedAutosens_data;
}
String getMicroBolusAllowedParam() {
return storedMicroBolusAllowed;
}
String getScriptDebug() { String getScriptDebug() {
return scriptDebug; return scriptDebug;
} }
@ -243,7 +232,6 @@ public class DetermineBasalAdapterSMBJS {
boolean isSaveCgmSource boolean isSaveCgmSource
) throws JSONException { ) throws JSONException {
String units = profile.getUnits();
PumpInterface pump = activePluginProvider.getActivePump(); PumpInterface pump = activePluginProvider.getActivePump();
Double pumpbolusstep = pump.getPumpDescription().bolusStep; Double pumpbolusstep = pump.getPumpDescription().bolusStep;
mProfile = new JSONObject(); mProfile = new JSONObject();
@ -267,8 +255,8 @@ public class DetermineBasalAdapterSMBJS {
mProfile.put("low_temptarget_lowers_sensitivity", false); mProfile.put("low_temptarget_lowers_sensitivity", false);
mProfile.put("sensitivity_raises_target", sp.getBoolean(R.string.key_sensitivity_raises_target,SMBDefaults.sensitivity_raises_target)); mProfile.put("sensitivity_raises_target", sp.getBoolean(R.string.key_sensitivity_raises_target, SMBDefaults.sensitivity_raises_target));
mProfile.put("resistance_lowers_target", sp.getBoolean(R.string.key_resistance_lowers_target,SMBDefaults.resistance_lowers_target)); mProfile.put("resistance_lowers_target", sp.getBoolean(R.string.key_resistance_lowers_target, SMBDefaults.resistance_lowers_target));
mProfile.put("adv_target_adjustments", SMBDefaults.adv_target_adjustments); mProfile.put("adv_target_adjustments", SMBDefaults.adv_target_adjustments);
mProfile.put("exercise_mode", SMBDefaults.exercise_mode); mProfile.put("exercise_mode", SMBDefaults.exercise_mode);
mProfile.put("half_basal_exercise_target", SMBDefaults.half_basal_exercise_target); mProfile.put("half_basal_exercise_target", SMBDefaults.half_basal_exercise_target);
@ -364,14 +352,12 @@ public class DetermineBasalAdapterSMBJS {
if (jsonObject == null) return Undefined.instance; if (jsonObject == null) return Undefined.instance;
Object param = NativeJSON.parse(rhino, scope, jsonObject.toString(), (context, scriptable, scriptable1, objects) -> objects[1]); return NativeJSON.parse(rhino, scope, jsonObject.toString(), (context, scriptable, scriptable1, objects) -> objects[1]);
return param;
} }
private Object makeParamArray(JSONArray jsonArray, Context rhino, Scriptable scope) { private Object makeParamArray(JSONArray jsonArray, Context rhino, Scriptable scope) {
//Object param = NativeJSON.parse(rhino, scope, "{myarray: " + jsonArray.toString() + " }", new Callable() { //Object param = NativeJSON.parse(rhino, scope, "{myarray: " + jsonArray.toString() + " }", new Callable() {
Object param = NativeJSON.parse(rhino, scope, jsonArray.toString(), (context, scriptable, scriptable1, objects) -> objects[1]); return NativeJSON.parse(rhino, scope, jsonArray.toString(), (context, scriptable, scriptable1, objects) -> objects[1]);
return param;
} }
private String readFile(String filename) throws IOException { private String readFile(String filename) throws IOException {

View file

@ -70,7 +70,7 @@ class EditEventDialog : DialogFragmentWithDate() {
binding.okcancel.ok.visibility = (!event.readOnly).toVisibility() binding.okcancel.ok.visibility = (!event.readOnly).toVisibility()
binding.inputEventTitle.setText(event.title) binding.inputEventTitle.setText(event.title)
binding.inputEventTitle.isFocusable = false binding.inputEventTitle.isFocusable = !event.readOnly
binding.triggerDescription.text = event.trigger.friendlyDescription() binding.triggerDescription.text = event.trigger.friendlyDescription()
binding.editTrigger.visibility = (!event.readOnly).toVisibility() binding.editTrigger.visibility = (!event.readOnly).toVisibility()

View file

@ -289,12 +289,12 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
R.id.overview_temptarget -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { TempTargetDialog().show(childFragmentManager, "Overview") }) R.id.overview_temptarget -> protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable { TempTargetDialog().show(childFragmentManager, "Overview") })
R.id.overview_activeprofile -> { R.id.overview_activeprofile -> {
val args = Bundle() ProfileViewerDialog().also { pvd ->
args.putLong("time", DateUtil.now()) pvd.arguments = Bundle().also {
args.putInt("mode", ProfileViewerDialog.Mode.RUNNING_PROFILE.ordinal) it.putLong("time", DateUtil.now())
val pvd = ProfileViewerDialog() it.putInt("mode", ProfileViewerDialog.Mode.RUNNING_PROFILE.ordinal)
pvd.arguments = args }
pvd.show(childFragmentManager, "ProfileViewDialog") }.show(childFragmentManager, "ProfileViewDialog")
} }
R.id.overview_cgmbutton -> { R.id.overview_cgmbutton -> {
@ -329,6 +329,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
val lastRun = loopPlugin.lastRun val lastRun = loopPlugin.lastRun
loopPlugin.invoke("Accept temp button", false) loopPlugin.invoke("Accept temp button", false)
if (lastRun?.lastAPSRun != null && lastRun.constraintsProcessed?.isChangeRequested == true) { if (lastRun?.lastAPSRun != null && lastRun.constraintsProcessed?.isChangeRequested == true) {
protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable {
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.tempbasal_label), lastRun.constraintsProcessed?.toSpanned() OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.tempbasal_label), lastRun.constraintsProcessed?.toSpanned()
?: "".toSpanned(), { ?: "".toSpanned(), {
aapsLogger.debug("USER ENTRY: ACCEPT TEMP BASAL") aapsLogger.debug("USER ENTRY: ACCEPT TEMP BASAL")
@ -337,16 +338,17 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
actionStringHandler.handleInitiate("cancelChangeRequest") actionStringHandler.handleInitiate("cancelChangeRequest")
loopPlugin.acceptChangeRequest() loopPlugin.acceptChangeRequest()
}) })
})
} }
} }
} }
R.id.overview_apsmode -> { R.id.overview_apsmode -> {
val args = Bundle() protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable {
args.putInt("showOkCancel", 1) // 1-> true LoopDialog().also { dialog ->
val pvd = LoopDialog() dialog.arguments = Bundle().also { it.putInt("showOkCancel", 1) }
pvd.arguments = args }.show(childFragmentManager, "Overview")
pvd.show(childFragmentManager, "Overview") })
} }
} }
} }
@ -374,11 +376,13 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
} }
R.id.overview_apsmode -> { R.id.overview_apsmode -> {
val args = Bundle() activity?.let { activity ->
args.putInt("showOkCancel", 0) // 0-> false protectionCheck.queryProtection(activity, ProtectionCheck.Protection.BOLUS, UIRunnable {
val pvd = LoopDialog() LoopDialog().also { dialog ->
pvd.arguments = args dialog.arguments = Bundle().also { it.putInt("showOkCancel", 0) }
pvd.show(childFragmentManager, "Overview") }.show(childFragmentManager, "Overview")
})
}
} }
R.id.overview_temptarget -> v.performClick() R.id.overview_temptarget -> v.performClick()

View file

@ -162,18 +162,20 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginBottom="-4dp" android:layout_marginBottom="-4dp"
android:visibility="gone"
app:srcCompat="@drawable/ic_loop_closed" /> app:srcCompat="@drawable/ic_loop_closed" />
<TextView <TextView
android:id="@+id/overview_apsmode_text" android:id="@+id/overview_apsmode_text"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:paddingTop="3dp" android:paddingTop="3dp"
android:paddingBottom="3dp" android:paddingBottom="3dp"
android:text="Open Loop" android:text="Open Loop"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="bold" /> android:textStyle="bold"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
@ -183,6 +185,7 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/overview_bg" app:layout_constraintBottom_toBottomOf="@+id/overview_bg"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/overview_apsmode_llayout" app:layout_constraintStart_toEndOf="@id/overview_apsmode_llayout"

View file

@ -1,14 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="alert_r7_description"><![CDATA[Amount: <b>%1$d%%</b>\nDuration: <b>%2$s h</b>]]></string> <string name="alert_r7_description"><![CDATA[Amount: <b>%1$d%%</b>\nDuration: <b>%2$s h</b>]]></string>
<string name="alert_w31_description"><![CDATA[Cartridge content: <b>%1$s U</b>]]></string> <string name="alert_w31_description"><![CDATA[Cartridge content: <b>%1$s U</b>]]></string>
<string name="alert_w32_description">Change battery.</string> <string name="alert_w32_description">Change battery.</string>
<string name="alert_w33_description">Set time/date.</string> <string name="alert_w33_description">Set time/date.</string>
<string name="alert_w34_description">Contact Accu-Chek support.</string> <string name="alert_w34_description">Contact Accu-Chek support.</string>
<string name="alert_w36_description"><![CDATA[Amount: <b>%1$d%%</b><br/>Duration: <b>%2$s h</b>]]></string> <string name="alert_w36_description"><![CDATA[Amount: <b>%1$d%%</b><br/>Duration: <b>%2$s h</b>]]></string>
<string name="alert_w38_description"><![CDATA[Programmed: <b>%1$s U</b><br/>Delivered: <b>%2$s U</b>]]></string> <string name="alert_w38_description"><![CDATA[Programmed: <b>%1$s U</b><br/>Delivered: <b>%2$s U</b>]]></string>
<string name="alert_m20_description">Insert cartridge.</string> <string name="alert_m20_description">Insert cartridge.</string>
<string name="alert_m21_description">Change cartridge.</string> <string name="alert_m21_description">Change cartridge.</string>
<string name="alert_m22_description">Change battery.</string> <string name="alert_m22_description">Change battery.</string>
@ -20,7 +18,6 @@
<string name="alert_m28_description">Check pump status.</string> <string name="alert_m28_description">Check pump status.</string>
<string name="alert_m29_description">Set battery type.</string> <string name="alert_m29_description">Set battery type.</string>
<string name="alert_m30_description">Set cartridge type.</string> <string name="alert_m30_description">Set cartridge type.</string>
<string name="alert_e6_description">Change battery and cartridge.</string> <string name="alert_e6_description">Change battery and cartridge.</string>
<string name="alert_e10_description">Change cartridge.</string> <string name="alert_e10_description">Change cartridge.</string>
<string name="alert_e13_description">Change language.</string> <string name="alert_e13_description">Change language.</string>

View file

@ -1425,7 +1425,7 @@
<string name="bolusadvisormessage">You have high glycemia. Instead of eating now it\'s recommended to wait for better glycemia. Do you want to do a correction bolus now and remind you when it\'s time to eat? In this case no carbs will be recorded and you must use wizard again when we remind you.</string> <string name="bolusadvisormessage">You have high glycemia. Instead of eating now it\'s recommended to wait for better glycemia. Do you want to do a correction bolus now and remind you when it\'s time to eat? In this case no carbs will be recorded and you must use wizard again when we remind you.</string>
<string name="key_usebolusadvisor" translatable="false">use_bolus_advisor</string> <string name="key_usebolusadvisor" translatable="false">use_bolus_advisor</string>
<string name="enablebolusadvisor">Enable bolus advisor</string> <string name="enablebolusadvisor">Enable bolus advisor</string>
<string name="enablebolusadvisor_summary">Use reminder to start eating instead of wizard during high glycemia</string> <string name="enablebolusadvisor_summary">Use reminder to start eating later instead of wizard result during high glycemia ("pre-bolus")</string>
<string name="time_to_eat">Time to eat!\nRun Bolus wizard and do calculation again.</string> <string name="time_to_eat">Time to eat!\nRun Bolus wizard and do calculation again.</string>
<string name="timetoeat">Time to eat</string> <string name="timetoeat">Time to eat</string>

View file

@ -4,8 +4,8 @@
xmlns:validate="http://schemas.android.com/apk/res-auto"> xmlns:validate="http://schemas.android.com/apk/res-auto">
<PreferenceCategory <PreferenceCategory
app:initialExpandedChildrenCount="0" android:title="@string/openapssmb"
android:title="@string/openapssmb"> app:initialExpandedChildrenCount="0">
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference <info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="1" android:defaultValue="1"
@ -88,10 +88,15 @@
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference <info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="30" android:defaultValue="30"
android:digits="0123456789"
android:entries="@array/smbMaxMinutes" android:entries="@array/smbMaxMinutes"
android:entryValues="@array/smbMaxMinutes" android:entryValues="@array/smbMaxMinutes"
android:inputType="number"
android:key="@string/key_smbmaxminutes" android:key="@string/key_smbmaxminutes"
android:title="@string/smbmaxminutes_summary" /> android:title="@string/smbmaxminutes_summary"
validate:maxNumber="120"
validate:minNumber="15"
validate:testType="numericRange" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference <info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:defaultValue="30" android:defaultValue="30"
@ -119,14 +124,12 @@
android:defaultValue="true" android:defaultValue="true"
android:key="@string/key_sensitivity_raises_target" android:key="@string/key_sensitivity_raises_target"
android:summary="@string/sensitivity_raises_target_summary" android:summary="@string/sensitivity_raises_target_summary"
android:title="@string/sensitivity_raises_target_title" android:title="@string/sensitivity_raises_target_title" />
/>
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="@string/key_resistance_lowers_target" android:key="@string/key_resistance_lowers_target"
android:summary="@string/resistance_lowers_target_summary" android:summary="@string/resistance_lowers_target_summary"
android:title="@string/resistance_lowers_target_title" android:title="@string/resistance_lowers_target_title" />
/>
<!-- TODO AS-FIX --> <!-- TODO AS-FIX -->
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
@ -144,19 +147,19 @@
android:title="@string/low_temptarget_lowers_sensitivity_title" /> android:title="@string/low_temptarget_lowers_sensitivity_title" />
<info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference <info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference
android:key="@string/key_carbsReqThreshold"
android:title="@string/carbsReqThreshold"
android:summary="@string/carbsReqThreshold_summary"
android:defaultValue="1" android:defaultValue="1"
android:dialogMessage="@string/carbsReqThreshold_summary" android:dialogMessage="@string/carbsReqThreshold_summary"
android:digits="0123456789" android:digits="0123456789"
android:inputType="number" android:inputType="number"
android:key="@string/key_carbsReqThreshold"
android:maxLines="20" android:maxLines="20"
android:selectAllOnFocus="true" android:selectAllOnFocus="true"
android:singleLine="true" android:singleLine="true"
android:summary="@string/carbsReqThreshold_summary"
android:title="@string/carbsReqThreshold"
validate:maxNumber="10" validate:maxNumber="10"
validate:minNumber="1" validate:minNumber="1"
validate:testType="numericRange"/> validate:testType="numericRange" />
<androidx.preference.PreferenceScreen <androidx.preference.PreferenceScreen
android:key="absorption_smb_advanced" android:key="absorption_smb_advanced"

View file

@ -277,6 +277,7 @@ class DanaRSService : DaggerService() {
danaPump.bolusStopped = true danaPump.bolusStopped = true
danaPump.bolusStopForced = true danaPump.bolusStopForced = true
aapsLogger.debug(LTag.PUMPCOMM, "Communication stopped") aapsLogger.debug(LTag.PUMPCOMM, "Communication stopped")
bleComm.disconnect("Communication stopped")
} }
} }
} }

View file

@ -102,11 +102,13 @@ class OmnipodOverviewFragment : DaggerFragment() {
omnipod_overview_button_pod_management.setOnClickListener { omnipod_overview_button_pod_management.setOnClickListener {
if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) { if (omnipodPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
activity?.let { activity -> activity?.let { activity ->
context?.let { context ->
protectionCheck.queryProtection( protectionCheck.queryProtection(
activity, ProtectionCheck.Protection.PREFERENCES, activity, ProtectionCheck.Protection.PREFERENCES,
UIRunnable(Runnable { startActivity(Intent(context, PodManagementActivity::class.java)) }) UIRunnable { startActivity(Intent(context, PodManagementActivity::class.java)) }
) )
} }
}
} else { } else {
displayNotConfiguredDialog() displayNotConfiguredDialog()
} }
@ -514,10 +516,10 @@ class OmnipodOverviewFragment : DaggerFragment() {
private fun displayNotConfiguredDialog() { private fun displayNotConfiguredDialog() {
context?.let { context?.let {
UIRunnable(Runnable { UIRunnable {
OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning), OKDialog.show(it, resourceHelper.gs(R.string.omnipod_warning),
resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null) resourceHelper.gs(R.string.omnipod_error_operation_not_possible_no_configuration), null)
}).run() }.run()
} }
} }
@ -534,9 +536,9 @@ class OmnipodOverviewFragment : DaggerFragment() {
private fun displayOkDialog(title: String, message: String) { private fun displayOkDialog(title: String, message: String) {
context?.let { context?.let {
UIRunnable(Runnable { UIRunnable {
OKDialog.show(it, title, message, null) OKDialog.show(it, title, message, null)
}).run() }.run()
} }
} }

View file

@ -65,6 +65,11 @@ public class InitializePumpManagerTask extends ServiceTask {
lastGoodFrequency = rileyLinkServiceData.lastGoodFrequency; lastGoodFrequency = rileyLinkServiceData.lastGoodFrequency;
} }
/* FIXME this can apparently crash:
Fatal Exception: java.lang.ClassCastException
info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin
cannot be cast to info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice
*/
RileyLinkCommunicationManager<?> rileyLinkCommunicationManager = ((RileyLinkPumpDevice) activePlugin.getActivePump()).getRileyLinkService().getDeviceCommunicationManager(); RileyLinkCommunicationManager<?> rileyLinkCommunicationManager = ((RileyLinkPumpDevice) activePlugin.getActivePump()).getRileyLinkService().getDeviceCommunicationManager();
if (activePlugin.getActivePump().manufacturer() == ManufacturerType.Medtronic) { if (activePlugin.getActivePump().manufacturer() == ManufacturerType.Medtronic) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB