Salome HOME
Value of GatePorts
authorrahuel <rahuel@opencascade.com>
Tue, 15 Feb 2005 12:43:05 +0000 (12:43 +0000)
committerrahuel <rahuel@opencascade.com>
Tue, 15 Feb 2005 12:43:05 +0000 (12:43 +0000)
src/GraphBase/DataFlowBase_DataPort.cxx

index 1f6d837551b06e1e09581cd2a8044cec0938543c..24156153a82726a133c441011ec00b5dd9f84ad1 100644 (file)
@@ -418,7 +418,6 @@ CORBA::Any const * GraphBase::DataPort::Value() const {
 
 bool GraphBase::DataPort::BoolValue() const {
   bool RetVal = false ;
-  long val ;
   pthread_mutex_t * aMutexWait = (pthread_mutex_t *) &_MutexWait ;
 //  cdebug << pthread_self() << " BoolValue() --> pthread_mutex_lock " << aMutexWait << endl ;
   if ( pthread_mutex_lock( aMutexWait ) ) {
@@ -428,6 +427,14 @@ bool GraphBase::DataPort::BoolValue() const {
 //  cdebug << pthread_self() << " BoolValue() --> pthread_mutex_locked " << aMutexWait
 //         << endl ;
   if ( (*_Value)->type()->kind() == CORBA::tk_long ) {
+    long val ;
+    **_Value >>= val ;
+    if ( val ) {
+      RetVal = true ;
+    }
+  }
+  else if ( (*_Value)->type()->kind() == CORBA::tk_boolean ) {
+    bool val ;
     **_Value >>= val ;
     if ( val ) {
       RetVal = true ;
@@ -437,8 +444,7 @@ bool GraphBase::DataPort::BoolValue() const {
     perror( "unlock DataValue" ) ;
     exit( 0 ) ;
   }
-//  cdebug << pthread_self() << " BoolValue() --> pthread_mutex_unlocked " << aMutexWait
-//         << endl ;
+  cdebug << pthread_self() << " " << NodeName() << "( " << PortName() << " ) BoolValue " << RetVal << endl ;
   return RetVal ;
 }