Salome HOME
Error messages
authorrahuel <rahuel@opencascade.com>
Tue, 30 Aug 2005 07:56:53 +0000 (07:56 +0000)
committerrahuel <rahuel@opencascade.com>
Tue, 30 Aug 2005 07:56:53 +0000 (07:56 +0000)
Debug for MacroNodes

src/Supervision/Graph_Impl.cxx
src/Supervision/Graph_Impl.hxx

index 25b3e3a70d4d28208bfc89beb89019719a75bfe4..edd9dc78bd60ebce04ab1dd3f03d90ca654d5343 100644 (file)
@@ -825,6 +825,11 @@ SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphExecutor::DataFlow * aDataFlow
           aMacroGraphExe->CoupledNode( aMacroNode ) ;
           aMacroNode->CoupledNode( aMacroGraphExe ) ;
 
+//JR 04.05.2005 Debug : InPorts values of MacroNodes are like for other nodes
+//                      InPorts values of MacroGraphs of MacroNodes are done in the Executor
+// It was probably to try to debug anything but it was a wrong debug and I do not know what bug
+// ===> folowing code is commented
+#if 0
          // initialize MacroNode's InPorts with corresponding "external" values
          int q ;
          for ( q = 0 ; q < aMacroNode->GetNodeInPortsSize() ; q++ ) {
@@ -841,7 +846,7 @@ SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphExecutor::DataFlow * aDataFlow
              }
            }
          } // end of init MacroNode's InPorts
-
+#endif
          aMacroGraphImpl->Run() ;
 
         }
@@ -1175,6 +1180,8 @@ SUPERV::Link_ptr Graph_Impl::Link( SUPERV::Port_ptr OutPort ,
         }
       }
       else {
+        MESSAGE( "Graph_Impl::Link( " << OutPort->Name() << " " << anOutPort << " , "
+                 << InPort->Name() << " " << anInPort << " ) ObjRef already exists" ) ;
         iobject = anOutPort->InPortObjRef( anInPort ) ;
       }
     }
@@ -1390,14 +1397,13 @@ SUPERV::ListOfNodes * Graph_Impl::Nodes() {
   RetVal->Graphs.length(0) ;
   if ( !IsMacro() ) {
     int i ;
-    cout << DataFlowEditor()->Graph()->GetGraphNodeSize() << " Nodes in the Map and "
-         << DataFlowEditor()->Graph()->GraphNodesSize() << " Nodes int the Vector" << endl ;
+    MESSAGE( DataFlowEditor()->Graph()->GetGraphNodeSize() << " Nodes in the Map and "
+             << DataFlowEditor()->Graph()->GraphNodesSize() << " Nodes int the Vector" ) ;
     for ( i = 0 ; i < DataFlowEditor()->Graph()->GraphNodesSize() ; i++ ) {
       GraphBase::ComputingNode * aNode = DataFlowEditor()->Graph()->GraphNodes( i ) ;
 #if 1
-      cout << i << ". Vector : " << aNode->Name() << " Map : "
-           << DataFlowEditor()->Graph()->GetGraphNode( aNode->Name() )->Name()
-           << endl ;
+      MESSAGE( i << ". Vector : " << aNode->Name() << " Map : "
+               << DataFlowEditor()->Graph()->GetGraphNode( aNode->Name() )->Name() ) ;
 #endif
       RetVal = SetNode( RetVal , aNode ) ;
     }
@@ -1658,6 +1664,20 @@ Engines::Component_ptr Graph_Impl::ComponentRef( const char * aComputerContainer
   return Engines::Component::_duplicate( objComponent ) ;
 }
 
+char * Graph_Impl::Messages() {
+  beginService( "Graph_Impl::Messages" );
+  string Messages  ;
+  MESSAGE( "Graph_Impl::Messages IsEditing " << DataFlowEditor()->IsEditing() ) ;
+  Messages = DataFlowEditor()->Graph()->Messages() ;
+  DataFlowEditor()->Graph()->ReSetMessages() ;
+  if ( DataFlowExecutor() ) {
+    Messages += DataFlowExecutor()->Graph()->Messages() ;
+    DataFlowExecutor()->Graph()->ReSetMessages() ;
+  }
+  endService( "Graph_Impl::Messages" );
+  return ( CORBA::string_dup( Messages.c_str() ) ) ;
+}
+
 bool Graph_Impl::IsValid() {
 //  beginService( "Graph_Impl::IsValid" );
   bool RetVal = false ;
@@ -1784,6 +1804,7 @@ bool Graph_Impl::Begin() {
       perror("pthread_mutex_lock _MutexExecutorWait") ;
       exit( 0 ) ;
     }
+    DataFlowEditor()->Graph()->ReSetMessages() ; // ==> Only one set of errors messages ...
     if ( DataFlowExecutor() ) {
       MESSAGE( "Graph_Impl::Begin " << DataFlowExecutor()->Threads() << " threads" )
       Editing(); // just in case it was not called before by GUI..
index 9e48ef5f8054a003c7e0221106a570975d46113a..e15f09575789da7207e891cd5ea6ac109cee4259 100644 (file)
@@ -169,6 +169,8 @@ class Graph_Impl : public POA_SUPERV::Graph ,
     virtual Engines::Component_ptr ComponentRef( const char * aComputerContainer ,
                                                  const char * aComponentName ) ;
 
+    virtual char * Messages() ;
+
     virtual bool IsValid() ;
     virtual bool IsExecutable() ;