Salome HOME
If there is an executor, values of ports are from the Executor.
authorrahuel <rahuel@opencascade.com>
Wed, 8 Dec 2004 14:06:31 +0000 (14:06 +0000)
committerrahuel <rahuel@opencascade.com>
Wed, 8 Dec 2004 14:06:31 +0000 (14:06 +0000)
If there is no Executor, values are from the Editor object.

src/Supervision/Value_Impl.cxx

index d721730efd80767e47ef771319ad16ebba14b679..9b948e61df2d4bc6276a6f3691060ebebe1aa551 100644 (file)
@@ -170,35 +170,27 @@ CORBA::Any * Value_Impl::ToAny() {
       else {
         _InputValue = _DataFlowEditor->HasInput( _ParameterName ) ;
       }
-      if ( _InputValue && _DataFlowEditor->IsEditing() ) {
+      GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
+      if ( _DataFlowExecutor ) {
+        anAny = new CORBA::Any( * _DataFlowExecutor->GetInData( name ,
+                                                                _ParameterName ) ) ;
+      }
+      else if ( _InputValue ) {
         anAny = new CORBA::Any( * _DataFlowEditor->GetInData( name ,
                                                               _ParameterName ) ) ;
       }
       else {
-        GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-        if ( _DataFlowExecutor ) {
-          anAny = new CORBA::Any( * _DataFlowExecutor->GetInData( name ,
-                                                                  _ParameterName ) ) ;
-        }
-        else {
-          anAny = new CORBA::Any( *_Any ) ;
-        }
+        anAny = new CORBA::Any( *_Any ) ;
       }
     }
     else {
-      if ( _InputValue && _DataFlowEditor->IsEditing() ) {
-        anAny = new CORBA::Any( * _DataFlowEditor->GetOutData( name ,
-                                                              _ParameterName ) ) ;
+      GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
+      if ( _DataFlowExecutor ) {
+        anAny = new CORBA::Any( * _DataFlowExecutor->GetOutData( name ,
+                                                                _ParameterName ) ) ;
       }
       else {
-        GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-        if ( _DataFlowExecutor ) {
-          anAny = new CORBA::Any( * _DataFlowExecutor->GetOutData( name ,
-                                                                  _ParameterName ) ) ;
-        }
-        else {
-          anAny = new CORBA::Any( *_Any ) ;
-        }
+        anAny = new CORBA::Any( *_Any ) ;
       }
     }
   }
@@ -211,8 +203,6 @@ CORBA::Any * Value_Impl::ToAny() {
 char * Value_Impl::ToString() {
 //  beginService( "Value_Impl::ToString" );
   CORBA::Any anAny = *ToAny() ;
-//  cout << "Value_Impl::ToString " << _DataFlowNode->Name() << " "
-//       << _ParameterName << " " ;
   if ( _DataFlowEditor ) {
     char * name ;
     if ( _DataFlowNode ) {
@@ -221,6 +211,7 @@ char * Value_Impl::ToString() {
     else {
       name = _DataFlowEditor->Graph()->Name() ;
     }
+//    cout << "Value_Impl::ToString " << name << " " << _ParameterName << " " ;
     if ( _InputPort ) {
       if ( _DataFlowNode ) {
         _InputValue = _DataFlowNode->HasInput( _ParameterName ) ;
@@ -228,29 +219,30 @@ char * Value_Impl::ToString() {
       else {
         _InputValue = _DataFlowEditor->HasInput( _ParameterName ) ;
       }
-      if ( _InputValue && _DataFlowEditor->IsEditing() ) {
+      GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
+      if ( _DataFlowExecutor ) {
+//        cout << "_DataFlowExecutor->GetInData" << endl ;
+        anAny = * _DataFlowExecutor->GetInData( name ,
+                                                _ParameterName ) ;
+      }
+      else if ( _InputValue ) {
+//        cout << "_DataFlowEditor->GetInData _DataFlowNode " << _DataFlowNode
+//             << " _InputValue " << _InputValue << endl ;
         anAny = * _DataFlowEditor->GetInData( name ,
                                               _ParameterName ) ;
       }
       else {
-        GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-        if ( _DataFlowExecutor ) {
-          anAny = * _DataFlowExecutor->GetInData( name ,
-                                                  _ParameterName ) ;
-        }
+        anAny = *_Any ;
       }
     }
     else {
-      if ( _InputValue && _DataFlowEditor->IsEditing() ) {
-        anAny = * _DataFlowEditor->GetOutData( name ,
-                                               _ParameterName ) ;
+      GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
+      if ( _DataFlowExecutor ) {
+        anAny = * _DataFlowExecutor->GetOutData( name ,
+                                                 _ParameterName ) ;
       }
       else {
-        GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
-        if ( _DataFlowExecutor ) {
-          anAny = * _DataFlowExecutor->GetOutData( name ,
-                                                   _ParameterName ) ;
-        }
+        anAny = *_Any ;
       }
     }
   }