Salome HOME
En cas d'erreur, affichage du nom du fichier à consulter.
authorGerald Nicolas <D68518@claui2t3.der.edf.fr>
Thu, 20 Mar 2014 16:37:09 +0000 (17:37 +0100)
committerGerald Nicolas <D68518@claui2t3.der.edf.fr>
Thu, 20 Mar 2014 16:37:09 +0000 (17:37 +0100)
src/HOMARDGUI/MonCreateHypothesis.cxx
src/HOMARD_I/HOMARD_Gen_i.cxx
src/HOMARD_I/HOMARD_Hypothesis_i.cxx

index 8b63d9ab557ed6439bbab2f9ece2a5b9ffd8d4a9..77de52195e7d7c1a2e58cd2f9fecfa4b3a5a587a 100644 (file)
@@ -782,8 +782,8 @@ void MonCreateHypothesis::AssocieComposants()
 
   _aFieldName=CBFieldName->currentText();
   aHypothesis->SetField(CORBA::string_dup(_aFieldName.toStdString().c_str()) ) ;
-  aHypothesis->SetRefinThr( _TypeThR, _ThreshR ) ;
-  aHypothesis->SetUnRefThr( _TypeThC, _ThreshC ) ;
+  if ( _TypeThR > 0 ) { aHypothesis->SetRefinThr( _TypeThR, _ThreshR ) ; }
+  if ( _TypeThC > 0 ) { aHypothesis->SetUnRefThr( _TypeThC, _ThreshC ) ; }
   aHypothesis->SetUseField( _UsField ) ;
   aHypothesis->SetUseComp( _UsCmpI ) ;
   _aListeComposant = GetListCompChecked() ;
index fbc5f9c7613e325e1a9db3ce3f6e778bddd2a7e9..bd1db458c7ca2f688a6d99b498dd4b93a298836f 100755 (executable)
@@ -2628,7 +2628,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
   // H.3 Message d'erreur
     if (codretexec != 0)
     {
-      std::string text ;
+      std::string text = "" ;
       // Message d'erreur en cas de probleme en adaptation
       if ( modeHOMARD == 1 )
       {
@@ -2651,10 +2651,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
           }
         }
       }
-      else
-      {
-        text = "Voir le fichier Liste.log.\n" ;
-      }
+      text += "\n\nSee the file " + LogFile + "\n" ;
       INFOS ( text ) ;
       SALOME::ExceptionStruct es;
       es.type = SALOME::BAD_PARAM;
@@ -2780,6 +2777,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM
   int TypeAdap = (*ListTypes)[0];
   int TypeRaff = (*ListTypes)[1];
   int TypeDera = (*ListTypes)[2];
+//   MESSAGE ( ". TypeAdap = " << TypeAdap << ", TypeRaff = " << TypeRaff << ", TypeDera = " << TypeDera  );
 
   // E. Texte du fichier de configuration
   // E.1. Incontournables du texte
@@ -2884,11 +2882,10 @@ char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num )
     // que c'est bien un probleme d'absence
 #ifndef WIN32
     if ( chdir(DirNameA.str().c_str()) != 0 )
-    {
 #else
     if ( _chdir(DirNameA.str().c_str()) != 0 )
-    {
 #endif
+    {
       bool existe = false ;
 #ifndef WIN32
       DIR *dp;
@@ -2960,16 +2957,13 @@ char* HOMARD_Gen_i::ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::
 #ifndef WIN32
   if (chdir(DirCompute.str().c_str()) != 0)
   {
-//  Creation du repertoire car il n'existe pas :
     if (mkdir(DirCompute.str().c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0)
-    {
 #else
   if (_chdir(DirCompute.str().c_str()) != 0)
   {
-//  Creation du repertoire car il n'existe pas :
     if (_mkdir(DirCompute.str().c_str()) != 0)
-    {
 #endif
+    {
        // GERALD -- QMESSAGE BOX
        std::cerr << "Pb Creation du repertoire DirCompute = " << DirCompute.str() << std::endl;
        VERIFICATION("Pb a la creation du repertoire" == 0);
index f2dd91817b2d4e93de1833d145cb31119a1fb12c..73c279e97fcca76e7f8756a0750535c6634472f0 100644 (file)
@@ -122,11 +122,15 @@ void HOMARD_Hypothesis_i::SetUnifRefinUnRef( CORBA::Long TypeRaffDera )
     TypeRaff = 1 ;
     TypeDera = 0 ;
   }
-  else
+  else if ( TypeRaffDera == -1 )
   {
     TypeRaff = 0 ;
     TypeDera = 1 ;
   }
+  else
+  {
+    ASSERT( "TypeRaffDera should be 1 or -1" == 0 );
+  }
   myHomardHypothesis->SetAdapType( -1 );
   myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera );
 }
@@ -231,8 +235,11 @@ HOMARD::listeComposantsHypo* HOMARD_Hypothesis_i::GetComps()
 void HOMARD_Hypothesis_i::SetRefinThr( CORBA::Long TypeThR, CORBA::Double ThreshR )
 {
   myHomardHypothesis->SetAdapType( 1 );
-  int TypeDera = myHomardHypothesis->GetUnRefType() ;
-  myHomardHypothesis->SetRefinTypeDera( 1, TypeDera );
+  if ( TypeThR > 0 )
+  {
+    int TypeDera = myHomardHypothesis->GetUnRefType() ;
+    myHomardHypothesis->SetRefinTypeDera( 1, TypeDera );
+  }
   myHomardHypothesis->SetRefinThr( TypeThR, ThreshR );
 }
 //=============================================================================
@@ -245,8 +252,11 @@ CORBA::Long HOMARD_Hypothesis_i::GetRefinThrType()
 void HOMARD_Hypothesis_i::SetUnRefThr( CORBA::Long TypeThC, CORBA::Double ThreshC )
 {
   myHomardHypothesis->SetAdapType( 1 );
-  int TypeRaff = myHomardHypothesis->GetRefinType() ;
-  myHomardHypothesis->SetRefinTypeDera( TypeRaff, 1 );
+  if ( TypeThC > 0 )
+  {
+    int TypeRaff = myHomardHypothesis->GetRefinType() ;
+    myHomardHypothesis->SetRefinTypeDera( TypeRaff, 1 );
+  }
   myHomardHypothesis->SetUnRefThr( TypeThC, ThreshC );
 }
 //=============================================================================