Only update first basal profile
This commit is contained in:
parent
2cde70e584
commit
b0f72fc736
1 changed files with 2 additions and 37 deletions
|
@ -341,25 +341,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchBasalProfile() throws Exception {
|
private void fetchBasalProfile() throws Exception {
|
||||||
Class<? extends BRProfileBlock> parameterBlock = null;
|
profileBlocks = ParameterBlockUtil.readParameterBlock(connectionService, Service.CONFIGURATION, BRProfile1Block.class).getProfileBlocks();
|
||||||
switch (ParameterBlockUtil.readParameterBlock(connectionService, Service.CONFIGURATION, ActiveBRProfileBlock.class).getActiveBasalProfile()) {
|
|
||||||
case PROFILE_1:
|
|
||||||
parameterBlock = BRProfile1Block.class;
|
|
||||||
break;
|
|
||||||
case PROFILE_2:
|
|
||||||
parameterBlock = BRProfile2Block.class;
|
|
||||||
break;
|
|
||||||
case PROFILE_3:
|
|
||||||
parameterBlock = BRProfile3Block.class;
|
|
||||||
break;
|
|
||||||
case PROFILE_4:
|
|
||||||
parameterBlock = BRProfile4Block.class;
|
|
||||||
break;
|
|
||||||
case PROFILE_5:
|
|
||||||
parameterBlock = BRProfile5Block.class;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
profileBlocks = ParameterBlockUtil.readParameterBlock(connectionService, Service.CONFIGURATION, parameterBlock).getProfileBlocks();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchStatus() throws Exception {
|
private void fetchStatus() throws Exception {
|
||||||
|
@ -452,24 +434,7 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
|
||||||
profileBlocks.add(profileBlock);
|
profileBlocks.add(profileBlock);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
BRProfileBlock profileBlock = null;
|
BRProfileBlock profileBlock = new BRProfile1Block();
|
||||||
switch (activeBasalRate.getActiveBasalProfile()) {
|
|
||||||
case PROFILE_1:
|
|
||||||
profileBlock = new BRProfile1Block();
|
|
||||||
break;
|
|
||||||
case PROFILE_2:
|
|
||||||
profileBlock = new BRProfile2Block();
|
|
||||||
break;
|
|
||||||
case PROFILE_3:
|
|
||||||
profileBlock = new BRProfile3Block();
|
|
||||||
break;
|
|
||||||
case PROFILE_4:
|
|
||||||
profileBlock = new BRProfile4Block();
|
|
||||||
break;
|
|
||||||
case PROFILE_5:
|
|
||||||
profileBlock = new BRProfile5Block();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
profileBlock.setProfileBlocks(profileBlocks);
|
profileBlock.setProfileBlocks(profileBlocks);
|
||||||
ParameterBlockUtil.writeConfigurationBlock(connectionService, profileBlock);
|
ParameterBlockUtil.writeConfigurationBlock(connectionService, profileBlock);
|
||||||
MainApp.bus().post(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
|
MainApp.bus().post(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
|
||||||
|
|
Loading…
Reference in a new issue