Skip to content
Snippets Groups Projects
Commit 6813c9e5 authored by Lennart Goedhart's avatar Lennart Goedhart Committed by GitHub
Browse files

Merge pull request #121 from Pogman/develop

Visual fixes
parents 0d1c0893 d57cf860
Branches
No related tags found
No related merge requests found
......@@ -645,8 +645,8 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
public static String strFormatSGV(double sgvValue) {
ConfigurationStore configurationStore = ConfigurationStore.getInstance();
if (configurationStore.isMmolxl()) {
NumberFormat sgvFormatter;
if (configurationStore.isMmolxl()) {
if (configurationStore.isMmolxlDecimals()) {
sgvFormatter = new DecimalFormat("0.00");
} else {
......@@ -654,7 +654,8 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
}
return sgvFormatter.format(sgvValue / MMOLXLFACTOR);
} else {
return String.valueOf(sgvValue);
sgvFormatter = new DecimalFormat("0");
return sgvFormatter.format(sgvValue);
}
}
......@@ -824,13 +825,9 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
mChart.getViewport().setMinX(left);
mChart.getViewport().setYAxisBoundsManual(true);
if (configurationStore.isMmolxl()) {
mChart.getViewport().setMinY(80 / MMOLXLFACTOR);
mChart.getViewport().setMaxY(120 / MMOLXLFACTOR);
} else {
mChart.getViewport().setMinY(80);
mChart.getViewport().setMaxY(120);
}
mChart.postInvalidate();
return;
}
......@@ -874,7 +871,6 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
@Override
public void draw(Canvas canvas, Paint paint, float x, float y, DataPointInterface dataPoint) {
double sgv = dataPoint.getY();
boolean mmolxl = configurationStore.isMmolxl();
if (sgv < 80)
paint.setColor(Color.RED);
else if (sgv <= 180)
......
......@@ -244,8 +244,8 @@ public class MedtronicCnlIntentService extends IntentService {
// Check if pump sent old event when new expected
if (dataStore.getLastPumpStatus() != null &&
dataStore.getLastPumpStatus().getPumpDate() != null &&
pumpRecord.getPumpDate().getTime() - dataStore.getLastPumpStatus().getPumpDate().getTime() < 5000L &&
dataStore.getLastPumpStatus().getSgvDate() != null &&
pumpRecord.getSgvDate().getTime() - dataStore.getLastPumpStatus().getSgvDate().getTime() < 5000L &&
timePollExpected - timePollStarted < 5000L) {
sendStatus("Pump sent old SGV event");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment