Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
-Date: $Date: 2008/04/23 14:49:27 $
-Version: $Revision: 1.15 $
+Date: $Date: 2008/06/19 09:46:41 $
+Version: $Revision: 1.21 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""<<name<<"\") : deleting black box"<<std::endl);
b->bbDelete();
-
+
bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""<<name<<"\") : releasing descriptor ["<<desc.lock()<<"]"<<std::endl);
if (!desc.expired())
}
//=========================================================================
+ //=========================================================================
+ BlackBox::BlackBox(const BlackBox&)
+ {}
//=========================================================================
BlackBox::BlackBox(BlackBox& from, const std::string &name)
/// Main processing method of the box.
void BlackBox::bbExecute(bool force)
{
- bbtkDebugMessageInc("Process",1,
+ bbtkDebugMessageInc("process",2,
"=> BlackBox::bbExecute() ["
<<bbGetFullName()<<"]"<<std::endl);
- Wx::BeginBusyCursor();
+ wxBusyCursor wait;
+ //EED Wx::BeginBusyCursor();
// If execution frozen : return
if (bbGlobalGetFreezeExecution())
{
- bbtkDebugMessage("Process",1,
+ bbtkDebugMessage("process",2,
" -> FreezeExecution global flag is 'true' : abort execution"<<std::endl);
}
// Calls the main recursive update method
bbBackwardUpdate(Connection::Pointer());
- Wx::EndBusyCursor();
+ //EED Wx::EndBusyCursor();
- bbtkDebugMessageDec("Process",1,
+ bbtkDebugMessageDec("process",2,
"<= BlackBox::bbExecute() ["
<<bbGetFullName()<<"]"<<std::endl);
}
/// User overloadable destruction method of a black box
void BlackBox::bbUserDelete()
{
- bbtkDebugMessage("Process",5,
+ bbtkDebugMessage("process",5,
"=> BlackBox::bbUserDelete() ["
<<bbGetFullName()<<"]"
<<" : not overloaded; using standard deletion"
this->bbSetStatus(MODIFIED);
return;
}
+ if ( (c==bbGetInputConnectorMap().find("WinClose")->second) )
+ // && (bbCanReact()))
+ {
+ bbtkDebugMessage("modified",2,
+ "-> Close triggered by WinClose input change"
+ <<std::endl);
+ this->bbHideWindow();
+ this->bbSetStatus(MODIFIED);
+ return;
+ }
if ( ( bbBoxProcessModeIsReactive() ||
(c==bbGetInputConnectorMap().find("BoxExecute")->second))
this->bbSignalOutputModification(false);
/*
- bbtkDebugMessageDec("Process",5,
+ bbtkDebugMessageDec("process",5,
"<= BlackBox::bbSetModifiedStatus("<<c<<") ["
<<bbGetFullName()<<"]"<<std::endl);
*/
//=========================================================================
void BlackBox::bbSignalOutputModification(bool reaction)
{
- bbtkDebugMessageInc("Process",5,
+ bbtkDebugMessageInc("process",5,
"=> BlackBox::bbSignalOutputModification() ["
<<bbGetFullName()<<"]"<<std::endl);
if (reaction) bbGlobalProcessExecutionList();
- bbtkDebugMessageDec("Process",5,
+ bbtkDebugMessageDec("process",5,
"<= BlackBox::bbSignalOutputModification() ["
<<bbGetFullName()<<"]"<<std::endl);
void BlackBox::bbSignalOutputModification(const std::string& output,
bool reaction)
{
- bbtkDebugMessageInc("Process",5,
+ bbtkDebugMessageInc("process",5,
"=> BlackBox::bbSignalOutputModification("
<<output<<") ["
<<bbGetFullName()<<"]"<<std::endl);
}
if (reaction) bbGlobalProcessExecutionList();
- bbtkDebugMessageDec("Process",5,
+ bbtkDebugMessageDec("process",5,
"<= BlackBox::bbSignalOutputModification("
<<output<<") ["
<<bbGetFullName()<<"]"<<std::endl);
void BlackBox::bbSignalOutputModification(const std::vector<std::string>& output,
bool reaction)
{
- bbtkDebugMessageInc("Process",5,
+ bbtkDebugMessageInc("process",5,
"=> BlackBox::bbSignalOutputModification(vector of outputs) ["
<<bbGetFullName()<<"]"<<std::endl);
OutputConnectorMapType::iterator i;
}
if (reaction) bbGlobalProcessExecutionList();
- bbtkDebugMessageDec("Process",5,
+ bbtkDebugMessageDec("process",5,
"<= BlackBox::bbSignalOutputModification(vector of outputs) ["
<<bbGetFullName()<<"]"<<std::endl);
/// else MODIFIED
IOStatus BlackBox::bbUpdateInputs(bool excludeParent)
{
- bbtkDebugMessageInc("Process",4,
+ bbtkDebugMessageInc("process",4,
"=> BlackBox::bbUpdateInputs() ["
<<bbGetFullName()<<"]"
<<std::endl);
if (t==MODIFIED) s = MODIFIED;
}
- bbtkDebugMessageDec("Process",4,
+ bbtkDebugMessageDec("process",4,
"<= BlackBox::bbUpdateInputs() ["
<<bbGetFullName()<<"]"
<<std::endl);
//=========================================================================
void BlackBox::bbGlobalProcessExecutionList()
{
- bbtkDebugMessageInc("Process",1,
+ bbtkDebugMessageInc("process",3,
"=> BlackBox::bbGlobalProcessExecutionList()"
<<std::endl);
i!=bbmgExecutionList.end();
++i)
{
- bbtkDebugMessage("Process",2,
+ bbtkDebugMessage("process",4,
" -> Executing "<<(*i)->bbGetFullName()<<std::endl);
(*i)->bbExecute(true);
}
bbmgExecutionList.clear();
- bbtkDebugMessageDec("Process",1,
+ bbtkDebugMessageDec("process",3,
"<= BlackBox::bbGlobalProcessExecutionList()"
<<std::endl);
}
- //=========================================================================
- // Static members initialization
-/*EED
- bool BlackBox::bbmgSomeBoxExecuting = false;
- bool BlackBox::bbmgFreezeExecution = false;
- std::set<BlackBox*> BlackBox::bbmgExecutionList;
-*/
//=========================================================================
//=========================================================================
}
//=========================================================================
+ void BlackBox::bbUserOnShowWidget(std::string nameInput)
+ {
+ bbtk::BlackBoxInputConnector *cc;
+ cc = this->bbGetInputConnectorMap().find( nameInput.c_str() )->second;
+ if (cc->GetConnection()!=NULL)
+ {
+ cc->GetConnection()->GetBlackBoxFrom()->bbUserOnShow();
+ }
+ }
+
} // EO namespace bbtk