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,16 +218,18 @@ public class Profile {
|
|||
|
||||
if (isValid) {
|
||||
// Check for hours alignment
|
||||
for (int index = 0; index < basal_v.size(); index++) {
|
||||
long secondsFromMidnight = basal_v.keyAt(index);
|
||||
if (secondsFromMidnight % 3600 != 0) {
|
||||
Notification notification = new Notification(Notification.BASAL_PROFILE_NOT_ALIGNED_TO_HOURS, String.format(MainApp.gs(R.string.basalprofilenotaligned), from), Notification.NORMAL);
|
||||
MainApp.bus().post(new EventNewNotification(notification));
|
||||
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) {
|
||||
Notification notification = new Notification(Notification.BASAL_PROFILE_NOT_ALIGNED_TO_HOURS, String.format(MainApp.gs(R.string.basalprofilenotaligned), from), Notification.NORMAL);
|
||||
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++) {
|
||||
|
|
|
@ -39,4 +39,6 @@ public class PumpDescription {
|
|||
public boolean isRefillingCapable = false;
|
||||
|
||||
public boolean storesCarbInfo = true;
|
||||
|
||||
public boolean is30minBasalRatesCapable = false;
|
||||
}
|
||||
|
|
|
@ -155,6 +155,7 @@ public class InsightPumpPlugin implements PluginBase, PumpInterface, Constraints
|
|||
|
||||
pumpDescription.isRefillingCapable = true;
|
||||
//pumpDescription.storesCarbInfo = false;
|
||||
pumpDescription.is30minBasalRatesCapable = true;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
|
|||
pumpDescription.isRefillingCapable = false;
|
||||
|
||||
pumpDescription.storesCarbInfo = false;
|
||||
pumpDescription.is30minBasalRatesCapable = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue