]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
The debug for PAL12455 was disabled. The right debug PAL14700 is done here :
authorrahuel <rahuel@opencascade.com>
Wed, 31 Jan 2007 10:16:30 +0000 (10:16 +0000)
committerrahuel <rahuel@opencascade.com>
Wed, 31 Jan 2007 10:16:30 +0000 (10:16 +0000)
the input values of the graph (which are also input values of a MacroNode)
was not transmitted to the corresponding subgraph. With the debug for
PAL12455 that values may be transmitted more than once (GraphMacroNodes1
from SAMPLES). Now that values are transmitted only once.

src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx

index 1789aa7075f871526c598aa466ae7ed8f8f7e9b2..500888155805b2dfd8039250cb89a7ac0ee41096 100644 (file)
@@ -85,6 +85,9 @@ int GraphExecutor::InNode::SendEvent( const GraphExecutor::NodeEvent anEvent ) {
   _OldState = State() ;
   _NextState = Automaton()->NextState( _OldState , anEvent ) ;
   if ( _NextState == _OldState ) {
+    string anErrorMessage = string( "Automaton error for node " ) +
+                            string( Name() ) + " (SuperVision executor error)." ;
+    _OutNode->Graph()->SetMessages( anErrorMessage ) ;
     cdebug << pthread_self() << "/" << ThreadNo() << " " << Name()
            << " GraphExecutor::InNodeThreads::SendEvent SameStates ERROR _OldState/_NextState "
            << _OldState << " Event " << Automaton()->EventName( anEvent ) << endl ;
@@ -888,7 +891,8 @@ int GraphExecutor::InNode::VoidAction() {
 int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
 #if SomeDataReadyActionTrace
   cdebug_in << pthread_self() << "/" << ThreadNo() << " " << Name()
-            << " DataWaiting_SomeDataReadyAction from " << DataFromNode() << endl;
+            << " DataWaiting_SomeDataReadyAction from " << DataFromNode()
+            << " " << GetNodeInPortsSize() << " Inport(s)" << endl;
 #endif
   unsigned int k;
   int InReady = 0 ;
@@ -979,7 +983,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
       anOutPort = anInPort->GetOutPort() ;
       if ( anOutPort ) {
 #if SomeDataReadyActionTrace
-        cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+        cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+               << k << " "
                << anInPort->PortName() << " already setted to OutPort " << anOutPort->NodeName()
                << "( " << anOutPort->PortName() << " )" << endl ;
 #endif
@@ -988,7 +993,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
         anOutPort = CoupledNode()->GetChangeOutPort( anInPort->PortName() ) ;
         if ( anOutPort ) {
 #if SomeDataReadyActionTrace
-          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+                 << k << " "
                  << anInPort->PortName() << " change of OutPort from "
                  << anInPort->GetOutPort()->NodeName() << "( " << anInPort->GetOutPort()->PortName()
                  << " ) to " << anOutPort->NodeName() << "( " << anOutPort->PortName() << " )"
@@ -996,7 +1002,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
 #endif
        }
         else {
-          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+          cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+                 << k << " "
                  << anInPort->PortName() << " have NO OutPort ERROR " << endl ;
           return 0 ;
        }
@@ -1007,7 +1014,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
       anOutPort = anInPort->GetOutPort() ;
     }
 #if SomeDataReadyActionTrace
-    cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort "
+    cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort"
+           << k << " "
            << anInPort->PortName() << " " << anInPort->PortState() << " "
            << anInPort->PortStatus() << " " << anInPort->Kind()  ;
     if ( anOutPort ) {
@@ -1045,6 +1053,8 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
 #endif
         cdebug << endl ;
 #endif
+//JR 30.01.2007 : wrong debug for PAL12455
+#if 0
         // mkr : PAL12455 -->
         // MacroNode : give immediately the value to the corresponding graph
         if ( IsMacroNode() ) {
@@ -1057,6 +1067,7 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
           aMacroGraph->InputOfAny( anInPort->PortName() , anOutPort->Value() ) ;
         }
         // mkr : PAL12455 <--
+#endif
       }
       else if ( IsLoopNode() && anInPort->IsDataConnected() ) {
         anInPort->PortState( SUPERV::ReadyState ) ;
@@ -1240,10 +1251,32 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() {
     cdebug << pthread_self() << "/" << ThreadNo() << " Node " << Name() << " HasAllDataReady"
            << endl ;
 #endif
+//JR 30.01.2007 Right Debug PAL12455 --->
+//That must be done only for DataConnected ports and only once
+    if ( IsMacroNode() ) {
+      GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ;
+      for ( k = 0 ; k < (unsigned int ) GetNodeInPortsSize() ; k++ ) {
+        GraphBase::InPort * anInPort = GetChangeNodeInPort(k) ;
+        GraphBase::OutPort * anOutPort ;
+        anOutPort = anInPort->GetOutPort() ;
+        if ( anInPort->IsDataConnected() ) {
+          cdebug << "SomeDataReadyAction MacroNode " << aMacroGraph->Name()
+                 << " --> InputOfAny " << InReady << "/" << GetNodeInPortsSize()
+                 << " InPorts are Ready ( " << anInPort->PortName()
+                 << " ) ===> InputOfAny" << endl ;
+          aMacroGraph->InputOfAny( anInPort->PortName() , anOutPort->Value() ) ;
+        }
+      }
+    }
+// <--- JR 30.01.2007 Right Debug PAL12455
     HasAllDataReady( true ) ; // ==> Ready to execute
     res = 1 ;
   }
   else { // At least one Flag == 0 :
+#if SomeDataReadyActionTrace
+    cdebug << pthread_self() << "/" << ThreadNo() << " Node " << Name() << " HasNOTAllDataReady "
+           << InReady << "/" << GetNodeInPortsSize() << " DoAllDataReadyIf " << DoAllDataReadyIf << endl ;
+#endif
     HasAllDataReady( false ) ;
     res = SendEvent( GraphExecutor::NotAllDataReadyEvent );
   }
@@ -2649,6 +2682,7 @@ int GraphExecutor::InNode::Successed_SuccessAction() {
         IgnoreForDefaultSwitch = true ;
       }
     }
+
 //Loop of LinkedNodes for SendSomeDataReady :
     for ( i = 0 ; i < LinkedNodesSize() ; i++ ) {
       GraphBase::ComputingNode * aComputingNode ;