diff --git a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertHexGridToSquareGridFilter.cpp b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertHexGridToSquareGridFilter.cpp index a0159f040d..77ad2d9535 100644 --- a/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertHexGridToSquareGridFilter.cpp +++ b/src/Plugins/OrientationAnalysis/src/OrientationAnalysis/Filters/ConvertHexGridToSquareGridFilter.cpp @@ -83,16 +83,18 @@ Parameters ConvertHexGridToSquareGridFilter::parameters() const // Create the parameter descriptors that are needed for this filter params.insertSeparator(Parameters::Separator{"Orientation Source Data"}); - params.insertLinkableParameter(std::make_unique(k_MultipleFiles_Key, "Convert Multiple Files", "", false)); + params.insertLinkableParameter(std::make_unique(k_MultipleFiles_Key, "Convert Multiple Files", "True=Convert a list of files, False, just convert a single file", false)); params.insert(std::make_unique(k_Spacing_Key, "Spacing", "Specifies the new spacing values", std::vector{1.0f, 1.0f}, std::vector{"X", "Y"})); - params.insert( - std::make_unique(k_InputPath_Key, "Input File", "", fs::path(""), FileSystemPathParameter::ExtensionsType{}, FileSystemPathParameter::PathType::InputFile, true)); - params.insert(std::make_unique(k_GeneratedFileList_Key, "Generated File List", "", GeneratedFileListParameter::ValueType{})); + params.insert(std::make_unique(k_InputPath_Key, "Input File", "Path to the single file to convert", fs::path(""), FileSystemPathParameter::ExtensionsType{}, + FileSystemPathParameter::PathType::InputFile, true)); + params.insert(std::make_unique(k_GeneratedFileList_Key, "Generated File List", + "The values that are used to generate the input file list. See GeneratedFileListParameter for more information.", + GeneratedFileListParameter::ValueType{})); params.insertSeparator(Parameters::Separator{"Output Parameters"}); - params.insert( - std::make_unique(k_OutputPath_Key, "Output Directory", "", fs::path(""), FileSystemPathParameter::ExtensionsType{}, FileSystemPathParameter::PathType::OutputDir, true)); - params.insert(std::make_unique(k_OutputPrefix_Key, "Output Prefix", "", "Sqr_")); + params.insert(std::make_unique(k_OutputPath_Key, "Output Directory", "The path to store the converted file. Should NOT be in the same directory.", fs::path(""), + FileSystemPathParameter::ExtensionsType{}, FileSystemPathParameter::PathType::OutputDir, true)); + params.insert(std::make_unique(k_OutputPrefix_Key, "Output Prefix", "A string to prepend the name of each converted file", "Sqr_")); // Link Parameters params.linkParameters(k_MultipleFiles_Key, k_GeneratedFileList_Key, true); diff --git a/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter1.cpp b/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter1.cpp index d2b67506d5..478f010bee 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter1.cpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter1.cpp @@ -96,15 +96,16 @@ Parameters ExampleFilter1::parameters() const params.insert(std::make_unique(k_Param6, "Numeric Type", "Example numeric type help text", NumericType::int32)); params.insertSeparator({"Big Parameters"}); - params.insert(std::make_unique(k_Param4, "Input File List", "Data needed to generate the input file list", GeneratedFileListParameter::ValueType{})); + params.insert(std::make_unique( + k_Param4, "Input File List", "The values that are used to generate the input file list. See GeneratedFileListParameter for more information.", GeneratedFileListParameter::ValueType{})); params.insert(std::make_unique(k_Param7, "Data Thresholds", "DataArray thresholds to mask", ArrayThresholdSet{})); // param10 should be active if either param8 OR param9 are the correct value params.insertSeparator({"Multiple Linked Parameters"}); - params.insertLinkableParameter(std::make_unique(k_Param8, "Bool Parameter", "", true)); - params.insertLinkableParameter(std::make_unique(k_Param9, "Choices Parameter", "", 0, ChoicesParameter::Choices{"0", "1", "2"})); - params.insert(std::make_unique(k_Param10, "Int32 Parameter", "", 42)); + params.insertLinkableParameter(std::make_unique(k_Param8, "Bool Parameter", "A boolean Parameter", true)); + params.insertLinkableParameter(std::make_unique(k_Param9, "Choices Parameter", "A choices parameter", 0, ChoicesParameter::Choices{"0", "1", "2"})); + params.insert(std::make_unique(k_Param10, "Int32 Parameter", "An Integer Parameter", 42)); params.linkParameters(k_Param8, k_Param10, true); params.linkParameters(k_Param9, k_Param10, std::make_any(1)); diff --git a/src/Plugins/TestOne/src/TestOne/Filters/TestFilter.cpp b/src/Plugins/TestOne/src/TestOne/Filters/TestFilter.cpp index 2a124ef3e0..5051078c79 100644 --- a/src/Plugins/TestOne/src/TestOne/Filters/TestFilter.cpp +++ b/src/Plugins/TestOne/src/TestOne/Filters/TestFilter.cpp @@ -54,7 +54,8 @@ complex::Parameters TestFilter::parameters() const Parameters params; params.insert(std::make_unique(k_Param1, "Parameter 1", "The 1st parameter", 0.1234f)); params.insert(std::make_unique(k_Param2, "Parameter 2", "The 2nd parameter", false)); - params.insert(std::make_unique(k_Param3, "Input File List", "Data needed to generate the input file list", GeneratedFileListParameter::ValueType{})); + params.insert(std::make_unique( + k_Param3, "Input File List", "The values that are used to generate the input file list. See GeneratedFileListParameter for more information.", GeneratedFileListParameter::ValueType{})); return params; } diff --git a/test/PluginTest.cpp b/test/PluginTest.cpp index 286848ef91..ea50b4839b 100644 --- a/test/PluginTest.cpp +++ b/test/PluginTest.cpp @@ -6,6 +6,7 @@ #include +#include #include using namespace complex; @@ -27,9 +28,9 @@ TEST_CASE("Test Loading Plugins") Application app; app.loadPlugins(unit_test::k_BuildDir.view()); - auto* filterList = Application::Instance()->getFilterList(); - const auto& filterHandles = filterList->getFilterHandles(); - auto plugins = filterList->getLoadedPlugins(); + auto* filterListPtr = Application::Instance()->getFilterList(); + const auto& filterHandles = filterListPtr->getFilterHandles(); + auto plugins = filterListPtr->getLoadedPlugins(); if(plugins.size() != COMPLEX_PLUGIN_COUNT) { @@ -37,7 +38,7 @@ TEST_CASE("Test Loading Plugins") << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n"; for(auto const& plugin : plugins) { - std::cout << plugin->getName() << std::endl; + std::cout << plugin->getName() << "\n"; } } @@ -47,13 +48,13 @@ TEST_CASE("Test Loading Plugins") DataStructure dataStructure; { - IFilter::UniquePointer filter = filterList->createFilter(k_TestFilterHandle); + IFilter::UniquePointer filter = filterListPtr->createFilter(k_TestFilterHandle); REQUIRE(filter != nullptr); REQUIRE(filter->humanName() == "Test Filter"); filter->execute(dataStructure, {}); } { - IFilter::UniquePointer filter2 = filterList->createFilter(k_Test2FilterHandle); + IFilter::UniquePointer filter2 = filterListPtr->createFilter(k_Test2FilterHandle); REQUIRE(filter2 != nullptr); REQUIRE(filter2->humanName() == "Test Filter 2"); filter2->execute(dataStructure, {}); @@ -62,14 +63,14 @@ TEST_CASE("Test Loading Plugins") TEST_CASE("Test Singleton") { - Application* app = new Application(); - app->loadPlugins(unit_test::k_BuildDir.view()); + Application* appPtr = new Application(); + appPtr->loadPlugins(unit_test::k_BuildDir.view()); - REQUIRE(app != nullptr); + REQUIRE(appPtr != nullptr); - auto* filterList = app->getFilterList(); - const auto& filterHandles = filterList->getFilterHandles(); - auto plugins = filterList->getLoadedPlugins(); + auto* filterListPtr = appPtr->getFilterList(); + const auto& filterHandles = filterListPtr->getFilterHandles(); + auto plugins = filterListPtr->getLoadedPlugins(); // Check plugins were loaded if(plugins.size() != COMPLEX_PLUGIN_COUNT) @@ -78,7 +79,7 @@ TEST_CASE("Test Singleton") << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n"; for(auto const& plugin : plugins) { - std::cout << plugin->getName() << std::endl; + std::cout << plugin->getName() << "\n"; } } REQUIRE(plugins.size() == COMPLEX_PLUGIN_COUNT); @@ -89,13 +90,13 @@ TEST_CASE("Test Singleton") // Create and execute filters DataStructure dataStructure; { - IFilter::UniquePointer filter = filterList->createFilter(k_TestFilterHandle); + IFilter::UniquePointer filter = filterListPtr->createFilter(k_TestFilterHandle); REQUIRE(filter != nullptr); REQUIRE(filter->humanName() == "Test Filter"); filter->execute(dataStructure, {}); } { - IFilter::UniquePointer filter2 = filterList->createFilter(k_Test2FilterHandle); + IFilter::UniquePointer filter2 = filterListPtr->createFilter(k_Test2FilterHandle); REQUIRE(filter2 != nullptr); REQUIRE(filter2->humanName() == "Test Filter 2"); filter2->execute(dataStructure, {}); @@ -104,3 +105,59 @@ TEST_CASE("Test Singleton") delete Application::Instance(); REQUIRE(Application::Instance() == nullptr); } + +TEST_CASE("Test Filter Help Text") +{ + Application* appPtr = new Application(); + REQUIRE(appPtr != nullptr); + + appPtr->loadPlugins(unit_test::k_BuildDir.view()); + auto* filterListPtr = Application::Instance()->getFilterList(); + const auto pluginListPtr = Application::Instance()->getPluginList(); + + std::stringstream output; + + // Loop on each Plugin + for(const auto& plugin : pluginListPtr) + { + const std::string plugName = plugin->getName(); + + const auto& pluginFilterHandles = plugin->getFilterHandles(); + + // Loop on each Filter + for(const auto& filterHandle : pluginFilterHandles) + { + const std::string filterClassName = filterHandle.getClassName(); + IFilter::UniquePointer filter = filterListPtr->createFilter(filterHandle); + + const auto& parameters = filter->parameters(); + // Loop over each Parameter + for(const auto& parameter : parameters) + { + auto const& paramValue = parameter.second; + if(paramValue->helpText().empty()) + { + output << plugName << "->" << filter->name() << "->" << paramValue->name() << ": Human Name: '" << paramValue->humanName() << "' The Help Text is empty\n"; + } + + for(const auto& letter : paramValue->name()) + { + if(::isupper(letter) != 0) + { + output << plugName << "->" << filter->name() << "->" << paramValue->name() << ". This parameter key has CAPITAL Letters. All parameter keys should be 'lower_snake_case' style\n"; + break; + } + } + } + } + } + + delete Application::Instance(); + REQUIRE(Application::Instance() == nullptr); + + if(!output.str().empty()) + { + std::cout << output.str(); + } + REQUIRE(output.str().empty() == true); +}