anOutPort->PortDone( true ) ;
//JR 21.02.2005 Debug Memory leak : CORBA::Any * anAny = new CORBA::Any() ;
CORBA::Any anAny = CORBA::Any() ;
-//JR 21.02.2005 Debug Memory leak : *anAny <<= (long ) 1 ;
- anAny <<= (long ) 1 ;
+//JR 21.02.2005 Debug Memory leak : *anAny <<= (CORBA::Long ) 1 ;
+ anAny <<= (CORBA::Long ) 1 ;
anOutPort->SetValue( anAny ) ;
_InitLoop = true ;
cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus()
}
bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
+ //JR Look at DataFlowExecutor for the meaning of WithErr
cdebug_in << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " WithErr " << WithErr
<< " PyFuncRunned() " << PyFuncRunned() << endl;
bool Err = false ;
PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
InLineNode()->PythonFunction() ,
OneErr ) ;
- InLineNode()->PyRunMethod( PyRunMethod ) ;
+ // JR Debug : if we must have a python function and if we have not : error
+ if ( PyRunMethod ) {
+ InLineNode()->PyRunMethod( PyRunMethod ) ;
+ }
+ else if ( WithErr && strlen( InLineNode()->PyFuncName() ) ) {
+ OneErr = true ;
+ }
}
Err = Err || OneErr ;
if ( OneErr && WithErr ) {
PyMoreMethod = InitPyDynInvoke( LoopNode()->PyMoreName() ,
LoopNode()->MorePythonFunction() ,
OneErr ) ;
- LoopNode()->PyMoreMethod( PyMoreMethod ) ;
+ // JR Debug : if we must have a python function and if we have not : error
+ if ( PyMoreMethod ) {
+ LoopNode()->PyMoreMethod( PyMoreMethod ) ;
+ }
+ else if ( WithErr && strlen( LoopNode()->PyMoreName() ) ) {
+ OneErr = true ;
+ }
}
Err = Err || OneErr ;
if ( OneErr && WithErr ) {
PyNextMethod = InitPyDynInvoke( LoopNode()->PyNextName() ,
LoopNode()->NextPythonFunction() ,
OneErr ) ;
- LoopNode()->PyNextMethod( PyNextMethod ) ;
+ // JR Debug : if we must have a python function and if we have not : error
+ if ( PyNextMethod ) {
+ LoopNode()->PyNextMethod( PyNextMethod ) ;
+ }
+ else if ( WithErr && strlen( LoopNode()->PyNextName() ) ) {
+ OneErr = true ;
+ }
}
Err = Err || OneErr ;
if ( OneErr && WithErr ) {
string( Name() ) ;
_OutNode->Graph()->SetMessages( anErrorMessage ) ;
}
+ //JR Debug 12854
+ if ( Err ) {
+ PyFuncRunned( false ) ;
+ }
cdebug << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " PyRunMethod(Init) "
<< PyRunMethod << " PyMoreMethod " << PyMoreMethod << " PyNextMethod " << PyNextMethod
<< endl;
PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
InLineNode()->PythonFunction() ,
OneErr ) ;
- InLineNode()->PyRunMethod( PyRunMethod ) ;
+ // JR Debug : if we must have a python function and if we have not : error
+ if ( PyRunMethod != NULL ) {
+ InLineNode()->PyRunMethod( PyRunMethod ) ;
+ }
+ else if ( WithErr && strlen( InLineNode()->PyFuncName() ) ) {
+ OneErr = true ;
+ }
}
Err = Err || OneErr ;
if ( OneErr && WithErr ) {
PyRunMethod = InitPyDynInvoke( InLineNode()->PyFuncName() ,
InLineNode()->PythonFunction() ,
OneErr ) ;
- InLineNode()->PyRunMethod( PyRunMethod ) ;
+ // JR Debug : if we must have a python function and if we have not : error
+ if ( PyRunMethod != NULL ) {
+ InLineNode()->PyRunMethod( PyRunMethod ) ;
+ }
+ else if ( WithErr && strlen( InLineNode()->PyFuncName() ) ) {
+ OneErr = true ;
+ }
}
Err = Err || OneErr ;
if ( OneErr && WithErr ) {
cdebug << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " PyRunMethod " << PyRunMethod << endl;
}
}
- Err = WithErr && Err ;
+ //JR Look at DataFlowExecutor :
+ // Err = WithErr && Err ;
cdebug_out << "GraphExecutor::InNode::InitPythonFunctions " << Name() ;
- if ( Err ) {
- cdebug << " Error " << Err ;
+ if ( WithErr && Err ) {
+ cdebug << " Error " << WithErr && Err ;
}
cdebug << endl;
return !Err ;
cpu = Component()->CpuUsed_impl() ;
}
catch ( ... ) {
- cdebug << "CpuUsed " << Name() << " --> Component()->CpuUsed_impl() ERROR catched "
- << endl ;
- State( GraphExecutor::ErroredState ) ;
- _OutNode->State( GraphExecutor::ErroredState ) ;
+ if ( _OutNode->IsDone() ) {
+ cdebug << "CpuUsed " << Name() << " --> Component()->CpuUsed_impl() WARNING catched Graph is done "
+ << Automaton()->StateName( _OutNode->State() ) << endl ;
+ }
+ else {
+ cdebug << "CpuUsed " << Name() << " --> Component()->CpuUsed_impl() WARNING catched "
+ << Automaton()->StateName( _OutNode->State() ) << endl ;
+//JR NPAL14110 09.02.2007 : If there is a shutdown of components ===> NodeState must not
+// be aborted ... ==> Commented :
+ //JRState( GraphExecutor::ErroredState ) ;
+ //JR_OutNode->State( GraphExecutor::ErroredState ) ;
+ }
cpu = -1 ;
}
}