Merge pull request #8 from MilosKozak/master

dev
This commit is contained in:
LadyViktoria 2016-06-11 22:49:49 +02:00 committed by GitHub
commit b85a3b1ab3
2 changed files with 5 additions and 12 deletions

View file

@ -192,10 +192,10 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
double avg;
if (bgReadings.size() > 3) {
BgReading now = bgReadings.get(sizeRecords - 1);
BgReading last = bgReadings.get(sizeRecords - 2);
BgReading last1 = bgReadings.get(sizeRecords - 3);
BgReading last2 = bgReadings.get(sizeRecords - 4);
BgReading now = bgReadings.get(sizeRecords - 4);
BgReading last = bgReadings.get(sizeRecords - 3);
BgReading last1 = bgReadings.get(sizeRecords - 2);
BgReading last2 = bgReadings.get(sizeRecords - 1);
if (last2.value > 30) {
minutes = 3 * 5;
change = now.value - last2.value;
@ -212,7 +212,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
avg = change / minutes * 5;
result.glucose = now.value;
result.delta = change;
result.delta = now.value - last.value;
result.avgdelta = avg;
}
} catch (SQLException e) {

View file

@ -36,7 +36,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/openapsma_lastrun"
android:layout_marginLeft="10dp" />
</LinearLayout>
@ -64,7 +63,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/openapsma_glucosestatus"
android:layout_marginLeft="10dp" />
<TextView
@ -77,7 +75,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/openapsma_currenttemp"
android:layout_marginLeft="10dp" />
<TextView
@ -90,7 +87,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/openapsma_iobdata"
android:layout_marginLeft="10dp" />
<TextView
@ -103,7 +99,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/openapsma_profile"
android:layout_marginLeft="10dp" />
<TextView
@ -116,7 +111,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/openapsma_mealdata"
android:layout_marginLeft="10dp" />
</LinearLayout>
@ -138,7 +132,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/openapsma_result"
android:layout_marginLeft="10dp" />
</LinearLayout>