Merge pull request #1243 from jotomo/patchpatchpatch

Abort APS run if AS requested but not yet available.
This commit is contained in:
Milos Kozak 2018-07-22 18:09:02 +02:00 committed by GitHub
commit 0616c16e9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.OpenAPSAMA; package info.nightscout.androidaps.plugins.OpenAPSAMA;
import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData;
import org.json.JSONException; import org.json.JSONException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -173,7 +174,11 @@ public class OpenAPSAMAPlugin extends PluginBase implements APSInterface {
startPart = new Date(); startPart = new Date();
if (MainApp.getConstraintChecker().isAutosensModeEnabled().value()) { if (MainApp.getConstraintChecker().isAutosensModeEnabled().value()) {
lastAutosensResult = IobCobCalculatorPlugin.getPlugin().getLastAutosensDataSynchronized("OpenAPSPlugin").autosensResult; AutosensData autosensData = IobCobCalculatorPlugin.getPlugin().getLastAutosensDataSynchronized("OpenAPSPlugin");
if (autosensData == null) {
MainApp.bus().post(new EventOpenAPSUpdateResultGui(MainApp.gs(R.string.openaps_noasdata)));
return;
}
} else { } else {
lastAutosensResult = new AutosensResult(); lastAutosensResult = new AutosensResult();
lastAutosensResult.sensResult = "autosens disabled"; lastAutosensResult.sensResult = "autosens disabled";

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.OpenAPSSMB; package info.nightscout.androidaps.plugins.OpenAPSSMB;
import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData;
import org.json.JSONException; import org.json.JSONException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -180,7 +181,12 @@ public class OpenAPSSMBPlugin extends PluginBase implements APSInterface {
startPart = new Date(); startPart = new Date();
if (MainApp.getConstraintChecker().isAutosensModeEnabled().value()) { if (MainApp.getConstraintChecker().isAutosensModeEnabled().value()) {
lastAutosensResult = IobCobCalculatorPlugin.getPlugin().getLastAutosensDataSynchronized("OpenAPSPlugin").autosensResult; AutosensData autosensData = IobCobCalculatorPlugin.getPlugin().getLastAutosensDataSynchronized("OpenAPSPlugin");
if (autosensData == null) {
MainApp.bus().post(new EventOpenAPSUpdateResultGui(MainApp.gs(R.string.openaps_noasdata)));
return;
}
lastAutosensResult = autosensData.autosensResult;
} else { } else {
lastAutosensResult = new AutosensResult(); lastAutosensResult = new AutosensResult();
lastAutosensResult.sensResult = "autosens disabled"; lastAutosensResult.sensResult = "autosens disabled";

View file

@ -1168,6 +1168,7 @@
<string name="error_adding_treatment_message" formatted="false">A treatment (insulin: %.2f, carbs: %d, at: %s) could not be added to treatments. Please check and manually add a record as appropriate.</string> <string name="error_adding_treatment_message" formatted="false">A treatment (insulin: %.2f, carbs: %d, at: %s) could not be added to treatments. Please check and manually add a record as appropriate.</string>
<string name="generated_ecarbs_note">Generated eCarbs with amount: %1$dg, duration: %2$dh, delay: %3$dm</string> <string name="generated_ecarbs_note">Generated eCarbs with amount: %1$dg, duration: %2$dh, delay: %3$dm</string>
<string name="key_plugin_stats_report_timestamp" translatable="false">key_plugin_stats_report_timestamp</string> <string name="key_plugin_stats_report_timestamp" translatable="false">key_plugin_stats_report_timestamp</string>
<string name="openaps_noasdata">No autosens data available</string>
<plurals name="objective_days"> <plurals name="objective_days">
<item quantity="one">%d day</item> <item quantity="one">%d day</item>