Merge branch 'master' of https://github.com/MilosKozak/AndroidAPS
This commit is contained in:
commit
933e081fc5
3 changed files with 12 additions and 3 deletions
|
@ -37,7 +37,7 @@
|
|||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -177,6 +177,13 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
|
|||
DetermineBasalResult determineBasalResult = determineBasalAdapterJS.invoke();
|
||||
// Fix bug determine basal
|
||||
if (determineBasalResult.rate == 0d && determineBasalResult.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) determineBasalResult.changeRequested = false;
|
||||
// limit requests on openloop mode
|
||||
if (!MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
||||
if (MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResult.rate - MainApp.getConfigBuilder().getTempBasalAbsoluteRate()) < 0.1)
|
||||
determineBasalResult.changeRequested = false;
|
||||
if (!MainApp.getConfigBuilder().isTempBasalInProgress() && Math.abs(determineBasalResult.rate - MainApp.getConfigBuilder().getBaseBasalRate()) < 0.1)
|
||||
determineBasalResult.changeRequested = false;
|
||||
}
|
||||
|
||||
determineBasalResult.iob = iobTotal;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.Overview.Dialogs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
@ -89,7 +90,8 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
|
|||
final Double finalInsulin = insulin;
|
||||
final int finalDurationInMinutes = durationInMinutes;
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this.getContext());
|
||||
final Context context = getContext();
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(this.getContext().getString(R.string.confirmation));
|
||||
builder.setMessage(confirmMessage);
|
||||
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
|
@ -100,7 +102,7 @@ public class NewExtendedBolusDialog extends DialogFragment implements View.OnCli
|
|||
public void run() {
|
||||
PumpEnactResult result = pump.setExtendedBolus(finalInsulin, finalDurationInMinutes);
|
||||
if (!result.success) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(getContext().getString(R.string.treatmentdeliveryerror));
|
||||
builder.setMessage(result.comment);
|
||||
builder.setPositiveButton(getContext().getString(R.string.ok), null);
|
||||
|
|
Loading…
Reference in a new issue