Merge remote-tracking branch 'origin/dev' into combo-scripter-v2

* origin/dev:
  another cob fix
This commit is contained in:
Johannes Mockenhaupt 2018-01-01 15:07:34 +01:00
commit cbf005a11e
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
5 changed files with 6 additions and 6 deletions

View file

@ -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;
} }

View file

@ -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;

View file

@ -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;
} }
} }

View file

@ -1197,7 +1197,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);

View file

@ -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";
} }