From 582d96847515ed0d46495531171b0da99a9a0eb1 Mon Sep 17 00:00:00 2001 From: Gerald Nicolas Date: Thu, 20 Mar 2014 17:37:09 +0100 Subject: [PATCH] =?utf8?q?En=20cas=20d'erreur,=20affichage=20du=20nom=20du?= =?utf8?q?=20fichier=20=C3=A0=20consulter.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/HOMARDGUI/MonCreateHypothesis.cxx | 4 ++-- src/HOMARD_I/HOMARD_Gen_i.cxx | 16 +++++----------- src/HOMARD_I/HOMARD_Hypothesis_i.cxx | 20 +++++++++++++++----- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/HOMARDGUI/MonCreateHypothesis.cxx b/src/HOMARDGUI/MonCreateHypothesis.cxx index 8b63d9ab..77de5219 100644 --- a/src/HOMARDGUI/MonCreateHypothesis.cxx +++ b/src/HOMARDGUI/MonCreateHypothesis.cxx @@ -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() ; diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index fbc5f9c7..bd1db458 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -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); diff --git a/src/HOMARD_I/HOMARD_Hypothesis_i.cxx b/src/HOMARD_I/HOMARD_Hypothesis_i.cxx index f2dd9181..73c279e9 100644 --- a/src/HOMARD_I/HOMARD_Hypothesis_i.cxx +++ b/src/HOMARD_I/HOMARD_Hypothesis_i.cxx @@ -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 ); } //============================================================================= -- 2.39.2