AndroidAPS/app/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.java

59 lines
2 KiB
Java
Raw Normal View History

2017-05-29 21:45:59 +02:00
package info.nightscout.androidaps.data;
import android.content.Context;
import org.json.JSONObject;
import java.util.Date;
import info.nightscout.androidaps.db.CareportalEvent;
import info.nightscout.androidaps.db.Source;
/**
* Created by mike on 29.05.2017.
*/
2018-01-31 13:54:15 +01:00
public class DetailedBolusInfo implements Cloneable {
2017-06-15 23:12:12 +02:00
public long date = System.currentTimeMillis();
2017-05-29 21:45:59 +02:00
public String eventType = CareportalEvent.MEALBOLUS;
public double insulin = 0;
public double carbs = 0;
public int source = Source.NONE;
2017-08-17 20:51:24 +02:00
public boolean isValid = true;
2017-05-29 21:45:59 +02:00
public double glucose = 0; // Bg value in current units
public String glucoseType = ""; // NS values: Manual, Finger, Sensor
public int carbTime = 0; // time shift of carbs in minutes
public JSONObject boluscalc = null; // additional bolus wizard info
public Context context = null; // context for progress dialog
2017-08-06 12:19:25 +02:00
public long pumpId = 0; // id of record if comming from pump history (not a newly created treatment)
public boolean isSMB = false; // is a Super-MicroBolus
2018-01-31 13:54:15 +01:00
public DetailedBolusInfo copy() {
DetailedBolusInfo copy = new DetailedBolusInfo();
copy.date = this.date;
copy.eventType = this.eventType;
copy.insulin = this.insulin;
copy.carbs = this.carbs;
copy.source = this.source;
copy.isValid = this.isValid;
copy.glucose = this.glucose;
copy.glucoseType = this.glucoseType;
copy.carbTime = this.carbTime;
copy.boluscalc = this.boluscalc;
copy.context = this.context;
copy.pumpId = this.pumpId;
copy.isSMB = this.isSMB;
return copy;
}
@Override
public String toString() {
return new Date(date).toLocaleString() +
" insulin: " + insulin +
" carbs: " + carbs +
" isValid: " + isValid +
" carbTime: " + carbTime +
" isSMB: " + isSMB;
}
2017-05-29 21:45:59 +02:00
}