From 3dcc408acd2264664ca6431a501378ea64233dd6 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 25 Aug 2015 18:06:05 +0200 Subject: [PATCH] #2696 BBTK Bug New Normal - BoxChange BoxExecute not responding at the second action for a new conected box. Need to be executed at the beginning --- kernel/src/bbtkBlackBox.cxx | 32 ++++-- kernel/src/bbtkBlackBoxOutputConnector.cxx | 2 - kernel/src/bbtkConnection.cxx | 12 +-- kernel/src/bbtkInterpreterVirtual.cxx | 11 +- kernel/src/bbtkWtBlackBox.cxx | 115 +++++++++++---------- kernel/src/bbtkWtBlackBox.h | 3 + kernel/src/bbtkWxBlackBox.cxx | 26 ++--- packages/wx/src/bbwxStaticBox.cxx | 2 - 8 files changed, 109 insertions(+), 94 deletions(-) diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index e2dae01..6fb1fb8 100644 --- a/kernel/src/bbtkBlackBox.cxx +++ b/kernel/src/bbtkBlackBox.cxx @@ -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(),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"<() ); - } + } // if bbtkBlackBoxDebugMessage("change",5, "<= BlackBox::bbSetStatusAndPropagate(input)" < 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 < InterpreterVirtual::DoInterpretLine(\"" < words; @@ -1131,7 +1128,7 @@ printf("EED InterpreterVirtual::Init end\n"); bbtkDebugMessage("interpreter",6,"<== InterpreterVirtual::DoInterpretLine(\"" <>%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; diff --git a/kernel/src/bbtkWtBlackBox.cxx b/kernel/src/bbtkWtBlackBox.cxx index a5925d4..a3cb0db 100644 --- a/kernel/src/bbtkWtBlackBox.cxx +++ b/kernel/src/bbtkWtBlackBox.cxx @@ -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"<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------------ "< if(!myWtData.parent) - { - std::cout<<" SIN PADRE "<setMinimumSize(800,500); - std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx.................50%"<bbUserCreateWidget(myCont); + { + std::cout<<" SIN PADRE "<setMinimumSize(800,500); + std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx.......50%"<bbUserCreateWidget(myContainer); + root()->addWidget(myWtData.parent); //bbmWindow = myCont; this->refresh(); //jss = WtBlackBox::jScript; - std::cout<<"Creando WebWIDGET DELETE ME ---- bbtkWtBlackBox.cxx.................80%"<doJavaScript(bbtk::jScript); +//EED + myWtData.pbox->bbwtUpdateInputs(); +// myWtData.pbox->bbwtProcess(); + } //================================================================== @@ -301,9 +289,9 @@ namespace bbtk std::string WtBlackBox::wtServerData::docRoot = ""; std::string WtBlackBox::wtServerData::port = ""; - 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(); - 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"<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("<GetName())<bbGetName()<<"] WxFrame()" <bbSetWindow(this); // Insert the widget into the window wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); - std::cout<<"------------------------------------USER CREATE WIDGET pre DELETE ME bbtkWxBlackBox.cxx--"<bbUserCreateWidget(this); - std::cout<<"------------------------------------USER CREATE WIDGET post DELETE ME bbtkWxBlackBox.cxx--"<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 ....."< WxBlackBox::bbCreateFrameWindow() - parent = " <Show(); + + } //================================================================== @@ -316,11 +308,9 @@ namespace bbtk { bbtkBlackBoxDebugMessage("widget",9,"==> WxBlackBox::bbSetWindow("<GetName())< WxBlackBox::bbShowWindow()" @@ -339,11 +328,12 @@ namespace bbtk } else { - std::cout<<"--!!--JFGA Testing bbShowWindow "<Show(); bbSetShown(true); } - } + } // if + + } //================================================================== diff --git a/packages/wx/src/bbwxStaticBox.cxx b/packages/wx/src/bbwxStaticBox.cxx index 2809ed2..69a8b1f 100644 --- a/packages/wx/src/bbwxStaticBox.cxx +++ b/packages/wx/src/bbwxStaticBox.cxx @@ -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"<