]> Creatis software - bbtk.git/commitdiff
#2696 BBTK Bug New Normal - BoxChange BoxExecute not responding at the second actio...
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Tue, 25 Aug 2015 16:06:05 +0000 (18:06 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Tue, 25 Aug 2015 16:06:05 +0000 (18:06 +0200)
kernel/src/bbtkBlackBox.cxx
kernel/src/bbtkBlackBoxOutputConnector.cxx
kernel/src/bbtkConnection.cxx
kernel/src/bbtkInterpreterVirtual.cxx
kernel/src/bbtkWtBlackBox.cxx
kernel/src/bbtkWtBlackBox.h
kernel/src/bbtkWxBlackBox.cxx
packages/wx/src/bbwxStaticBox.cxx

index e2dae01bcc2cd42401bc53469cb8106bf3c17005..6fb1fb83a9c749dfce3cc545269c3f0773ad71bf 100644 (file)
@@ -463,17 +463,32 @@ namespace bbtk
       }
     */
 
+
     OutputConnectorMapType::const_iterator o;  
     for ( o = bbGetOutputConnectorMap().begin(); 
          o != bbGetOutputConnectorMap().end(); ++o )                   
-      {                                                                        
-       if (o->second->GetStatus()==UPTODATE) 
+      {
+
+
+       if (o->first=="BoxChange")
+       {
+               o->second->SetStatus(UPTODATE);
+       }
+
+
+
+//EED 24/08/2015
+// EED CASPITAS 2
+       if (o->second->GetStatus()==UPTODATE)
+//     if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==OUTOFDATE))
+//     if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==MODIFIED))
          {
            o->second->SetStatus(OUTOFDATE);
            o->second->SignalChange(GetThisPointer<BlackBox>(),o->first); 
-         }
-       }                                                               
+         } // if
+       } // for                                                        
     
+
     if (  ( bbBoxProcessModeIsReactive()
           || (c==bbGetInputConnectorMap().find("BoxExecute")->second))
           && (bbCanReact() ) )
@@ -481,7 +496,7 @@ namespace bbtk
        bbtkBlackBoxDebugMessage("change",2,
                         "-> Execution triggered by Reactive mode or BoxExecute input change"<<std::endl);
         bbGlobalAddToExecutionList( GetThisPointer<BlackBox>() );
-      }    
+      } // if
     bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSetStatusAndPropagate(input)"
                             <<std::endl);
@@ -692,6 +707,7 @@ namespace bbtk
   //=========================================================================
   void BlackBox::bbRecursiveExecute( Connection::Pointer caller )
   {
+
     bbtkBlackBoxDebugMessage("process",3,
                        "=> BlackBox::bbRecursiveExecute("
                        <<(caller?caller->GetFullName():"0")<<")"
@@ -721,8 +737,8 @@ namespace bbtk
          IOStatus s=UPTODATE;
 //       IOStatus s=OUTOFDATE;
 //       IOStatus s=MODIFIED;
-         
-         
+                 
+
          if ( ( bbBoxProcessModeIsManual()==false )  || 
                   ( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==true) ) )
          {
@@ -781,6 +797,7 @@ namespace bbtk
     bbSetExecuting(false);
     bbGlobalSetSomeBoxExecuting(wasExecuting);
 
+
     return;
   }
   //=========================================================================
@@ -1468,6 +1485,7 @@ namespace bbtk
                         <<std::endl);     
      
      bbmgGlobalProcessingExecutionList = false;
+
      
    }
   //=========================================================================
index f350f89d49b1839ae77502d4df8295bf7b7905b3..ca794920622ae758b2bc3cda7de70815cfb98962 100644 (file)
@@ -62,8 +62,6 @@ namespace bbtk
     IOStatus mStatus;
     /// The output changed signal 
     BlackBox::OutputChangeSignalType mChangeSignal;
-
-
   };
   //========================================================================
 
index d3d73a924bd21658dbc7db86e325c9f2915280ce..e6ee23851e7288d08e4cfc37a460528bb797867d 100644 (file)
@@ -166,12 +166,12 @@ Connection::Connection(BlackBox::Pointer from, const std::string& output,
       }
 
 
