Merge branch 'dev' of https://github.com/MilosKozak/AndroidAPS into dev
This commit is contained in:
commit
d0fc697183
|
@ -1250,6 +1250,22 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
return new ArrayList<ExtendedBolus>();
|
return new ArrayList<ExtendedBolus>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ExtendedBolus> getExtendedBolusDataFromTime(long from, long to, boolean ascending) {
|
||||||
|
try {
|
||||||
|
List<ExtendedBolus> extendedBoluses;
|
||||||
|
QueryBuilder<ExtendedBolus, Long> queryBuilder = getDaoExtendedBolus().queryBuilder();
|
||||||
|
queryBuilder.orderBy("date", ascending);
|
||||||
|
Where where = queryBuilder.where();
|
||||||
|
where.between("date", from, to);
|
||||||
|
PreparedQuery<ExtendedBolus> preparedQuery = queryBuilder.prepare();
|
||||||
|
extendedBoluses = getDaoExtendedBolus().query(preparedQuery);
|
||||||
|
return extendedBoluses;
|
||||||
|
} catch (SQLException e) {
|
||||||
|
log.error("Unhandled exception", e);
|
||||||
|
}
|
||||||
|
return new ArrayList<ExtendedBolus>();
|
||||||
|
}
|
||||||
|
|
||||||
public void deleteExtendedBolusById(String _id) {
|
public void deleteExtendedBolusById(String _id) {
|
||||||
ExtendedBolus stored = findExtendedBolusById(_id);
|
ExtendedBolus stored = findExtendedBolusById(_id);
|
||||||
if (stored != null) {
|
if (stored != null) {
|
||||||
|
|
|
@ -110,6 +110,8 @@ public class TemporaryBasal implements Interval, DbObjectBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public TemporaryBasal(ExtendedBolus extendedBolus) {
|
public TemporaryBasal(ExtendedBolus extendedBolus) {
|
||||||
|
injector = MainApp.instance();
|
||||||
|
injector.androidInjector().inject(this);
|
||||||
double basal = profileFunction.getProfile(extendedBolus.date).getBasal(extendedBolus.date);
|
double basal = profileFunction.getProfile(extendedBolus.date).getBasal(extendedBolus.date);
|
||||||
this.date = extendedBolus.date;
|
this.date = extendedBolus.date;
|
||||||
this.isValid = extendedBolus.isValid;
|
this.isValid = extendedBolus.isValid;
|
||||||
|
|
Loading…
Reference in a new issue