From 080038e8020301ae9b2bca58b6c77146581d6b47 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 9 Jun 2010 14:57:30 +0000 Subject: [PATCH] Merge from V5_1_4_BR (5_1_4rc2) 09/06/2010 --- src/Container/SALOME_ContainerManager.cxx | 2 -- src/Launcher/Launcher_Job.cxx | 5 ++-- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 2 +- .../SALOMEDSImpl_ScalarVariable.cxx | 29 +++++++++++++++---- .../SALOMEDSImpl_StudyBuilder.cxx | 6 ++++ 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 8245fe50b..497e0c1ed 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -420,11 +420,9 @@ SALOME_ContainerManager::GiveContainer(const Engines::ContainerParameters& param logFilename += "/"; #endif logFilename += _NS->ContainerName(params)+"_"+ resource_selected +"_"+getenv( "USER" ) ; -#ifdef WNT std::ostringstream tmp; tmp << "_" << getpid(); logFilename += tmp.str(); -#endif logFilename += ".log" ; command += " > " + logFilename + " 2>&1"; #ifdef WNT diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index b2c61375c..53b3c0e33 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -412,11 +412,10 @@ Launcher::Job::common_job_params() params[Batch::USER] = _resource_definition.UserName; params[Batch::NBPROC] = _resource_required_params.nb_proc; - // Memory + // Memory in megabytes if (_resource_required_params.mem_mb > 0) { - // Memory is in kilobytes - params[Batch::MAXRAMSIZE] = _resource_required_params.mem_mb * 1024; + params[Batch::MAXRAMSIZE] = _resource_required_params.mem_mb; } // We define a default directory based on user time diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index aec99bcfe..4c5c24360 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -718,7 +718,7 @@ void SALOME_LifeCycleCORBA::killOmniNames() { std::string cmd = ("from killSalomeWithPort import killNotifdAndClean; "); cmd += std::string("killNotifdAndClean(") + portNumber + "); "; - cmd = std::string("python -c \"") + cmd +"\" >& /dev/null"; + cmd = std::string("python -c \"") + cmd +"\" > /dev/null 2> /dev/null"; MESSAGE(cmd); system( cmd.c_str() ); } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx index 0bc795290..e6bb38616 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx @@ -23,10 +23,13 @@ // #include "SALOMEDSImpl_ScalarVariable.hxx" #include "SALOMEDSImpl_GenericVariable.hxx" +#include "Basics_Utils.hxx" #include #include #include +#define OLDSTUDY_COMPATIBILITY + //============================================================================ /*! Function : SALOMEDSImpl_ScalarVariable * Purpose : @@ -101,6 +104,8 @@ std::string SALOMEDSImpl_ScalarVariable::getStringValue() const */ //============================================================================ std::string SALOMEDSImpl_ScalarVariable::Save() const{ + Kernel_Utils::Localizer loc; + char buffer[255]; switch(Type()) { @@ -132,6 +137,8 @@ std::string SALOMEDSImpl_ScalarVariable::Save() const{ //============================================================================ std::string SALOMEDSImpl_ScalarVariable::SaveToScript() const { + Kernel_Utils::Localizer loc; + char buffer[255]; switch(Type()) { @@ -147,10 +154,7 @@ std::string SALOMEDSImpl_ScalarVariable::SaveToScript() const } case SALOMEDSImpl_GenericVariable::BOOLEAN_VAR: { - if((bool)myValue) - sprintf(buffer, "%s", "True"); - else - sprintf(buffer, "%s", "False"); + sprintf(buffer, "%s", ((bool)myValue) ? "True" : "False"); break; } case SALOMEDSImpl_GenericVariable::STRING_VAR: @@ -181,6 +185,19 @@ std::string SALOMEDSImpl_ScalarVariable::SaveType() const{ //============================================================================ void SALOMEDSImpl_ScalarVariable::Load(const std::string& theStrValue) { - double aValue = atof(theStrValue.c_str()); - setValue(aValue); + Kernel_Utils::Localizer loc; + + if ( Type() == SALOMEDSImpl_GenericVariable::STRING_VAR ) { + setStringValue( theStrValue ); + } + else { + std::string strCopy = theStrValue; +#ifdef OLDSTUDY_COMPATIBILITY + int dotpos = strCopy.find(','); + if (dotpos != std::string::npos) + strCopy.replace(dotpos, 1, "."); +#endif // OLDSTUDY_COMPATIBILITY + double aValue = atof(strCopy.c_str()); + setValue(aValue); + } } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index b1020d2e8..b42685c3f 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -320,6 +320,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, char aMultifileState[2]; char ASCIIfileState[2]; + bool hasModuleData = false; try { std::string scoid = anSCO.GetID(); hdf_file->OpenOnDisk(HDF_RDONLY); @@ -327,6 +328,7 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, hdf_group->OpenOnDisk(); HDFgroup *hdf_sco_group = new HDFgroup((char*)scoid.c_str(), hdf_group); hdf_sco_group->OpenOnDisk(); + hasModuleData = true; unsigned char* aStreamFile = NULL; int aStreamSize = 0; @@ -397,6 +399,10 @@ bool SALOMEDSImpl_StudyBuilder::LoadWith(const SALOMEDSImpl_SComponent& anSCO, } if (aLocked) _study->GetProperties()->SetLocked(true); + + if (!hasModuleData) + return true; + _errorCode = "No persistent file"; return false; } -- 2.39.2