-    mFrom = from;
-    mOriginalFrom = from;
-    mTo = to;
-    mOriginalTo = to;
-    mInput = mOriginalInput = input;
-    mOutput = mOriginalOutput = output;
+    mFrom                      = from;
+    mOriginalFrom      = from;
+    mTo                        = to;
+    mOriginalTo        = to;
+    mInput                     = mOriginalInput        = input;
+    mOutput            = mOriginalOutput       = output;
 
      // Lock this pointer !!!
     //Pointer p = MakePointer(this,true);
index d3538e1a2a46af6a95e7349ff5232e8c61bcf98f..58552fc160db1b8ee27dd2a1a0ebd7577d1fbcc3 100644 (file)
@@ -77,7 +77,6 @@ namespace bbtk
   //=======================================================================
   void InterpreterVirtual::Init() 
   {
-printf("EED InterpreterVirtual::Init start\n"); 
     mUser                      = 0;
     mCommandLine       = false;
     mThrow                     = false;
@@ -346,7 +345,6 @@ printf("EED InterpreterVirtual::Init start\n");
     mCommandDict[info.keyword] = info;
     */
 
-printf("EED InterpreterVirtual::Init end\n");
 
   } 
   //=======================================================================
@@ -805,8 +803,7 @@ printf("EED InterpreterVirtual::Init end\n");
        
   //=======================================================================  
   void InterpreterVirtual::DoInterpretLine( const std::string& line )
