WatchUpdaterService: use IobCob.getCobInfo().

This commit is contained in:
Johannes Mockenhaupt 2018-04-26 01:04:27 +02:00
parent b5a6ef2ecc
commit 2f846bc417
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -37,6 +37,7 @@ import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.db.BgReading;
import info.nightscout.androidaps.db.DatabaseHelper;
import info.nightscout.androidaps.db.TemporaryBasal;
import info.nightscout.androidaps.plugins.IobCobCalculator.CobInfo;
import info.nightscout.androidaps.plugins.Treatments.Treatment;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.interfaces.TreatmentsInterface;
@ -718,9 +719,9 @@ public class WatchUpdaterService extends WearableListenerService implements
private String generateCOBString() {
String cobStringResult = "--";
AutosensData autosensData = IobCobCalculatorPlugin.getPlugin().getLastAutosensData("WatcherUpdaterService");
if (autosensData != null) {
cobStringResult = (int) autosensData.cob + "g";
CobInfo cobInfo = IobCobCalculatorPlugin.getPlugin().getCobInfo(false, "WatcherUpdaterService");
if (cobInfo.displayCob != null) {
cobStringResult = DecimalFormatter.to0Decimal(cobInfo.displayCob) + "g";
}
return cobStringResult;
}