]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Tue, 22 Apr 2008 08:29:09 +0000 (08:29 +0000)
committerguigues <guigues>
Tue, 22 Apr 2008 08:29:09 +0000 (08:29 +0000)
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkComplexBlackBox.cxx
kernel/src/bbtkConnection.cxx
kernel/src/bbtkFactory.cxx
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkInterpreter.h
kernel/src/bbtkMessageManager.cxx
kernel/src/bbtkObject.cxx
kernel/src/bbtkObject.h
kernel/src/bbtkPackage.cxx

index 084e5195861e7ebaf7438abe8073eb9ca986ce6c..ae56fd4beb0a3adc978f22e65090b3c25f2625ab 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkBlackBox.cxx,v $
 Language:  C++
-Date:      $Date: 2008/04/22 06:59:31 $
-Version:   $Revision: 1.12 $
+Date:      $Date: 2008/04/22 08:29:09 $
+Version:   $Revision: 1.13 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See doc/license.txt or
@@ -1165,7 +1165,7 @@ namespace bbtk
   //=========================================================================
   void BlackBox::Check(bool recursive)
   {
-    bbtkMessage("Debug",1,"*** Checking Black Box "<<(void*)this<<" ["<<bbGetFullName()
+    bbtkMessage("debug",1,"*** Checking Black Box "<<(void*)this<<" ["<<bbGetFullName()
                <<"] ... OK"<<std::endl);
   }
   //=========================================================================
index 840c596091e0c1e404355089e7a05c7c6088fe13..f4bc7dd3c42e0dae46d454e1f18ecd6d383d2ed1 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkComplexBlackBox.cxx,v $
 Language:  C++
-Date:      $Date: 2008/04/22 06:59:31 $
-Version:   $Revision: 1.13 $
+Date:      $Date: 2008/04/22 08:29:09 $
+Version:   $Revision: 1.14 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See Doc/License.txt or
@@ -1090,7 +1090,7 @@ namespace bbtk
   //=======================================================================
   void ComplexBlackBox::Check(bool recursive)
   {
-     bbtkMessage("Debug",1,"**** Checking Complex Black Box "<<(void*)this
+     bbtkMessage("debug",1,"**** Checking Complex Black Box "<<(void*)this
                 <<" ["<<bbGetFullName()<<"]"<<std::endl);
      
      BlackBoxMapType::const_iterator i;
@@ -1102,9 +1102,9 @@ namespace bbtk
      for ( j = mConnectionList.begin(); 
           j != mConnectionList.end(); ++j ) 
        {
-        //(*j)->Check();
+        (*j)->Check();
        }
-     bbtkMessage("Debug",1,"**** Checking Complex Black Box "<<(void*)this
+     bbtkMessage("debug",1,"**** Checking Complex Black Box "<<(void*)this
                 <<" ["<<bbGetFullName()<<"] ... OK"<<std::endl);
   
   }
index 9c8487ace1fe496f21762f539e1f6bd1bc5fc93b..507c6f09b893cea991cf0bb5a2220267209d7293 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkConnection.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/22 06:59:31 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2008/04/22 08:29:09 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -393,15 +393,15 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
   //==================================================================
   void Connection::Check() const
   {
-    bbtkMessage("Debug",1,"** Checking Connection "<<(void*)this<<" ["<<GetFullName()<<"]"
+    bbtkMessage("debug",1,"** Checking Connection "<<(void*)this<<" ["<<GetFullName()<<"]"
                <<std::endl);
     if (mFrom==0) 
       {
-       bbtkMessage("Debug",2," - From = 0"<<std::endl);
+       bbtkMessage("debug",2," - From = 0"<<std::endl);
       }
     else
       {
-       bbtkMessage("Debug",2," - From : "<<mFrom->bbGetFullName()<<std::endl);
+       bbtkMessage("debug",2," - From : "<<mFrom->bbGetFullName()<<std::endl);
        if (!mFrom->bbHasOutput(mOutput))
          {
            bbtkError("** Checking Connection "<<(void*)this
@@ -409,7 +409,7 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
                      << mFrom->bbGetFullName()<<" does not have output '"
                      <<mOutput<<"'");
          }     
-       bbtkMessage("Debug",2," - From : Output '"<<mOutput<<"' exists"<<std::endl);
+       bbtkMessage("debug",2," - From : Output '"<<mOutput<<"' exists"<<std::endl);
        BlackBox::OutputConnectorMapType::const_iterator i 
          = mFrom->bbGetOutputConnectorMap().find(mOutput);
        if (i== mFrom->bbGetOutputConnectorMap().end())
@@ -419,7 +419,7 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
                       <<mFrom->bbGetFullName()<<" output '"
                       <<mOutput<<"' is not in OutputConnectorMap");
          }
-       bbtkMessage("Debug",2," - From : Output '"<<mOutput
+       bbtkMessage("debug",2," - From : Output '"<<mOutput
                    <<"' is in OutputConnectorMap"<<std::endl);
 
         std::vector< Connection::WeakPointer >::const_iterator j;
@@ -444,23 +444,23 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
                      <<" does not point to this connection");
            
          }
-       bbtkMessage("Debug",2," - From : This connection is in OutputConnector connection vector"<<std::endl);
-       bbtkMessage("Debug",1," * Box from : Check successfull"<<std::endl);
+       bbtkMessage("debug",2," - From : This connection is in OutputConnector connection vector"<<std::endl);
+       bbtkMessage("debug",1," * Box from : Check successfull"<<std::endl);
 
       }
 
     if (mTo==0) 
       {
-       bbtkMessage("Debug",2," - To   = 0"<<std::endl);
+       bbtkMessage("debug",2," - To   = 0"<<std::endl);
       }
     else
       {
-       bbtkMessage("Debug",2," - To   : "<<mTo->bbGetName()<<std::endl);
+       bbtkMessage("debug",2," - To   : "<<mTo->bbGetName()<<std::endl);
        //      std::cout << mTo << std::endl;
        //      std::cout << mTo->bbGetDescriptor() << std::endl;
        //      std::cout << mTo->bbGetDescriptor()->GetTypeName() << std::endl;
        //      mTo->bbGetFullName();
-       bbtkMessage("Debug",2," - To   : "<<mTo->bbGetFullName()<<std::endl);
+       bbtkMessage("debug",2," - To   : "<<mTo->bbGetFullName()<<std::endl);
        if (!mTo->bbHasInput(mInput))
          {
            bbtkError("** Checking Connection "<<(void*)this
@@ -468,7 +468,7 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
                      <<mTo->bbGetFullName()<<" does not have input '"
                      <<mInput<<"'");
          }     
-       bbtkMessage("Debug",2," - To   : Input '"<<mInput<<"' exists"<<std::endl);
+       bbtkMessage("debug",2," - To   : Input '"<<mInput<<"' exists"<<std::endl);
        BlackBox::InputConnectorMapType::const_iterator i 
          = mTo->bbGetInputConnectorMap().find(mInput);
        if (i== mTo->bbGetInputConnectorMap().end())
@@ -478,7 +478,7 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
                       <<mTo->bbGetFullName()<<" input '"
                       <<mInput<<"' is not in InputConnectorMap");
          }
-       bbtkMessage("Debug",2," - To   : Input '"<<mInput
+       bbtkMessage("debug",2," - To   : Input '"<<mInput
                    <<"' is in InputConnectorMap"<<std::endl);
 
        if (i->second->GetConnection()==0)
@@ -491,8 +491,8 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
                      <<" does not point to this connection");
     
          }
