Change way of checking operating mode during bolus delivery

This commit is contained in:
TebbeUbben 2019-02-09 23:12:36 +01:00
parent 0b1e181662
commit a8a182dc9d

View file

@ -538,8 +538,9 @@ public class LocalInsightPlugin extends PluginBase implements PumpInterface, Con
detailedBolusInfo.pumpId = insightBolusID.id; detailedBolusInfo.pumpId = insightBolusID.id;
TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, true); TreatmentsPlugin.getPlugin().addToHistoryTreatment(detailedBolusInfo, true);
while (true) { while (true) {
fetchStatus(); OperatingMode operatingMode = connectionService.requestMessage(new GetOperatingModeMessage()).await().getOperatingMode();
if (operatingMode != OperatingMode.STARTED) break; if (operatingMode != OperatingMode.STARTED) break;
List<ActiveBolus> activeBoluses = connectionService.requestMessage(new GetActiveBolusesMessage()).await().getActiveBoluses();
ActiveBolus activeBolus = null; ActiveBolus activeBolus = null;
for (ActiveBolus bolus : activeBoluses) { for (ActiveBolus bolus : activeBoluses) {
if (bolus.getBolusID() == bolusID) { if (bolus.getBolusID() == bolusID) {