]> Creatis software - bbtk.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Wed, 15 Sep 2010 14:17:17 +0000 (14:17 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Wed, 15 Sep 2010 14:17:17 +0000 (14:17 +0000)
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkInterpreter.h

index 961b42ed87f7efbc1c0567080a3bbda5f248858f..6771d7788013d12bed23d9d1b85aac56b953a004 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/09/14 07:18:46 $
-  Version:   $Revision: 1.88 $
+  Date:      $Date: 2010/09/15 14:17:17 $
+  Version:   $Revision: 1.89 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -867,7 +867,38 @@ namespace bbtk
                GetExecuter()->UnLoadPackage(packageName);
     }
        
-       //ups2 EED Borrame      
+       void Interpreter::commandBreak()
+    {
+           /*
+                std::cout << "BreakException(" 
+                <<in_script<<","
+                <<file<<","
+                <<line<<")"<<std::endl;
+                */
+               bbtkError("break");//,in_script,file,line);
+           //      throw BreakException(in_script,file,line);
+    }
+       
+       void Interpreter::commandQuit()
+    {
+               bbtkError("quit");//,in_script,file,line);
+               //throw QuitException(in_script,file,line);
+    }
+       
+       void Interpreter::commandMessage()
+    {
+               mVirtualExecuter->HelpMessages();
+    }
+       
+//ups2 EED Borrame     
+       void Interpreter::commandMessage(std::string kind, std::string levelstr)
+    {
+               int level=0;
+               sscanf(levelstr.c_str(),"%d",&level);
+               mVirtualExecuter->SetMessageLevel(kind,level);
+
+    }
+       
        
        
   //=======================================================================  
@@ -929,21 +960,24 @@ namespace bbtk
     bbtkDebugMessage("interpreter",9,
                      "Command='"<<command.keyword
                       <<"' code="<<command.code<<std::endl); 
-    int level=0;
+         
     std::string left,right,left2,right2;
     std::string filename;
 
+//ups1 EED borrame       
     // message command
     if (command.code==cMessage)
       {
        if (words.size()<3)
          {
-           mVirtualExecuter->HelpMessages();
+                 commandMessage();
+//EED Borrame      mVirtualExecuter->HelpMessages();
          }
         else
          {
-           sscanf(words[2].c_str(),"%d",&level);
-           mVirtualExecuter->SetMessageLevel(words[1],level);
+               commandMessage(words[1],words[2]);
+//EED Borrame          sscanf(words[2].c_str(),"%d",&level);
+//EED Borrame      mVirtualExecuter->SetMessageLevel(words[1],level);
          }
        return;
       }
@@ -974,12 +1008,14 @@ namespace bbtk
                      <<file<<","
                      <<line<<")"<<std::endl;
            */
-           bbtkError("break");//,in_script,file,line);
+                 commandBreak();
+//EED Borrame      bbtkError("break");//,in_script,file,line);
            //      throw BreakException(in_script,file,line);
          }       
        else 
          {
-           bbtkError("quit");//,in_script,file,line);
+                 commandQuit();
+//EED Borrame      bbtkError("quit");//,in_script,file,line);
              //throw QuitException(in_script,file,line);
          }
        return;
@@ -1088,7 +1124,7 @@ namespace bbtk
 
       case cSet :
         Utilities::SplitAroundFirstDot(words[1],left,right);
-               commandSet(left,right,words[1]);
+               commandSet(left,right,words[2]);
 //EED Borrame        mVirtualExecuter->Set(left,right,words[2]);
         break;
 
@@ -1098,7 +1134,7 @@ namespace bbtk
         break;
 
       case cNewGUI :
-               NewGUI(words[1],words[2]);
+               commandNewGUI(words[1],words[2]);
         break;
 
       case cCategory :
@@ -1108,11 +1144,11 @@ namespace bbtk
 
       case cIndex :
         if (words.size()==1)
-                       Index("tmp_index.html");
+                       commandIndex("tmp_index.html");
         else if (words.size()==2)
-                       Index(words[1]);
+                       commandIndex(words[1]);
         else if (words.size()==3)
-                       Index(words[1],words[2]);
+                       commandIndex(words[1],words[2]);
         break;
 
       case cDescription :
@@ -1121,20 +1157,20 @@ namespace bbtk
         break;
 
       case cHelp :
-        Help(words);
+        commandHelp(words);
         break;
 
 
       case cGraph :
-        Graph(words);
+        commandGraph(words);
         break;
 
       case cConfig :
-        Config();
+        commandConfig();
         break;
 
       case cReset :  
-       Reset();
+       commandReset();
         break;
        
       case cClear :  
@@ -1164,10 +1200,9 @@ namespace bbtk
 //EED Borrame        GetExecuter()->UnLoadPackage(words[1]);
         break;
 
-                         //ups1 EED borrame      
       case cDebug :