-       bbtkMessage("Debug",2," - To   : This connection is in InputConnector connection vector"<<std::endl);
-       bbtkMessage("Debug",1," * Box to   : Check successfull"<<std::endl);
+       bbtkMessage("debug",2," - To   : This connection is in InputConnector connection vector"<<std::endl);
+       bbtkMessage("debug",1," * Box to   : Check successfull"<<std::endl);
 
       }
   }
index 6ec28e5000ebfc5b338d688e9bbc6118682922ae..8c28996c4e506da8fed7678ba3ca116c8d047288 100644 (file)
@@ -4,8 +4,8 @@ Program:   bbtk
 Module:    $RCSfile: bbtkFactory.cxx,v $
 Language:  C++
 
-Date:      $Date: 2008/04/22 06:59:31 $
-Version:   $Revision: 1.35 $
+Date:      $Date: 2008/04/22 08:29:09 $
+Version:   $Revision: 1.36 $
                                                                                 
 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
@@ -137,7 +137,7 @@ namespace bbtk
   // lastname : string before the last / (if any), or user supplied name
 
     bbtkDebugMessageInc("Kernel",7,"Factory::LoadPackage(\""<<name<<"\")"<<std::endl);
-    bbtkMessage("Debug",1,"Factory::LoadPackage(\""<<name<<"\")"<<std::endl);
+    bbtkMessage("debug",1,"Factory::LoadPackage(\""<<name<<"\")"<<std::endl);
 
     std::vector<std::string> package_paths;
     std::string libname;  // full path library name
@@ -146,8 +146,8 @@ namespace bbtk
     std::string upath;
     pkgname = Utilities::ExtractPackageName(name,upath);
 
