cdebug << " " << Name() << " " << anOutPort->PortName() << " " << anOutPort->PortType()
<< " " << anOutPort->Kind() << " " << anOutPort->PortStatus() << endl ;
if ( anOutPort->IsDataConnected() ) {
- aGraphOfMacroGraph->AddInputData( Name() , anInPort->PortName() , *(anOutPort->Value()) ) ;
+//JR 30.03.2005 aGraphOfMacroGraph->AddInputData( Name() , anInPort->PortName() , *(anOutPort->Value()) ) ;
+ aGraphOfMacroGraph->AddInputData( Name() , anInPort->PortName() , anOutPort->Value() ) ;
anOutPort->PortStatus( ExternConnected ) ;
}
}
bool GraphBase::ComputingNode::CheckLoop(GraphBase::LoopNode * aLoopNode ,
GraphBase::EndOfLoopNode * anEndLoopNode ) const {
- cdebug_in << Name() << "->GraphBase::ComputingNode::CheckLoop( " << aLoopNode->Name() << " , "
+ cdebug_in << Name() << "->ComputingNode::CheckLoop( " << aLoopNode->Name() << " , "
<< anEndLoopNode->Name() << ") LinkedNodesSize "
<< LinkedNodesSize() << endl;
int i ;
if ( LinkedNodesSize() == 0 && !IsDataFlowNode() && !IsDataStreamNode() ) {
- cdebug_out << Name() << "->GraphBase::ComputingNode::CheckLoop( " << aLoopNode->Name()
+ cdebug_out << Name() << "->ComputingNode::CheckLoop( " << aLoopNode->Name()
<< " , " << anEndLoopNode->Name() << ") LinkedNodesSize "
- << LinkedNodesSize() << " false" << endl;
+ << LinkedNodesSize() << " WARNING false" << endl;
return false ;
}
// We check that all nodes linked to that node go to the end of LoopNode :
cdebug << i << ". " << Name() << " Linked to " << aNode->Name() << endl ;
if ( !aNode->IsEndLoopNode() || aNode != anEndLoopNode ) {
if ( !aNode->CheckLoop( aLoopNode , anEndLoopNode ) ) {
- cdebug_out << Name() << "->GraphBase::ComputingNode::CheckLoop( " << aLoopNode->Name()
+ cdebug_out << Name() << "->ComputingNode::CheckLoop( " << aLoopNode->Name()
<< " , " << anEndLoopNode->Name() << ") LinkedNodesSize "
- << LinkedNodesSize() << " false" << endl;
+ << LinkedNodesSize() << " WARNING false" << endl;
return false ;
}
}
}
- cdebug_out << Name() << "->GraphBase::ComputingNode::CheckLoop( " << aLoopNode->Name() << " , "
+ cdebug_out << Name() << "->ComputingNode::CheckLoop( " << aLoopNode->Name() << " , "
<< anEndLoopNode->Name() << ") LinkedNodesSize "
<< LinkedNodesSize() << " true" << endl;
return true ;
bool GraphBase::ComputingNode::CheckEndLoop(GraphBase::LoopNode * aLoopNode ,
GraphBase::EndOfLoopNode * anEndLoopNode ) const {
- cdebug_in << Name() << "->GraphBase::ComputingNode::CheckEndLoop( " << aLoopNode->Name() << " , "
+ cdebug_in << Name() << "->ComputingNode::CheckEndLoop( " << aLoopNode->Name() << " , "
<< anEndLoopNode->Name() << ") LinkedFromNodesSize "
<< LinkedFromNodesSize() << endl;
int i ;
if ( LinkedFromNodesSize() == 0 ) {
- cdebug_out << Name() << "->GraphBase::ComputingNode::CheckEndLoop( " << aLoopNode->Name()
+ cdebug_out << Name() << "->ComputingNode::CheckEndLoop( " << aLoopNode->Name()
<< " , " << anEndLoopNode->Name() << ") LinkedFromNodesSize "
- << LinkedFromNodesSize() << " false" << endl;
+ << LinkedFromNodesSize() << " WARNING false" << endl;
return false ;
}
// We have to check that all nodes linked from that node go to the beginning of LoopNode :
cdebug << i << ". " << Name() << " Linked from " << aNode->Name() << endl ;
if ( !aNode->IsLoopNode() || aNode != aLoopNode ) {
if ( !aNode->CheckEndLoop( aLoopNode , anEndLoopNode ) ) {
- cdebug_out << Name() << "->GraphBase::ComputingNode::CheckEndLoop( " << aLoopNode->Name()
+ cdebug_out << Name() << "->ComputingNode::CheckEndLoop( " << aLoopNode->Name()
<< " , " << anEndLoopNode->Name() << ") LinkedFromNodesSize "
- << LinkedFromNodesSize() << " false" << endl;
+ << LinkedFromNodesSize() << " WARNING false" << endl;
return false ;
}
}
}
- cdebug_out << Name() << "->GraphBase::ComputingNode::CheckEndLoop( " << aLoopNode->Name() << " , "
+ cdebug_out << Name() << "->ComputingNode::CheckEndLoop( " << aLoopNode->Name() << " , "
<< anEndLoopNode->Name() << ") LinkedFromNodesSize "
<< LinkedFromNodesSize() << " true" << endl;
return true ;
}
+bool GraphBase::ComputingNode::InitBranchOfSwitchDone(bool AllInit ,
+ GraphBase::EndOfSwitchNode * anEndSwitchNode ) {
+ bool sts = BranchOfSwitchDone( false ) ;
+ if ( !sts && !AllInit && anEndSwitchNode != this ) {
+// Common Node in branchs :
+ cdebug << Name() << "->ComputingNode::InitBranchOfSwitchDone WARNING false"
+ << endl ;
+ return false ;
+ }
+ int i ;
+ if ( !IsGOTONode() && anEndSwitchNode != this ) {
+ for ( i = 0 ; i < LinkedNodesSize() ; i++ ) {
+ GraphBase::ComputingNode * aNode ;
+ aNode = (GraphBase::ComputingNode * ) LinkedNodes( i ) ;
+ if ( !aNode->InitBranchOfSwitchDone( AllInit , anEndSwitchNode ) ) {
+ return false ;
+ }
+ }
+ }
+ return true ;
+}
+
+bool GraphBase::ComputingNode::CheckSwitch(GraphBase::EndOfSwitchNode * anEndSwitchNode ) {
+ cdebug_in << Name() << "->ComputingNode::CheckSwitch( "
+ << anEndSwitchNode->Name() << " ) " << Kind() << endl;
+ if ( anEndSwitchNode == this ) {
+ }
+// if it is a SwitchNode, continue the check at the corresponding EndSwitchNode
+ else if ( IsSwitchNode() ) {
+ GraphBase::EndOfSwitchNode * anOtherEndSwitchNode ;
+ anOtherEndSwitchNode = (GraphBase::EndOfSwitchNode * ) ((GraphBase::SwitchNode * ) this)->CoupledNode() ;
+ cdebug << Name() << "->ComputingNode::CheckSwitch will Check "
+ << anOtherEndSwitchNode->Name() << endl ;
+ if ( !anOtherEndSwitchNode->CheckSwitch( anEndSwitchNode ) ) {
+ cdebug_out << Name() << "->ComputingNode::CheckSwitch "
+ << anOtherEndSwitchNode->Name() << " WARNING false" << endl;
+ return false ;
+ }
+ }
+ else {
+ int i ;
+ for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
+ GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i ) ;
+ if ( !anOutPort->IsDataStream() ) {
+ int j ;
+ for ( j = 0 ; j < anOutPort->InPortsSize() ; j++ ) {
+ GraphBase::InPort * anInPort = anOutPort->ChangeInPorts( j ) ;
+ if ( !anInPort->IsDataStream() ) {
+ GraphBase::ComputingNode * aNode ;
+ aNode = GraphOfNode()->GetChangeGraphNode( anInPort->NodeName() ) ;
+ GraphBase::LoopNode * aLoopNode = NULL ;
+ GraphBase::EndOfLoopNode * aEndLoopNode = NULL ;
+ if ( IsLoopNode() ) {
+ aEndLoopNode = (GraphBase::EndOfLoopNode * ) ((GraphBase::LoopNode * ) this)->CoupledNode() ;
+ cdebug << Name() << "->ComputingNode::CheckSwitch LoopNode " << Name() << " coupled to "
+ << aEndLoopNode << " " << aEndLoopNode->Name() << " aNode " << aNode << endl ;
+ }
+ else if ( IsEndLoopNode() ) {
+ aLoopNode = (GraphBase::LoopNode * ) ((GraphBase::EndOfLoopNode * ) this)->CoupledNode() ;
+ cdebug << Name() << "->ComputingNode::CheckSwitch EndLoopNode " << Name()
+ << " coupled to "
+ << aLoopNode << " " << aLoopNode->Name() << " aNode " << aNode << endl ;
+ }
+ if ( aNode == NULL ) {
+ cdebug << Name() << "->ComputingNode::CheckSwitch ignore "
+ << anInPort->NodeName() << "( " << anInPort->PortName() << " )" << endl ;
+ }
+ else if ( aNode == anEndSwitchNode ) {
+ ((GraphBase::EndOfSwitchNode * ) aNode)->DecrEndSwitchInPortLinked( anInPort ) ;
+ }
+ else if ( aNode->BranchOfSwitchDone() ) {
+ cdebug << Name() << "->ComputingNode::CheckSwitch will NOT Check "
+ << anInPort->NodeName() << "( " << anInPort->PortName() << " ) : already checked"
+ << endl ;
+ }
+ else if ( IsLoopNode() && aNode == aEndLoopNode ) {
+ cdebug << Name() << "->ComputingNode::CheckSwitch will NOT Check "
+ << anInPort->NodeName() << "( " << anInPort->PortName() << " )" << endl ;
+ }
+ else if ( IsEndLoopNode() && aNode == aLoopNode ) {
+ cdebug << Name() << "->ComputingNode::CheckSwitch will NOT Check "
+ << anInPort->NodeName() << "( " << anInPort->PortName() << " )" << endl ;
+ }
+ else if ( aNode->IsGOTONode() ) {
+ cdebug << Name() << "->ComputingNode::CheckSwitch will NOT Check "
+ << anInPort->NodeName() << "( " << anInPort->PortName() << " )" << endl ;
+ anEndSwitchNode->SetSwitchWithGOTO() ;
+ }
+ else {
+ cdebug << Name() << "->ComputingNode::CheckSwitch will Check "
+ << anInPort->NodeName() << "( " << anInPort->PortName() << " )" << endl ;
+ if ( !aNode->CheckSwitch( anEndSwitchNode ) ) {
+ cdebug_out << Name() << "->ComputingNode::CheckSwitch "
+ << anEndSwitchNode->Name() << " WARNING false" << endl;
+ return false ;
+ }
+// aNode->BranchOfSwitchDone( true ) ;
+ }
+ }
+ }
+ }
+ }
+ }
+ BranchOfSwitchDone( true ) ;
+ cdebug_out << Name() << "->ComputingNode::CheckSwitch BranchOfSwitchDone == true "
+ << anEndSwitchNode->Name() << " true" << endl;
+ return true ;
+}
+
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
const ListOfFuncName FuncNames ,
const ListOfPythonFunctions PythonFunctions ,
int XCoordinate , int YCoordinate ) const {
+ cdebug_in << "ComputingNode::SavePY " << Name() << endl ;
// san - Presumably, data stream graphs should be always saved with kind = DataStreamGraph
// JR : the bug was at line 927 : && HasDataStream() != 0 was missing
if ( IsDataFlowNode() || ( IsDataStreamNode() && HasDataStream() == 0 ) ) {
f << " " << Name() << ".SetCoupled( '"
<< ((GraphBase::GOTONode * ) this)->CoupledNodeName() << "' )" << endl ;
}
- }
+ }
else if ( IsDataStreamNode() && HasDataStream() != 0 ) {
f << " " << Name() << " = StreamGraph( '" << Name() << "' )" << endl ;
long Timeout ;
// strcpy( EndName , "End" ) ;
// strcat( EndName , Name() ) ;
char * EndName = aCoupledNode->Name() ;
+ cdebug << "ComputingNode::SavePY Node " << Name() << " EndName " << EndName
+ << endl ;
if ( IsLoopNode() ) {
int i ;
SUPERV::ListOfStrings aPyMore = *PythonFunctions[1] ;
}
}
}
- delete [] EndName ;
+ cdebug << "ComputingNode::SavePY Node " << Name() << " EndName " << EndName
+ << endl ;
+// PAL8507
+//JR 24.02.2005 Debug !!!... : I should not delete myself : what a stupid thing !
+// delete [] EndName ;
}
}
}
}
+ cdebug_out << "ComputingNode::SavePY " ;
+ NodeInfo( *_fdebug ) ;
+ cdebug << endl ;
return true ;
}