fix bug when app is running without loop
This commit is contained in:
parent
08d677b806
commit
9766b4eccb
|
@ -11,7 +11,7 @@ public class Config {
|
||||||
public static final boolean OPENAPSMAENABLED = APS && true;
|
public static final boolean OPENAPSMAENABLED = APS && true;
|
||||||
public static final boolean LOOPENABLED = APS && true;
|
public static final boolean LOOPENABLED = APS && true;
|
||||||
public static final boolean OBJECTIVESENABLED = APS && true;
|
public static final boolean OBJECTIVESENABLED = APS && true;
|
||||||
public static final boolean CAREPORTALENABLED = true;
|
public static final boolean CAREPORTALENABLED = APS && true;
|
||||||
|
|
||||||
public static final boolean detailedLog = true;
|
public static final boolean detailedLog = true;
|
||||||
public static final boolean logFunctionCalls = true;
|
public static final boolean logFunctionCalls = true;
|
||||||
|
|
|
@ -616,6 +616,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
break;
|
break;
|
||||||
case PluginBase.LOOP:
|
case PluginBase.LOOP:
|
||||||
activeLoop = (LoopFragment) getTheOneEnabledInArray(pluginsInCategory);
|
activeLoop = (LoopFragment) getTheOneEnabledInArray(pluginsInCategory);
|
||||||
|
if (activeLoop != null) {
|
||||||
if (Config.logConfigBuilder)
|
if (Config.logConfigBuilder)
|
||||||
log.debug("Selected loop interface: " + activeLoop.getName());
|
log.debug("Selected loop interface: " + activeLoop.getName());
|
||||||
for (PluginBase p : pluginsInCategory) {
|
for (PluginBase p : pluginsInCategory) {
|
||||||
|
@ -623,6 +624,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
p.setFragmentVisible(false);
|
p.setFragmentVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PluginBase.TEMPBASAL:
|
case PluginBase.TEMPBASAL:
|
||||||
activeTempBasals = (TempBasalsInterface) getTheOneEnabledInArray(pluginsInCategory);
|
activeTempBasals = (TempBasalsInterface) getTheOneEnabledInArray(pluginsInCategory);
|
||||||
|
@ -649,6 +651,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private PluginBase getTheOneEnabledInArray(ArrayList<PluginBase> pluginsInCategory) {
|
private PluginBase getTheOneEnabledInArray(ArrayList<PluginBase> pluginsInCategory) {
|
||||||
PluginBase found = null;
|
PluginBase found = null;
|
||||||
for (PluginBase p : pluginsInCategory) {
|
for (PluginBase p : pluginsInCategory) {
|
||||||
|
@ -661,7 +664,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If none enabled, enable first one
|
// If none enabled, enable first one
|
||||||
if (found == null)
|
if (found == null && pluginsInCategory.size() > 0)
|
||||||
found = pluginsInCategory.get(0);
|
found = pluginsInCategory.get(0);
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue