add bolus sound

This commit is contained in:
Milos Kozak 2017-11-11 16:20:34 +01:00
parent 86b11edd58
commit a5227fc773
5 changed files with 24 additions and 15 deletions

View file

@ -60,5 +60,5 @@ public class Constants {
public static final double DEVIATION_TO_BE_EQUAL = 2.0; public static final double DEVIATION_TO_BE_EQUAL = 2.0;
// Pump // Pump
public static final int PUMP_MAX_CONNECTION_TIME_IN_SECONDS = 5 * 60; public static final int PUMP_MAX_CONNECTION_TIME_IN_SECONDS = 60 - 1;
} }

View file

@ -61,9 +61,6 @@ public class Notification {
public NSAlarm nsAlarm = null; public NSAlarm nsAlarm = null;
public Integer soundId = null; public Integer soundId = null;
public Notification() {
}
public Notification(int id, Date date, String text, int level, Date validTo) { public Notification(int id, Date date, String text, int level, Date validTo) {
this.id = id; this.id = id;
this.date = date; this.date = date;
@ -88,6 +85,27 @@ public class Notification {
this.validTo = new Date(0); this.validTo = new Date(0);
} }
public Notification(int id) {
this.id = id;
this.date = new Date();
this.validTo = new Date(0);
}
public Notification text(String text) {
this.text = text;
return this;
}
public Notification level(int level) {
this.level = level;
return this;
}
public Notification sound(int soundId) {
this.soundId = soundId;
return this;
}
public Notification(NSAlarm nsAlarm) { public Notification(NSAlarm nsAlarm) {
this.date = new Date(); this.date = new Date();
this.validTo = new Date(0); this.validTo = new Date(0);

View file

@ -5,20 +5,11 @@ import info.nightscout.androidaps.data.PumpEnactResult;
/** /**
* Created by mike on 09.11.2017. * Created by mike on 09.11.2017.
*/ */
public class Callback { public abstract class Callback implements Runnable {
public PumpEnactResult result; public PumpEnactResult result;
Runnable runnable;
public Callback(Runnable runnable) {
this.runnable = runnable;
}
public Callback result(PumpEnactResult result) { public Callback result(PumpEnactResult result) {
this.result = result; this.result = result;
return this; return this;
} }
public void run() {
runnable.run();
}
} }

View file

@ -25,6 +25,6 @@ public class CommandReadStatus extends Command {
@Override @Override
public String status() { public String status() {
return "READSTATUS " + reason; return "READSTATUS";
} }
} }

Binary file not shown.