From 8170abe74b926c3f9d8747c778355adecbb006b8 Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@c-s.fr>
Date: Mon, 19 Sep 2011 20:09:30 +0200
Subject: [PATCH] ENH: use a one-line watcher in the command line wrapper

---
 .../otbWrapperCommandLineLauncher.cxx         | 32 +++++++++----------
 .../otbWrapperCommandLineLauncher.h           |  4 +--
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
index 2023efc789..0b94c3c4f1 100644
--- a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
+++ b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx
@@ -427,25 +427,25 @@ CommandLineLauncher::LinkWatchers()
   // Link internall filters watcher
   for( unsigned int i=0; i<m_Application->GetInternalProcessList().size(); i++ )
     {
-      StandardFilterWatcher * watch = new StandardFilterWatcher(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
-   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);
-           itk::OStringStream oss;
-           oss<< "Writing "<< param->GetName()<<"...";
-
-           StandardFilterWatcher * watch = new StandardFilterWatcher(outputParam->GetWriter(), oss.str());
-           m_WatcherList.push_back( watch );
-        }
+  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);
+      itk::OStringStream oss;
+      oss << "Writing " << param->GetName() << "...";
+
+      StandardOneLineFilterWatcher * watch = new StandardOneLineFilterWatcher(outputParam->GetWriter(), oss.str());
+      m_WatcherList.push_back(watch);
+      }
     }
 }
 
diff --git a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.h b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.h
index 4b11c5126b..d137dee04e 100644
--- a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.h
+++ b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.h
@@ -29,7 +29,7 @@
 
 #include "itkStdStreamLogOutput.h"
 
-#include "otbStandardFilterWatcher.h"
+#include "otbStandardOneLineFilterWatcher.h"
 
 
 namespace otb
@@ -67,7 +67,7 @@ public:
   typedef enum { OKPARAM, MISSINGMANDATORYPARAMETER, MISSINGPARAMETERVALUE, WRONGPARAMETERVALUE,  INVALIDNUMBEROFVALUE, DEFAULT} ParamResultType;
   
   /** Filter watcher list type */
-  typedef std::vector<StandardFilterWatcher *> WatcherListType;
+  typedef std::vector<StandardOneLineFilterWatcher *> WatcherListType;
 
   /** Load the application in several steps :
    * - Load the paths
-- 
GitLab