-  {
-         
+  {  
     bbtkDebugMessage("interpreter",6,"==> InterpreterVirtual::DoInterpretLine(\""
                     <<line<<"\")"<<std::endl);
     std::vector<std::string> words;
@@ -1131,7 +1128,7 @@ printf("EED InterpreterVirtual::Init end\n");
 
     bbtkDebugMessage("interpreter",6,"<== InterpreterVirtual::DoInterpretLine(\""
                     <<line<<"\")"<<std::endl);
-         
+
   }
   //=======================================================================  
 
@@ -1373,7 +1370,7 @@ printf("EED InterpreterVirtual::SwitchToFile 1. >>%s\n", full_path.c_str() );
        for (i=script_paths.begin();i!=script_paths.end();i++)
          {
 
-printf("EED InterpreterVirtual::SwitchToFile jaja >>  %s\n", (*i).c_str() );
+printf("EED InterpreterVirtual::SwitchToFile (1) >>  %s\n", (*i).c_str() );
                  
            bbtkMessage("interpreter",1,
                        "--> Looking in '" << *i << "'" << std::endl);
@@ -1407,7 +1404,7 @@ printf("EED InterpreterVirtual::SwitchToFile jaja >>  %s\n", (*i).c_str() );
                 j!= Filenames.end(); ++j)
              {
                          
-printf("EED InterpreterVirtual::SwitchToFile kkkkk     >>  %s\n", (*j).c_str() );
+printf("EED InterpreterVirtual::SwitchToFile (2)     >>  %s\n", (*j).c_str() );
                          
                int lgr = (*j).size();
                if (lgr < 5) continue;  
index a5925d48a95cae3c3e3efb79b7b1a3aba041df73..a3cb0db75c09fec514311476812fcc3367d60e98 100644 (file)
@@ -85,7 +85,8 @@ namespace bbtk
        {
                Wt::WContainerWidget *parent;
                WtBlackBox::Pointer b;
-               Wt::WString title;              
+               WtBlackBox *pbox;       
+               Wt::WString title;      
        };
 
 /*     jScript::jScript()
@@ -104,81 +105,68 @@ namespace bbtk
   // javaScript Line
   //=========================================================================
        //Contains all the JS statements needed for the bbwt.
-       
-       
+               
   //=========================================================================
   // WxFrame
   //=========================================================================
        // Application WT deployed
   //==================================================================
  
-
  class WtWFrame : public Wt::WApplication
   {
   public:
-    WtWFrame(
-                       const Wt::WEnvironment& env                     
-           );
-    ~WtWFrame();
-               
-       
-       
-       WtBlackBox::WeakPointer mBox; 
-       
-
+    WtWFrame( const Wt::WEnvironment& env );
+    ~WtWFrame();       
+    WtBlackBox::WeakPointer mBox; 
   };   
        
 
-       WtWFrame::WtWFrame(
-                       const Wt::WEnvironment& env
-                  )
-    : 
-    Wt::WApplication(env)
-  {  
+       WtWFrame::WtWFrame( const Wt::WEnvironment& env ):Wt::WApplication(env)
+       {  
                //std::cout<<"Adding JavaScript --  DELETE ME -- bbtkWtBlackBox.cxx"<<std::endl;
                //this->require("/home/gonzalez/Documents/CREATOOLS/wt_library/wt/bbtk_wt_PKG/src/js/xtk.js");
 
                //this->require("http://get.goXTK.com/xtk.js");
                //this->useStyleSheet("css/demo.css");
 
-
        //this->require("http://get.goXTK.com/xtk.js");
        this->require( "resourcesXTK/xtk.js" );
-
                
        //      this->require("http://get.goXTK.com/xtk_edge.js");
 //     this->require("http://get.goXTK.com/xtk_xdat.gui.js");
        this->require( "resourcesXTK/xtk_xdat.gui.js" );
 
-
   this->useStyleSheet("resourcesXTK/styleWT.css"); 
-  
-
        //      std::cout<<"Cargado------------           "<<loadedJS<<std::endl;
-
                mBox = myWtData.b;
+
+//EED -->
                if(!myWtData.parent)
-                       {
-                               std::cout<<"        SIN PADRE "<<std::endl;
-                               if(myWtData.parent == 0){std::cout<<"        PARENT 0 "<<std::endl;}
-                               if(myWtData.parent == NULL){std::cout<<"        PARENT NULL "<<std::endl;}
-                               myWtData.parent = new Wt::WContainerWidget();
-                               std::cout<<"Parent created --  DELETE ME -- bbtkWtBlackBox.cxx"<<std::endl;
-                       }
-
-               Wt::WContainerWidget *myCont = new Wt::WContainerWidget(myWtData.parent);
-               myCont->setMinimumSize(800,500);
-               std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx.................50%"<<std::endl;
-               myWtData.b->bbUserCreateWidget(myCont);
+               {
+                       std::cout<<"        SIN PADRE "<<std::endl;
+                       if(myWtData.parent == 0){std::cout<<"        PARENT 0 "<<std::endl;}
+                       if(myWtData.parent == NULL){std::cout<<"        PARENT NULL "<<std::endl;}
+                       myWtData.parent = new Wt::WContainerWidget();
+                       std::cout<<"Parent created --  DELETE ME -- bbtkWtBlackBox.cxx"<<std::endl;
+               }
+
+               Wt::WContainerWidget *myContainer = new Wt::WContainerWidget(myWtData.parent);
+               myContainer->setMinimumSize(800,500);
+               std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx.......50%"<<std::endl;
+               myWtData.b->bbUserCreateWidget(myContainer);
+
                root()->addWidget(myWtData.parent);
                //bbmWindow = myCont;
                this->refresh();
                //jss = WtBlackBox::jScript;
-               std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx.................80%"<<std::endl;
-               std::cout<<"Creando WebWIDGET DELETE ME SCRIPT : ---"<<bbtk::jScript<<".................80%"<<std::endl;
+               std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx........80%"<<std::endl;
+               std::cout<<"Creando WebWIDGET DELETE ME SCRIPT : ---"<<bbtk::jScript<<"......80%"<<std::endl;
                //this->doJavaScript(bbtk::jScript); 
 
+//EED
+       myWtData.pbox->bbwtUpdateInputs();
+//       myWtData.pbox->bbwtProcess();
+
 
   }
   //==================================================================
@@ -301,9 +289,9 @@ namespace bbtk
 
        std::string WtBlackBox::wtServerData::docRoot   = "<void>";
        std::string WtBlackBox::wtServerData::port      = "<void>";
-  std::string WtBlackBox::wtServerData::address        = "0.0.0.0";
-  int WtBlackBox::wtServerData::argc                   = 0;
-  char **WtBlackBox::wtServerData::argv                = NULL;
+       std::string WtBlackBox::wtServerData::address   = "0.0.0.0";
+       int WtBlackBox::wtServerData::argc                              = 0;
+       char **WtBlackBox::wtServerData::argv                   = NULL;
 
   //=========================================================================
   //=========================================================================
@@ -356,13 +344,8 @@ namespace bbtk
                //Setting necessary data for Wt server deployment
                myWtData.parent = WWt::GetTopWindow();
                myWtData.b      = GetThisPointer<WtBlackBox>();
-               myWtData.title  = std2wt( bbGetInputWinTitle()  
-                            + " - bbtk (c) CREATIS");
-
-
-
-    
-
+               myWtData.title  = std2wt( bbGetInputWinTitle() + " - bbtk (c) CREATIS");
+               myWtData.pbox   = this;
                
                //char  *argv[7] =  {"./WtTest","--docroot","/home/gonzalez/Documents/pruebaResources","--http-address","0.0.0.0","--http-port","8080"};
                //int argc = 7;
@@ -389,11 +372,18 @@ int argc=2;
                        Wt::WServer::instance()->stop();
                }
        */
+
+
                std::cout<<"EED WtBlackBox::bbCreateFrameWindow  Deploying Server -- Definition of server parameters by default  -DELETE THIS MESSAGE bbtkWTBlackBox.cxx"<<std::endl;
+
+
 //             Wt::WRun(argc,argv,&createApplication); 
+
                Wt::WRun(WtBlackBox::wtServerData::argc,
                          WtBlackBox::wtServerData::argv,
                          &createApplication);  
+
+
    }
 
   //==================================================================    
@@ -429,6 +419,13 @@ int argc=2;
                // There is not such a thing like show becouse it is a webapp
           // bbGetWindow()->Show();
          //  WWt::CreateWtAppIfNeeded();
+
+
+               Wt::WRun(WtBlackBox::wtServerData::argc,
+                         WtBlackBox::wtServerData::argv,
+                         &createApplication);  
+
+
            bbSetShown(true);
          } 
       }
