Explicit pump initialization.
(cherry picked from commit d8b244a)
This commit is contained in:
parent
8b8a135804
commit
57be9bb9b1
|
@ -175,8 +175,10 @@ public class MainApp extends Application {
|
|||
public void run() {
|
||||
SystemClock.sleep(5000);
|
||||
PumpInterface pump = MainApp.getConfigBuilder();
|
||||
if (pump != null)
|
||||
pump.refreshDataFromPump("Initialization");
|
||||
if (pump != null) {
|
||||
log.debug("Initializing pump");
|
||||
pump.initialize();
|
||||
}
|
||||
}
|
||||
});
|
||||
t.start();
|
||||
|
|
|
@ -15,6 +15,7 @@ import info.nightscout.androidaps.data.Profile;
|
|||
*/
|
||||
public interface PumpInterface {
|
||||
|
||||
void initialize();
|
||||
boolean isInitialized();
|
||||
boolean isSuspended();
|
||||
boolean isBusy();
|
||||
|
|
|
@ -222,6 +222,11 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C
|
|||
return useExtendedBoluses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
refreshDataFromPump("Initialization");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInitialized() {
|
||||
return pump.lastConnection.getTime() > 0 && pump.isExtendedBolusEnabled;
|
||||
|
|
|
@ -224,6 +224,11 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, DanaRInterf
|
|||
return useExtendedBoluses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
refreshDataFromPump("Initialization");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInitialized() {
|
||||
return pump.lastConnection.getTime() > 0 && !pump.isConfigUD && !pump.isEasyModeEnabled && pump.isExtendedBolusEnabled;
|
||||
|
|
|
@ -357,6 +357,10 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface,
|
|||
}
|
||||
|
||||
// Pump interface
|
||||
@Override
|
||||
public void initialize() {
|
||||
refreshDataFromPump("Initialization");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInitialized() {
|
||||
|
|
|
@ -209,6 +209,11 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, DanaRInterface,
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
refreshDataFromPump("Initialization");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInitialized() {
|
||||
return pump.lastConnection.getTime() > 0;
|
||||
|
|
|
@ -109,6 +109,10 @@ public class MDIPlugin implements PluginBase, PumpInterface {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInitialized() {
|
||||
return true;
|
||||
|
|
|
@ -164,6 +164,10 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
|
|||
return Config.NSCLIENT && fromNSAreCommingFakedExtendedBoluses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInitialized() {
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue