From: Eduardo Davila Date: Mon, 30 Mar 2009 15:22:46 +0000 (+0000) Subject: BUG MACOS X-Git-Tag: EED.02Oct2009~66 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=98e18224b83c6955a804d79d4e7083626ea8afcd;p=bbtk.git BUG MACOS --- diff --git a/kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp b/kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp index 1f8249a..cfae87e 100644 --- a/kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp +++ b/kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp @@ -7,6 +7,7 @@ //========================================================================== void RegenerateDoc ( bbtk::Package::Pointer p, std::string& doc_path ) { + std::string pack_name(p->GetName()); std::string pack_path = doc_path + pack_name; // Creating directory @@ -24,7 +25,11 @@ void RegenerateDoc ( bbtk::Package::Pointer p, std::string& doc_path ) p->SetDocURL(pack_index); p->SetDocRelativeURL("index.html"); - p->CreateHtmlPage(pack_index,"bbtk",pack_name,"","",0,0,false); //true); + + + p->CreateHtmlPage(pack_index,"bbtk",pack_name,"","",0,0,true); //true); + + } @@ -40,6 +45,7 @@ void Usage() //========================================================================== int main(int argc, char **argv) { + std::string pack("-a"); if (argc==2) { @@ -65,25 +71,27 @@ int main(int argc, char **argv) try { - std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path(); + std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path(); doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); doc_path += "bbdoc"; doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); - + bbtk::Interpreter::Pointer I = bbtk::Interpreter::New(); I->SetCommandLine(true); I->SetThrow(false); - I->InterpretLine( "exec freeze_no_error"); + I->InterpretLine( "exec freeze_no_error"); if (pack != "-a") { - I->InterpretLine( "include "+pack); - I->InterpretLine( "include "+pack+"-appli"); - RegenerateDoc(I->GetExecuter()->GetFactory()->GetPackage(pack),doc_path); + I->InterpretLine( "include "+pack); + I->InterpretLine( "include "+pack+"-appli"); + bbtk::Package::Pointer p = I->GetExecuter()->GetFactory()->GetPackage(pack); + + RegenerateDoc(I->GetExecuter()->GetFactory()->GetPackage(pack),doc_path); } else { - I->InterpretLine( "include *"); - bbtk::Factory::PackageMapType::const_iterator i; +I->InterpretLine( "include *"); + bbtk::Factory::PackageMapType::const_iterator i; for (i = I->GetExecuter()->GetFactory()->GetPackageMap().begin(); i != I->GetExecuter()->GetFactory()->GetPackageMap().end(); ++i) @@ -98,7 +106,7 @@ int main(int argc, char **argv) std::cout << "* ERROR : "<\n\n"; // End diff --git a/kernel/src/bbtkComplexBlackBoxDescriptor.cxx b/kernel/src/bbtkComplexBlackBoxDescriptor.cxx index 2bc2e3e..de6d2b7 100644 --- a/kernel/src/bbtkComplexBlackBoxDescriptor.cxx +++ b/kernel/src/bbtkComplexBlackBoxDescriptor.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkComplexBlackBoxDescriptor.cxx,v $ Language: C++ - Date: $Date: 2008/10/17 08:18:12 $ - Version: $Revision: 1.18 $ + Date: $Date: 2009/03/30 15:22:51 $ + Version: $Revision: 1.19 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -410,14 +410,14 @@ namespace bbtk url = p->GetDocRelativeURL(); else url = p->GetDocURL(); - + s << "" << p->GetName()<<"::"<\n"; - } + } // for (s) << "\n"; - } + } // If B.size (s) << "\n"; diff --git a/kernel/src/bbtkExecuter.cxx b/kernel/src/bbtkExecuter.cxx index 41ca9b6..519a264 100644 --- a/kernel/src/bbtkExecuter.cxx +++ b/kernel/src/bbtkExecuter.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkExecuter.cxx,v $ Language: C++ - Date: $Date: 2009/03/30 14:42:16 $ - Version: $Revision: 1.28 $ + Date: $Date: 2009/03/30 15:22:51 $ + Version: $Revision: 1.29 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -511,33 +511,7 @@ namespace bbtk { int detail = atoi(detailStr.c_str()); int level = atoi(levelStr.c_str()); - - std::string filename_rootHtml (output_html) ; - std::string simplefilename_rootHtml ( Utilities::get_file_name(output_html)); - - bool relative_link = true; - - // No output provided : automatic generation - if (output_html.length() == 0) - { - // Don't pollute the file store with "temp_dir" directories ... - std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); - - char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1]; - - std::string directory = default_doc_dir; - if (c != '/' && c !='\\') directory = directory + "/"; - directory = directory + "temp_dir"; - - filename_rootHtml = directory + "/" + "User.html"; - simplefilename_rootHtml = "User.html" ; - - // Creating directory - std::string command0("mkdir \"" +directory + "\""); - system( command0.c_str() ); - - relative_link = false; - } + bool relative_link = true; Package::Pointer p; try @@ -548,13 +522,30 @@ namespace bbtk { p = GetUserPackage(); } + + std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path(); + doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); + doc_path += "bbdoc"; + doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); + + std::string pack_name(p->GetName()); + std::string pack_path = doc_path + pack_name; + // Creating directory + if ( ! bbtk::Utilities::FileExists(pack_path) ) + { + std::string command("mkdir \"" +pack_path+ "\""); + system( command.c_str() ); + } + std::string pack_index(pack_path); + pack_index += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); + pack_index += "index.html"; + + // Generating documentation-help of workspace - p->SetDocURL(filename_rootHtml); - p->SetDocRelativeURL(simplefilename_rootHtml); - - p->CreateHtmlPage(filename_rootHtml,"bbtk","user package",custom_header,custom_title,detail,level,relative_link); - - std::string page = filename_rootHtml; + p->SetDocURL(pack_index); + p->SetDocRelativeURL("index.html"); + p->CreateHtmlPage(pack_index,"bbtk","user package",custom_header,custom_title,detail,level,relative_link); + /* try { @@ -566,7 +557,7 @@ namespace bbtk page = ShowGraphInstances(nameblackbox,detail,level,system_display); } */ - return page; + return pack_index; } //======================================================================= @@ -624,7 +615,6 @@ namespace bbtk } else { s << "
" << blackbox->bbGetName()<< "
"; } - blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false ); s << "\n"; } diff --git a/kernel/src/bbtkFactory.cxx b/kernel/src/bbtkFactory.cxx index 3ba655b..ad64151 100644 --- a/kernel/src/bbtkFactory.cxx +++ b/kernel/src/bbtkFactory.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkFactory.cxx,v $ Language: C++ - Date: $Date: 2009/02/27 11:20:25 $ - Version: $Revision: 1.41 $ + Date: $Date: 2009/03/30 15:22:51 $ + Version: $Revision: 1.42 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -39,6 +39,7 @@ #include "bbtkConnection.h" #include "bbtkConfigurationFile.h" #include "bbtkUtilities.h" +#include "bbtkConfigurationFile.h" #include // for struct stat stFileInfo @@ -1011,7 +1012,9 @@ namespace bbtk s << "  -  \n"; s << "
\n"; - s << "first << "/main.html>(Doxygen documentation of the source)\n"; +//EED 26Mars2009 + std::string bin_path = bbtk::ConfigurationFile::GetInstance().Get_bin_path(); + s << "first << "/main.html>(Doxygen documentation of the source)\n"; } else { diff --git a/kernel/src/bbtkWxGUIScriptingInterface.cxx b/kernel/src/bbtkWxGUIScriptingInterface.cxx index b6581d0..f06b07e 100644 --- a/kernel/src/bbtkWxGUIScriptingInterface.cxx +++ b/kernel/src/bbtkWxGUIScriptingInterface.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkWxGUIScriptingInterface.cxx,v $ Language: C++ - Date: $Date: 2009/03/24 13:42:59 $ - Version: $Revision: 1.35 $ + Date: $Date: 2009/03/30 15:22:51 $ + Version: $Revision: 1.36 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -519,14 +519,27 @@ namespace bbtk //================================================================ void WxGUIScriptingInterface::OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event)) { - std::string default_temp_dir = ConfigurationFile::GetInstance().Get_default_temp_dir(); + std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path(); + doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); + doc_path += "bbdoc"; + doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); + + std::string pack_name("User"); + std::string pack_path = doc_path + pack_name; + + #if defined(WIN32) std::string strappli="start "; #else - std::string strappli="gnome-open "; + #if defined(MACOSX) + std::string strappli="open "; + #else + std::string strappli="gnome-open "; + #endif #endif - std::string strcommand = strappli +default_temp_dir+"/temp_dir/workspace_workspacePrototype.png"; + + std::string strcommand = strappli +pack_path+"/workspace_workspacePrototype.png"; // std::cout << "system: " << strcommand << std::endl; system ( strcommand.c_str() );