X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkExecuter.cxx;h=7564baf85337198a81111d65f2c6478aef454ea2;hb=76f2826fd6b67d3a15fe72c1b50d5ee1af1960a1;hp=2bb24d8e12b8eec87092a6d6b6056a061313c206;hpb=a27f0e31cdca2d167c01323443eac3397a0c6fea;p=bbtk.git diff --git a/kernel/src/bbtkExecuter.cxx b/kernel/src/bbtkExecuter.cxx index 2bb24d8..7564baf 100644 --- a/kernel/src/bbtkExecuter.cxx +++ b/kernel/src/bbtkExecuter.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkExecuter.cxx,v $ $ Language: C++ - Date: $Date: 2008/02/06 10:53:02 $ - Version: $Revision: 1.9 $ + Date: $Date: 2008/02/14 11:38:58 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,7 +37,7 @@ namespace bbtk { /** - * + * */ Executer::Executer() : mPackage(0), @@ -53,7 +53,7 @@ namespace bbtk } /** - * + * */ Executer::~Executer() { @@ -61,9 +61,9 @@ namespace bbtk if (mRoot) { mPackage->UnRegisterBlackBox("workspace"); - delete mRoot; + delete mRoot; } - if (mPackage) + if (mPackage) { GetGlobalFactory()->UnLoadPackage("user"); } @@ -72,7 +72,7 @@ namespace bbtk /** - * + * */ void Executer::Reset() { @@ -84,10 +84,10 @@ namespace bbtk // all user defined CBB otherwise any instance // of a user CBB that is in the 'workspace' would try to // access a user CBB descriptor which has been previously freed - if (mRoot) + if (mRoot) { mPackage->UnRegisterBlackBox(mRoot->GetTypeName()); - delete mRoot; + delete mRoot; } if (mPackage) { @@ -111,7 +111,7 @@ namespace bbtk mOpenPackage.push_back(mPackage); bbtkDebugDecTab("Kernel",9); } - + /// changes the workspace name void Executer::SetWorkspaceName( const std::string& n ) { @@ -165,7 +165,6 @@ namespace bbtk { mOpenDefinition.back().box->SetScriptFileName(name); } - void Executer::EndDefine () { @@ -206,20 +205,19 @@ namespace bbtk { Current()->Add(nodeType,nodeName); } - /* void Executer::Remove (const std::string &nodeName) { // Current()->RemoveBlackBox(nodeName); } - */ + */ /** - * + * */ void Executer::Connect (const std::string &nodeFrom, - const std::string &outputLabel, + const std::string &outputLabel, const std::string &nodeTo, const std::string &inputLabel) { @@ -227,7 +225,7 @@ namespace bbtk } /** - * + * */ void Executer::Update (const std::string &nodeName) // would 'Execute' be more meaningfull ? { @@ -244,9 +242,9 @@ namespace bbtk Current()->AddToExecutionList(nodeName) ; } } - + /** - * + * */ void Executer::DefineInput ( const std::string &name, const std::string &box, @@ -290,7 +288,6 @@ namespace bbtk mess += ")"; std::string title(name); title += " ?"; - std::string ans = wx2std ( wxGetTextFromUser( std2wx (mess), std2wx(title))); Set(box,input,ans); } @@ -300,7 +297,7 @@ namespace bbtk Current()->DefineInput(name,box,input,help); } - + /** * */ @@ -348,8 +345,8 @@ namespace bbtk } /** - * - */ + * + */ std::string Executer::Get(const std::string &box, const std::string &output) { @@ -381,7 +378,7 @@ namespace bbtk a->bbDelete(); return r; } - else + else { b->bbExecute(); return b->bbGetOutput(output).unsafe_get(); @@ -497,7 +494,7 @@ namespace bbtk { blackbox=Current()->GetPrototype(); } - else + else { blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox); } @@ -506,21 +503,20 @@ namespace bbtk if (blackbox) { - // Don't pollute the file store with "temp_dir" directories ... + // 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"; - + directory = directory + "temp_dir"; //std::string directory("temp_dir"); std::string filename(directory + "/" + "bbtk_graph_pipeline"); std::string filename_html(filename+".html"); std::string command0("mkdir \""+directory + "\""); -#if defined(_WIN32) +#if defined(_WIN32) std::string command2("start "); #else std::string command2("gnome-open "); @@ -543,7 +539,7 @@ namespace bbtk } blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false ); - s << "\n"; + s << "\n"; } s.close(); @@ -554,7 +550,6 @@ namespace bbtk { bbtkMessageInc("Help",1,"No black box: \"" <