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

@ -489,7 +489,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
int type = plugin.getType(); int type = plugin.getType();
// Force enabled if there is only one plugin // Force enabled if there is only one plugin
if (type == PluginBase.PUMP || type == PluginBase.TREATMENT || type == PluginBase.TEMPBASAL || type == PluginBase.PROFILE) if (type == PluginBase.PUMP || type == PluginBase.TREATMENT || type == PluginBase.TEMPBASAL || type == PluginBase.PROFILE )
if (pluginList.size() < 2) if (pluginList.size() < 2)
holder.checkboxEnabled.setEnabled(false); holder.checkboxEnabled.setEnabled(false);
@ -552,6 +552,8 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
pluginsInCategory = MainActivity.getSpecificPluginsListByInterface(ProfileInterface.class); pluginsInCategory = MainActivity.getSpecificPluginsListByInterface(ProfileInterface.class);
break; break;
case PluginBase.BGSOURCE: case PluginBase.BGSOURCE:
pluginsInCategory = MainActivity.getSpecificPluginsListByInterface(BgSourceInterface.class);
break;
case PluginBase.LOOP: case PluginBase.LOOP:
case PluginBase.TEMPBASAL: case PluginBase.TEMPBASAL:
case PluginBase.TREATMENT: case PluginBase.TREATMENT:
@ -591,7 +593,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
} }
// PluginBase.BGSOURCE // PluginBase.BGSOURCE
pluginsInCategory = MainActivity.getSpecificPluginsList(PluginBase.BGSOURCE); pluginsInCategory = MainActivity.getSpecificPluginsListByInterface(BgSourceInterface.class);
activeBgSource = (BgSourceInterface) getTheOneEnabledInArray(pluginsInCategory, PluginBase.BGSOURCE); activeBgSource = (BgSourceInterface) getTheOneEnabledInArray(pluginsInCategory, PluginBase.BGSOURCE);
if (Config.logConfigBuilder) if (Config.logConfigBuilder)
log.debug("Selected bgSource interface: " + ((PluginBase) activeBgSource).getName()); log.debug("Selected bgSource interface: " + ((PluginBase) activeBgSource).getName());