// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
Info->theName = Name() ;
Info->theKind = Kind() ;
if ( IsDataStreamNode() ) {
- long Timeout ;
+ CORBA::Long Timeout ;
SUPERV::KindOfDataStreamTrace DataStreamTrace ;
- double DeltaTime ;
+ CORBA::Double DeltaTime ;
((GraphBase::StreamGraph * ) this)->StreamParams( Timeout , DataStreamTrace , DeltaTime ) ;
Info->theTimeout = Timeout ;
Info->theDataStreamTrace = DataStreamTrace ;
const GraphBase::InPort * anInPort ;
anInPort = aCNode->GetNodeInPort( iostream ) ;
if ( anInPort->IsDataStream() ) {
- cdebug << "GraphBase::Graph::GetNodes In" << iostream << " " << aCNode->Name() << " " << anInPort->NodeName() << " " << anInPort->PortName()
- << endl ;
- (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametertype = StringToDataStreamType( anInPort->PortType() ) ;
+ cdebug << "GraphBase::Graph::GetNodes In" << iostream << " " << aCNode->Name()
+ << " " << anInPort->NodeName() << " " << anInPort->PortName() << endl;
+ (*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametertype = CORBA::string_dup( anInPort->PortType() ) ;
(*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parametername = CORBA::string_dup( anInPort->PortName() ) ;
(*_list_nodes)[ind].theListOfInDataStreams[streamind].theDataStreamParameter.Parameterdependency = anInPort->Dependency() ;
SUPERV::KindOfSchema aKindOfSchema ;
if ( anOutPort->IsDataStream() ) {
cdebug << "GraphBase::Graph::GetNodes Out" << iostream << " " << aCNode->Name() << " " << anOutPort->NodeName() << " " << anOutPort->PortName() << " "
<< endl ;
- (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametertype = StringToDataStreamType( anOutPort->PortType() ) ;
+ (*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametertype = CORBA::string_dup( anOutPort->PortType() ) ;
(*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parametername = CORBA::string_dup( anOutPort->PortName() ) ;
(*_list_nodes)[ind].theListOfOutDataStreams[streamind].theDataStreamParameter.Parameterdependency = anOutPort->Dependency() ;
long aNumberOfValues = ((GraphBase::OutDataStreamPort * ) anOutPort)->NumberOfValues() ;
//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theEditorRelease = CORBA::string_dup( aCNode->EditorRelease());
(*_list_nodes)[ind].theEditorRelease = string( aCNode->EditorRelease());
//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theAuthor = CORBA::string_dup( aCNode->Author());
+ (*_list_nodes)[ind].theAuthor = string( aCNode->Author()); // mkr : IPAL10200
if ( aCNode->IsFactoryNode() ) {
GraphBase::FactoryNode * aFNode = (GraphBase::FactoryNode * ) aCNode ;
//JR 24.02.2005 Memory Leak (*_list_nodes)[ind].theContainer = CORBA::string_dup( aFNode->Computer());
}
//PAL8177-PAL8509
//JR 24.03.2005 : Debug : CoupledNode field of GOTONodes was not erased
- if ( aNode->IsInLineNode() ) {
+ if ( aNode->IsInLineNode() && aNode->GetNodeInPortsSize() ) { //mkr : IPAL10078
GraphBase::OutPort * anOutPort = aNode->GetNodeInGate()->GetOutPort() ;
if ( anOutPort ) {
GraphBase::ComputingNode * aLinkedNode ;
}
}
}
+ //mkr : fix for bugs IPAL9814 and IPAL9630
+ RetVal = true;
}
if ( RetVal ) {
if ( RetVal ) {
if ( fromPort->IsGate() && toPort->IsGate() ) {
CORBA::Any aValue ;
- aValue <<= (long ) 1 ;
+//JR 29.09.2005 Debug for CEA : we do not do that for MacroNodes :
+ if ( !fromNode->IsMacroNode() ) {
+ aValue <<= (CORBA::Long ) 1 ;
+ }
+ else {
+ aValue <<= (CORBA::Long ) 0 ;
+ }
fromPort->SetValue( aValue ) ;
}
// else {
cdebug_out << "RemoveLink(AddLink) toPort->GetOutPort()->NodeName() RemoveLink Error." << endl ;
return false ;
}
+ if ( fromNode->IsGOTONode() && fromPort->IsGate() ) { // mkr : PAL12575
+ ((GraphBase::GOTONode * ) fromNode)->CoupledNode( (GraphBase::InLineNode * ) toNode ) ;
+ }
}
if ( !fromNode->IsDataFlowNode() && !fromNode->IsDataStreamNode() &&
}
else {
fromNode->RemoveLinkedNode( toNode ) ;
+ // mkr : PAL12575 -->
+ if ( fromNode->IsGOTONode() ) {
+ GraphBase::GOTONode * aGOTONode = (GraphBase::GOTONode * ) fromNode ;
+ if ( aGOTONode->CoupledNode() && strcmp( aGOTONode->CoupledNode()->Name(), toNode->Name() ) == 0 ) {
+ aGOTONode->CoupledNode(NULL);
+ aGOTONode->CoupledNodeName("");
+
+ // set ExternConnected status for output data port of GoTo node
+ for ( int aPortId = 0 ; aPortId < fromNode->GetNodeOutPortsSize() ; aPortId++ ) {
+ GraphBase::OutPort * anOutPort = fromNode->GetChangeNodeOutPort(aPortId) ;
+ if ( anOutPort->IsNotConnected() && !anOutPort->IsGate() )
+ anOutPort->PortStatus( ExternConnected ) ;
+ }
+ }
+ }
+ // mkr : PAL12575 <--
}
}
//JR PAL7990 : a SwitchPort is an OutPort of a SwitchNode connected to a InGate Port
bool RetVal = false ;
cdebug_in << "GraphBase::Graph::AddInputData(" << ToNodeName << ","
<< ToServiceParameterName << " , Any " ;
+ bool isUnknown = false;
switch (aValue.type()->kind()) {
case CORBA::tk_string:
- char * t;
+ const char * t;
aValue >>= t;
cdebug << t << " (string) " ;
+ if ( !strcmp( t, "Unknown CORBA::Any Type" ) )
+ // mkr : IPAL8054 : in this case port has no input value
+ isUnknown = true;
break;
case CORBA::tk_double:
double d;
cdebug << d << " (double) " ;
break;
case CORBA::tk_long:
- long l;
+ CORBA::Long l;
aValue >>= l;
- cdebug << l << " (long) " ;
+ cdebug << l << " (CORBA::Long) " ;
break;
case CORBA::tk_objref:
cdebug << "(object reference) " ;
toNode , toPort ) ;
if ( RetVal ) {
fromDataNodePort->SetValue( aValue ) ;
- fromDataNodePort->PortStatus( DataConnected ) ;
+ if ( !isUnknown ) // mkr : IPAL8054 : to avoid setting "strange" value to a port
+ fromDataNodePort->PortStatus( DataConnected ) ;
}
}
else {
cdebug << "ERROR Node and/or Port not found : " << aNodeName << " " << aPortName << endl ;
}
- delete aNodeName ;
- delete aPortName ;
+ delete [] aNodeName ;
+ delete [] aPortName ;
cdebug_out << "GraphBase::Graph::AddInputData " << RetVal << endl;
return RetVal ;
<< ToServiceParameterName << "' , Any " ;
switch (aValue.type()->kind()) {
case CORBA::tk_string:
- char * t;
+ const char * t;
aValue >>= t;
cdebug << t << " (string) " ;
break;
cdebug << d << " (double) " ;
break;
case CORBA::tk_long:
- long l;
+ CORBA::Long l;
aValue >>= l;
- cdebug << l << " (long) " ;
+ cdebug << l << " (CORBA::Long) " ;
break;
case CORBA::tk_objref:
cdebug << "(object reference) " ;
cdebug << t << " (string) " ;
break;
case CORBA::tk_double:
- double d;
+ CORBA::Double d;
theValue >>= d;
cdebug << d << " (double) " ;
break;
case CORBA::tk_long:
- long l;
+ CORBA::Long l;
theValue >>= l;
- cdebug << l << " (long) " ;
+ cdebug << l << " (CORBA::Long) " ;
break;
case CORBA::tk_objref:
cdebug << "(object reference) " ;
// DataService( _Orb , aService , InPortsKind , OutPortsKind , Graph_prof_debug() , Graph_fdebug() ) ;
for ( i = 0 ; i < innbr ; i++ ) {
if ( InPortsKind[ i ] == SUPERV::DataStreamParameter ) {
- GraphBase::InDataStreamPort * anInPort = AddInDataStreamPort( aService.ServiceinParameter[ i ].Parametername ,
- StringToDataStreamType( aService.ServiceinParameter[ i ].Parametertype ) ,
+ GraphBase::InDataStreamPort * anInPort = AddInDataStreamPort( aService.ServiceinParameter[ i ].Parametername,
+ aService.ServiceinParameter[ i ].Parametertype,
InDataStreamDependency[ i ] ,
SUPERV::DataStreamParameter ) ;
anInPort->SetParams( InKindOfSchema[ i ] ,
for ( i = 0 ; i < outnbr ; i++ ) {
if ( OutPortsKind[ i ] == SUPERV::DataStreamParameter ) {
GraphBase::OutDataStreamPort * anOutPort = AddOutDataStreamPort( aService.ServiceoutParameter[ i ].Parametername ,
- StringToDataStreamType( aService.ServiceoutParameter[ i ].Parametertype ) ,
+ aService.ServiceoutParameter[ i ].Parametertype ,
OutDataStreamDependency[ i ] ,
SUPERV::DataStreamParameter ) ;
anOutPort->NumberOfValues( OutNumberOfValues[ i ] ) ;
<< ") " << anOutPort->PortStatus() << " :" << endl ;
//JR PAL8914 : OutPorts of LoopNodes may not be in the Service of the Graph
// if ( !anOutPort->IsGate() && anOutPort->IsNotConnected() && !aToNode->IsGOTONode() ) {
- if ( !anOutPort->IsGate() && anOutPort->IsNotConnected() && !aToNode->IsGOTONode() &&
- !aToNode->IsLoopNode() ) {
+ if ( !anOutPort->IsGate() && !aToNode->IsGOTONode() && !aToNode->IsLoopNode() &&
+//JR Debug : 06.09.2005 : recreate that link if the OutPort is ExternConnected !!!...
+ ( anOutPort->IsNotConnected() || anOutPort->IsExternConnected() ) ) {
GraphBase::InPort *anInPort = GetChangeOutDataNodePort( anOutPort->NodePortName() ) ;
if ( !AddLink( aToNode , anOutPort , this , anInPort ) ) {
cdebug << " --> " << Name() << "(" << anInPort->PortName()
}
else if ( aINode->GetChangeNodeInPort(j)->IsDataStream() ) {
aService.ServiceinDataStreamParameter.length( InStreamService+1 ) ;
- aService.ServiceinDataStreamParameter[InStreamService].Parametertype = StringToDataStreamType( aINode->GetChangeNodeInPort(j)->PortType() ) ;
+ aService.ServiceinDataStreamParameter[InStreamService].Parametertype = CORBA::string_dup( aINode->GetChangeNodeInPort(j)->PortType() ) ;
aService.ServiceinDataStreamParameter[InStreamService].Parametername = CORBA::string_dup( aINode->GetChangeNodeInPort(j)->PortName() ) ;
aService.ServiceinDataStreamParameter[InStreamService++].Parameterdependency = aINode->GetChangeNodeInPort(j)->Dependency() ;
aINode->IncrDataStreamInPorts() ;
}
else if ( aINode->GetChangeNodeOutPort(j)->IsDataStream() ) {
aService.ServiceoutDataStreamParameter.length( OutStreamService+1 ) ;
- aService.ServiceoutDataStreamParameter[OutStreamService].Parametertype = StringToDataStreamType( aINode->GetChangeNodeOutPort(j)->PortType() ) ;
+ aService.ServiceoutDataStreamParameter[OutStreamService].Parametertype = CORBA::string_dup( aINode->GetChangeNodeOutPort(j)->PortType() ) ;
aService.ServiceoutDataStreamParameter[OutStreamService].Parametername = CORBA::string_dup( aINode->GetChangeNodeOutPort(j)->PortName() ) ;
aService.ServiceoutDataStreamParameter[OutStreamService++].Parameterdependency = aINode->GetChangeNodeOutPort(j)->Dependency() ;
aINode->IncrDataStreamOutPorts() ;
return true ;
}
+// mkr : PAL12575
+bool GraphBase::Graph::ValidGOTO() {
+ cdebug_in << "GraphBase::Graph::ValidGOTO" << endl;
+ bool RetVal = true ;
+ int i, j ;
+ GraphBase::ComputingNode * aNode ;
+ for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+ aNode = GraphNodes( i ) ;
+ if ( aNode->IsGOTONode() ) {
+ GraphBase::GOTONode * aGoToNode = (GraphBase::GOTONode * ) aNode ;
+ GraphBase::InLineNode * aCoupledNode ;
+ aCoupledNode = (GraphBase::InLineNode * ) aGoToNode->CoupledNode() ;
+ if ( aCoupledNode ) {
+ ostringstream ErrorMessage ;
+ // 1. Check the number of ports (the number of OutPorts of a GOTONode and of InPorts of its linked
+ // InLine node must be the same)
+ if ( aNode->GetNodeOutPortsSize() != aCoupledNode->GetNodeInPortsSize() ) {
+ cdebug << "GraphBase::Graph::ValidGOTO : Different ports number!" << endl ;
+ ReSetMessages() ;
+ ErrorMessage << "Different ports number : the number of OutPorts of a " << aNode->Name()
+ << " node (GoTo node) and of InPorts of its linked " << aCoupledNode->Name()
+ << " node (InLine node) must be the same!\n" ;
+ SetMessages( ErrorMessage.str() ) ;
+ RetVal = false ;
+ }
+ // 2. Check ports names (the names of OutPorts of a GOTONode and of InPorts of its linked
+ // InLine node must be the same)
+ else {
+ for ( j = 0 ; j < aNode->GetNodeOutPortsSize() ; j++ ) {
+ GraphBase::OutPort * aBusParamOutPort = aNode->GetChangeNodeOutPort( j ) ;
+ if ( !aBusParamOutPort->IsGate() ) {
+ GraphBase::InPort * aBusParamChangeInPort = NULL ;
+ aBusParamChangeInPort = aCoupledNode->GetChangeInPort( aBusParamOutPort->PortName() ) ;
+ if ( !aBusParamChangeInPort ) {
+ cdebug << "GraphBase::Graph::ValidGOTO : Different names of ports!" << endl ;
+ ReSetMessages() ;
+ ErrorMessage << "Different names of ports : there is no input port of " << aCoupledNode->Name()
+ << " node (InLine node) coupled to " << aBusParamOutPort->PortName()
+ << " output port of a " << aNode->Name()
+ << " node (GoTo node)\n" ;
+ SetMessages( ErrorMessage.str() ) ;
+ RetVal = false ;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ cdebug_out << "GraphBase::Graph::ValidGOTO RetVal " << RetVal << endl;
+ return RetVal ;
+}
+
bool GraphBase::Graph::ValidLoops() const {
cdebug_in << "GraphBase::Graph::ValidLoops" << endl;
bool RetVal = true ;
const GraphBase::OutPort * anOutPort = aNode->GetNodeOutPort(j) ;
//JR Debug 06.06.2005 : if it is not a Gate !
// if ( anOutPort->IsNotConnected() ) {
- if ( anOutPort->IsNotConnected() && !anOutPort->IsGate() ) {
+ if ( anOutPort->IsNotConnected() && !anOutPort->IsGate() && !aNode->IsGOTONode() ) { // mkr : PAL12575
cdebug << "Graph::DataServerNodes Add[Stream]LinkedNode for OutPort "
<< aNode->Name() << "( " << anOutPort->PortName() << " , "
<< anOutPort->PortStatus() << " )" << endl ;
cdebug << "GraphBase::Graph::PortInData " << ToNodeName << " "
<< ToServiceParameterName << " ERROR no Node" << endl ;
}
- delete theNode ;
- delete aPort ;
+ delete [] theNode ;
+ delete [] aPort ;
#if TracePortInOutData
cdebug_out << "GraphBase::Graph::PortInData " << endl ;
#endif
cdebug << "GraphBase::Graph::PortOutData " << FromNodeName << " "
<< FromServiceParameterName << " ERROR no Node" << endl ;
}
- delete theNode ;
- delete aPort ;
+ delete [] theNode ;
+ delete [] aPort ;
#if TracePortInOutData
cdebug_out << "GraphBase::Graph::PortOutData " << endl ;
#endif