@@ -453,7 +450,21 @@ int argc=2;
     bbtkBlackBoxDebugMessage("widget",3,"<== WtBlackBox::bbDestroyWindow("<<bbmWindow<<")"<<std::endl);
 
   }
-  //==================================================================    
+
+
+//==================================================================    
+       void WtBlackBox::bbwtUpdateInputs()
+       {
+               BlackBox::bbUpdateInputs();
+       }
+
+//==================================================================    
+       void WtBlackBox::bbwtProcess()
+       {
+               BlackBox::bbProcess();
+       }
+
+
 
 }//namespace bbtk
 
index bd36a45037e7fbf3ac90f7e1c4617a33ec9b365d..1df5570c476222a44cccc6789945b95334271a31 100644 (file)
@@ -133,6 +133,9 @@ namespace bbtk
     virtual void bbDestroyWindow();
     //==================================================================    
 
+   void bbwtUpdateInputs();
+   void bbwtProcess();
+
   private:
     
     Wt::WApplication* bbApp;
index a9b4f0b6215b75dae564b8362599d31626395add..22f0a6baf910f7859f156803d2afe8857cc7c934 100644 (file)
@@ -99,21 +99,13 @@ namespace bbtk
             ),
     mBox(b)
   {   
-               std::cout<<"Creando Widget DELETE ME bbtkWxBlackBox.cxx--"<<std::endl;
-               std::cout<<"NAME :  "<<bbtk::wx2std(title);
-               if(parent)
-                       std::cout<<"PARENT :   "<<bbtk::wx2std(parent->GetName())<<std::endl;
-               else
-                       std::cout<<"        SIN PADRE "<<std::endl;
     bbtkDebugMessage("widget",9,"["<<b->bbGetName()<<"] WxFrame()"
                     <<std::endl);
     Wx::IncNbWindowsAlive();
     b->bbSetWindow(this);
     // Insert the widget into the window
     wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
-       std::cout<<"------------------------------------USER CREATE WIDGET pre DELETE ME bbtkWxBlackBox.cxx--"<<std::endl;
     b->bbUserCreateWidget(this);
-       std::cout<<"------------------------------------USER CREATE WIDGET post DELETE ME bbtkWxBlackBox.cxx--"<<std::endl;
     wxWindow* widget = b->bbGetOutputWidget();
     sizer->Add( widget, 1, wxALL|wxGROW, 2);
     SetSizer(sizer);
@@ -293,7 +285,6 @@ namespace bbtk
   /// Callback for creating a Frame window 
   void WxBlackBox::bbCreateFrameWindow()
   {
-    std::cout<<"--/////////////*****////////////////--JFGA Testing bbCreateFrameWindow Starting ....."<<bbGetInputWinTitle()<<"......!! D E L E T  M E !! bbtkWxBlackBox.cxx"<<std::endl;
     bbtkBlackBoxDebugMessage("widget",3,
                     "==> WxBlackBox::bbCreateFrameWindow() - parent = "
                     <<Wx::GetTopWindow()
@@ -305,8 +296,9 @@ namespace bbtk
                             + " - bbtk (c) CREATIS"),
                     wxSize( bbGetInputWinWidth() , 
                             bbGetInputWinHeight() ) );
-    std::cout<<"--/////////////*****////////////////!!--JFGA Testing bbCreateFrameWindow Done ........"<<bbGetInputWinTitle()<<"......!! D E L E T  M E !! bbtkWxBlackBox.cxx"<<std::endl;
     w->Show();
+
+
    }
 
   //==================================================================    
