show if pump is suspended
This commit is contained in:
parent
32fda0f0df
commit
a4f302ee4a
10 changed files with 56 additions and 5 deletions
|
@ -106,6 +106,18 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
pumpDescription.basalMinimumRate = 0.04d;
|
pumpDescription.basalMinimumRate = 0.04d;
|
||||||
|
|
||||||
pumpDescription.isRefillingCapable = true;
|
pumpDescription.isRefillingCapable = true;
|
||||||
|
|
||||||
|
Thread t = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
Thread.sleep(5000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
|
refreshDataFromPump("Initialization");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
t.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
ServiceConnection mConnection = new ServiceConnection() {
|
ServiceConnection mConnection = new ServiceConnection() {
|
||||||
|
|
|
@ -108,6 +108,18 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints
|
||||||
pumpDescription.basalMinimumRate = 0.1d;
|
pumpDescription.basalMinimumRate = 0.1d;
|
||||||
|
|
||||||
pumpDescription.isRefillingCapable = true;
|
pumpDescription.isRefillingCapable = true;
|
||||||
|
|
||||||
|
Thread t = new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
Thread.sleep(5000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
|
refreshDataFromPump("Initialization");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
t.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
ServiceConnection mConnection = new ServiceConnection() {
|
ServiceConnection mConnection = new ServiceConnection() {
|
||||||
|
|
|
@ -133,12 +133,24 @@ public class LoopPlugin implements PluginBase {
|
||||||
log.debug("invoke");
|
log.debug("invoke");
|
||||||
ConstraintsInterface constraintsInterface = MainApp.getConfigBuilder();
|
ConstraintsInterface constraintsInterface = MainApp.getConfigBuilder();
|
||||||
if (!constraintsInterface.isLoopEnabled()) {
|
if (!constraintsInterface.isLoopEnabled()) {
|
||||||
|
log.debug(MainApp.sResources.getString(R.string.loopdisabled));
|
||||||
|
MainApp.bus().post(new EventLoopSetLastRunGui(MainApp.sResources.getString(R.string.loopdisabled)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!constraintsInterface.isLoopEnabled()) {
|
||||||
|
log.debug(MainApp.sResources.getString(R.string.loopdisabled));
|
||||||
MainApp.bus().post(new EventLoopSetLastRunGui(MainApp.sResources.getString(R.string.loopdisabled)));
|
MainApp.bus().post(new EventLoopSetLastRunGui(MainApp.sResources.getString(R.string.loopdisabled)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final ConfigBuilderPlugin configBuilder = MainApp.getConfigBuilder();
|
final ConfigBuilderPlugin configBuilder = MainApp.getConfigBuilder();
|
||||||
APSResult result = null;
|
APSResult result = null;
|
||||||
|
|
||||||
|
if (!configBuilder.isSuspended()) {
|
||||||
|
log.debug(MainApp.sResources.getString(R.string.pumpsuspended));
|
||||||
|
MainApp.bus().post(new EventLoopSetLastRunGui(MainApp.sResources.getString(R.string.pumpsuspended)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (configBuilder == null || !isEnabled(PluginBase.LOOP))
|
if (configBuilder == null || !isEnabled(PluginBase.LOOP))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -546,6 +546,8 @@ public class OverviewFragment extends Fragment {
|
||||||
loopStatusLayout.setVisibility(View.VISIBLE);
|
loopStatusLayout.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PumpInterface pump = MainApp.getConfigBuilder();
|
||||||
|
|
||||||
// Skip if not initialized yet
|
// Skip if not initialized yet
|
||||||
if (bgGraph == null)
|
if (bgGraph == null)
|
||||||
return;
|
return;
|
||||||
|
@ -560,7 +562,11 @@ public class OverviewFragment extends Fragment {
|
||||||
apsModeView.setBackgroundResource(R.drawable.loopmodeborder);
|
apsModeView.setBackgroundResource(R.drawable.loopmodeborder);
|
||||||
apsModeView.setTextColor(Color.BLACK);
|
apsModeView.setTextColor(Color.BLACK);
|
||||||
final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop();
|
final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop();
|
||||||
if (activeloop != null && activeloop.isEnabled(activeloop.getType())) {
|
if (pump.isSuspended()) {
|
||||||
|
apsModeView.setBackgroundResource(R.drawable.loopmodesuspendedborder);
|
||||||
|
apsModeView.setText(MainApp.sResources.getString(R.string.pumpsuspended));
|
||||||
|
apsModeView.setTextColor(Color.WHITE);
|
||||||
|
} else if (activeloop != null && activeloop.isEnabled(activeloop.getType())) {
|
||||||
if (MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
if (MainApp.getConfigBuilder().isClosedModeEnabled()) {
|
||||||
apsModeView.setText(MainApp.sResources.getString(R.string.closedloop));
|
apsModeView.setText(MainApp.sResources.getString(R.string.closedloop));
|
||||||
} else {
|
} else {
|
||||||
|
@ -627,8 +633,6 @@ public class OverviewFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
// **** Temp button ****
|
// **** Temp button ****
|
||||||
PumpInterface pump = MainApp.getConfigBuilder();
|
|
||||||
|
|
||||||
boolean showAcceptButton = !MainApp.getConfigBuilder().isClosedModeEnabled(); // Open mode needed
|
boolean showAcceptButton = !MainApp.getConfigBuilder().isClosedModeEnabled(); // Open mode needed
|
||||||
showAcceptButton = showAcceptButton && finalLastRun != null && finalLastRun.lastAPSRun != null; // aps result must exist
|
showAcceptButton = showAcceptButton && finalLastRun != null && finalLastRun.lastAPSRun != null; // aps result must exist
|
||||||
showAcceptButton = showAcceptButton && (finalLastRun.lastOpenModeAccept == null || finalLastRun.lastOpenModeAccept.getTime() < finalLastRun.lastAPSRun.getTime()); // never accepted or before last result
|
showAcceptButton = showAcceptButton && (finalLastRun.lastOpenModeAccept == null || finalLastRun.lastOpenModeAccept.getTime() < finalLastRun.lastAPSRun.getTime()); // never accepted or before last result
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||||
<solid android:color="@color/colorCancelTempButton" />
|
<solid android:color="@color/loopenabled" />
|
||||||
<stroke android:width="1dip" android:color="@android:color/white"/>
|
<stroke android:width="1dip" android:color="@android:color/white"/>
|
||||||
<corners
|
<corners
|
||||||
android:radius="2dp" >
|
android:radius="2dp" >
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||||
<solid android:color="@color/colorSetExtendedButton" />
|
<solid android:color="@color/loopdisabled" />
|
||||||
<stroke android:width="1dip" android:color="@android:color/white"/>
|
<stroke android:width="1dip" android:color="@android:color/white"/>
|
||||||
<corners
|
<corners
|
||||||
android:radius="2dp" >
|
android:radius="2dp" >
|
||||||
|
|
7
app/src/main/res/drawable/loopmodesuspendedborder.xml
Normal file
7
app/src/main/res/drawable/loopmodesuspendedborder.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||||
|
<solid android:color="@color/looppumpsuspended" />
|
||||||
|
<stroke android:width="1dip" android:color="@android:color/white"/>
|
||||||
|
<corners
|
||||||
|
android:radius="2dp" >
|
||||||
|
</corners>
|
||||||
|
</shape>
|
|
@ -27,6 +27,10 @@
|
||||||
<color name="colorPumpLabel">#779ECB</color>
|
<color name="colorPumpLabel">#779ECB</color>
|
||||||
<color name="cardItemLabel">#FF478EFF</color>
|
<color name="cardItemLabel">#FF478EFF</color>
|
||||||
|
|
||||||
|
<color name="loopenabled">#47c8ff</color>
|
||||||
|
<color name="loopdisabled">#FFDD7792</color>
|
||||||
|
<color name="looppumpsuspended">#ff0400</color>
|
||||||
|
|
||||||
<color name="notificationUrgent">#ff0400</color>
|
<color name="notificationUrgent">#ff0400</color>
|
||||||
<color name="notificationNormal">#ff5e55</color>
|
<color name="notificationNormal">#ff5e55</color>
|
||||||
<color name="notificationLow">#ff827c</color>
|
<color name="notificationLow">#ff827c</color>
|
||||||
|
|
Loading…
Reference in a new issue