From: rahuel Date: Tue, 30 Aug 2005 06:19:27 +0000 (+0000) Subject: Debug in CheckDataServerNode X-Git-Tag: V_3_0_2~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8d96ff80ca172005e38ea7530e2ef0204ff3a707;p=modules%2Fsuperv.git Debug in CheckDataServerNode --- diff --git a/src/GraphBase/DataFlowBase_DataNode.cxx b/src/GraphBase/DataFlowBase_DataNode.cxx index b0644c8..1b0a191 100644 --- a/src/GraphBase/DataFlowBase_DataNode.cxx +++ b/src/GraphBase/DataFlowBase_DataNode.cxx @@ -28,6 +28,7 @@ using namespace std; #include "DataFlowBase_DataNode.hxx" +#include "DataFlowBase_Graph.hxx" GraphBase::DataNode::DataNode() : GOTONode() { @@ -96,49 +97,77 @@ void GraphBase::DataNode::DataService( CORBA::ORB_ptr ORB , int GraphBase::DataNode::CheckDataServerNodes() const { - cdebug << "GraphBase::DataNode::CheckDataServerNodes :" << endl; + cdebug_in << "GraphBase::DataNode::CheckDataServerNodes :" << endl; int i , ierr = 0 ; for ( i = 0 ; i < _DataFlowDataPorts->GetNodeOutPortsSize() ; i++ ) { -// Not a BUG : Reversed Service of the graph +// Not a BUG : Reversed Service of the graph : OutPort of the Graph give input values to nodes const GraphBase::OutPort * anOutPort = _DataFlowDataPorts->GetNodeOutPort(i) ; // if ( !anOutPort->IsGate() && !anOutPort->IsDataStream() && !anOutPort->IsDataConnected() ) { if ( !anOutPort->IsGate() && !anOutPort->IsDataConnected() ) { if ( anOutPort->IsExternConnected() && GraphMacroLevel() != 0 ) { - cdebug << "InPort " << anOutPort->PortName() << " " << anOutPort->PortType() << " " + cdebug << "Base::DataNode::CheckDataServerNodes InPort " << anOutPort->PortName() << " " + << anOutPort->PortType() << " " << anOutPort->PortStatus() << " of DataFlow " << Name() << " is ExternConnected. GraphMacroLevel " << GraphMacroLevel() << endl ; } else { - cdebug << "InPort " << anOutPort->PortName() << " " << anOutPort->PortType() << " " - << anOutPort->PortStatus() << " of DataFlow " << Name() << " has NO Data. GraphMacroLevel " - << GraphMacroLevel() << endl ; - ierr++ ; + cdebug << "Base::DataNode::CheckDataServerNodes InPort " << anOutPort->PortName() << " " + << anOutPort->PortType() << " " << anOutPort->PortStatus() << " of DataFlow " << Name() + << " has NO Data. GraphMacroLevel " << GraphMacroLevel() << " InPortsSize " + << anOutPort->InPortsSize() << " corresponding to :" + << endl ; + int i ; + for ( i = 0 ; i < anOutPort->InPortsSize() ; i++ ) { + cdebug << " " << anOutPort->InPorts( i )->NodeName() << "( " + << anOutPort->InPorts( i )->PortName() << " ) " << endl ; + } + if ( anOutPort->InPortsSize() == 1 && + GraphOfNode()->GetGraphNode( anOutPort->InPorts( 0 )->NodeName() )->IsEndSwitchNode() ) { + cdebug << "Base::DataNode::CheckDataServerNodes InPort " << anOutPort->PortName() + << " is connected to an EndSwitchNode. Input Data is controlled by ValidSwitchs." + << endl ; + } + else { + ostringstream astr ; + astr << anOutPort->PortStatus() ; + string anErrorMessage = string( "InPort " ) + string( anOutPort->NodeName() ) + + string( "( " ) + string( anOutPort->PortName() ) + string( " ) " ) + + astr.str() + string( " has NO Input Data.\n" ) ; + GraphOfNode()->SetMessages( anErrorMessage ) ; + ierr++ ; + } } } else { - cdebug << "InPort " << anOutPort->PortName() << " " << anOutPort->PortType() << " " - << anOutPort->PortStatus() << " of DataFlow " << Name() << " has Data : " + cdebug << "Base::DataNode::CheckDataServerNodes InPort " << anOutPort->PortName() << " " + << anOutPort->PortType() << " " + << anOutPort->PortStatus() << " of DataFlow " << Name() << " has Data or IsGate" << endl ; } } for ( i = 0 ; i < _DataFlowDataPorts->GetNodeInPortsSize() ; i++ ) { if ( _DataFlowDataPorts->GetNodeInPort(i)->IsPortConnected() ) { - cdebug << "OutPort " << _DataFlowDataPorts->GetNodeInPort(i)->PortName() + cdebug << "Base::DataNode::CheckDataServerNodes OutPort " + << _DataFlowDataPorts->GetNodeInPort(i)->PortName() << " of DataFlow " << Name() << " is Connected" << endl ; } else { - cdebug << "OutPort " << _DataFlowDataPorts->GetNodeInPort(i)->PortName() + cdebug << "Base::DataNode::CheckDataServerNodes OutPort " + << _DataFlowDataPorts->GetNodeInPort(i)->PortName() << " of DataFlow " << Name() << " is NOT Connected" << endl ; } } if ( ierr ) { - cdebug << "In the DataFlow " << Name() << " " << ierr << " Some Input Data is missing" << endl ; + GraphOfNode()->SetMessages( "Some Input Data are missing.\n" ) ; + cdebug << "Base::DataNode::CheckDataServerNodes In the DataFlow " << Name() << " " << ierr + << " Some Input Data are missing" << endl ; } + cdebug_out << "GraphBase::DataNode::CheckDataServerNodes ierr " << ierr << endl; return ierr ; }