allow bgsource not to be primary type

This commit is contained in:
Milos Kozak 2016-07-13 14:28:16 +02:00
parent 272262b115
commit a10a819a9d

View file

@ -552,6 +552,8 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
pluginsInCategory = MainActivity.getSpecificPluginsListByInterface(ProfileInterface.class);
break;
case PluginBase.BGSOURCE:
pluginsInCategory = MainActivity.getSpecificPluginsListByInterface(BgSourceInterface.class);
break;
case PluginBase.LOOP:
case PluginBase.TEMPBASAL:
case PluginBase.TREATMENT:
@ -591,7 +593,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
}
// PluginBase.BGSOURCE
pluginsInCategory = MainActivity.getSpecificPluginsList(PluginBase.BGSOURCE);
pluginsInCategory = MainActivity.getSpecificPluginsListByInterface(BgSourceInterface.class);
activeBgSource = (BgSourceInterface) getTheOneEnabledInArray(pluginsInCategory, PluginBase.BGSOURCE);
if (Config.logConfigBuilder)
log.debug("Selected bgSource interface: " + ((PluginBase) activeBgSource).getName());