From 536dfc0a21b307fe5fa18afca108a77a5f79a6f6 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 24 Jul 2018 17:43:16 +0200 Subject: [PATCH] #3203 BBTK Feature New Normal vtk7itk4wx3-mingw64 --- kernel/appli/bbi/CMakeLists.txt | 1 + kernel/appli/bbi/bbi.cxx | 17 +++++++++- kernel/src/bbtkConfigurationFile.cxx | 2 +- kernel/src/bbtkException.h | 6 +++- kernel/src/bbtkExecuter.cxx | 14 +++++++++ kernel/src/bbtkInterpreter.cxx | 4 +++ kernel/src/bbtkMessageManager.h | 2 +- kernel/src/bbtkPackage.cxx | 9 +++++- kernel/src/bbtkUtilities.cxx | 47 ++++++++++++++++++++++++++-- kernel/src/bbtkWxGUIConsole.cxx | 14 ++++++++- 10 files changed, 108 insertions(+), 8 deletions(-) diff --git a/kernel/appli/bbi/CMakeLists.txt b/kernel/appli/bbi/CMakeLists.txt index 0422e38..381e872 100644 --- a/kernel/appli/bbi/CMakeLists.txt +++ b/kernel/appli/bbi/CMakeLists.txt @@ -41,6 +41,7 @@ IF(BBTK_USE_WXWIDGETS AND WIN32) SET_TARGET_PROPERTIES(bbi PROPERTIES LINK_FLAGS -mconsole ) ELSE(MINGW) SET_TARGET_PROPERTIES(bbi PROPERTIES LINK_FLAGS /subsystem:console ) +# SET_TARGET_PROPERTIES(bbi PROPERTIES LINK_FLAGS ) ENDIF(MINGW) ELSE(BBTK_USE_WXWIDGETS AND WIN32) ADD_EXECUTABLE(bbi MACOSX_BUNDLE ${SOURCES}) diff --git a/kernel/appli/bbi/bbi.cxx b/kernel/appli/bbi/bbi.cxx index 3f60890..3b5580b 100644 --- a/kernel/appli/bbi/bbi.cxx +++ b/kernel/appli/bbi/bbi.cxx @@ -210,6 +210,7 @@ bool wxBBIApp::OnCmdLineParsed(wxCmdLineParser& parser) // main frame bool wxBBIApp::OnInit( ) { + printf("EED wxBBIApp::OnInit 1\n"); //Borrame //FILE *ff; ff = fopen ("/tmp/wt.log","a+"); fprintf(ff,"EED wxBBIApp::OnInit\n"); fclose(ff); @@ -220,6 +221,7 @@ bool wxBBIApp::OnInit( ) setlocale(LC_NUMERIC, "C"); #endif + printf("EED wxBBIApp::OnInit 2\n"); if (cmd.quiet) bbtk::MessageManager::SetMessageLevel("max",0); if (cmd.debug) bbtk::MessageManager::SetMessageLevel("all",9); @@ -229,11 +231,15 @@ bool wxBBIApp::OnInit( ) //printf ("EED bbi wxBBIApp::OnInit .....................\n"); //cmd.input_file.push_back("/home/davila/Borrame/testwt.bbs"); + printf("EED wxBBIApp::OnInit 2.1\n"); bbtk::WxGUIConsole *I = new bbtk::WxGUIConsole(0,_T("bbi"),wxSize(800,600)); + printf("EED wxBBIApp::OnInit 2.2\n"); SetTopWindow(I); + printf("EED wxBBIApp::OnInit 2.3\n"); if (cmd.console) I->Show(true); +printf("EED wxBBIApp::OnInit 3\n"); I->SetInputs(cmd.param_map); @@ -245,6 +251,8 @@ bool wxBBIApp::OnInit( ) std::vector::const_iterator i; bool error = false; +printf("EED wxBBIApp::OnInit 4\n"); + for (i=cmd.input_file.begin(); i!=cmd.input_file.end(); ++i) { error = ! I->InterpretFile(*i); @@ -261,6 +269,8 @@ bool wxBBIApp::OnInit( ) I->GetInterpreter()->GetExecuter()->GetFactory()->PrintHelpDescriptor("workspace",package,false); } +printf("EED wxBBIApp::OnInit 5\n"); + /* std::cout << "soe="<Close(); // std::cout << "I->Close"<2) // { diff --git a/kernel/src/bbtkConfigurationFile.cxx b/kernel/src/bbtkConfigurationFile.cxx index 7706084..e6e7926 100644 --- a/kernel/src/bbtkConfigurationFile.cxx +++ b/kernel/src/bbtkConfigurationFile.cxx @@ -146,7 +146,6 @@ namespace bbtk Utilities::replace( mBbs_paths[iStrVec] , INVALID_FILE_SEPARATOR , VALID_FILE_SEPARATOR); } - // always add "." (current working directory) at the begining mPackage_paths.push_back("."); // add system bin path (for build tree / standalone folder install) @@ -214,6 +213,7 @@ namespace bbtk // In any case, deal with bbtk_config.xml! Read(configXmlFullPathName.c_str()); + } //========================================================================= diff --git a/kernel/src/bbtkException.h b/kernel/src/bbtkException.h index d99fec5..d99d4a2 100644 --- a/kernel/src/bbtkException.h +++ b/kernel/src/bbtkException.h @@ -71,10 +71,14 @@ namespace bbtk : mObject(object), mSourceFile(source_file), mMessage(message) - {} + { +printf("EED Exception::Exception \n"); + + } ~Exception() throw() {} void Print() throw() { +printf("EED Exception Print\n"); std::cerr << "* ERROR : " << mMessage < 0) { diff --git a/kernel/src/bbtkExecuter.cxx b/kernel/src/bbtkExecuter.cxx index bf51fe5..e3ec15d 100644 --- a/kernel/src/bbtkExecuter.cxx +++ b/kernel/src/bbtkExecuter.cxx @@ -82,9 +82,15 @@ namespace bbtk // We have to "lock" the smart pointer because the factory // only keeps a weak pointer on the executer // -> this would auto-destroy !! + +printf("EED Executer::Executer Start\n"); + mFactory->SetExecuter(MakePointer(this,true)); +printf("EED Executer::Executer 1\n"); + Reset(); bbtkDebugMessage("object",2,"<== Executer()" < Executer::Reset()" <Check(); @@ -128,16 +135,21 @@ namespace bbtk // Wx::DestroyTopWindow(); +printf("EED Executer::Reset 01\n"); GetFactory()->Reset(); +printf("EED Executer::Reset 02\n"); #if(USE_WXWIDGETS) +printf("EED Executer::Reset 03\n"); Wx::ProcessPendingEvents(); #endif +printf("EED Executer::Reset 04\n"); // Create user package Package::Pointer p = Package::New("user","internal","User defined black boxes",""); // Insert the user package in the factory +printf("EED Executer::Reset 1\n"); GetFactory()->InsertPackage(p); // And in the list of open packages mOpenPackage.push_back(p); @@ -147,6 +159,7 @@ namespace bbtk ComplexBlackBoxDescriptor::Pointer r = ComplexBlackBoxDescriptor::New("workspace"); // mRootCBB->Reference(); +printf("EED Executer::Reset 2\n"); r->SetFactory(GetFactory()); r->AddToAuthor("bbtk"); r->AddToDescription("User's workspace"); @@ -158,6 +171,7 @@ namespace bbtk // Object::PrintObjectListInfo(); // GetFactory()->CheckPackages(); bbtkDebugMessage("kernel",9,"<== Executer::Reset()" <(exe); } +printf("EED Interpreter::Init 2\n"); // Lock this pointer or will auto-destruct !! @@ -119,6 +122,7 @@ namespace bbtk bbtk::InterpreterVirtual::Init(); +printf("EED Interpreter::Init End\n"); } //======================================================================= diff --git a/kernel/src/bbtkMessageManager.h b/kernel/src/bbtkMessageManager.h index 51d7da6..c5a8211 100644 --- a/kernel/src/bbtkMessageManager.h +++ b/kernel/src/bbtkMessageManager.h @@ -382,7 +382,7 @@ s.str()); \ throw e; \ } \ - while (0) + while (0); #define BBTK_INTERNAL_ERROR_MESSAGE \ "\n\n***********************************************\n**** THIS IS AN INTERNAL ERROR TO BBTK ****\n**** Please send a full bug report to : ****\n**** bbtk-developers@creatis.insa-lyon.fr ****\n***********************************************\n\n" diff --git a/kernel/src/bbtkPackage.cxx b/kernel/src/bbtkPackage.cxx index 8aca801..743dc79 100644 --- a/kernel/src/bbtkPackage.cxx +++ b/kernel/src/bbtkPackage.cxx @@ -85,18 +85,22 @@ namespace bbtk mDescription(description), mVersion(version) { - +printf("EED Package::Package Start\n"); bbtkDebugMessage("object",2,"==> Package('"< Package::CreateFromDynamicLibrary(" < 0) { @@ -740,6 +742,8 @@ namespace bbtk free (given_path); return status; #endif /* MACOSX */ + +printf("EED Utilities get_app_path END\n"); return -1; /* Path Lookup Failed */ } @@ -750,20 +754,59 @@ namespace bbtk //========================================================================= std::string Utilities::GetExecutablePath() { +printf("EED Utilities::GetExecutablePath Start\n"); char name[PATH_MAX]; +printf("EED Utilities::GetExecutablePath 1 \n"); int err = get_app_path(name, PATH_MAX); +printf("EED Utilities::GetExecutablePath 2 \n"); if (err) { - bbtkGlobalError("Could not determine current executable path ?"); +printf("EED Utilities::GetExecutablePath 2.1 \n"); +// bbtkGlobalError("Could not determine current executable path ?"); + +/* + +printf("EED Utilities bbtkGlobalError XX Start\n"); + do + { +printf("EED Utilities bbtkGlobalError XX A.1\n"); + std::ostringstream s; +printf("EED Utilities bbtkGlobalError XX A.2\n"); + s << "Could not determine current executable path ?"; +printf("EED Utilities bbtkGlobalError XX A.3\n"); + std::ostringstream f; +printf("EED Utilities bbtkGlobalError XX A.4\n"); + f << __FILE__ << " (l."<<__LINE__<<")"; +printf("EED Utilities bbtkGlobalError XX A.5\n"); +std::string aa=f.str(); +printf("EED Utilities bbtkGlobalError XX A.6\n"); +std::string bb=f.str(); +printf("EED Utilities bbtkGlobalError XX A.7\n"); + bbtk::Exception e( "global scope", + f.str(), + s.str()); + throw e; +printf("EED Utilities bbtkGlobalError XX B\n"); + } + while (0); +printf("EED Utilities bbtkGlobalError XX End\n"); + +*/ + + +printf("EED Utilities::GetExecutablePath 2.2 \n"); } // remove the exe name char *slash; +printf("EED Utilities::GetExecutablePath 3 >%s<\n",name); slash = strrchr(name, VALID_FILE_SEPARATOR_CHAR); +printf("EED Utilities::GetExecutablePath 4 \n"); if (slash) { *slash = 0; } +printf("EED Utilities::GetExecutablePath END \n"); return name; } //========================================================================= diff --git a/kernel/src/bbtkWxGUIConsole.cxx b/kernel/src/bbtkWxGUIConsole.cxx index 031ee43..51abe49 100644 --- a/kernel/src/bbtkWxGUIConsole.cxx +++ b/kernel/src/bbtkWxGUIConsole.cxx @@ -84,13 +84,20 @@ namespace bbtk WxGUIConsole::WxGUIConsole( wxWindow *parent, wxString title, wxSize size) : wxFrame((wxFrame *)parent, -1, title, wxDefaultPosition, size) { +printf( "EED WxGUIConsole Start \n" ); // m_mgr = new wxAuiManager(this); m_mgr.SetManagedWindow(this); +printf( "EED WxGUIConsole 0.1 \n" ); mInterpreter = bbtk::Interpreter::New(); +printf( "EED WxGUIConsole 0.2 \n" ); mInterpreter->SetUser(this); +printf( "EED WxGUIConsole 0.3 \n" ); mInterpreter->SetCommandLine(true); +printf( "EED WxGUIConsole 0.4 \n" ); mInterpreter->SetThrow(false); +printf( "EED WxGUIConsole 1\n" ); + //============== // Menu wxInitAllImageHandlers(); @@ -119,6 +126,7 @@ namespace bbtk CreateStatusBar(); SetStatusText( _T("Welcome to bbi !") ); +printf( "EED WxGUIConsole 2\n" ); //============== // Notebook @@ -150,7 +158,8 @@ namespace bbtk mwxPageHelp->SetSizer(helpsizer); helpsizer->Fit(mwxPageHelp); helpsizer->SetSizeHints(mwxPageHelp); - + printf( "EED WxGUIConsole 3\n" ); + mWxGUIHtmlBrowser = new WxGUIHtmlBrowser(mwxPageHelp, //EED wxSize(1200,0)); wxSize(200,0)); @@ -174,6 +183,7 @@ namespace bbtk cmdsizer->Add (mWxGUIOutputMessages, 1, wxALL | wxGROW, 5); cmdsizer->Add (mWxGUICommand, 0, wxALL | wxGROW, 5); +printf( "EED WxGUIConsole 4\n" ); // Set the parent window of all bbtk windows as a child of this // bbtk::Wx::SetTopWindowParent(this); @@ -197,6 +207,8 @@ namespace bbtk Layout(); // Refresh(); // m_mgr.Update(); +printf( "EED WxGUIConsole End\n" ); + } //================================================================ -- 2.47.1