parent
95ea377d71
commit
e9883dcc3a
1 changed files with 1 additions and 5 deletions
|
@ -11,7 +11,6 @@ import info.nightscout.androidaps.db.Source;
|
||||||
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
|
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
|
||||||
import info.nightscout.androidaps.plugins.Overview.Dialogs.ErrorHelperActivity;
|
import info.nightscout.androidaps.plugins.Overview.Dialogs.ErrorHelperActivity;
|
||||||
import info.nightscout.androidaps.queue.Callback;
|
import info.nightscout.androidaps.queue.Callback;
|
||||||
import info.nightscout.utils.DateUtil;
|
|
||||||
|
|
||||||
import static info.nightscout.utils.DateUtil.now;
|
import static info.nightscout.utils.DateUtil.now;
|
||||||
|
|
||||||
|
@ -29,11 +28,8 @@ public class CarbsGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createCarb(int carbs, long time, String eventType, @Nullable String notes) {
|
public static void createCarb(int carbs, long time, String eventType, @Nullable String notes) {
|
||||||
long now = DateUtil.now();
|
|
||||||
int carbTime = (int) ((time - now) / 1000 / 60);
|
|
||||||
DetailedBolusInfo carbInfo = new DetailedBolusInfo();
|
DetailedBolusInfo carbInfo = new DetailedBolusInfo();
|
||||||
carbInfo.date = now;
|
carbInfo.date = time;
|
||||||
carbInfo.carbTime = carbTime;
|
|
||||||
carbInfo.eventType = eventType;
|
carbInfo.eventType = eventType;
|
||||||
carbInfo.carbs = carbs;
|
carbInfo.carbs = carbs;
|
||||||
carbInfo.context = MainApp.instance();
|
carbInfo.context = MainApp.instance();
|
||||||
|
|
Loading…
Reference in a new issue