From a84daf0736f6cb2c14ba830059e777f82a902c14 Mon Sep 17 00:00:00 2001 From: Cyrille Valladeau <cyrille.valladeau@c-s.fr> Date: Tue, 20 Sep 2011 10:02:11 +0200 Subject: [PATCH] ENH: correct merge issu --- .../otbWrapperCommandLineLauncher.cxx | 50 +++++++------------ 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx index a0acd99166..e9f69a04c1 100644 --- a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx +++ b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx @@ -368,6 +368,11 @@ CommandLineLauncher::LoadParameters() } dynamic_cast<OutputImageParameter *>(param.GetPointer())->SetPixelType( outPixType ); } + else if( values.size() != 1 && values.size() != 2 ) + { + std::cout<<"INVALIDNUMBEROFVALUE2: "<<paramKey<<" "<<values.size()<<std::endl; + return INVALIDNUMBEROFVALUE; + } } else if( values.size() != 1) { @@ -401,26 +406,7 @@ CommandLineLauncher::LoadParameters() } } - else - { - return WRONGPARAMETERVALUE; - } - - // Loop over each output image parameter - std::vector<std::string> paramList = m_Application->GetParametersKeys(true); - std::vector<std::string>::const_iterator it = paramList.begin(); - for (; it != paramList.end(); ++it) - { - if (m_Application->GetParameterType(*it) == ParameterType_OutputImage) - { - Parameter* param = m_Application->GetParameterByKey(*it); - OutputImageParameter* outputParam = dynamic_cast<OutputImageParameter*>(param); - outputParam->SetPixelType( outPixType ); - } - } - } - - return OKPARAM; + return OKPARAM; } @@ -431,8 +417,8 @@ CommandLineLauncher::LinkWatchers() // Link internall filters watcher for( unsigned int i=0; i<m_Application->GetInternalProcessList().size(); i++ ) { - StandardOneLineFilterWatcher * watch = new StandardOneLineFilterWatcher(m_Application->GetInternalProcessList()[i], m_Application->GetInternalProcessListName()[i]); - m_WatcherList.push_back( watch ); + StandardOneLineFilterWatcher * watch = new StandardOneLineFilterWatcher(m_Application->GetInternalProcessList()[i], m_Application->GetInternalProcessListName()[i]); + m_WatcherList.push_back( watch ); } // Link output image writers watchers @@ -440,16 +426,16 @@ CommandLineLauncher::LinkWatchers() std::vector<std::string>::const_iterator it = paramList.begin(); for (; it != paramList.end(); ++it) { - if (m_Application->GetParameterType(*it) == ParameterType_OutputImage) - { - Parameter* param = m_Application->GetParameterByKey(*it); - OutputImageParameter* outputParam = dynamic_cast<OutputImageParameter*> (param); - itk::OStringStream oss; - oss << "Writing " << param->GetName() << "..."; - - StandardOneLineFilterWatcher * watch = new StandardOneLineFilterWatcher(outputParam->GetWriter(), oss.str()); - m_WatcherList.push_back(watch); - } + if (m_Application->GetParameterType(*it) == ParameterType_OutputImage) + { + Parameter* param = m_Application->GetParameterByKey(*it); + OutputImageParameter* outputParam = dynamic_cast<OutputImageParameter*> (param); + itk::OStringStream oss; + oss << "Writing " << param->GetName() << "..."; + + StandardOneLineFilterWatcher * watch = new StandardOneLineFilterWatcher(outputParam->GetWriter(), oss.str()); + m_WatcherList.push_back(watch); + } } } -- GitLab