SUBDIRS(bbCreateBlackBox)
SUBDIRS(bbed)
+
+SUBDIRS(bbhelp)
Program: bbtk
Module: $RCSfile: bbtkAtomicBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/02/07 11:06:37 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2008/03/20 15:27:56 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
: BlackBox(name)
{
bbtkDebugMessageInc("Kernel",7,
- "AtomicBlackBox::AtomicBlackBox(\""
- <<name<<"\")"<<std::endl);
+ "AtomicBlackBox::AtomicBlackBox(\""
+ <<name<<"\")"<<std::endl);
bbtkDebugDecTab("Kernel",7);
}
//=========================================================================
//=========================================================================
/// Constructor from an existing box (copy) with a new name
AtomicBlackBox::AtomicBlackBox(AtomicBlackBox& from,
- const std::string &name,
- bool alloc)
+ const std::string &name,
+ bool alloc)
: BlackBox(from,name)
{
bbtkDebugMessageInc("Kernel",7,
- "AtomicBlackBox::AtomicBlackBox("
- <<from.bbGetFullName()<<",\""
- <<name<<"\")"<<std::endl);
+ "AtomicBlackBox::AtomicBlackBox("
+ <<from.bbGetFullName()<<",\""
+ <<name<<"\")"<<std::endl);
bbtkDebugDecTab("Kernel",7);
}
AtomicBlackBox::~AtomicBlackBox()
{
bbtkDebugMessage("Kernel",7,"AtomicBlackBox::~AtomicBlackBox()"
- <<std::endl);
+ <<std::endl);
}
//=========================================================================
IOStatus AtomicBlackBox::bbBackwardUpdate( Connection* caller )
{
bbtkDebugMessageInc("Process",1,
- "=> AtomicBlackBox::bbBackwardUpdate() ["
- <<bbGetFullName()<<"]"<<std::endl);
+ "=> AtomicBlackBox::bbBackwardUpdate() ["
+ <<bbGetFullName()<<"]"<<std::endl);
- bbtkDebugMessage("Process",5,"Initial Status = "<<bbGetStatus()<<std::endl);
- bbtkDebugMessage("Process",5,"BoxProcessMode = "<<bbGetInputBoxProcessMode()<<std::endl);
+ bbtkDebugMessage("Process",5,"Initial Status = "<<bbGetStatus()
+ <<std::endl);
+ bbtkDebugMessage("Process",5,"BoxProcessMode = "
+ <<bbGetInputBoxProcessMode()<<std::endl);
/*
if ( bbGetStatus() == UPDATING )
{
- bbtkMessage("Warning",1,"!! WARNING !! Cyclic pipeline execution (bbBackwardUpdate ["<<bbGetFullName()<<"] reentered). This may indicate an error in pipeline conception"<<std::endl);
- // return UPTODATE;
- bbSetStatus(MODIFIED);
+ bbtkMessage("Warning",1,"!! WARNING !! Cyclic pipeline execution (bbBackwardUpdate ["<<bbGetFullName()<<"] reentered). This may indicate an error in pipeline conception"<<std::endl);
+ // return UPTODATE;
+ bbSetStatus(MODIFIED);
}
*/
if ( ( bbGetStatus() == MODIFIED ) ||
- ( bbBoxProcessModeIsAlways() ) )
+ ( bbBoxProcessModeIsAlways() ) )
{
- bool wasExecuting = bbGlobalGetSomeBoxExecuting();
- bbGlobalSetSomeBoxExecuting(true);
+ bool wasExecuting = bbGlobalGetSomeBoxExecuting();
+ bbGlobalSetSomeBoxExecuting(true);
- // bbSetStatus(UPDATING);
-
- // Updates its inputs
- IOStatus s = bbUpdateInputs();
-
- bbtkDebugMessage("Process",6,"Inputs post-update status = "<<s<<std::endl);
- // If all inputs are in UPTODATE post-update status
- // and mProcessMode is not "Always"
- // then the box is now UPTODATE
- if ( ( s == UPTODATE ) &&
- ( ! bbBoxProcessModeIsAlways() ) )
- {
- bbSetStatus(UPTODATE);
- }
- else
- {
- // else it remains MODIFIED
- bbSetStatus(MODIFIED);
- }
-
- // Creates the window (WxBlackbox)
- // bbCreateWindow();
-
- // Children update (WxContainerBlackBox)
- // bbUpdateChildren(caller);
-
- // User process
- bbProcess();
-
- // Displays the window (WxBlackbox)
- bbShowWindow(caller);
-
-
-
- bbGlobalSetSomeBoxExecuting(wasExecuting);
+ // bbSetStatus(UPDATING);
+ // Updates its inputs
+ IOStatus s = bbUpdateInputs();
+
+ bbtkDebugMessage("Process",6,"Inputs post-update status = "<<s<<std::endl);
+ // If all inputs are in UPTODATE post-update status
+ // and mProcessMode is not "Always"
+ // then the box is now UPTODATE
+ if ( ( s == UPTODATE ) &&
+ ( ! bbBoxProcessModeIsAlways() ) )
+ {
+ bbSetStatus(UPTODATE);
+ }
+ else
+ {
+ // else it remains MODIFIED
+ bbSetStatus(MODIFIED);
+ }
+
+ // User process
+ bbProcess();
+
+ // Displays the window (WxBlackbox)
+ bbShowWindow(caller);
+
+ bbGlobalSetSomeBoxExecuting(wasExecuting);
}
else
{
- bbtkDebugMessage("Process",5,"Up-to-date : nothing to do"<<std::endl);
+ bbtkDebugMessage("Process",5,"Up-to-date : nothing to do"<<std::endl);
}
bbtkDebugMessage("Process",5,"Final Status = "
- <<bbGetStatus()<<std::endl);
+ <<bbGetStatus()<<std::endl);
bbtkDebugMessage("Process",1,
- "<= AtomicBlackBox::bbBackwardUpdate() ["
- <<bbGetFullName()<<"]"<<std::endl);
+ "<= AtomicBlackBox::bbBackwardUpdate() ["
+ <<bbGetFullName()<<"]"<<std::endl);
bbtkDebugDecTab("Process",1);
return bbGetStatus();
Data AtomicBlackBox::bbGetOutput( const std::string &name )
{
bbtkDebugMessageInc("Data",7,
- "AtomicBlackBox::bbGetOutput(\""<<name<<"\") ["
- <<bbGetFullName()<<"]"
- <<std::endl);
+ "AtomicBlackBox::bbGetOutput(\""<<name<<"\") ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
- Data p = ((AtomicBlackBoxOutputDescriptor*)bbGetDescriptor()->GetOutputDescriptor(name))->GetGetFunctor()->Get(this);
+ Data p = ((AtomicBlackBoxOutputDescriptor*)bbGetDescriptor()
+ ->GetOutputDescriptor(name))->GetGetFunctor()->Get(this);
bbtkDebugDecTab("Data",7);
return p;
Data AtomicBlackBox::bbGetInput( const std::string &name )
{
bbtkDebugMessageInc("Data",7,
- "AtomicBlackBox::bbGetInput(\""<<name<<"\") ["
- <<bbGetFullName()<<"]"
- <<std::endl);
+ "AtomicBlackBox::bbGetInput(\""<<name<<"\") ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
- Data p = ((AtomicBlackBoxInputDescriptor*)bbGetDescriptor()->GetInputDescriptor(name))->GetGetFunctor()->Get(this);
+ Data p = ((AtomicBlackBoxInputDescriptor*)bbGetDescriptor()
+ ->GetInputDescriptor(name))->GetGetFunctor()->Get(this);
bbtkDebugDecTab("Data",7);
return p;
void AtomicBlackBox::bbSetOutput( const std::string &name, Data data)
{
bbtkDebugMessageInc("Data",7,
- "AtomicBlackBox::bbSetOutput(\""<<name<<"\",data) ["
- <<bbGetFullName()<<"]"
- <<std::endl);
+ "AtomicBlackBox::bbSetOutput(\""<<name<<"\",data) ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
- ((AtomicBlackBoxOutputDescriptor*)bbGetDescriptor()->GetOutputDescriptor(name))->GetSetFunctor()->Set(this,data);
+ ((AtomicBlackBoxOutputDescriptor*)bbGetDescriptor()
+ ->GetOutputDescriptor(name))->GetSetFunctor()->Set(this,data);
bbtkDebugDecTab("Data",7);
}
//=========================================================================
/// Sets the data of the input called <name>
- void AtomicBlackBox::bbSetInput( const std::string &name, Data data,
- bool setModified )
+ void AtomicBlackBox::bbSetInput(
+ const std::string &name,
+ Data data,
+ bool setModified )
{
bbtkDebugMessageInc("Data",7,
- "AtomicBlackBox::bbSetInput(\""<<name<<"\",data) ["
- <<bbGetFullName()<<"]"
- <<std::endl);
+ "AtomicBlackBox::bbSetInput(\""<<name<<"\",data) ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
((AtomicBlackBoxInputDescriptor*)bbGetDescriptor()->GetInputDescriptor(name))->GetSetFunctor()->Set(this,data);
if (setModified)
- {
- bbSetModifiedStatus();
- }
+ {
+ bbSetModifiedStatus();
+ }
bbtkDebugDecTab("Data",7);
}
//=========================================================================
/// Sets the data of the input called <name>
- void AtomicBlackBox::bbBruteForceSetInputPointer( const std::string &name,
- void* data,
- bool setModified )
+ void AtomicBlackBox::bbBruteForceSetInputPointer
+ (
+ const std::string &name,
+ void* data,
+ bool setModified
+ )
{
bbtkDebugMessageInc("Data",7,
- "AtomicBlackBox::bbBruteForceSetInputPointer(\""
- <<name<<"\",data) ["
- <<bbGetFullName()<<"]"
- <<std::endl);
- ((AtomicBlackBoxInputDescriptor*)bbGetDescriptor()->GetInputDescriptor(name))->GetSetFunctor()->BruteForceSetPointer(this,data);
+ "AtomicBlackBox::bbBruteForceSetInputPointer(\""
+ <<name<<"\",data) ["
+ <<bbGetFullName()<<"]"
+ <<std::endl);
+ ((AtomicBlackBoxInputDescriptor*)bbGetDescriptor()
+ ->GetInputDescriptor(name))->GetSetFunctor()
+ ->BruteForceSetPointer(this,data);
if (setModified)
{
- bbSetModifiedStatus();
+ bbSetModifiedStatus();
}
bbtkDebugDecTab("Data",7);
Program: bbtk
Module: $RCSfile: bbtkInterpreter.cxx,v $ $
Language: C++
- Date: $Date: 2008/03/20 11:04:57 $
- Version: $Revision: 1.49 $
+ Date: $Date: 2008/03/20 15:27:56 $
+ Version: $Revision: 1.50 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Interpreter::Interpreter()
:
mUser(0),
- mCommandLine(false)
+ mCommandLine(false),
+ mThrow(false)
{
bufferNb =0;
bbtk::MessageManager::RegisterMessageType("Echo","Level>0 : Prints the 'echo' commands of the user.\n\tLevel>1 : Prints the command being interpreted",1);
ExitStatus status = OK;
+
try
{
SwitchToFile(filename);
catch (QuitException e)
{
status = QUIT;
+ if (mThrow) throw QuitException();
}
catch (bbtk::Exception e)
{
- std::cerr << "* ERROR : "<<e.GetMessage()<<std::endl;
+ std::stringstream mess;
+ mess << "* ERROR : "<<e.GetMessage()<<std::endl;
if (mFileName.size()) {
- std::cerr << "* FILE : \""<<mFileName.back()<<"\""<<std::endl;
- std::cerr << "* LINE : "<<mLine.back()<<std::endl;
+ mess << "* FILE : \""<<mFileName.back()<<"\""<<std::endl;
+ mess << "* LINE : "<<mLine.back()<<std::endl;
}
status = ERROR;
+ if (mThrow)
+ throw bbtk::Exception("Interpreter","",mess.str());
+ else
+ std::cerr << mess;
+
}
catch (std::exception& e)
{
- std::cerr << "* ERROR : "<<e.what()<<" (not in bbtk)"<<std::endl;
+ std::stringstream mess;
+ mess << "* ERROR : "<<e.what()<<" (not in bbtk)"<<std::endl;
if (mFileName.size()) {
- std::cerr << "* FILE : \""<<mFileName.back()<<"\""<<std::endl;
- std::cerr << "* LINE : "<<mLine.back()<<std::endl;
+ mess << "* FILE : \""<<mFileName.back()<<"\""<<std::endl;
+ mess << "* LINE : "<<mLine.back()<<std::endl;
}
status = ERROR;
+ if (mThrow)
+ throw bbtk::Exception("Interpreter","",mess.str());
+ else
+ std::cerr << mess;
}
catch (...)
- {
- std::cerr << "* UNDEFINED ERROR (not a bbtk nor a std exception)"<<std::endl;
- if (mFileName.size()) {
- std::cerr << "* FILE : \""<<mFileName.back()<<"\""<<std::endl;
- std::cerr << "* LINE : "<<mLine.back()<<std::endl;
- }
- status = ERROR;
- }
-
+ {
+ std::stringstream mess;
+ mess << "* UNDEFINED ERROR (not a bbtk nor a std exception)"
+ <<std::endl;
+ if (mFileName.size()) {
+ mess << "* FILE : \""<<mFileName.back()<<"\""<<std::endl;
+ mess << "* LINE : "<<mLine.back()<<std::endl;
+ }
+ status = ERROR;
+ if (mThrow)
+ throw bbtk::Exception("Interpreter","",mess.str());
+ else
+ std::cerr << mess;
+ }
+
CloseAllFiles();
bbtkDebugMessage("Interpreter",9,"EO Interpreter::InterpretFile(\""<<filename<<"\")"<<std::endl);
bbtkDecTab("Interpreter",9);
Program: bbtk
Module: $RCSfile: bbtkInterpreter.h,v $ $
Language: C++
- Date: $Date: 2008/03/20 09:51:28 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2008/03/20 15:27:56 $
+ Version: $Revision: 1.18 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// Sets the bool that indicates wether we are in command line context
void SetCommandLine(bool v = true) { mCommandLine = v; }
+ void SetThrow(bool b) { mThrow = b; }
+
#ifdef _USE_WXWIDGETS_
/// Sets the user of the interpreter (if any)
std::deque< char* > mHistory;
int bufferNb;
+
+ bool mThrow;
+
};
// EO class Interpreter
// The "Quit" exception
struct QuitException : public bbtk::Exception
{
- QuitException() : bbtk::Exception("","","") {}
+ QuitException() : bbtk::Exception("Interpreter","","Quit") {}
};
}
Program: bbtk
Module: $RCSfile: bbtkWxGUICommand.cxx,v $
Language: C++
- Date: $Date: 2008/03/20 11:04:57 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/03/20 15:27:56 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
sizerCommand->Add(mwxTextCommand,1,wxGROW);
sizerCommand->Add(btnGo);
- sizer->Add(sizerCommand,0,wxLEFT | wxRIGHT | wxBOTTOM | wxGROW, 10 );
+ sizer->Add(sizerCommand,0,wxGROW);
wxBoxSizer *btnsSizer = new wxBoxSizer(wxHORIZONTAL);
btnsSizer->Add( btnGraphD );
btnsSizer->Add( btnHelp );
- sizer->Add(btnsSizer,0,wxLEFT | wxRIGHT | wxBOTTOM | wxGROW, 10 );
+ sizer->Add(btnsSizer,0,wxTOP|wxGROW, 10 );
SetSizer(sizer);
Program: bbtk
Module: $RCSfile: bbtkWxGUIConsole.cxx,v $
Language: C++
- Date: $Date: 2008/03/20 11:04:57 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/03/20 15:27:57 $
+ Version: $Revision: 1.3 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
wxSize(200,0));
// mWxGUIHtmlBrowser->SetSize(wxSize(800,1000));
- helpsizer->Add (mWxGUIHtmlBrowser,1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM );
+ helpsizer->Add (mWxGUIHtmlBrowser,1, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5 );
// helpsizer->Add ( new wxButton(mwxPageHelp,-1,"perro"), 0, wxEXPAND );
wxBitmap bmp_run(cc_run_xpm);
mwxButtonRun = new wxBitmapButton( mwxPageHelp,ID_Button_Run,bmp_run);//_T("Run") );
- helpsizer->Add( mwxButtonRun );
+ helpsizer->Add( mwxButtonRun, 0, wxALL, 5 );
//==============
mWxGUICommand->SetFocus();
- cmdsizer->Add (mWxGUIOutputMessages, 1, wxALL | wxGROW, 10);
- cmdsizer->Add (mWxGUICommand, 1, wxALL | wxGROW, 10);
+ cmdsizer->Add (mWxGUIOutputMessages, 1, wxALL | wxGROW, 5);
+ cmdsizer->Add (mWxGUICommand, 0, wxALL | wxGROW, 5);
// Creates and sets the parent window of all bbtk windows
Program: bbtk
Module: $RCSfile: bbtkWxGUIHtmlBrowser.cxx,v $
Language: C++
- Date: $Date: 2008/03/20 09:51:29 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2008/03/20 15:27:57 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
mwxBackButton = new wxButton( panel, bwd_id,_T("<"),wxDefaultPosition,
wxDefaultSize,wxBU_EXACTFIT);
- bsizer->Add ( mwxBackButton , 0, wxALIGN_CENTRE | wxLEFT | wxTOP | wxBOTTOM , 10 );
+ bsizer->Add ( mwxBackButton , 0, wxALIGN_CENTRE );
mwxForwardButton = new wxButton( panel, fwd_id,_T(">"),wxDefaultPosition,
wxDefaultSize,wxBU_EXACTFIT);
- bsizer->Add ( mwxForwardButton , 0, wxALIGN_CENTRE | wxTOP | wxBOTTOM , 10);
+ bsizer->Add ( mwxForwardButton , 0, wxALIGN_CENTRE );
mwxHomeButton = new wxButton( panel, home_id,_T("Home"),wxDefaultPosition,
wxDefaultSize,wxBU_EXACTFIT);
- bsizer->Add ( mwxHomeButton , 0, wxALIGN_CENTRE | wxLEFT | wxTOP | wxBOTTOM , 10 );
+ bsizer->Add ( mwxHomeButton , 0, wxALIGN_CENTRE );
mwxReloadButton = new wxButton( panel, reload_id,_T("Reload"),wxDefaultPosition,
wxDefaultSize,wxBU_EXACTFIT);
- bsizer->Add ( mwxReloadButton , 0, wxALIGN_CENTRE | wxTOP | wxBOTTOM , 10 );
+ bsizer->Add ( mwxReloadButton , 0, wxALIGN_CENTRE );
/*
mwxIncludeFileButton = new wxButton( panel, include_id,
wxDefaultSize,
wxTE_PROCESS_ENTER);
mwxURL->SetLabel(_T("URL"));
- bsizer->Add(mwxURL, 1, wxEXPAND | wxALL, 10);
+ bsizer->Add(mwxURL, 1, wxEXPAND);
// mwxHtmlWindow = new WxHtmlWindow(parent,html_id,this,size);
Program: bbtk
Module: $RCSfile: bbtkWxGUIOutputMessages.cxx,v $
Language: C++
- Date: $Date: 2008/03/20 09:51:29 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2008/03/20 15:27:57 $
+ Version: $Revision: 1.2 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
mwxOutputTextAttr = new wxTextAttr;
mwxOutputTextAttr->SetFont(*FixedFont);
- sizer->Add ( mwxOutputText, 1, wxALL | wxGROW, 10);
+ sizer->Add ( mwxOutputText, 1, wxGROW);
// Redirection of std::cout to mwxTextHistory and printf
mRedirect_cout =