Add property that contains the list of all compiled modules (closes #1021)

This commit is contained in:
Alexander Bock
2022-06-18 19:44:05 +02:00
parent 6626e98c88
commit 02a2bcf1af
2 changed files with 23 additions and 2 deletions

View File

@@ -37,11 +37,24 @@
namespace {
constexpr const char* _loggerCat = "ModuleEngine";
constexpr openspace::properties::Property::PropertyInfo AllModulesInfo = {
"AllModules",
"All Modules",
"The list of all modules that were compiled for this version of OpenSpace in the "
"same order in which they were initialized."
};
} // namespace
namespace openspace {
ModuleEngine::ModuleEngine() : properties::PropertyOwner({ "Modules" }) {}
ModuleEngine::ModuleEngine()
: properties::PropertyOwner({ "Modules" })
, _allModules(AllModulesInfo)
{
_allModules.setReadOnly(true);
addProperty(_allModules);
}
void ModuleEngine::initialize(
const std::map<std::string, ghoul::Dictionary>& moduleConfigurations)
@@ -50,9 +63,13 @@ void ModuleEngine::initialize(
std::vector<OpenSpaceModule*> modules = AllModules();
std::vector<std::string> moduleNames;
moduleNames.reserve(modules.size());
for (OpenSpaceModule* m : modules) {
registerModule(std::unique_ptr<OpenSpaceModule>(m));
moduleNames.push_back(m->guiName());
}
_allModules = moduleNames;
for (OpenSpaceModule* m : modules) {
const std::string& identifier = m->identifier();