disable bolus when pump is suspended

This commit is contained in:
Milos Kozak 2017-05-30 18:23:07 +02:00
parent f5f7d28cc1
commit b3d18b2537
3 changed files with 12 additions and 3 deletions

View file

@ -804,8 +804,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
pumpStatusLayout.setVisibility(View.VISIBLE);
loopStatusLayout.setVisibility(View.GONE);
} else {
wizardButton.setVisibility(View.VISIBLE);
treatmentButton.setVisibility(View.VISIBLE);
pumpStatusLayout.setVisibility(View.GONE);
loopStatusLayout.setVisibility(View.VISIBLE);
}
@ -1002,6 +1000,15 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
} else
quickWizardButton.setVisibility(View.GONE);
// Bolus and calc button
if (pump.isInitialized() && !pump.isSuspended()) {
wizardButton.setVisibility(View.VISIBLE);
treatmentButton.setVisibility(View.VISIBLE);
} else {
wizardButton.setVisibility(View.GONE);
treatmentButton.setVisibility(View.GONE);
}
String units = profile.getUnits();
Double lowLine = SP.getDouble("low_mark", 0d);

View file

@ -425,6 +425,9 @@ public class SmsCommunicatorPlugin implements PluginBase {
if (new Date().getTime() - lastRemoteBolusTime.getTime() < Constants.remoteBolusMinDistance) {
reply = MainApp.sResources.getString(R.string.smscommunicator_remotebolusnotallowed);
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
} else if (MainApp.getConfigBuilder().isSuspended()) {
reply = MainApp.sResources.getString(R.string.pumpsuspended);
sendSMS(new Sms(receivedSms.phoneNumber, reply, new Date()));
} else if (splited.length > 1) {
amount = SafeParse.stringToDouble(splited[1]);
amount = MainApp.getConfigBuilder().applyBolusConstraints(amount);

View file

@ -197,7 +197,6 @@
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_alignParentBottom="true"
android:layout_paddingBottom="5dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"