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
void Transcriptor::Reset()
{
- m_Fp << "e->Reset( );" << std::endl;
+ m_Fp << " e->Reset( );" << std::endl;
/*
bbtkDebugMessageInc("Kernel",9,"Transcriptor::Reset()" <<std::endl);
Package* p;
try
{
- p = GetGlobalFactory()->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);
*/
}
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(\""<<name<<
- ","<<pack<<"\")"
+ ","<<pack<<"\")"
<<std::endl);
ComplexBlackBoxDescriptor* b = new ComplexBlackBoxDescriptor(name);
{
try
{
- p = GetGlobalFactory()->GetPackage(pname);
+ p = GetGlobalFactory()->GetPackage(pname);
}
catch (Exception e)
{
}
else
{
- p = mOpenPackage.back();
+ p = mOpenPackage.back();
}
p->RegisterBlackBox(Current());
const std::string& nodeName)
{
// Current()->Add(nodeType,nodeName);\"
- m_Fp << "e->Add(\"" << nodeType << "\", \"" << nodeName << "\");" << std::endl;
+ m_Fp << " e->Add(\"" << nodeType << "\", \"" << nodeName << "\");" << std::endl;
}
{
/// \todo Remove
// Current()->RemoveBlackBox(nodeName);
- // m_Fp << "e->Remove(" << nodeName << ");" << std::endl;
+ // m_Fp << " e->Remove(" << nodeName << ");" << std::endl;
}
*/
*
*/
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;
}
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;
/*
*
*/
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;
}
*
*/
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
*
*/
std::string Transcriptor::Get(const std::string &box,
- const std::string &output)
+ const std::string &output)
{
m_Fp << "// ==> Get() called here" << std::endl;
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;
}
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);
/*
try
{
- ShowGraphTypes(nameblackbox);
+ ShowGraphTypes(nameblackbox);
}
catch (bbtk::Exception a)
{
- std::cout <<"EXC"<<std::endl;
- page = ShowGraphInstances(nameblackbox,detail,level,system_display);
+ std::cout <<"EXC"<<std::endl;
+ page = ShowGraphInstances(nameblackbox,detail,level,system_display);
}
*/
return page;
/// Generate a png file with the actual pipeline (Graphviz-dot needed)
std::string Transcriptor::ShowGraphInstances(const std::string &nameblackbox, int detail, int level,
- bool system_display)
+ bool system_display)
{
BlackBox* blackbox=NULL;
if (nameblackbox==".")
{
- blackbox=Current()->GetPrototype();
+ blackbox=Current()->GetPrototype();
}
else
{
- blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox);
+ blackbox = Current()->GetPrototype()->bbFindBlackBox(nameblackbox);
}
std::string page;
}
blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false );
- s << "</body></html>\n";
+ s << "</body></html>\n";
}
s.close();