read pump status after pump driver change
This commit is contained in:
parent
5e2fdebc07
commit
5a192d82d0
17 changed files with 25 additions and 4 deletions
|
@ -1,9 +1,12 @@
|
|||
package info.nightscout.androidaps.interfaces;
|
||||
|
||||
import android.os.SystemClock;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
|
||||
|
||||
/**
|
||||
* Created by mike on 09.06.2016.
|
||||
|
@ -146,6 +149,12 @@ public abstract class PluginBase {
|
|||
}
|
||||
|
||||
protected void onStart() {
|
||||
if (getType() == PluginType.PUMP) {
|
||||
new Thread(() -> {
|
||||
SystemClock.sleep(3000);
|
||||
ConfigBuilderPlugin.getCommandQueue().readStatus("Pump driver changed.", null);
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
protected void onStop() {
|
||||
|
|
|
@ -97,8 +97,8 @@ public class ConfigBuilderPlugin extends PluginBase {
|
|||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
MainApp.bus().register(this);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -78,8 +78,8 @@ public class IobCobCalculatorPlugin extends PluginBase {
|
|||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
MainApp.bus().register(this);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -89,8 +89,8 @@ public class LoopPlugin extends PluginBase {
|
|||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
MainApp.bus().register(this);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -86,6 +86,7 @@ public class NSClientPlugin extends PluginBase {
|
|||
Context context = MainApp.instance().getApplicationContext();
|
||||
Intent intent = new Intent(context, NSClientService.class);
|
||||
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -62,6 +62,7 @@ public class OverviewPlugin extends PluginBase {
|
|||
@Override
|
||||
protected void onStart() {
|
||||
MainApp.bus().register(this);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,6 +58,7 @@ public class PersistentNotificationPlugin extends PluginBase {
|
|||
protected void onStart() {
|
||||
MainApp.bus().register(this);
|
||||
updateNotification();
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -55,6 +55,7 @@ public class NSProfilePlugin extends PluginBase implements ProfileInterface {
|
|||
@Override
|
||||
protected void onStart() {
|
||||
MainApp.bus().register(this);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -80,6 +80,7 @@ public class DanaRPlugin extends AbstractDanaRPlugin {
|
|||
Intent intent = new Intent(context, DanaRExecutionService.class);
|
||||
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||
MainApp.bus().register(this);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -81,6 +81,7 @@ public class DanaRKoreanPlugin extends AbstractDanaRPlugin {
|
|||
Intent intent = new Intent(context, DanaRKoreanExecutionService.class);
|
||||
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||
MainApp.bus().register(this);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -131,6 +131,7 @@ public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInte
|
|||
|
||||
MainApp.bus().register(this);
|
||||
onStatusEvent(new EventDanaRSDeviceChange()); // load device name
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -81,6 +81,7 @@ public class DanaRv2Plugin extends AbstractDanaRPlugin {
|
|||
context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||
|
||||
MainApp.bus().register(this);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -171,6 +171,7 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai
|
|||
}
|
||||
}
|
||||
}
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
protected void onStop() {
|
||||
|
|
|
@ -131,6 +131,7 @@ public class SmsCommunicatorPlugin extends PluginBase {
|
|||
@Override
|
||||
protected void onStart() {
|
||||
MainApp.bus().register(this);
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -86,6 +86,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
|
|||
initializeExtendedBolusData();
|
||||
initializeTempTargetData();
|
||||
initializeProfileSwitchData();
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -66,6 +66,7 @@ public class WearPlugin extends PluginBase {
|
|||
if (watchUS != null) {
|
||||
watchUS.setSettings();
|
||||
}
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -75,9 +75,9 @@ public class StatuslinePlugin extends PluginBase {
|
|||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
MainApp.bus().register(this);
|
||||
sendStatus();
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue