diff --git a/Code/Core/otbWrapperApplication.cxx b/Code/Core/otbWrapperApplication.cxx index a7a9f673e5854ac9baf577958b8ea95e1ed2b653..8c0042384fc19471a00676078893e0950ca5b6d3 100644 --- a/Code/Core/otbWrapperApplication.cxx +++ b/Code/Core/otbWrapperApplication.cxx @@ -580,6 +580,27 @@ Application::GetDoExecuteProgress() return res; } +bool +Application::IsApplicationReady() +{ + // Check if all the mandatory parameters are set + bool ready = true; + + std::vector<std::string> paramList = GetParametersKeys(true); + for (std::vector<std::string>::const_iterator it = paramList.begin(); + it != paramList.end(); + ++it) + { + // Check all Input Parameters + if (!this->HasValue(*it) && IsMandatory(*it)) + { + ready = false; + } + } + + return ready; +} + } } diff --git a/Code/Core/otbWrapperApplication.h b/Code/Core/otbWrapperApplication.h index 44eddb86f428b36829538cbd21ba10a802959115..cbb828ce6659caf3548b2bda17b3866b5a4deb05 100644 --- a/Code/Core/otbWrapperApplication.h +++ b/Code/Core/otbWrapperApplication.h @@ -146,6 +146,11 @@ public: /* Returns the description of a parameter */ std::vector<std::string> GetChoiceNames(std::string paramKey); + /* Is the application ready to be executed : All the mandatory + * parameters have to be set + */ + bool IsApplicationReady(); + /* Set an integer value *