-                         if (words.size()==2) Debug(words[1]);
-                               else Debug("");
+                         if (words.size()==2) commandDebug(words[1]);
+                               else commandDebug("");
         break;
                          
        /* obsolete
@@ -1231,7 +1266,7 @@ namespace bbtk
 
 
   //=======================================================================
-  void Interpreter::Reset()
+  void Interpreter::commandReset()
   {
     // Cannot close all files if the reset command is read from a file !
     CloseAllFiles();
@@ -1748,7 +1783,7 @@ void Interpreter::SwitchToStream( std::stringstream* stream )
 
   //=======================================================================
   /// Displays help on all the commands
-void Interpreter::Help(const std::vector<std::string>& words)
+void Interpreter::commandHelp(const std::vector<std::string>& words)
 {
     unsigned int nbarg = words.size()-1;
 
@@ -1848,7 +1883,7 @@ void Interpreter::Help(const std::vector<std::string>& words)
 
    //===================================================================    
   /// Displays the Configuration
-  void Interpreter::Config() const
+  void Interpreter::commandConfig() const
   {
     ConfigurationFile::GetInstance().GetHelp(1);
   }  
@@ -2193,7 +2228,7 @@ void Interpreter::Help(const std::vector<std::string>& words)
   }
 
 //=======================================================================
-void Interpreter::Graph(const std::vector<std::string>& words)
+void Interpreter::commandGraph(const std::vector<std::string>& words)
 {
   std::string page;
     bool system_display = true;
@@ -2238,7 +2273,7 @@ void Interpreter::Graph(const std::vector<std::string>& words)
 
 
 //=======================================================================
-void  Interpreter::Index(const std::string& filename, 
+void  Interpreter::commandIndex(const std::string& filename, 
                         const std::string& type)
 {
   Factory::IndexEntryType t;
@@ -2253,7 +2288,7 @@ void  Interpreter::Index(const std::string& filename,
 
 
 //=======================================================================
-void  Interpreter::NewGUI(const std::string& boxname,
+void  Interpreter::commandNewGUI(const std::string& boxname,
                             const std::string& instanceName)
 {
   if (mRealExecuter.expired())
@@ -2430,7 +2465,7 @@ void  Interpreter::NewGUI(const std::string& boxname,
 
 
  //==========================================================================
-  void Interpreter::Debug(const std::string& name)
+  void Interpreter::commandDebug(const std::string& name)
   {
     if ((name.length()==2)&&(name[0]=='-'))
       {
index e94da2abe8498cea8da71afca01e129af8f8dfd1..355e0fe7fad0e1810fd572147819cb81b508de23 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.h,v $
   Language:  C++
-  Date:      $Date: 2010/09/14 07:18:47 $
-  Version:   $Revision: 1.41 $
+  Date:      $Date: 2010/09/15 14:17:17 $
+  Version:   $Revision: 1.42 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -291,10 +291,10 @@ namespace bbtk
     void CloseAllFiles();
 
     /// Resets all
-    void Reset();
+    void commandReset();
 
     /// Displays help (entry point of any help)
-    void Help(const std::vector<std::string>& words);
+    void commandHelp(const std::vector<std::string>& words);
 
     /// Displays help on all the commands
     void HelpCommands();
@@ -303,14 +303,14 @@ namespace bbtk
     void HelpCommand( const std::string& command );
 
     ///
-    void Graph(const std::vector<std::string>& words);
+    void commandGraph(const std::vector<std::string>& words);
 
     ///
-    void Config() const; 
+    void commandConfig() const; 
     /// 
     //    void Print(const std::string&);
 
-    void Index(const std::string& filename, 
+    void commandIndex(const std::string& filename, 
               const std::string& type = "Initials");
     ///
     void FindCommandsWithPrefix( char* buf,
@@ -322,11 +322,8 @@ namespace bbtk
     /// Define it as a complex box type with name instanceName+"Type"
     /// The instance is called instanceName
     /// and connected to the existing pipeline
-    void NewGUI(const std::string& box, 
-               const std::string& instanceName);
-
-    void Debug(const std::string& arg);
-
+      void commandNewGUI(const std::string& box,const std::string& instanceName);
+      void commandDebug(const std::string& arg);
          void commandNew(std::string boxType, std::string boxName);
          void commandDelete(std::string boxName);
          void commandConnection(std::string nodeFrom, std::string outputLabel, std::string nodeTo, std::string inputLabel);
@@ -347,7 +344,11 @@ namespace bbtk
          void commandInclude(std::string word, bool ok);
          void commandLoad(std::string packageName);
          void commandUnload(std::string packageName);
-         
+         void commandBreak();
+         void commandQuit();
+         void commandMessage();
+         void commandMessage(std::string kind, std::string levelstr);
+
          /// Constructor
          Interpreter(const std::string& cpp_file = "");