From: asv Date: Fri, 10 Dec 2004 09:53:57 +0000 (+0000) Subject: A special "Loading" state was implemented. It is returned to GUI if the correspondin... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=09952140ba09c68a1bc9e0af364e32807f4353a4;p=modules%2Fsuperv.git A special "Loading" state was implemented. It is returned to GUI if the corresponding InNode returns IsLoading()==true. So, 1) OutNode::State( char* aNodeName ) will return LoadingState in case InNode is Loading 2) InNode::IsLoading( bool b ) pushes to GUI "Executing" state if b == false -- loading is complete. --- diff --git a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx index 363f373..e5d0f87 100644 --- a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx +++ b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx @@ -80,6 +80,7 @@ void * start_function( void *p ) ; #define StoppedState GraphExecutor::StoppedState #define ReRunnedState GraphExecutor::ReRunnedState #define ReStartedState GraphExecutor::ReStartedState +#define LoadingState GraphExecutor::LoadingState #define NumberOfAutomatonStates GraphExecutor::NumberOfAutomatonStates #endif @@ -168,6 +169,7 @@ GraphExecutor::FiniteStateMachine::FiniteStateMachine() { _StateName[ StoppedState ] = "StoppedState" ; _StateName[ ReRunnedState ] = "ReRunnedState" ; _StateName[ ReStartedState ] = "ReStartedState" ; + _StateName[ LoadingState ] = "LoadingState" ; _EventName[ UndefinedEvent ] = "UndefinedEvent" ; _EventName[ NewThreadEvent ] = "NewThreadEvent" ; @@ -799,6 +801,9 @@ ostream & operator<< (ostream &f ,const GraphExecutor::AutomatonState & aState ) case GraphExecutor::ReStartedState : f << "ReStartedState"; break; + case GraphExecutor::LoadingState : + f << "LoadingState"; + break; default : f << "GraphExecutor::AutomatonState_?"; break; diff --git a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx index c6d3169..84fcee3 100644 --- a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx +++ b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx @@ -85,6 +85,7 @@ namespace GraphExecutor { SuspendedErroredToReStartState , ReRunnedState , ReStartedState , + LoadingState, NumberOfAutomatonStates } ; enum NodeEvent { UndefinedEvent , NewThreadEvent , diff --git a/src/GraphExecutor/DataFlowExecutor_InNode.cxx b/src/GraphExecutor/DataFlowExecutor_InNode.cxx index 32e7cd5..6b31814 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNode.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNode.cxx @@ -1602,3 +1602,13 @@ void GraphExecutor::InNode::SetPyCpuUsed() { // << _PyCpuUsed << endl ; } +void GraphExecutor::InNode::IsLoading( bool Loading ) { + _Loading = Loading ; + + // asv : 09.12.04 : "Bugs and Improvents" 2.19 : how it works: + // LoadingState is returned by OutNode::State( NodeName ) if InNode->IsLoading() + // after Loading is finished (here below), ExecutingState must be pushed for GUI. + if ( !Loading ) + _OutNode->PushEvent( this, GraphExecutor::ExecuteEvent, GraphExecutor::ExecutingState ); +} + diff --git a/src/GraphExecutor/DataFlowExecutor_InNode.hxx b/src/GraphExecutor/DataFlowExecutor_InNode.hxx index 174c4cd..00448a4 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNode.hxx +++ b/src/GraphExecutor/DataFlowExecutor_InNode.hxx @@ -376,10 +376,8 @@ namespace GraphExecutor { bool IsSuspended() ; bool IsKilled() ; bool IsStopped() ; - void IsLoading( bool Loading ) { - _Loading = Loading ; } ; - bool IsLoading() { - return _Loading ; } ; + void IsLoading( bool Loading ); + bool IsLoading() { return _Loading ; } ; bool StateWait( SUPERV::GraphState aState ) ; bool ReadyWait() ; diff --git a/src/GraphExecutor/DataFlowExecutor_OutNode.cxx b/src/GraphExecutor/DataFlowExecutor_OutNode.cxx index 8d97e50..45e3d1e 100644 --- a/src/GraphExecutor/DataFlowExecutor_OutNode.cxx +++ b/src/GraphExecutor/DataFlowExecutor_OutNode.cxx @@ -1184,6 +1184,10 @@ SUPERV::GraphState GraphExecutor::OutNode::AutomatonGraphState(GraphExecutor::Au aGraphState = SUPERV::ReStartState ; break ; } + case GraphExecutor::LoadingState : { + aGraphState = SUPERV::LoadingState ; + break; + } default : { cdebug << " GraphExecutor::OutNode::AutomatonGraphState Error Undefined State : " << aGraphState << endl ; @@ -1533,7 +1537,10 @@ SUPERV::GraphState GraphExecutor::OutNode::State( const char * NodeName ) { if ( aCNode ) { GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *)aCNode->GetInNode() ; if ( anInNode ) { - aret = anInNode->State() ; + if ( anInNode->IsLoading() ) + aret = GraphExecutor::LoadingState; + else + aret = anInNode->State() ; // cdebug << "GraphExecutor::OutNode::State( " << NodeName << " ) " // << theAutomaton->StateName( AutomatonGraphState( aret ) ) << endl ; }