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