AndroidAPS/app/src/main/java/info/nightscout/androidaps/db/TDD.java

48 lines
938 B
Java
Raw Normal View History

2018-03-14 00:57:48 +01:00
package info.nightscout.androidaps.db;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
2018-03-14 00:57:48 +01:00
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Objects;
2018-03-14 00:57:48 +01:00
2018-07-30 15:46:20 +02:00
import info.nightscout.androidaps.logging.L;
2018-03-14 00:57:48 +01:00
/**
* Created by mike on 20.09.2017.
*/
2018-03-14 00:57:48 +01:00
@DatabaseTable(tableName = DatabaseHelper.DATABASE_TDDS)
public class TDD {
2018-07-30 15:46:20 +02:00
private static Logger log = LoggerFactory.getLogger(L.DATABASE);
2018-03-14 00:57:48 +01:00
@DatabaseField(id = true)
public long date;
@DatabaseField
public double bolus;
@DatabaseField
public double basal;
@DatabaseField
public double total;
public double getTotal(){
return (total > 0d) ? total:(bolus+basal);
2018-03-14 00:57:48 +01:00
}
public TDD() { }
2018-03-14 00:57:48 +01:00
public TDD(long date, double bolus, double basal, double total){
2018-03-14 00:57:48 +01:00
this.date = date;
this.bolus = bolus;
this.basal = basal;
this.total = total;
}
}