Program: bbtk
Module: $RCSfile: bbtkExecuter.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:13 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2009/03/30 15:22:51 $
+ Version: $Revision: 1.29 $
=========================================================================*/
/* ---------------------------------------------------------------------
#include "bbtkUtilities.h"
#include <fstream>
-#ifdef _USE_WXWIDGETS_
+#ifdef USE_WXWIDGETS
#include <wx/textdlg.h>
#endif
mRootPackage(),
mRootCBB(),
mNoExecMode(false),
- mDialogMode(NoDialog)
+ mDialogMode(NoDialog),
+ mNoErrorMode(false)
{
bbtkDebugMessageInc("Kernel",9,"Executer::Executer()" <<std::endl);
mFactory = Factory::New();
// Create user package
Package::Pointer p =
- Package::New("user","internal",
- "User defined black boxes",
- "",
- BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
+ Package::New("user","internal","User defined black boxes","");
// Insert the user package in the factory
GetFactory()->InsertPackage(p);
// And in the list of open packages
}
//=======================================================================
+
//=======================================================================
/// changes the workspace name
void Executer::SetWorkspaceName( const std::string& n )
}
catch (Exception e)
{
- p = Package::New(name,
- "",
- "",
- "",
- BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
+ p = Package::New(name,"","","");
GetFactory()->InsertPackage(p);
}
mOpenPackage.push_back(p);
}
//=======================================================================
+ //=======================================================================
+ void Executer::Clear()
+ {
+ bbtkDebugMessageInc("Kernel",9,"Executer::Clear()" <<std::endl);
+ GetCurrentDescriptor()->GetPrototype()->Clear();
+
+ }
+ //=======================================================================
+
//=======================================================================
void Executer::EndDefine ()
{
}
catch (Exception e)
{
- p = Package::New(pname,
- "",
- "",
- "",
- BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
+ p = Package::New(pname,"","","");
GetFactory()->InsertPackage(p);
}
}
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)
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<bbtk::thing>) )&&
+ ( b->bbGetInputType(input) != typeid(std::string) ) )
{
BlackBox::Pointer a =
GetFactory()->NewAdaptor(typeid(std::string),
{
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
{
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
{
page = ShowGraphInstances(nameblackbox,detail,level,system_display);
}
*/
- return page;
+ return pack_index;
}
//=======================================================================
} else {
s << "<center>" << blackbox->bbGetName()<< "</center>";
}
-
blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false );
s << "</body></html>\n";
}