allow 30min basal rates when pump supports it
This commit is contained in:
parent
714abbbb6e
commit
6cf849ce76
4 changed files with 12 additions and 6 deletions
|
@ -218,6 +218,8 @@ public class Profile {
|
||||||
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
// Check for hours alignment
|
// Check for hours alignment
|
||||||
|
PumpInterface pump = MainApp.getConfigBuilder().getActivePump();
|
||||||
|
if (!pump.getPumpDescription().is30minBasalRatesCapable) {
|
||||||
for (int index = 0; index < basal_v.size(); index++) {
|
for (int index = 0; index < basal_v.size(); index++) {
|
||||||
long secondsFromMidnight = basal_v.keyAt(index);
|
long secondsFromMidnight = basal_v.keyAt(index);
|
||||||
if (secondsFromMidnight % 3600 != 0) {
|
if (secondsFromMidnight % 3600 != 0) {
|
||||||
|
@ -225,9 +227,9 @@ public class Profile {
|
||||||
MainApp.bus().post(new EventNewNotification(notification));
|
MainApp.bus().post(new EventNewNotification(notification));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check for minimal basal value
|
// Check for minimal basal value
|
||||||
PumpInterface pump = ConfigBuilderPlugin.getActivePump();
|
|
||||||
if (pump != null) {
|
if (pump != null) {
|
||||||
PumpDescription description = pump.getPumpDescription();
|
PumpDescription description = pump.getPumpDescription();
|
||||||
for (int i = 0; i < basal_v.size(); i++) {
|
for (int i = 0; i < basal_v.size(); i++) {
|
||||||
|
|
|
@ -39,4 +39,6 @@ public class PumpDescription {
|
||||||
public boolean isRefillingCapable = false;
|
public boolean isRefillingCapable = false;
|
||||||
|
|
||||||
public boolean storesCarbInfo = true;
|
public boolean storesCarbInfo = true;
|
||||||
|
|
||||||
|
public boolean is30minBasalRatesCapable = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,6 +155,7 @@ public class InsightPumpPlugin implements PluginBase, PumpInterface, Constraints
|
||||||
|
|
||||||
pumpDescription.isRefillingCapable = true;
|
pumpDescription.isRefillingCapable = true;
|
||||||
//pumpDescription.storesCarbInfo = false;
|
//pumpDescription.storesCarbInfo = false;
|
||||||
|
pumpDescription.is30minBasalRatesCapable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,7 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
|
||||||
pumpDescription.isRefillingCapable = false;
|
pumpDescription.isRefillingCapable = false;
|
||||||
|
|
||||||
pumpDescription.storesCarbInfo = false;
|
pumpDescription.storesCarbInfo = false;
|
||||||
|
pumpDescription.is30minBasalRatesCapable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue