another cob fix
This commit is contained in:
parent
d27d1b1821
commit
d2753e0dad
|
@ -80,7 +80,7 @@ public class QuickWizardEntry {
|
|||
|
||||
// COB
|
||||
double cob = 0d;
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getLastAutosensData();
|
||||
if (autosensData != null && useCOB() == YES) {
|
||||
cob = autosensData.cob;
|
||||
}
|
||||
|
|
|
@ -560,7 +560,7 @@ public class IobCobCalculatorPlugin implements PluginBase {
|
|||
if (autosensDataTable.size() < 1)
|
||||
return null;
|
||||
AutosensData data = autosensDataTable.valueAt(autosensDataTable.size() - 1);
|
||||
if (data.time < System.currentTimeMillis() - 5 * 60 * 1000) {
|
||||
if (data.time < System.currentTimeMillis() - 11 * 60 * 1000) {
|
||||
return null;
|
||||
} else {
|
||||
return data;
|
||||
|
|
|
@ -458,9 +458,9 @@ public class WizardDialog extends DialogFragment implements OnClickListener, Com
|
|||
// COB
|
||||
Double c_cob = 0d;
|
||||
if (cobCheckbox.isChecked()) {
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getLastAutosensData();
|
||||
|
||||
if(autosensData != null && autosensData.time > System.currentTimeMillis() - 11 * 60 * 1000L) {
|
||||
if(autosensData != null) {
|
||||
c_cob = autosensData.cob;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1198,7 +1198,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
// cob
|
||||
if (cobView != null) { // view must not exists
|
||||
String cobText = "";
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getLastAutosensData();
|
||||
if (autosensData != null)
|
||||
cobText = (int) autosensData.cob + " g";
|
||||
cobView.setText(cobText);
|
||||
|
|
|
@ -654,7 +654,7 @@ public class WatchUpdaterService extends WearableListenerService implements
|
|||
private String generateCOBString() {
|
||||
|
||||
String cobStringResult = "--";
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getAutosensData(System.currentTimeMillis());
|
||||
AutosensData autosensData = IobCobCalculatorPlugin.getLastAutosensData();
|
||||
if (autosensData != null) {
|
||||
cobStringResult = (int) autosensData.cob + "g";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue