From: Eduardo DAVILA Date: Wed, 25 Jul 2018 11:37:14 +0000 (+0200) Subject: #3203 BBTK Feature New Normal vtk7itk4wx3-mingw64 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b7d6fdd0df18c14ba87b1954561c8ec6fb1e7a0a;p=bbtk.git #3203 BBTK Feature New Normal vtk7itk4wx3-mingw64 --- diff --git a/kernel/appli/bbi/bbi.cxx b/kernel/appli/bbi/bbi.cxx index 3b5580b..7918d19 100644 --- a/kernel/appli/bbi/bbi.cxx +++ b/kernel/appli/bbi/bbi.cxx @@ -121,7 +121,7 @@ void WxProcessCmdLine::Process(wxCmdLineParser& parser) #if wxMAJOR_VERSION <= 2 graphical_dialog = ( parser.Found(_T("wxcommandlineg")) ); #else - printf("EED Warnning. WxProcessCmdLine::Process g wxcommandlineg "); + printf("EED Warnning. WxProcessCmdLine::Process g wxcommandlineg \n"); graphical_dialog = ( parser.Found(_T("g")) ); #endif @@ -210,7 +210,6 @@ 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); @@ -221,8 +220,6 @@ 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); @@ -231,15 +228,10 @@ 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); @@ -251,7 +243,6 @@ printf("EED wxBBIApp::OnInit 3\n"); 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) { @@ -269,7 +260,6 @@ printf("EED wxBBIApp::OnInit 4\n"); 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/bbtkException.h b/kernel/src/bbtkException.h index d99d4a2..18ca1a6 100644 --- a/kernel/src/bbtkException.h +++ b/kernel/src/bbtkException.h @@ -72,13 +72,10 @@ namespace bbtk 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 e3ec15d..a55fce1 100644 --- a/kernel/src/bbtkExecuter.cxx +++ b/kernel/src/bbtkExecuter.cxx @@ -83,14 +83,10 @@ namespace bbtk // 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(); @@ -135,21 +130,16 @@ printf("EED Executer::Reset Start\n"); // 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); @@ -159,7 +149,6 @@ printf("EED Executer::Reset 1\n"); 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"); @@ -171,7 +160,6 @@ printf("EED Executer::Reset 2\n"); // Object::PrintObjectListInfo(); // GetFactory()->CheckPackages(); bbtkDebugMessage("kernel",9,"<== Executer::Reset()" <(bbtk::Transcriptor::New(cpp_file)); - } - else - { -printf("EED Interpreter::Init 1\n"); - bbtk::Executer::Pointer exe = bbtk::Executer::New(); - mRealExecuter = exe; - mVirtualExecuter = boost::static_pointer_cast(exe); + if (e) { + mVirtualExecuter = e; + } else if (cpp_file.size()!=0){ + mVirtualExecuter = boost::static_pointer_cast(bbtk::Transcriptor::New(cpp_file)); + } else { + bbtk::Executer::Pointer exe = bbtk::Executer::New(); + mRealExecuter = exe; + mVirtualExecuter = boost::static_pointer_cast(exe); } -printf("EED Interpreter::Init 2\n"); - - // Lock this pointer or will auto-destruct !! if (!e) mVirtualExecuter->SetInterpreter(MakePointer(this,true)); bbtk::InterpreterVirtual::Init(); -printf("EED Interpreter::Init End\n"); } //======================================================================= diff --git a/kernel/src/bbtkPackage.cxx b/kernel/src/bbtkPackage.cxx index 743dc79..7507a2a 100644 --- a/kernel/src/bbtkPackage.cxx +++ b/kernel/src/bbtkPackage.cxx @@ -85,22 +85,18 @@ namespace bbtk mDescription(description), mVersion(version) { -printf("EED Package::Package Start\n"); bbtkDebugMessage("object",2,"==> Package('"< Package::CreateFromDynamicLibrary(" < 0) { @@ -743,7 +745,6 @@ namespace bbtk return status; #endif /* MACOSX */ -printf("EED Utilities get_app_path END\n"); return -1; /* Path Lookup Failed */ } @@ -754,59 +755,27 @@ printf("EED Utilities get_app_path END\n"); //========================================================================= 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) - { -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"); - } - + { + try + { + bbtkGlobalError("Could not determine current executable path ?"); + } + catch (bbtk::Exception e) + { + std::cerr << e.GetErrorMessage() << std::endl; + } + } + // 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"); + { + *slash = 0; + } return name; } //========================================================================= diff --git a/kernel/src/bbtkWxGUIConsole.cxx b/kernel/src/bbtkWxGUIConsole.cxx index 51abe49..220341a 100644 --- a/kernel/src/bbtkWxGUIConsole.cxx +++ b/kernel/src/bbtkWxGUIConsole.cxx @@ -84,19 +84,13 @@ 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 @@ -126,7 +120,6 @@ printf( "EED WxGUIConsole 1\n" ); CreateStatusBar(); SetStatusText( _T("Welcome to bbi !") ); -printf( "EED WxGUIConsole 2\n" ); //============== // Notebook @@ -158,7 +151,6 @@ printf( "EED WxGUIConsole 2\n" ); mwxPageHelp->SetSizer(helpsizer); helpsizer->Fit(mwxPageHelp); helpsizer->SetSizeHints(mwxPageHelp); - printf( "EED WxGUIConsole 3\n" ); mWxGUIHtmlBrowser = new WxGUIHtmlBrowser(mwxPageHelp, //EED wxSize(1200,0)); @@ -182,8 +174,6 @@ printf( "EED WxGUIConsole 2\n" ); 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); @@ -207,8 +197,6 @@ printf( "EED WxGUIConsole 4\n" ); Layout(); // Refresh(); // m_mgr.Update(); -printf( "EED WxGUIConsole End\n" ); - } //================================================================