-    bbtkMessage("Debug",1,"Package name ["<<pkgname<<"]"<<std::endl);
-    bbtkMessage("Debug",1,"Package path ["<<upath<<"]"<<std::endl);
+    bbtkMessage("debug",1,"Package name ["<<pkgname<<"]"<<std::endl);
+    bbtkMessage("debug",1,"Package path ["<<upath<<"]"<<std::endl);
 
     // no loading package if already loaded
     PackageMapType::iterator iUnload;
@@ -231,7 +231,7 @@ namespace bbtk
 
         libname = Utilities::MakeLibnameFromPath(path, pkgname);
 
-        bbtkMessage("Debug",2,"-> Trying to load [" << libname << "]" <<std::endl);
+        bbtkMessage("debug",2,"-> Trying to load [" << libname << "]" <<std::endl);
 
       // Check if library exists           
         if ( !Utilities::FileExists(libname) )
@@ -250,7 +250,7 @@ namespace bbtk
         ok = DoLoadPackage( libname, pkgname, path);
         if (ok)
         {
-           bbtkMessage("Debug",2,"   OK"<<std::endl);
+           bbtkMessage("debug",2,"   OK"<<std::endl);
            break; // a package was found; we stop iterating
         }
     } //------------------ // end for ( package_paths.begin();i!=package_paths.end() )
