commit
1c1ef26c84
1 changed files with 18 additions and 14 deletions
|
@ -433,22 +433,26 @@ public class DanaRExecutionService extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
final Object o = new Object();
|
final Object o = new Object();
|
||||||
ConfigBuilderPlugin.getCommandQueue().independentConnect("bolusingInterrupted", new Callback() {
|
synchronized(o) {
|
||||||
@Override
|
ConfigBuilderPlugin.getCommandQueue().independentConnect("bolusingInterrupted", new Callback() {
|
||||||
public void run() {
|
@Override
|
||||||
if (danaRPump.lastBolusTime.getTime() > System.currentTimeMillis() - 60 * 1000L) { // last bolus max 1 min old
|
public void run() {
|
||||||
t.insulin = danaRPump.lastBolusAmount;
|
if (danaRPump.lastBolusTime.getTime() > System.currentTimeMillis() - 60 * 1000L) { // last bolus max 1 min old
|
||||||
log.debug("Used bolus amount from history: " + danaRPump.lastBolusAmount);
|
t.insulin = danaRPump.lastBolusAmount;
|
||||||
} else {
|
log.debug("Used bolus amount from history: " + danaRPump.lastBolusAmount);
|
||||||
log.debug("Bolus amount in history too old: " + danaRPump.lastBolusTime.toLocaleString());
|
} else {
|
||||||
|
log.debug("Bolus amount in history too old: " + danaRPump.lastBolusTime.toLocaleString());
|
||||||
|
}
|
||||||
|
synchronized (o) {
|
||||||
|
o.notify();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
o.notify();
|
});
|
||||||
|
try {
|
||||||
|
o.wait();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
try {
|
|
||||||
o.wait();
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ConfigBuilderPlugin.getCommandQueue().readStatus("bolusOK", null);
|
ConfigBuilderPlugin.getCommandQueue().readStatus("bolusOK", null);
|
||||||
|
|
Loading…
Reference in a new issue