wear yet again current situation tweaks

This commit is contained in:
AdrianLxM 2016-11-18 05:58:06 +01:00
parent 663a865595
commit 95432e35e0

View file

@ -329,13 +329,13 @@ public class WatchUpdaterService extends WearableListenerService implements
tb2 = MainApp.getConfigBuilder().getTempBasal(new Date(now)); //use "now" to express current situation tb2 = MainApp.getConfigBuilder().getTempBasal(new Date(now)); //use "now" to express current situation
if(tb2 == null) { if(tb2 == null) {
//express the cancelled temp by painting it down one minute early //express the cancelled temp by painting it down one minute early
temps.add(tempDatamap(tb_start, tb_before, now - 1 * 60 * 1000, tb_amount, tb_amount)); temps.add(tempDatamap(tb_start, tb_before, now - 1 * 60 * 1000, endBasalValue, tb_amount));
} else { } else {
//express currently running temp by painting it a bit into the future //express currently running temp by painting it a bit into the future
double currentAmount = tb2.tempBasalConvertedToAbsolute(new Date(runningTime)); double currentAmount = tb2.tempBasalConvertedToAbsolute(new Date(now));
if(currentAmount != tb_amount){ if(currentAmount != tb_amount){
temps.add(tempDatamap(tb_start, tb_before, runningTime, tb_amount, tb_amount)); temps.add(tempDatamap(tb_start, tb_before, now, tb_amount, tb_amount));
temps.add(tempDatamap(runningTime, tb_amount, runningTime + 5 * 60 * 1000, currentAmount, currentAmount)); temps.add(tempDatamap(now, tb_amount, runningTime + 5 * 60 * 1000, currentAmount, currentAmount));
} else { } else {
temps.add(tempDatamap(tb_start, tb_before, runningTime + 5 * 60 * 1000, tb_amount, tb_amount)); temps.add(tempDatamap(tb_start, tb_before, runningTime + 5 * 60 * 1000, tb_amount, tb_amount));
} }