}
}
// Remove the InPort of the EndSwitchNode from that OutPort
+// PAL7990 :
+// the InPort of the EndSwitchNode from that OutPort was already removed by
+// anInPort->RemoveOutPort done above :
+#if 0
RetVal = anOutPort->RemoveInPort( anInPort ) ;
if ( !RetVal ) {
cdebug << "anOutPort->RemoveInPort( anInPort ) Error RetVal " << RetVal << endl ;
break ;
}
+#endif
}
}
}
cdebug << "anOutPort->RemoveLinkedNode Error RetVal " << RetVal << endl ;
break ;
}
+// PAL7990 : the InPort of the EndSwitchNode from that OutPort was already removed by
+// anInPort->RemoveOutPort done above :
+#if 0
RetVal = anOutPort->RemoveInPort( anInPort ) ;
if ( !RetVal ) {
cdebug << "anOutPort->RemoveInPort( anInPort ) Error RetVal " << RetVal << endl ;
break ;
}
+#endif
+ if ( ToNode->IsEndSwitchNode() ) { // PAL7990
+ int i ;
+ int done = false ;
+ for ( i = 0 ; i < ToNode->LinkedFromNodesSize() ; i++ ) {
+ GraphBase::StreamNode * fromNode = ToNode->LinkedFromNodes( i ) ;
+// Not the node that we are deleting ... :
+ if ( strcmp( fromNode->Name() , aNode->Name() ) ) {
+ int j ;
+ for ( j = 0 ; j < fromNode->GetNodeOutPortsSize() ; j++ ) {
+ GraphBase::OutPort * fromOutPort = fromNode->GetChangeNodeOutPort( j ) ;
+ int k ;
+ for ( k = 0 ; k < fromOutPort->InPortsSize() ; k++ ) {
+ if ( strcmp( ToNode->Name() , fromOutPort->InPorts( k )->NodeName() ) == 0 ) {
+ if ( strcmp( anInPort->PortName() , fromOutPort->InPorts( k )->PortName() ) == 0 ) {
+// Restore an OutPort in the InPort
+ anInPort->ChangeOutPort( fromOutPort ) ;
+ cdebug << "Graph::RemoveNode reestablish " << fromOutPort->NodeName() << "( "
+ << fromOutPort->PortName() << " ) in the InPort of EndSwitch : "
+ << ToNode->Name() << "( " << anInPort->PortName() << " )"
+ << anInPort->Kind() << " " << anInPort->PortStatus() << endl;
+ done = true ;
+ break ;
+ }
+ }
+ }
+ if ( done ) {
+ break ;
+ }
+ }
+ if ( done ) {
+ break ;
+ }
+ }
+ }
+ }
}
}
if ( !RetVal ) {
if ( aNode->IsEndLoopNode() || aNode->IsEndSwitchNode() ) {
theCoupledNode = ((GraphBase::GOTONode * ) aNode)->CoupledNode() ;
theCoupledNodeName = ((GraphBase::GOTONode * ) aNode)->CoupledNodeName() ;
- CoupledIndex = GetGraphNodeIndex( theCoupledNode->Name() ) ;
+ //CoupledIndex = GetGraphNodeIndex( theCoupledNode->Name() ) ;
}
delete aNode ;
_GraphNodesSize -= 1 ;
_MapOfGraphNodes.erase( aNodeName ) ;
// Delete of the LoopNode of that EndLoopNode or of the SwitchNode of that EndSwitchNode :
if ( theCoupledNode ) {
+// from dev version -> JR 02.02.2005 DEBUG : CoupledIndex must be here after the delete of aNode (not before)
+ CoupledIndex = GetGraphNodeIndex( theCoupledNode->Name() ) ;
delete theCoupledNode ;
_GraphNodesSize -= 1 ;
for ( i = CoupledIndex ; i < _GraphNodesSize ; i++ ) {
fromNode->RemoveLinkedNode( toNode ) ;
}
}
- if ( fromNode->IsSwitchNode() && !anOutPort->IsGate() && !toNode->IsEndSwitchNode() ) {
- anOutPort->Kind( SUPERV::InLineParameter ) ;
+
+// from JR PAL7990 : a SwitchPort is an OutPort of a SwitchNode connected to a InGate Port
+//Debug : change the kind only if there is no other InGate connected to the OutPort
+ if ( fromNode->IsSwitchNode() && !anOutPort->IsGate() && anOutPort->InPortsSize() == 0 ) {
+ if ( !toNode->IsEndSwitchNode() ) {
+ anOutPort->Kind( SUPERV::InLineParameter ) ;
+ }
+ else if ( !anInPort->IsGate() ) {
+ anOutPort->Kind( SUPERV::InLineParameter ) ;
+ }
}
// JR 13.01.2005 : Bug if it is a link to an EndSwitchNode. The InPort may be linked !!!
if ( toNode->IsEndSwitchNode() ) {