commit
b85a3b1ab3
2 changed files with 5 additions and 12 deletions
|
@ -192,10 +192,10 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
double avg;
|
double avg;
|
||||||
|
|
||||||
if (bgReadings.size() > 3) {
|
if (bgReadings.size() > 3) {
|
||||||
BgReading now = bgReadings.get(sizeRecords - 1);
|
BgReading now = bgReadings.get(sizeRecords - 4);
|
||||||
BgReading last = bgReadings.get(sizeRecords - 2);
|
BgReading last = bgReadings.get(sizeRecords - 3);
|
||||||
BgReading last1 = bgReadings.get(sizeRecords - 3);
|
BgReading last1 = bgReadings.get(sizeRecords - 2);
|
||||||
BgReading last2 = bgReadings.get(sizeRecords - 4);
|
BgReading last2 = bgReadings.get(sizeRecords - 1);
|
||||||
if (last2.value > 30) {
|
if (last2.value > 30) {
|
||||||
minutes = 3 * 5;
|
minutes = 3 * 5;
|
||||||
change = now.value - last2.value;
|
change = now.value - last2.value;
|
||||||
|
@ -212,7 +212,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
avg = change / minutes * 5;
|
avg = change / minutes * 5;
|
||||||
|
|
||||||
result.glucose = now.value;
|
result.glucose = now.value;
|
||||||
result.delta = change;
|
result.delta = now.value - last.value;
|
||||||
result.avgdelta = avg;
|
result.avgdelta = avg;
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="Small Text"
|
|
||||||
android:id="@+id/openapsma_lastrun"
|
android:id="@+id/openapsma_lastrun"
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -64,7 +63,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="Small Text"
|
|
||||||
android:id="@+id/openapsma_glucosestatus"
|
android:id="@+id/openapsma_glucosestatus"
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -77,7 +75,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="Small Text"
|
|
||||||
android:id="@+id/openapsma_currenttemp"
|
android:id="@+id/openapsma_currenttemp"
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -90,7 +87,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="Small Text"
|
|
||||||
android:id="@+id/openapsma_iobdata"
|
android:id="@+id/openapsma_iobdata"
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -103,7 +99,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="Small Text"
|
|
||||||
android:id="@+id/openapsma_profile"
|
android:id="@+id/openapsma_profile"
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -116,7 +111,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="Small Text"
|
|
||||||
android:id="@+id/openapsma_mealdata"
|
android:id="@+id/openapsma_mealdata"
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -138,7 +132,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="Small Text"
|
|
||||||
android:id="@+id/openapsma_result"
|
android:id="@+id/openapsma_result"
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
Loading…
Reference in a new issue