@@ -750,14 +750,14 @@ namespace bbtk
   //===================================================================
   void Factory::CheckPackages() const
   {
-    bbtkMessage("Debug",1,"****** Checking Factory "<<(void*)this
+    bbtkMessage("debug",1,"****** Checking Factory "<<(void*)this
                 <<std::endl);
     PackageMapType::const_iterator i;
     for (i = mPackageMap.begin(); i!=mPackageMap.end(); ++i )
       {
        i->second->CheckBoxes();
       }
-    bbtkMessage("Debug",1,"****** Checking Factory "<<(void*)this
+    bbtkMessage("debug",1,"****** Checking Factory "<<(void*)this
                <<" ... OK"<<std::endl);
   }
   //===================================================================
index ff2fbb17d123e2769ea1bf56a5c35a3f3ef48565..850784a8443909b112ddc4481cd87b8f7ed7e186 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/04/22 06:59:31 $
-  Version:   $Revision: 1.61 $
+  Date:      $Date: 2008/04/22 08:29:09 $
+  Version:   $Revision: 1.62 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -811,8 +811,7 @@ void Interpreter::InterpretLine( const std::string& line, bool &insideComment )
         break;
 
       case cReset :  
-        this->mExecuter->Reset();
-       mFileNameHistory.clear();
+       Reset();
         break;
 
       case cInclude :
@@ -909,7 +908,15 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
   //=======================================================================
 
 
+  //=======================================================================
+  void Interpreter::Reset()
+  {
+    // Cannot close all files if the reset command is read from a file !
+    //    CloseAllFiles();
+    mFileNameHistory.clear();
+    this->mExecuter->Reset();
+  }
+  //=======================================================================
 
   //=======================================================================
   /**
@@ -991,8 +998,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
    *
    */
 
-// ===================================================================================
-
+  // =========================================================================
   void Interpreter::SwitchToFile( const std::string& name )
   {
   // Note : in the following :
@@ -1578,7 +1584,7 @@ void Interpreter::Help(const std::vector<std::string>& words)
        c=0;
        read ( STDIN_FILENO, &c, 4) ;
 
-       bbtkDebugMessage("Debug",9,"[0x"<<std::hex<<c<<"]\n");
+       bbtkDebugMessage("debug",9,"[0x"<<std::hex<<c<<"]\n");
 
        // Printable character
        if ( (ind<MAX_LINE_SIZE-1) &&
@@ -2043,7 +2049,24 @@ void  Interpreter::NewGUI(const std::string& boxname,
  //==========================================================================
   void Interpreter::ObjectInfo(const std::string& name)
   {
-    Object:: PrintObjectInfo(name);
+    if ((name.length()==2)&&(name[0]=='-'))
+      {
+       if (name[1]=='S')
+         {
+           bbtk::StaticInitTime::PrintObjectListInfo = true;
+         }
+       if (name[1]=='C')
+         {
+           //      int o = MessageManager::GetMessageLevel("debug");
+           //      if (o<2) MessageManager::SetMessageLevel("debug",2);
+           mExecuter->GetFactory()->CheckPackages();
+           //      MessageManager::SetMessageLevel("debug",o);
+         }
+      }
+    else 
+      {
+       Object:: PrintObjectListInfo(name);
+      }
   }
  //==========================================================================
  //==========================================================================
index b5ca18f3d168b349e071155f4eb53a76c83d8b41..42db24dc637bda891c28aa9d8518f2b5f8f17104 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:15 $
-  Version:   $Revision: 1.26 $
+  Date:      $Date: 2008/04/22 08:29:09 $
+  Version:   $Revision: 1.27 $
 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -223,6 +223,9 @@ namespace bbtk
     /// Closes all open files
     void CloseAllFiles();
 
+    /// Resets all
+    void Reset();
+
     /// Displays help (entry point of any help)
     void Help(const std::vector<std::string>& words);
 
index 4bdb1bee7f4d9fcd12464738b71d21975ea649e2..c3c07f3acbe670aac30f141b98177385b8d73aee 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkMessageManager.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/22 06:59:31 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2008/04/22 08:29:09 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -53,7 +53,7 @@ namespace bbtk
     mMessageLevel[key] = 1;
     mMessageHelp[key] = "Output messages";
     if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
-    key = "Debug";
+    key = "debug";
     mMessageLevel[key] = 0;
     mMessageHelp[key] = "Debug messages";
     if (mMaxMessageLength<key.length()) mMaxMessageLength = key.length();
index 6f425642effcc28abac6cd2226ddf20045a7cebe..e498187bb662dd44ee0603542aff0a6d25ed03d1 100644 (file)
@@ -59,7 +59,7 @@ namespace bbtk
   //=======================================================================
   
   //=======================================================================
-  void Object::PrintObjectListInfo()
+  void Object::PrintObjectListInfo(const std::string& name)
   {
     
     std::cout 
@@ -80,9 +80,13 @@ namespace bbtk
        else 
          { 
            Object::Pointer p(i->lock());
-           PrintObjectInfo(p);
-           n++;
-           m += p->GetObjectSize();
+           if (p->GetObjectName().find(name) != std::string::npos ) 
+             {
+               std::cout << n << "/" << mgObjectList.size() << " ";
+               PrintObjectInfo(p);
+               m += p->GetObjectSize();
+               n++;
+             }
          }
       }
     std::cout 
@@ -107,6 +111,7 @@ namespace bbtk
   }
   //=======================================================================
 
+  /*
   //=======================================================================
   void Object::PrintObjectInfo(const std::string& name)
   {
@@ -127,7 +132,7 @@ namespace bbtk
       }
   }
   //=======================================================================
-
+  */
   //=======================================================================
   void Object::PrintObjectInfo(const Object::Pointer& p)
   {
@@ -180,7 +185,7 @@ namespace bbtk
        std::cout << std::endl
                  << "***************** main ended *******************"
                  << std::endl << std::endl;
-       Object::PrintObjectListInfo();
+       Object::PrintObjectListInfo("");
       }
   }
   //=======================================================================
index 21109d3405794c2d8057aac9562c7b91e4491516..483efa4244f2c46cc77c15a58143706cc0996fb0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkObject.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:15 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2008/04/22 08:29:09 $
+  Version:   $Revision: 1.2 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -51,8 +51,8 @@ namespace bbtk
     static void InsertInObjectList(Pointer);
     static void RemoveFromObjectList(WeakPointer);
 
-    static void PrintObjectListInfo();
-    static void PrintObjectInfo(const std::string& name);
+    static void PrintObjectListInfo(const std::string& name);
+    //    static void PrintObjectInfo(const std::string& name);
     static void PrintObjectInfo(const Pointer& o); 
     /// Default objects deleter : removes object from list on deletion
     struct Deleter 
index 29bd891d79008fd75b062b1c9800d51f3f03d622..330d303304bfa4502cc9106ac02ec4d02052352e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkPackage.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/22 06:59:31 $
-  Version:   $Revision: 1.14 $
+  Date:      $Date: 2008/04/22 08:29:09 $
+  Version:   $Revision: 1.15 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -864,7 +864,7 @@ namespace bbtk
   //===================================================================
   void Package::CheckBoxes() const
   {
-    bbtkMessage("Debug",1,"****** Checking Package "<<(void*)this
+    bbtkMessage("debug",1,"****** Checking Package "<<(void*)this
                <<" ["<<GetName()<<"]"<<std::endl);
     BlackBoxMapType::const_iterator i;
     for (i=mBlackBoxMap.begin();
@@ -873,7 +873,7 @@ namespace bbtk
       {
        i->second->Check(true);
       }
-    bbtkMessage("Debug",1,"****** Checking Package "<<(void*)this
+    bbtkMessage("debug",1,"****** Checking Package "<<(void*)this
                <<" ["<<GetName()<<"] ... OK"<<std::endl);
   }
   //===================================================================