Salome HOME
"Loading" state is set ONLY for Computing and Factory nodes. Decided NOT to set...
authorasv <asv@opencascade.com>
Tue, 14 Dec 2004 11:51:52 +0000 (11:51 +0000)
committerasv <asv@opencascade.com>
Tue, 14 Dec 2004 11:51:52 +0000 (11:51 +0000)
src/GraphExecutor/DataFlowExecutor_InNode.cxx
src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx

index e03187981ecf14869adaff2be373016473aad782..bd8ce05d497495d7c869c40ed841d5d8dee12122 100644 (file)
@@ -1317,8 +1317,9 @@ void GraphExecutor::InNode::InitialState()
   _SuspendSync = false ;
   _ResumeSync = false ;
 
-  // asv : 13.12.04 : "Loading" state is ON (and OFF eventially) only for Computing, Factory, Inline nodes
-  if ( !IsMacroNode() )
+  // asv : 13.12.04 : Decided to set "Loading" state for factory and computing nodes ONLY.
+  //                  See extended comment in p.2.19 of "Bugs and Improvements" about IsLoading for InLine.
+  if ( IsComputingNode() || IsFactoryNode() )
     IsLoading( true ) ;
 
 //  ThreadNo( pthread_self() ) ;
index 50b386191e9f6a4d7d82ecfba53fa8da3b27ee6c..eb9aae62b6e5fde943c252595cb419b990f30e9a 100644 (file)
@@ -1160,7 +1160,6 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() {
       MESSAGE(pthread_self() << "Executor::InNode::DataReady_ExecuteAction of " << Name()
               << " ControlState " << Automaton()->ControlStateName( ControlState() )
               << " BEFORE execution ThreadNo " << ThreadNo() ) ;
-      IsLoading( false ) ;
       Err = true ;
     }
     else {
@@ -1191,9 +1190,6 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() {
           bool StsPyDynInvoke = true;
          _OutNode->PyThreadLock() ;
           SetPyCpuUsed() ;
-         IsLoading( false ); // loading complete for InLine nodes. For Computing and Factory - there still
-                             // is some work to be done..  IsLoading( false ) for them is called later just before
-                              // calling DynInvoke()..  but for InLine PyDynInvoke() is called just right here below..  
           try {
 //            if ( IsInLineNode() && (*InLineNode()->PythonFunction()).length() &&
             bool CopyInOut = false ;
@@ -1454,7 +1450,7 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() {
               }
               catch( ... ) {
                 cdebug << "DynInvoke setProperties catched ERROR" << endl ;
-                Err = true ;
+               Err = true;
              }
            }
             if ( !Err && IsComputingNode() ) {
@@ -1468,7 +1464,7 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() {
                          &InParametersList[1] , ServiceInParameter().length()-1 ,
                          &OutParametersList[0] , ServiceOutParameter().length() ) ;
            }
-            else if ( !Err &&IsFactoryNode() ) {
+            else if ( !Err && IsFactoryNode() ) {
               cdebug << ThreadNo() << " !ObjInterface " << Name()
                      << " IsFactoryNode DynInvoke"  << endl ;
               cdebug << ServiceInParameter().length() << " input parameters and "
@@ -1494,15 +1490,18 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() {
       }
     }
   }
-//  else {
-//    sleep( 1 ) ;
-//  }
 
 //  ostringstream astr ;
 //  astr << "Graph " << _OutNode->Graph()->Name() << " Node " << Name() << " is done : "
 //       << Automaton()->StateName( State() ) ;
 //  _OutNode->Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
+
   if ( Err ) {
+    
+    // if exception or something else - IsLoading( false ) may not NOT has been called
+    if ( IsLoading() )
+      IsLoading( false );
+
     if ( ControlState() == SUPERV::ToKillState ||
          ControlState() == SUPERV::ToKillDoneState ||
          ControlState() == SUPERV::ToStopState ) {