allow 30min basal rates when pump supports it

This commit is contained in:
Milos Kozak 2018-03-11 16:03:21 +01:00
parent 714abbbb6e
commit 6cf849ce76
4 changed files with 12 additions and 6 deletions

View file

@ -218,6 +218,8 @@ public class Profile {
if (isValid) {
// Check for hours alignment
PumpInterface pump = MainApp.getConfigBuilder().getActivePump();
if (!pump.getPumpDescription().is30minBasalRatesCapable) {
for (int index = 0; index < basal_v.size(); index++) {
long secondsFromMidnight = basal_v.keyAt(index);
if (secondsFromMidnight % 3600 != 0) {
@ -225,9 +227,9 @@ public class Profile {
MainApp.bus().post(new EventNewNotification(notification));
}
}
}
// Check for minimal basal value
PumpInterface pump = ConfigBuilderPlugin.getActivePump();
if (pump != null) {
PumpDescription description = pump.getPumpDescription();
for (int i = 0; i < basal_v.size(); i++) {

View file

@ -39,4 +39,6 @@ public class PumpDescription {
public boolean isRefillingCapable = false;
public boolean storesCarbInfo = true;
public boolean is30minBasalRatesCapable = false;
}

View file

@ -155,6 +155,7 @@ public class InsightPumpPlugin implements PluginBase, PumpInterface, Constraints
pumpDescription.isRefillingCapable = true;
//pumpDescription.storesCarbInfo = false;
pumpDescription.is30minBasalRatesCapable = true;
}

View file

@ -101,6 +101,7 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
pumpDescription.isRefillingCapable = false;
pumpDescription.storesCarbInfo = false;
pumpDescription.is30minBasalRatesCapable = true;
}
@Override