From 53a57e67e61140c33be22645c9d47649bcf96b8d Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Thu, 14 Feb 2008 17:40:09 +0000 Subject: [PATCH] modifs --- kernel/src/bbtkTranscriptor.cxx | 120 +++++++++++++++++--------------- 1 file changed, 64 insertions(+), 56 deletions(-) diff --git a/kernel/src/bbtkTranscriptor.cxx b/kernel/src/bbtkTranscriptor.cxx index 48fffe2..5eee475 100644 --- a/kernel/src/bbtkTranscriptor.cxx +++ b/kernel/src/bbtkTranscriptor.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkTranscriptor.cxx,v $ $ Language: C++ - Date: $Date: 2008/02/14 13:53:01 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/02/14 17:40:09 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -93,7 +93,7 @@ namespace bbtk void Transcriptor::Reset() { - m_Fp << "e->Reset( );" << std::endl; + m_Fp << " e->Reset( );" << std::endl; /* bbtkDebugMessageInc("Kernel",9,"Transcriptor::Reset()" <GetPackage(name); + p = GetGlobalFactory()->GetPackage(name); } catch (Exception e) { - p = new Package(name, - "", - "", - "", - BBTK_STRINGIFY_SYMBOL(BBTK_VERSION)); - InsertPackage(p); + p = new Package(name, + "", + "", + "", + BBTK_STRINGIFY_SYMBOL(BBTK_VERSION)); + InsertPackage(p); } mOpenPackage.push_back(p); */ @@ -171,13 +171,13 @@ namespace bbtk } void Transcriptor::Define (const std::string &name, - const std::string &pack, - const std::string &scriptfilename) + const std::string &pack, + const std::string &scriptfilename) { m_Fp << "// on Define, Define() called here" << std::endl; /* bbtkDebugMessageInc("Kernel",9,"Executer::Define(\""<GetPackage(pname); + p = GetGlobalFactory()->GetPackage(pname); } catch (Exception e) { @@ -226,7 +226,7 @@ namespace bbtk } else { - p = mOpenPackage.back(); + p = mOpenPackage.back(); } p->RegisterBlackBox(Current()); @@ -240,7 +240,7 @@ namespace bbtk const std::string& nodeName) { // Current()->Add(nodeType,nodeName);\" - m_Fp << "e->Add(\"" << nodeType << "\", \"" << nodeName << "\");" << std::endl; + m_Fp << " e->Add(\"" << nodeType << "\", \"" << nodeName << "\");" << std::endl; } @@ -249,7 +249,7 @@ namespace bbtk { /// \todo Remove // Current()->RemoveBlackBox(nodeName); - // m_Fp << "e->Remove(" << nodeName << ");" << std::endl; + // m_Fp << " e->Remove(" << nodeName << ");" << std::endl; } */ @@ -257,12 +257,12 @@ namespace bbtk * */ void Transcriptor::Connect (const std::string &nodeFrom, - const std::string &outputLabel, - const std::string &nodeTo, - const std::string &inputLabel) + const std::string &outputLabel, + const std::string &nodeTo, + const std::string &inputLabel) { //Current()->Connect(nodeFrom, outputLabel, nodeTo, inputLabel); - m_Fp << "e->Connect("<< nodeFrom << "\", \"" << outputLabel << "\", \"" + m_Fp << " e->Connect(\""<< nodeFrom << "\", \"" << outputLabel << "\", \"" << nodeTo << "\", \"" << inputLabel<< "\");" << std::endl; } @@ -277,32 +277,32 @@ namespace bbtk if (!mNoExecMode) { //Current()->GetPrototype()->bbGetBlackBox(nodeName)->bbExecute(true); - m_Fp << "e->GetPrototype()->bbGetBlackBox(\"" << nodeName << "\", true );" << std::endl; + m_Fp << " e->GetPrototype()->bbGetBlackBox(\"" << nodeName << "\", true );" << std::endl; } } else { //Current()->AddToExecutionList(nodeName) ; - m_Fp << "e->AddToExecutionList(\"" << nodeName << "\");" << std::endl; + m_Fp << " e->AddToExecutionList(\"" << nodeName << "\");" << std::endl; } } - + /** - * + * */ void Transcriptor::DefineInput ( const std::string &name, - const std::string &box, - const std::string &input, - const std::string& help) + const std::string &box, + const std::string &input, + const std::string& help) { // If the input is defined in the Root box - if (Current()==mRoot) - { + if (Current()==mRoot) + { m_Fp << "// ==> Some extra work to do when Current()==mRoot" << std::endl; } - m_Fp << "e->DefineInput(\""<< name << "\", " << box << ", " - << input << ", \"" << help << "\");" << std::endl; + m_Fp << " e->DefineInput(\""<< name << "\", " << box << ", " + << input << ", \"" << help << "\");" << std::endl; /* @@ -359,12 +359,12 @@ namespace bbtk * */ void Transcriptor::DefineOutput ( const std::string &name, - const std::string &box, - const std::string &output, - const std::string& help) + const std::string &box, + const std::string &output, + const std::string& help) { // Current()->DefineOutput(name,box,output,help); - m_Fp << "e->DefineOutput(\""<< name << "\", \"" << box << "\", \"" + m_Fp << " e->DefineOutput(\""<< name << "\", \"" << box << "\", \"" << output << "\", \"" << help << "\");" << std::endl; } @@ -372,11 +372,13 @@ namespace bbtk * */ void Transcriptor::Set (const std::string &box, - const std::string &input, - const std::string &value) + const std::string &input, + const std::string &value) { - m_Fp << "// ==> Set() called here" << std::endl; + m_Fp << "// ==> Set() called here" << std::endl; + m_Fp << " e->GetPrototype()->bbGetBlackBox(\""<< box << "\");" << std::endl; + /* BlackBox* b = Current()->GetPrototype()->bbGetBlackBox(box); // Looks for the adaptor @@ -411,7 +413,7 @@ namespace bbtk * */ std::string Transcriptor::Get(const std::string &box, - const std::string &output) + const std::string &output) { m_Fp << "// ==> Get() called here" << std::endl; @@ -459,29 +461,35 @@ namespace bbtk void Transcriptor::Author(const std::string &authorName) { + m_Fp << " e->AddToAuthor(\"" << authorName << "\", true)" << std::endl; + return; // just to see //Current()->AddToAuthor(authorName,Current()==mRoot); if (Current()==mRoot) - m_Fp << "e->AddToAuthor(\"" << authorName << "\", true)" << std::endl; + m_Fp << " e->AddToAuthor(\"" << authorName << "\", true)" << std::endl; else - m_Fp << "e->AddToAuthor(\"" << authorName << "\", false)" << std::endl; + m_Fp << " e->AddToAuthor(\"" << authorName << "\", false)" << std::endl; } void Transcriptor::Category(const std::string &category) - { + { + m_Fp << " e->AddToCategory(\"" << category << "\", true)" << std::endl; + return; // just to see //Current()->AddToCategory(category,Current()==mRoot); if (Current()==mRoot) - m_Fp << "e->AddToCategory(\"" << category << "\", true)" << std::endl; + m_Fp << " e->AddToCategory(\"" << category << "\", true)" << std::endl; else - m_Fp << "e->AddToCategory(\"" << category << "\", false)" << std::endl; + m_Fp << " e->AddToCategory(\"" << category << "\", false)" << std::endl; } void Transcriptor::Description(const std::string &d) { + m_Fp << " e->AddToDescription(\"" << d << "\", true)" << std::endl; + return; // just to see // Current()->AddToDescription(d,Current()==mRoot); if (Current()==mRoot) - m_Fp << "e->AddToDescription(\"" << d << "\", true)" << std::endl; + m_Fp << " e->AddToDescription(\"" << d << "\", true)" << std::endl; else - m_Fp << "e->AddToDescription(\"" << d << "\", false)" << std::endl; + m_Fp << " e->AddToDescription(\"" << d << "\", false)" << std::endl; } @@ -540,11 +548,11 @@ namespace bbtk Package* p; try { - p = GetGlobalFactory()->GetPackage(nameblackbox); + p = GetGlobalFactory()->GetPackage(nameblackbox); } catch (Exception e) { - p = mPackage; + p = mPackage; } // Generating documentation-help of workspace p->SetDocURL(filename_rootHtml); @@ -556,12 +564,12 @@ namespace bbtk /* try { - ShowGraphTypes(nameblackbox); + ShowGraphTypes(nameblackbox); } catch (bbtk::Exception a) { - std::cout <<"EXC"<GetPrototype(); + blackbox=Current()->GetPrototype(); } else { - blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox); + blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox); } std::string page; @@ -623,7 +631,7 @@ namespace bbtk } blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false ); - s << "\n"; + s << "\n"; } s.close(); -- 2.47.1