Watch: don't bother pump with carbs if pump doesn't support it.
This commit is contained in:
parent
1cb92861b5
commit
87a7249997
2 changed files with 16 additions and 9 deletions
|
@ -97,6 +97,8 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
|
||||||
pumpDescription.basalMinimumRate = 0.01d;
|
pumpDescription.basalMinimumRate = 0.01d;
|
||||||
|
|
||||||
pumpDescription.isRefillingCapable = false;
|
pumpDescription.isRefillingCapable = false;
|
||||||
|
|
||||||
|
pumpDescription.storesCarbInfo = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package info.nightscout.androidaps.plugins.Wear;
|
package info.nightscout.androidaps.plugins.Wear;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
import android.os.HandlerThread;
|
import android.os.HandlerThread;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
@ -644,16 +645,20 @@ public class ActionStringHandler {
|
||||||
detailedBolusInfo.insulin = amount;
|
detailedBolusInfo.insulin = amount;
|
||||||
detailedBolusInfo.carbs = carbs;
|
detailedBolusInfo.carbs = carbs;
|
||||||
detailedBolusInfo.source = Source.USER;
|
detailedBolusInfo.source = Source.USER;
|
||||||
ConfigBuilderPlugin.getCommandQueue().bolus(detailedBolusInfo, new Callback() {
|
if (detailedBolusInfo.insulin > 0 || ConfigBuilderPlugin.getActivePump().getPumpDescription().storesCarbInfo) {
|
||||||
@Override
|
ConfigBuilderPlugin.getCommandQueue().bolus(detailedBolusInfo, new Callback() {
|
||||||
public void run() {
|
@Override
|
||||||
if (!result.success) {
|
public void run() {
|
||||||
sendError(MainApp.sResources.getString(R.string.treatmentdeliveryerror) +
|
if (!result.success) {
|
||||||
"\n" +
|
sendError(MainApp.sResources.getString(R.string.treatmentdeliveryerror) +
|
||||||
result.comment);
|
"\n" +
|
||||||
|
result.comment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
} else {
|
||||||
|
MainApp.getConfigBuilder().addToHistoryTreatment(detailedBolusInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized static void sendError(String errormessage) {
|
private synchronized static void sendError(String errormessage) {
|
||||||
|
|
Loading…
Reference in a new issue