]> Creatis software - bbtk.git/commitdiff
Fixed crash with Interpreter without WxConsole (case of RUN button of WxBrowser)
authorguigues <guigues>
Tue, 11 Mar 2008 12:27:21 +0000 (12:27 +0000)
committerguigues <guigues>
Tue, 11 Mar 2008 12:27:21 +0000 (12:27 +0000)
Removed unwanted debug messages

kernel/src/bbtkFactory.cxx
kernel/src/bbtkInterpreter.cxx
kernel/src/bbtkWxBrowser.cxx
kernel/src/bbtkWxConsole.cxx

index 9a6010bf19175e56278914e92d34e15a81d08715..6b4079344912f2c976bba2e3e209c044990f6d7e 100644 (file)
@@ -4,8 +4,8 @@ Program:   bbtk
 Module:    $RCSfile: bbtkFactory.cxx,v $
 Language:  C++
 
-Date:      $Date: 2008/03/10 06:24:12 $
-Version:   $Revision: 1.29 $
+Date:      $Date: 2008/03/11 12:27:21 $
+Version:   $Revision: 1.30 $
                                                                                 
 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
@@ -80,12 +80,14 @@ namespace bbtk
   //===================================================================
   void Factory::Reset()
   {
+    /*
 printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
 printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
 printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
 printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
 printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
 printf("EED kkkkkkkkkkkkkkkkkkkkkkkk  Factory::Reset() \n");
+    */
     bbtkDebugMessageInc("Kernel",7,"Factory::Reset()"<<std::endl);
     CloseAllPackages();
     bbtkDebugDecTab("Kernel",7);
index ab194e90913eb95ebf7b8e4ec58c7064dc6d48ff..d791462c9464d2a338f819fd01317aada1a88b8b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkInterpreter.cxx,v $ $
   Language:  C++
-  Date:      $Date: 2008/03/10 06:24:13 $
-  Version:   $Revision: 1.42 $
+  Date:      $Date: 2008/03/11 12:27:21 $
+  Version:   $Revision: 1.43 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -313,27 +313,24 @@ std::cout << "=========================================~Interpreter()" << std::e
     try 
     {
       SwitchToFile(filename);
-
-printf("EED Interpreter::InterpretFile 0001\n" );
+      /*
+      printf("EED Interpreter::InterpretFile 0001\n" );
 int ii,ssize = mFileName.size();
 for (ii=0;ii<ssize;ii++)
 {
-       printf("EED RRR Interpreter::InterpretFile %s\n", mFileName[ii].c_str() );
+       printf("EED RRR Interpreter::InterpretFile %s\n", mFileName[ii].c_str() );
 }
-
+      */
       bool insideComment = false; // for multiline comment
       while (mFile.size()>0) 
       {
-printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() );
+       //printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() );
          while ((mFile.size()>0) && 
                 (!mFile.back()->eof()))
-//EED3                                 (!mFile[0]->eof()))
          {
             mLine.back()++;
             char buf[500];
             mFile.back()->getline(buf,500);
-//EED3            mFile[0]->getline(buf,500);
-      
             std::string str(buf);
             int size=str.length();
             if ( str[ size-1 ]==13  )
@@ -342,7 +339,7 @@ printf("EED --- %s --- Interpreter::InterpretFile \n", mFileName[0].c_str() );
             }
       
             InterpretLine(str, insideComment);
-printf("EED Interpreter::InterpretFile %s\n", str.c_str() );
+           //printf("EED Interpreter::InterpretFile %s\n", str.c_str() );
          }
         //if (mFile.size()>0) 
         CloseCurrentFile();
@@ -995,7 +992,7 @@ void Interpreter::SplitLine ( const std::string& str, std::vector<std::string>&
 //EED printf("  EED %d Interpreter::LoadScript %s __>>__ %s\n", iStrScript,mFileName[iStrScript].c_str(),fullPathScriptName.c_str() );
                if (mFileName[iStrScript] == fullPathScriptName )
                {
-                       printf("  EED %d Interpreter::LoadScript iguales\n",iStrScript ); 
+                 //                    printf("  EED %d Interpreter::LoadScript iguales\n",iStrScript ); 
                        okScriptExist=true;
                } // if
        } // for
index 3f158ca0f161afa250bf383db7388d810ac39b8f..745bcdaf16df3afe726eb2afb2306d66310eb704 100644 (file)
@@ -59,7 +59,8 @@ namespace bbtk
   //========================================================================
     WxBrowser::WxBrowser ( wxWindow *parent, wxSize size )
       : 
-    wxPanel ( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
+      wxPanel ( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
+      mWxConsole(0)
 
   {
     wxPanel* panel = this;
@@ -251,8 +252,11 @@ namespace bbtk
        && (filename[s-3]=='b')
        && (filename[s-4]=='.'))
       {
+       std::cout << "stat"<<std::endl;
        if (C!=0) C->SetStatusText(_T("Executing ")+mwxURL->GetValue());
+       std::cout << "int"<<std::endl;
        I->InterpretFile(filename);
+       std::cout << "eoint"<<std::endl;
       }
     else
       {
index 31ca73b3ea1b9847dcfee4872cb62478e57a6ed6..45e1581405f1324339abcdf31cd35462f6aa314f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/10 12:28:43 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2008/03/11 12:27:21 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -378,14 +378,14 @@ namespace bbtk
   //================================================================
   void WxConsole::CommandString(wxString line )
   {
-printf("WxConsole::CommandString 01 \n");
+    //printf("WxConsole::CommandString 01 \n");
     wxString s = _T("> ") + line + _T("\n");
     mwxTextHistoryAttr->SetTextColour(*wxRED);
     mwxTextHistory->SetDefaultStyle(*mwxTextHistoryAttr);
     mwxTextHistory->AppendText(s);
     // send to standard console also 
-printf("WxConsole::CommandString 02 \n");
-    printf("%s",wx2std(s).c_str());
+    //printf("WxConsole::CommandString 02 \n");
+    //    printf("%s",wx2std(s).c_str());
 //EED    mwxTextCommand->Clear();
     mwxTextCommand->SetValue(_T(""));
        mwxTextCommand->Append(line);
@@ -394,13 +394,13 @@ printf("WxConsole::CommandString 02 \n");
     mwxTextHistoryAttr->SetTextColour(*wxBLACK);
     mwxTextHistory->SetDefaultStyle(*mwxTextHistoryAttr);
 
-printf("WxConsole::CommandString 03 \n");
+    //printf("WxConsole::CommandString 03 \n");
     try 
     {
       bool insideComment = false;
-printf("WxConsole::CommandString 04 \n");
+      //printf("WxConsole::CommandString 04 \n");
           mInterpreter->InterpretLine( wx2std(line), insideComment );
-printf("WxConsole::CommandString 05 \n");
+          //printf("WxConsole::CommandString 05 \n");
     }
     catch (bbtk::QuitException)
     {
@@ -419,7 +419,7 @@ printf("WxConsole::CommandString 05 \n");
           std::cout << "* UNDEFINED ERROR (not a bbtk nor a std exception)"
                          << std::endl;
     }
-printf("WxConsole::CommandString 06 \n");
+    //printf("WxConsole::CommandString 06 \n");
   }
   //================================================================