@@ -316,11 +308,9 @@ namespace bbtk
   {
     bbtkBlackBoxDebugMessage("widget",9,"==> WxBlackBox::bbSetWindow("<<w<<")"<<std::endl);
     if ((bbmWindow != 0)&&(w!=0)) 
-      { 
-       std::cout << "ERRRRRRRROOOOR"<<std::endl; 
-      }
-               std::cout<<"SetWindow   DELETE ME bbtkWxBlackBox.cxx ------"<<std::endl;
-               std::cout<<"WINDOW     :  "<<bbtk::wx2std(w->GetName())<<std::endl;
+       { 
+               std::cout << "WxBlackBox::bbSetWindow   ?? EED ?? ERRRRRRRROOOOR"<<std::endl; 
+       }
     bbmWindow = w;
   }
   //==================================================================    
@@ -328,7 +318,6 @@ namespace bbtk
   //==================================================================    
   void WxBlackBox::bbShowWindow()
   {
-        std::cout<<"--!!--JFGA Testing bbShowWindow PRE IF "<<bbGetInputWinTitle()<<"......!! D E L E T  M E !! bbtkWxBlackBox.cxx"<<std::endl;
     if ((bbmWindow) && (!bbIsShown()))
       {
        bbtkBlackBoxDebugMessage("widget",3,"==> WxBlackBox::bbShowWindow()"
@@ -339,11 +328,12 @@ namespace bbtk
          }
        else    
          {
-           std::cout<<"--!!--JFGA Testing bbShowWindow "<<bbGetInputWinTitle()<<"......!! D E L E T  M E !! bbtkWxBlackBox.cxx"<<std::endl;
            bbGetWindow()->Show();
            bbSetShown(true);
          } 
-      }
+      } // if
+
+
   }
   //==================================================================    
 
index 2809ed26a64d386b824291554ecf56a3e86bcaa4..69a8b1f608ee29170f6694b9b98d9c82dfebfcb3 100644 (file)
@@ -23,7 +23,6 @@ namespace bbwx
 //===== 
   void StaticBox::CreateWidget(wxWindow* parent)
   {
-    std::cout << "creating..." << std::endl;
     wxPanel *w=new wxPanel(
       parent, //bbGetWxParent(),
       -1
@@ -56,7 +55,6 @@ namespace bbwx
   {
     bbSetInputBoxTitle("");
     bbSetInputBoxContent(NULL);
-    std::cout << "initialized"<<std::endl;
   }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)