From c92c02d464cc393854d280971a4d5eb7e947e8c6 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 7 Dec 2009 14:51:20 +0000 Subject: [PATCH] Merge from V5_1_3_BR 07/12/2009 --- src/Basics/Basics_DirUtils.cxx | 2 +- src/Basics/Basics_Utils.cxx | 10 +++++++ src/Basics/Basics_Utils.hxx | 9 ++++++ src/KERNEL_PY/salome_test.py | 5 ++-- .../SALOME_FileTransferCORBA.cxx | 1 + .../SALOME_ModuleCatalog_Server.cxx | 4 --- .../SALOME_ModuleCatalog_impl.cxx | 4 ++- src/NamingService/SALOME_NamingService.cxx | 1 + .../SALOME_ResourcesCatalog_Handler.cxx | 29 +++++++++++-------- src/SALOMEDS/SALOME_DriverPy.py | 3 +- .../SALOMEDSImpl_AttributeIOR.cxx | 2 +- src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx | 1 - .../SALOMEDSImpl_ScalarVariable.cxx | 1 + src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 4 +++ src/SALOMELocalTrace/LocalTraceBufferPool.cxx | 1 + 15 files changed, 53 insertions(+), 24 deletions(-) diff --git a/src/Basics/Basics_DirUtils.cxx b/src/Basics/Basics_DirUtils.cxx index e1682301f..613368ba0 100644 --- a/src/Basics/Basics_DirUtils.cxx +++ b/src/Basics/Basics_DirUtils.cxx @@ -24,7 +24,7 @@ // Module : SALOME // #include "Basics_DirUtils.hxx" - +#include #include #include diff --git a/src/Basics/Basics_Utils.cxx b/src/Basics/Basics_Utils.cxx index 10a12b74a..3be1e68c2 100644 --- a/src/Basics/Basics_Utils.cxx +++ b/src/Basics/Basics_Utils.cxx @@ -82,4 +82,14 @@ namespace Kernel_Utils return p; } + Localizer::Localizer() + { + myCurLocale = setlocale(LC_NUMERIC, 0); + setlocale(LC_NUMERIC, "C"); + } + + Localizer::~Localizer() + { + setlocale(LC_NUMERIC, myCurLocale.c_str()); + } } diff --git a/src/Basics/Basics_Utils.hxx b/src/Basics/Basics_Utils.hxx index ed99361c7..7ca83964a 100644 --- a/src/Basics/Basics_Utils.hxx +++ b/src/Basics/Basics_Utils.hxx @@ -34,6 +34,15 @@ namespace Kernel_Utils { BASICS_EXPORT std::string GetHostname(); + + class BASICS_EXPORT Localizer + { + public: + Localizer(); + ~Localizer(); + private: + std::string myCurLocale; + }; } #endif //_Basics_UTILS_HXX_ diff --git a/src/KERNEL_PY/salome_test.py b/src/KERNEL_PY/salome_test.py index c0818f45f..697feb2cf 100755 --- a/src/KERNEL_PY/salome_test.py +++ b/src/KERNEL_PY/salome_test.py @@ -261,8 +261,9 @@ print print "============= Test Supervisor =============================" print import salome_version -versions = salome_version.getVersions() -if versions[0] < 5: +version = salome_version.getVersions("GUI")[0] +if not version: version = salome_version.getVersions("KERNEL")[0] +if version < 5: # SUPERV module is avaiable comp = catalog.GetComponent("SUPERV") if comp is None: diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx index 26e08da56..4601dce6f 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx @@ -28,6 +28,7 @@ #include "SALOME_LifeCycleCORBA.hxx" #include "utilities.h" #include "Basics_Utils.hxx" +#include using namespace std; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx index 43c4b6d8c..9e5912f34 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx @@ -40,7 +40,6 @@ int main(int argc,char **argv) { // initialize the ORB CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - // LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb); try { CosNaming::NamingContext_var _rootContext, catalogContext; @@ -157,11 +156,9 @@ int main(int argc,char **argv) Utils_Timer timer; timer.Start(); timer.Stop(); - MESSAGE("SALOME_Registry_Server.cxx - orb->run()"); timer.ShowAbsolute(); #endif orb->run(); - std::cerr << "server returned from orb->run()" << std::endl; orb->destroy(); // mgr->deactivate(true,true); @@ -176,6 +173,5 @@ int main(int argc,char **argv) } END_OF( argv[0] ); - // delete myThreadTrace; return 0; } diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 865635705..621b34c03 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -27,6 +27,7 @@ // #include "SALOME_ModuleCatalog_impl.hxx" #include "SALOME_ModuleCatalog_Acomponent_impl.hxx" +#include #include #include #include "utilities.h" @@ -79,6 +80,8 @@ list splitStringToList(const string& theString, const string& theSeparat SALOME_ModuleCatalogImpl::SALOME_ModuleCatalogImpl(int argc, char** argv, CORBA::ORB_ptr orb) : _orb(orb) { if(MYDEBUG) MESSAGE("Catalog creation"); + /* Init libxml */ + xmlInitParser(); // Conversion rules for component types ComponentTypeConvert[GEOM] @@ -686,7 +689,6 @@ SALOME_ModuleCatalogImpl::_parse_xml_file(const char* file, MESSAGE("ModuleCatalog: could not parse file "< #include #include +#include using namespace std; diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index 4234cda85..d4f5d269b 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -144,13 +144,14 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) else { // Adding a machine - _resources_list[_resource.HostName] = _resource; - if(_resource.HostName == "localhost") - { - _resource.HostName = Kernel_Utils::GetHostname(); - _resource.DataForSort._hostName = Kernel_Utils::GetHostname(); - _resources_list[Kernel_Utils::GetHostname()] = _resource; - } + if(_resource.HostName == "localhost") + { + _resource.HostName = Kernel_Utils::GetHostname(); + _resource.DataForSort._hostName = Kernel_Utils::GetHostname(); + _resources_list[Kernel_Utils::GetHostname()] = _resource; + } + else + _resources_list[_resource.HostName] = _resource; } } else @@ -555,6 +556,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser xmlNodePtr aCurSubNode = machine_descr->xmlChildrenNode; while(aCurSubNode != NULL) { + // Process components if ( !xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_components) ) { //If a component is given, it is in a module with the same name @@ -577,14 +579,17 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser } } // Process modules - if ( !xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_modules) ) + else if ( !xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_modules) ) { + // If a module is given, we create an entry in componentsList and modulesList + // with the same name (module == component) if (xmlHasProp(aCurSubNode, (const xmlChar*)test_module_name)) { - xmlChar* module_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_module_name); - std::string aModuleName = (const char*)module_name; - resource.ModulesList.push_back(aModuleName); - xmlFree(module_name); + xmlChar* component_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_module_name); + std::string aComponentName = (const char*)component_name; + _resource.ComponentsList.push_back(aComponentName); + _resource.ModulesList.push_back(aComponentName); + xmlFree(component_name); } } aCurSubNode = aCurSubNode->next; diff --git a/src/SALOMEDS/SALOME_DriverPy.py b/src/SALOMEDS/SALOME_DriverPy.py index 87da46bd2..c76d4c9bd 100644 --- a/src/SALOMEDS/SALOME_DriverPy.py +++ b/src/SALOMEDS/SALOME_DriverPy.py @@ -23,7 +23,7 @@ ## @package SALOME_DriverPy # \brief python implementation of SALOMEDS::Driver interface # -# +# import SALOMEDS__POA ## Python implementation of generic SALOMEDS::Driver. @@ -35,7 +35,6 @@ class SALOME_DriverPy_i(SALOMEDS__POA.Driver): to provide persistence mechanism. """ def __init__ (self, componentDataType): - print "SALOME_DriverPy.__init__: ",componentDataType self._ComponentDataType = componentDataType def IORToLocalPersistentID(self, theSObject, IORString, isMultiFile, isASCII): diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx index 1c049a87f..965c83239 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx @@ -29,7 +29,7 @@ using namespace std; //to disable automatic genericobj management comment the following line -#define WITHGENERICOBJ +//#define WITHGENERICOBJ #ifdef WITHGENERICOBJ #include "SALOME_GenericObj_i.hh" diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx index 6d4c99082..ff5cae558 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx @@ -284,7 +284,6 @@ string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int s vector lst = ip.getValues(v[i]); dump += "# fill list "+v[i]+"\n"; for(int j = 0; j < lst.size(); j++) { - printf("### %s \nFind : %i\n",lst[j].c_str(), lst[j].find('\"')); if (lst[j].find('\"') == -1) dump += "ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n"; else diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx index d40db227c..73803b063 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx @@ -25,6 +25,7 @@ #include "SALOMEDSImpl_GenericVariable.hxx" #include #include +#include using namespace std; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 373058472..2b24641ad 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -28,6 +28,8 @@ using namespace std; +#include + #include "DF_Application.hxx" #include "DF_ChildIterator.hxx" @@ -904,6 +906,8 @@ string SALOMEDSImpl_Study::_GetStudyVariablesScript() if(myNoteBookVars.empty()) return dump; + + Kernel_Utils::Localizer loc; dump += "####################################################\n"; dump += "## Begin of NoteBook variables section ##\n"; diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx index 1b384dc37..ac1712a44 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.cxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #ifndef WIN32 #include -- 2.39.2