X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkExecuter.cxx;h=519a264eec6eb7bb3017a38ae007d33df0cf4c89;hb=98e18224b83c6955a804d79d4e7083626ea8afcd;hp=f8d71a28d9f0629e8b6fb8c89160e46c081d2195;hpb=5d503ab0e50fbae3cd2ebd26e6c815557abbe42e;p=bbtk.git diff --git a/kernel/src/bbtkExecuter.cxx b/kernel/src/bbtkExecuter.cxx index f8d71a2..519a264 100644 --- a/kernel/src/bbtkExecuter.cxx +++ b/kernel/src/bbtkExecuter.cxx @@ -1,20 +1,33 @@ -/*========================================================================= - +/*========================================================================= Program: bbtk - Module: $RCSfile: bbtkExecuter.cxx,v $ $ + Module: $RCSfile: bbtkExecuter.cxx,v $ Language: C++ - Date: $Date: 2008/07/01 07:58:28 $ - Version: $Revision: 1.21 $ - - Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de - l'Image). All rights reserved. See Doc/License.txt or - http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details. + Date: $Date: 2009/03/30 15:22:51 $ + Version: $Revision: 1.29 $ +=========================================================================*/ - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. +/* --------------------------------------------------------------------- + +* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) +* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux +* +* This software is governed by the CeCILL-B license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL-B +* license as circulated by CEA, CNRS and INRIA at the following URL +* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +* or in the file LICENSE.txt. +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited +* liability. +* +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL-B license and that you accept its terms. +* ------------------------------------------------------------------------ */ -=========================================================================*/ /** * \file * \brief class Executer: level 0 of script execution (code) @@ -26,7 +39,7 @@ #include "bbtkUtilities.h" #include -#ifdef _USE_WXWIDGETS_ +#ifdef USE_WXWIDGETS #include #endif @@ -51,7 +64,8 @@ namespace bbtk mRootPackage(), mRootCBB(), mNoExecMode(false), - mDialogMode(NoDialog) + mDialogMode(NoDialog), + mNoErrorMode(false) { bbtkDebugMessageInc("Kernel",9,"Executer::Executer()" <InsertPackage(p); // And in the list of open packages @@ -136,6 +147,7 @@ namespace bbtk } //======================================================================= + //======================================================================= /// changes the workspace name void Executer::SetWorkspaceName( const std::string& n ) @@ -156,11 +168,7 @@ namespace bbtk } catch (Exception e) { - p = Package::New(name, - "", - "", - "", - BBTK_STRINGIFY_SYMBOL(BBTK_VERSION)); + p = Package::New(name,"","",""); GetFactory()->InsertPackage(p); } mOpenPackage.push_back(p); @@ -202,6 +210,15 @@ namespace bbtk } //======================================================================= + //======================================================================= + void Executer::Clear() + { + bbtkDebugMessageInc("Kernel",9,"Executer::Clear()" <GetPrototype()->Clear(); + + } + //======================================================================= + //======================================================================= void Executer::EndDefine () { @@ -219,11 +236,7 @@ namespace bbtk } catch (Exception e) { - p = Package::New(pname, - "", - "", - "", - BBTK_STRINGIFY_SYMBOL(BBTK_VERSION)); + p = Package::New(pname,"","",""); GetFactory()->InsertPackage(p); } } @@ -343,7 +356,7 @@ namespace bbtk std::cin >> ans; Set(box,input,ans); } -#ifdef _USE_WXWIDGETS_ +#ifdef USE_WXWIDGETS // If the dialog mode is set to GraphicalDialog // A dialog box is pop up else if (mDialogMode == GraphicalDialog) @@ -384,7 +397,8 @@ namespace bbtk BlackBox::Pointer b = GetCurrentDescriptor()->GetPrototype()->bbGetBlackBox(box); // Looks for the adaptor - if ( b->bbGetInputType(input) != typeid(std::string) ) + if ( ( b->bbGetInputType(input) != typeid(bbtk::any) )&& + ( b->bbGetInputType(input) != typeid(std::string) ) ) { BlackBox::Pointer a = GetFactory()->NewAdaptor(typeid(std::string), @@ -497,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 @@ -534,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 { @@ -552,7 +557,7 @@ namespace bbtk page = ShowGraphInstances(nameblackbox,detail,level,system_display); } */ - return page; + return pack_index; } //======================================================================= @@ -610,7 +615,6 @@ namespace bbtk } else { s << "
" << blackbox->bbGetName()<< "
"; } - blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false ); s << "\n"; }